Skip to content

Commit 0e0e89f

Browse files
committed
Add comment icon to comment count
1 parent 7103819 commit 0e0e89f

File tree

8 files changed

+62
-3
lines changed

8 files changed

+62
-3
lines changed

src/img/icons.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"circle-person",
2424
"circle-plus",
2525
"close",
26+
"comment",
2627
"cup",
2728
"drag-handle",
2829
"empty-task",

src/img/icons/comment.svg

Lines changed: 13 additions & 0 deletions
Loading

src/modules/core/components/Icon/Icon.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
* Next set of classes will define the icons's size
3434
*/
3535

36+
.extraTiny {
37+
height: 12px;
38+
width: 12px;
39+
}
40+
3641
.sizeTiny {
3742
height: 14px;
3843
width: 14px;

src/modules/core/components/Icon/Icon.css.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export const main: string;
2+
export const extraTiny: string;
23
export const sizeTiny: string;
34
export const sizeSmall: string;
45
export const sizeNormal: string;

src/modules/core/components/Icon/Icon.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ const displayName = 'Icon';
1414

1515
type Appearance = {
1616
theme?: 'primary' | 'invert';
17-
size?: 'tiny' | 'small' | 'normal' | 'medium' | 'large' | 'huge';
17+
size?:
18+
| 'extraTiny'
19+
| 'tiny'
20+
| 'small'
21+
| 'normal'
22+
| 'medium'
23+
| 'large'
24+
| 'huge';
1825
};
1926

2027
interface Props extends Omit<HTMLAttributes<HTMLElement>, 'title'> {

src/modules/dashboard/components/TaskList/TaskListItem.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,26 @@ td.taskDetails > div {
4747
margin-left: 20px;
4848
}
4949

50+
.commentCountItem {
51+
composes: extraInfoItem;
52+
display: flex;
53+
align-items: center;
54+
}
55+
56+
.commentCountIcon {
57+
margin-right: 5px;
58+
margin-bottom: 2px;
59+
height: 12px;
60+
width: 12px;
61+
stroke: none;
62+
}
63+
64+
.commentCountIcon svg {
65+
display: block;
66+
height: 12px;
67+
width: 12px;
68+
}
69+
5070
td.taskPayouts {
5171
flex-basis: 15%;
5272
justify-content: flex-end;

src/modules/dashboard/components/TaskList/TaskListItem.css.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ export const taskDetailsTitle: string;
77
export const taskDetailsReputation: string;
88
export const extraInfo: string;
99
export const extraInfoItem: string;
10+
export const commentCountItem: string;
11+
export const commentCountIcon: string;
1012
export const taskPayouts: string;
1113
export const userAvatar: string;

src/modules/dashboard/components/TaskList/TaskListItem.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import React, { useCallback, useMemo } from 'react';
33
import { useHistory } from 'react-router-dom';
44
import BigNumber from 'bn.js';
55

6-
import { AnyTask, Payouts, EventType } from '~data/index';
6+
import Icon from '~core/Icon';
77
import { AbbreviatedNumeral } from '~core/Numeral';
88
import PayoutsList from '~core/PayoutsList';
99
import { TableRow, TableCell } from '~core/Table';
10+
import { AnyTask, Payouts, EventType } from '~data/index';
1011
import HookedUserAvatar from '~users/HookedUserAvatar';
1112

1213
import styles from './TaskListItem.css';
@@ -80,7 +81,16 @@ const TaskListItem = ({ task }: Props) => {
8081
</div>
8182
)}
8283
{commentCount && (
83-
<div className={styles.extraInfoItem}>
84+
<div className={styles.commentCountItem}>
85+
<Icon
86+
appearance={{ size: 'extraTiny' }}
87+
className={styles.commentCountIcon}
88+
name="comment"
89+
title={formatMessage(MSG.titleCommentCount, {
90+
commentCount,
91+
formattedCommentCount: formatNumber(commentCount),
92+
})}
93+
/>
8494
<AbbreviatedNumeral
8595
formatOptions={{
8696
notation: 'compact',

0 commit comments

Comments
 (0)