Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
651eb1bf
authored
May 12, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: fold sliderbar
parent
4e0c8761
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
11 deletions
+57
-11
src/constants/theme.ts
+2
-2
src/pages/chat/index.tsx
+55
-9
No files found.
src/constants/theme.ts
View file @
651eb1bf
...
@@ -221,8 +221,8 @@ export const theme = extendTheme({
...
@@ -221,8 +221,8 @@ export const theme = extendTheme({
sm
:
'900px'
,
sm
:
'900px'
,
md
:
'1200px'
,
md
:
'1200px'
,
lg
:
'1500px'
,
lg
:
'1500px'
,
xl
:
'1800'
,
xl
:
'1800
px
'
,
'2xl'
:
'2100'
'2xl'
:
'2100
px
'
},
},
components
:
{
components
:
{
Modal
:
ModalTheme
,
Modal
:
ModalTheme
,
...
...
src/pages/chat/index.tsx
View file @
651eb1bf
...
@@ -98,6 +98,7 @@ const Chat = ({
...
@@ -98,6 +98,7 @@ const Chat = ({
top
:
number
;
top
:
number
;
message
:
ChatSiteItemType
;
message
:
ChatSiteItemType
;
}
>
();
}
>
();
const
[
foldSliderBar
,
setFoldSlideBar
]
=
useState
(
false
);
const
{
const
{
lastChatModelId
,
lastChatModelId
,
...
@@ -636,14 +637,57 @@ const Chat = ({
...
@@ -636,14 +637,57 @@ const Chat = ({
flexDirection={['column', 'row']}
flexDirection={['column', 'row']}
backgroundColor={useColorModeValue('#fdfdfd', '')}
backgroundColor={useColorModeValue('#fdfdfd', '')}
>
>
{/* pc always show history.
phone is only show when modelId is present
*/}
{/* pc always show history. */}
{(isPc || !modelId) && (
{(isPc || !modelId) && (
<Box flex={[1, '0 0 250px']} w={['100%', 0]} h={'100%'}>
<Box
<History
position={'relative'}
onclickDelHistory={onclickDelHistory}
flex={foldSliderBar ? '0 0 0' : [1, '0 0 250px', '0 0 280px', '0 0 310px', '0 0 340px']}
onclickExportChat={onclickExportChat}
w={['100%', 0]}
isPcDevice={isPcDevice}
h={'100%'}
/>
zIndex={1}
transition={'0.2s'}
_hover={{
'& > div': { visibility: 'visible', opacity: 1 }
}}
>
<Flex
position={'absolute'}
right={0}
top={'50%'}
transform={'translate(50%,-50%)'}
alignItems={'center'}
justifyContent={'flex-end'}
pr={1}
w={'36px'}
h={'50px'}
borderRadius={'10px'}
bg={'rgba(0,0,0,0.5)'}
cursor={'pointer'}
transition={'0.2s'}
{...(foldSliderBar
? {
opacity: 0.6
}
: {
visibility: 'hidden',
opacity: 0
})}
onClick={() => setFoldSlideBar(!foldSliderBar)}
>
<MyIcon
name={'back'}
transform={foldSliderBar ? 'rotate(180deg)' : ''}
w={'14px'}
color={'white'}
/>
</Flex>
<Box position={'relative'} h={'100%'} bg={'white'} overflow={'hidden'}>
<History
onclickDelHistory={onclickDelHistory}
onclickExportChat={onclickExportChat}
isPcDevice={isPcDevice}
/>
</Box>
</Box>
</Box>
)}
)}
...
@@ -656,6 +700,7 @@ const Chat = ({
...
@@ -656,6 +700,7 @@ const Chat = ({
flex={'1 0 0'}
flex={'1 0 0'}
flexDirection={'column'}
flexDirection={'column'}
>
>
{/* chat header */}
<Flex
<Flex
alignItems={'center'}
alignItems={'center'}
justifyContent={'space-between'}
justifyContent={'space-between'}
...
@@ -722,10 +767,11 @@ const Chat = ({
...
@@ -722,10 +767,11 @@ const Chat = ({
<Box w={'16px'} h={'16px'} />
<Box w={'16px'} h={'16px'} />
)}
)}
</Flex>
</Flex>
{/* chat content box */}
<Box ref={ChatBox} pb={[4, 0]} flex={'1 0 0'} h={0} w={'100%'} overflow={'overlay'}>
<Box ref={ChatBox} pb={[4, 0]} flex={'1 0 0'} h={0} w={'100%'} overflow={'overlay'}>
<Box id={'history'}
maxW={['auto', '800px', '1000px']} m={'auto'}
>
<Box id={'history'}>
{chatData.history.map((item, index) => (
{chatData.history.map((item, index) => (
<Flex key={item._id} alignItems={'flex-start'} py={2} px={[2,
4
]}>
<Flex key={item._id} alignItems={'flex-start'} py={2} px={[2,
6, 8
]}>
{item.obj === 'Human' && <Box flex={1} />}
{item.obj === 'Human' && <Box flex={1} />}
{/* avatar */}
{/* avatar */}
<Menu autoSelect={false} isLazy>
<Menu autoSelect={false} isLazy>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment