chore: installed app

pull/198/head
金伟强 3 years ago
parent 6f7fe943d1
commit a2d2ca4348

@ -25,6 +25,8 @@ import { userInputsFormToPromptVariables } from '@/utils/model-config'
import { SuggestedQuestionsAfterAnswerConfig } from '@/models/debug' import { SuggestedQuestionsAfterAnswerConfig } from '@/models/debug'
import { InstalledApp } from '@/models/explore' import { InstalledApp } from '@/models/explore'
import s from './style.module.css'
export type IMainProps = { export type IMainProps = {
isInstalledApp?: boolean, isInstalledApp?: boolean,
installedAppInfo? : InstalledApp installedAppInfo? : InstalledApp
@ -441,6 +443,7 @@ const Main: FC<IMainProps> = ({
onCurrentIdChange={handleConversationIdChange} onCurrentIdChange={handleConversationIdChange}
currentId={currConversationId} currentId={currConversationId}
copyRight={siteInfo.copyright || siteInfo.title} copyRight={siteInfo.copyright || siteInfo.title}
isInstalledApp={isInstalledApp}
/> />
) )
} }
@ -476,7 +479,11 @@ const Main: FC<IMainProps> = ({
</div> </div>
)} )}
{/* main */} {/* 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 <ConfigSence
conversationName={conversationName} conversationName={conversationName}
hasSetInputs={hasSetInputs} hasSetInputs={hasSetInputs}

@ -21,17 +21,25 @@ export type ISidebarProps = {
currentId: string currentId: string
onCurrentIdChange: (id: string) => void onCurrentIdChange: (id: string) => void
list: ConversationItem[] list: ConversationItem[]
isInstalledApp: boolean
} }
const Sidebar: FC<ISidebarProps> = ({ const Sidebar: FC<ISidebarProps> = ({
copyRight, copyRight,
currentId, currentId,
onCurrentIdChange, onCurrentIdChange,
list }) => { list,
isInstalledApp
}) => {
const { t } = useTranslation() const { t } = useTranslation()
return ( return (
<div <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 && ( {list.length < MAX_CONVERSATION_LENTH && (
<div className="flex flex-shrink-0 p-4 !pb-0"> <div className="flex flex-shrink-0 p-4 !pb-0">

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

@ -210,9 +210,11 @@ const TextGeneration: FC<IMainProps> = ({
<div <div
ref={resRef} ref={resRef}
className={ 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', 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'> <div className='shrink-0 flex items-center justify-between'>
@ -267,7 +269,11 @@ const TextGeneration: FC<IMainProps> = ({
return ( 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 */} {/* 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={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'> <div className='mb-6'>

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

Loading…
Cancel
Save