Skip to content

Commit 841c93b

Browse files
UI updates
1 parent 6fc26d4 commit 841c93b

3 files changed

Lines changed: 18 additions & 16 deletions

File tree

src/components/Comment/index.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,7 @@ export default function Comment({ comment, children, gravatar }: Props) {
6868
{author} {comment.isVerified && <CheckCircleFilled />}
6969
<Date>{dayjs(comment.createdAt).format('DD MMM YYYY - HH:mm')}</Date>
7070
</Username>
71-
<HeaderActions>
72-
{comment.isOwn && (
73-
<Delete onClick={() => dispatch(removeComment(comment))}>
74-
<DeleteOutlined /> Delete
75-
</Delete>
76-
)}
77-
</HeaderActions>
71+
<HeaderActions></HeaderActions>
7872
</Header>
7973
<Body>{comment.body}</Body>
8074
<Actions>
@@ -112,6 +106,11 @@ export default function Comment({ comment, children, gravatar }: Props) {
112106
>
113107
<CommentOutlined /> {t('REPLY')}
114108
</Reply>
109+
{comment.isOwn && (
110+
<Delete onClick={() => dispatch(removeComment(comment))}>
111+
<DeleteOutlined /> {t('DELETE')}
112+
</Delete>
113+
)}
115114
</Actions>
116115
{children}
117116
</Content>

src/components/Comments/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ export default function Comments(props: Props) {
105105
<Title>
106106
{total} {total > 1 ? t('COMMENTS') : t('COMMENT')}
107107
</Title>
108-
<SortContainer>
109-
<SortButton $active={sort === 'desc'} onClick={() => handleSortChange('desc')}>
110-
{t('NEWEST')}
111-
</SortButton>
112-
<SortButton $active={sort === 'asc'} onClick={() => handleSortChange('asc')}>
113-
{t('OLDEST')}
114-
</SortButton>
115-
</SortContainer>
116108
</Header>
109+
<SortContainer>
110+
<SortButton $active={sort === 'desc'} onClick={() => handleSortChange('desc')}>
111+
{t('NEWEST')}
112+
</SortButton>
113+
<SortButton $active={sort === 'asc'} onClick={() => handleSortChange('asc')}>
114+
{t('OLDEST')}
115+
</SortButton>
116+
</SortContainer>
117117
{loading ? (
118118
<NoResult>{t('LOADING')}</NoResult>
119119
) : (

src/components/Comments/style.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export const SortContainer = styled.div`
2020
display: flex;
2121
align-items: center;
2222
gap: 12px;
23+
padding: 10px 4px 0 4px;
24+
display: flex;
25+
justify-content: flex-end;
2326
`;
2427

2528
export const SortButton = styled.button<{ $active?: boolean }>`
@@ -51,7 +54,7 @@ export const Container = styled.div`
5154
`;
5255

5356
export const List = styled.div`
54-
padding: 20px 10px;
57+
padding: 20px 4px;
5558
`;
5659

5760
export const NoResult = styled.div`

0 commit comments

Comments
 (0)