chore: installed app

This commit is contained in:
金伟强 2023-05-19 14:37:41 +08:00
parent 6f7fe943d1
commit a2d2ca4348
5 changed files with 34 additions and 6 deletions

View File

@ -25,6 +25,8 @@ import { userInputsFormToPromptVariables } from '@/utils/model-config'
import { SuggestedQuestionsAfterAnswerConfig } from '@/models/debug'
import { InstalledApp } from '@/models/explore'
import s from './style.module.css'
export type IMainProps = {
isInstalledApp?: boolean,
installedAppInfo? : InstalledApp
@ -441,6 +443,7 @@ const Main: FC<IMainProps> = ({
onCurrentIdChange={handleConversationIdChange}
currentId={currConversationId}
copyRight={siteInfo.copyright || siteInfo.title}
isInstalledApp={isInstalledApp}
/>
)
}
@ -476,7 +479,11 @@ const Main: FC<IMainProps> = ({
</div>
)}
{/* main */}
<div className='flex-grow flex flex-col h-[calc(100vh_-_3rem)] overflow-y-auto'>
<div className={cn(
isInstalledApp ? s.installedApp : 'h-[calc(100vh_-_3rem)]',
'flex-grow flex flex-col overflow-y-auto'
)
}>
<ConfigSence
conversationName={conversationName}
hasSetInputs={hasSetInputs}

View File

@ -21,17 +21,25 @@ export type ISidebarProps = {
currentId: string
onCurrentIdChange: (id: string) => void
list: ConversationItem[]
isInstalledApp: boolean
}
const Sidebar: FC<ISidebarProps> = ({
copyRight,
currentId,
onCurrentIdChange,
list }) => {
list,
isInstalledApp
}) => {
const { t } = useTranslation()
return (
<div
className="shrink-0 flex flex-col overflow-y-auto bg-white pc:w-[244px] tablet:w-[192px] mobile:w-[240px] border-r border-gray-200 tablet:h-[calc(100vh_-_3rem)] mobile:h-screen"
className={
classNames(
isInstalledApp ? 'tablet:h-[calc(100vh_-_120px)]' : 'tablet:h-[calc(100vh_-_3rem)]',
"shrink-0 flex flex-col overflow-y-auto bg-white pc:w-[244px] tablet:w-[192px] mobile:w-[240px] border-r border-gray-200 mobile:h-screen"
)
}
>
{list.length < MAX_CONVERSATION_LENTH && (
<div className="flex flex-shrink-0 p-4 !pb-0">

View File

@ -0,0 +1,3 @@
.installedApp {
height: calc(100vh - 120px);
}

View File

@ -210,9 +210,11 @@ const TextGeneration: FC<IMainProps> = ({
<div
ref={resRef}
className={
cn("flex flex-col h-full shrink-0",
cn(
"flex flex-col h-full shrink-0",
isPC ? 'px-10 py-8' : 'bg-gray-50',
isTablet && 'p-6', isMoble && 'p-4')}
isTablet && 'p-6', isMoble && 'p-4')
}
>
<>
<div className='shrink-0 flex items-center justify-between'>
@ -267,7 +269,11 @@ const TextGeneration: FC<IMainProps> = ({
return (
<>
<div className={cn(isPC && 'flex', 'h-screen bg-gray-50')}>
<div className={cn(
isPC && 'flex',
isInstalledApp ? s.installedApp : 'h-screen',
'bg-gray-50'
)}>
{/* Left */}
<div className={cn(isPC ? 'w-[600px] max-w-[50%] p-8' : 'p-4', "shrink-0 relative flex flex-col pb-10 h-full border-r border-gray-100 bg-white")}>
<div className='mb-6'>

View File

@ -1,3 +1,7 @@
.installedApp {
height: calc(100vh - 72px);
}
.appIcon {
width: 32px;
height: 32px;