Skip to content

Commit abbd88b

Browse files
feat: update notification badge to support 99+ (#17007)
After dogfooding the notifications we noticed that admins will probably have a larger number of unread notifications everyday so with that in mind we decided to increase the "truncate" rate from 9+ to 99+.
1 parent 6a7c43d commit abbd88b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

site/src/modules/notifications/NotificationsInbox/UnreadBadge.stories.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ const meta: Meta<typeof UnreadBadge> = {
99
export default meta;
1010
type Story = StoryObj<typeof UnreadBadge>;
1111

12-
export const Default: Story = {
12+
export const Until10: Story = {
1313
args: {
1414
count: 3,
1515
},
1616
};
1717

18-
export const MoreThanNine: Story = {
18+
export const MoreThan10: Story = {
1919
args: {
2020
count: 12,
2121
},
2222
};
23+
24+
export const MoreThan99: Story = {
25+
args: {
26+
count: 1000,
27+
},
28+
};

site/src/modules/notifications/NotificationsInbox/UnreadBadge.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ export const UnreadBadge: FC<UnreadBadgeProps> = ({
1313
return (
1414
<span
1515
className={cn([
16-
"flex size-[18px] rounded text-2xs items-center justify-center",
16+
"flex min-w-[18px] h-[18px] w-fit px-1 rounded text-2xs items-center justify-center",
1717
"bg-surface-sky text-highlight-sky",
1818
className,
1919
])}
2020
{...props}
2121
>
22-
{count > 9 ? "9+" : count}
22+
{count > 99 ? "99+" : count}
2323
</span>
2424
);
2525
};

0 commit comments

Comments
 (0)