Skip to content

Commit f2eab33

Browse files
committed
improve conversation header ui
1 parent f391f89 commit f2eab33

File tree

1 file changed

+60
-9
lines changed

1 file changed

+60
-9
lines changed

applications/web/src/features/conversations/Conversation.tsx

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Box, Center, Container, Flex, Grid, GridItem, HStack, Spinner, Stack } from '@chakra-ui/react';
2-
import { LuMailQuestion } from 'react-icons/lu';
1+
import { Box, Card, Center, Container, Flex, Grid, GridItem, HStack, IconButton, Skeleton, Spinner, Stack, Text } from '@chakra-ui/react';
2+
import { LuEllipsisVertical, LuMailQuestion } from 'react-icons/lu';
33
import { useAppDispatch, useAppSelector } from '~/store';
44
import { useParams } from 'react-router';
55
import { NotFound } from '~/pages/NotFound';
@@ -14,8 +14,8 @@ import { ConversationInteraction } from './components/organisms/ConversationInte
1414
import { useIdempotencyKey } from '~/hooks/useIdempotencyKey';
1515
import { Panel } from '~/components/atoms/Panel';
1616
import React from 'react';
17-
import { HeaderCard } from '~/components/atoms/HeaderCard';
1817
import { initializeChatInput } from '../chat-input/store';
18+
import { MenuContent, MenuItem, MenuRoot, MenuTrigger } from '~/components/ui/menu';
1919

2020
export const Conversation: React.FC = () => {
2121
const { conversationId } = useParams();
@@ -98,13 +98,64 @@ export const Conversation: React.FC = () => {
9898
minHeight={0}
9999
boxShadow={'md'}
100100
>
101-
<Container maxW={'6xl'} minW={'sm'} py={10} pb={40} w={'full'}>
102-
<Stack gap={6} mx={10}>
103-
<HeaderCard
104-
title={conversation.title || 'New conversation'}
105-
description={''}
106-
/>
101+
<Box
102+
position={'sticky'}
103+
zIndex={10}
104+
pb={4}
105+
top={0}
106+
>
107+
<Box
108+
zIndex={10}
109+
h={10}
110+
top={-10}
111+
left={0}
112+
right={0}
113+
background={'bg.panel'}
114+
/>
107115

116+
<Container maxW={'6xl'} minW={'sm'} w={'full'}>
117+
<Card.Root
118+
variant={'elevated'}
119+
overflow={'hidden'}
120+
background={'bg.muted/30'}
121+
backdropFilter={'blur(20px)'}
122+
backgroundSize={'100vw 500px'}
123+
>
124+
<Card.Body p={6}>
125+
<Flex justify={'space-between'}>
126+
<Text textStyle={'xl'} fontWeight={'semibold'} textShadow={'2xl'}>
127+
{conversation.title ? conversation.title : (
128+
<Skeleton width={'50%'} />
129+
)}
130+
</Text>
131+
<MenuRoot>
132+
<MenuTrigger asChild>
133+
<IconButton size={'xs'} variant={'outline'}>
134+
<LuEllipsisVertical />
135+
</IconButton>
136+
</MenuTrigger>
137+
<MenuContent>
138+
<MenuItem disabled value={'export'}>
139+
{'Export'}
140+
</MenuItem>
141+
<MenuItem
142+
disabled
143+
value={'delete'}
144+
color={'fg.error'}
145+
_hover={{ bg: 'bg.error', color: 'fg.error' }}
146+
>
147+
{'Delete...'}
148+
</MenuItem>
149+
</MenuContent>
150+
</MenuRoot>
151+
</Flex>
152+
</Card.Body>
153+
</Card.Root>
154+
</Container>
155+
</Box>
156+
157+
<Container maxW={'6xl'} minW={'sm'} w={'full'} py={4} pt={10} pb={40}>
158+
<Stack gap={6} mx={10}>
108159
{sortedInteractions.map(i => <ConversationInteraction key={i.id} interaction={i} />)}
109160
</Stack>
110161
</Container>

0 commit comments

Comments
 (0)