Skip to content

Commit b726a21

Browse files
committed
feat(): Updating the comment box UI
1 parent fa0edc6 commit b726a21

1 file changed

Lines changed: 46 additions & 9 deletions

File tree

src/screens/articles/components/CommentBox.tsx

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,59 @@ const CommentBox = ({ articleKey }: { articleKey: string }) => {
5353
{comments ? (
5454
comments?.map(
5555
(
56-
comment: { name: string; email: string; comment: string },
56+
comment: {
57+
name: string;
58+
email: string;
59+
comment: string;
60+
date: string;
61+
},
5762
index: number,
5863
) => (
59-
<Box
64+
<VStack
6065
key={index}
6166
p={2}
62-
px={4}
63-
borderRadius={'md'}
67+
borderRadius={'lg'}
6468
mt={4}
6569
bg={'gray.800'}
70+
rowGap={2}
6671
>
67-
<Heading size={'md'}>
68-
🤖{comment.name} 📫{comment.email}
69-
</Heading>
70-
<Box paddingStart={2}>{comment.comment}</Box>
71-
</Box>
72+
<Box
73+
w={'100%'}
74+
p={1}
75+
border={'1px solid gray'}
76+
borderRadius={'md'}
77+
>
78+
<HStack
79+
w={'100%'}
80+
justifyContent={'space-between'}
81+
p={1}
82+
border={'1px solid gray'}
83+
borderRadius={'md'}
84+
borderStyle={'dashed'}
85+
mb={2}
86+
>
87+
<Heading size={'md'}>
88+
🤖{comment.name} 📫{comment.email}
89+
</Heading>
90+
<Text
91+
as={'span'}
92+
fontSize={'md'}
93+
color={'gray.300'}
94+
fontWeight={'normal'}
95+
>
96+
{new Date(comment.date).toDateString()}
97+
</Text>
98+
</HStack>
99+
<Box
100+
w={'100%'}
101+
paddingStart={2}
102+
fontSize={'md'}
103+
color={'gray.300'}
104+
>
105+
{comment.comment}
106+
</Box>
107+
</Box>
108+
</VStack>
72109
),
73110
)
74111
) : (

0 commit comments

Comments
 (0)