Fix some icon display size + fix padding issue on EditableChip component (#314)

* Fix some icon display size + fix padding issue on EditableChip component

* Fix according to PR

* Fix server generate and deploy scripts

* Fix image size on Opportunities board

* Fix lint

* Fix according to PR
This commit is contained in:
Charles Bochet
2023-06-16 14:16:35 +02:00
committed by GitHub
parent 98127d1d4c
commit 7f25f16766
18 changed files with 64 additions and 41 deletions

View File

@ -1,3 +1,4 @@
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { IconComment } from '@/ui/icons';
@ -47,13 +48,15 @@ const StyledCount = styled.div`
`;
export function CommentChip({ count, onClick }: CommentChipProps) {
const theme = useTheme();
if (count === 0) return null;
const formattedCount = count > 99 ? '99+' : count;
return (
<StyledChip data-testid="comment-chip" onClick={onClick}>
<StyledCount>{formattedCount}</StyledCount>
<IconComment size={16} />
<IconComment size={theme.iconSizeMedium} />
</StyledChip>
);
}

View File

@ -1,4 +1,5 @@
import { Tooltip } from 'react-tooltip';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { CommentForDrawer } from '@/comments/types/CommentForDrawer';
@ -62,6 +63,7 @@ const StyledTooltip = styled(Tooltip)`
`;
export function CommentHeader({ comment }: OwnProps) {
const theme = useTheme();
const beautifiedCreatedAt = beautifyPastDateRelativeToNow(comment.createdAt);
const exactCreatedAt = beautifyExactDate(comment.createdAt);
const showDate = beautifiedCreatedAt !== '';
@ -79,7 +81,7 @@ export function CommentHeader({ comment }: OwnProps) {
<StyledContainer>
<Avatar
avatarUrl={avatarUrl}
size={16}
size={theme.iconSizeMedium}
placeholder={capitalizedFirstUsernameLetter}
/>
<StyledName>{authorName}</StyledName>