Skip to content

Commit 3cff2eb

Browse files
committed
Add unread ball
1 parent 9fd7b00 commit 3cff2eb

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

frontend/src/pages/Home/components/ReportItem/ReportItem.scss

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,36 @@
88

99
&__content {
1010
flex: 1;
11-
margin-left: 16px;
11+
margin-left: 8px;
12+
width: 60%;
13+
}
14+
15+
&__status-bullet {
16+
width: 8px;
17+
height: 8px;
18+
margin-top: 5px;
19+
display: inline-block;
20+
background-color: #fead7f;
21+
border-radius: 50%;
22+
vertical-align: middle;
1223
}
1324

1425
&__category-label {
1526
font-size: 13px;
1627
color: #4355b9;
1728
margin-bottom: 4px;
1829
font-weight: 700;
19-
20-
// Add a small bullet before brain category
21-
&:before {
22-
content: '';
23-
display: inline-block;
24-
width: 6px;
25-
height: 6px;
26-
background-color: #fd6a6a;
27-
border-radius: 50%;
28-
margin-right: 8px;
29-
vertical-align: middle;
30-
}
3130
}
3231

3332
&__title {
3433
font-weight: 600;
3534
font-size: 16px;
3635
color: #111;
3736
margin-bottom: 4px;
37+
white-space: nowrap;
38+
overflow: hidden;
39+
text-overflow: ellipsis;
40+
max-width: 100%;
3841
}
3942

4043
&__date {
@@ -51,11 +54,11 @@
5154
margin-right: 6px;
5255

5356
&-icon {
54-
font-size: 12px;
57+
font-size: 11px;
5558
color: #aaa;
5659
transition: all 0.2s ease;
57-
width: 12px;
58-
height: 12px;
60+
width: 34px;
61+
height: 34px;
5962
display: flex;
6063
align-items: center;
6164
justify-content: center;

frontend/src/pages/Home/components/ReportItem/ReportItem.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const ReportItem: React.FC<ReportItemProps> = ({
2828
}) => {
2929
const { t } = useTranslation(['common', 'report']);
3030
const { title, category, createdAt, status, bookmarked } = report;
31-
console.log('status', status);
3231

3332
// Treat category as string
3433
const categoryStr = category.toString().toLowerCase();
@@ -85,7 +84,11 @@ const ReportItem: React.FC<ReportItemProps> = ({
8584
return (
8685
<div className="report-item" onClick={onClick}>
8786
{getCategoryIcon()}
88-
87+
{status === 'UNREAD' && (
88+
<div className="report-item__status-bullet">
89+
<figure className="circle"></figure>
90+
</div>
91+
)}
8992
<div className="report-item__content">
9093
<div className="report-item__category-label">
9194
{t(getCategoryTranslationKey(), { ns: 'report' })}

0 commit comments

Comments
 (0)