Skip to content

Commit b01e2be

Browse files
committed
refactor: update text overflow loop style
1 parent 4e41daa commit b01e2be

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

client/src/components/SystemNotification/index.module.scss

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
margin-top: 16px;
33
background-color: var(--bg-box);
44
overflow: hidden;
5+
width: 100%;
56
> span {
67
color: var(---brand-danger) !important;
78
}
@@ -10,4 +11,22 @@
1011
color: var(--primary-color) !important;
1112
}
1213
}
13-
}
14+
}
15+
16+
.textLoop {
17+
white-space: wrap;
18+
width: 100%;
19+
overflow: hidden;
20+
div {
21+
white-space: nowrap;
22+
overflow: hidden;
23+
text-overflow: ellipsis;
24+
width: 100% !important;
25+
}
26+
}
27+
28+
.overflowEllipse {
29+
white-space: nowrap;
30+
overflow: hidden;
31+
text-overflow: ellipsis;
32+
}

client/src/components/SystemNotification/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ const SystemNotification: React.FC = () => {
1616
type="info"
1717
icon={<BellFilled size={16} />}
1818
message={
19-
<TextLoop interval={5000}>
20-
{notices.map((notice) => (
21-
<span dangerouslySetInnerHTML={{ __html: notice }} />
22-
))}
23-
</TextLoop>
19+
<div className={style.textLoop}>
20+
<TextLoop interval={5000}>
21+
{notices.map((notice) => (
22+
<span className={style.overflowEllipse} dangerouslySetInnerHTML={{ __html: notice }} />
23+
))}
24+
</TextLoop>
25+
</div>
2426
}
2527
/>
2628
) : null;

0 commit comments

Comments
 (0)