Skip to content

feat: update notification badge to support 99+ #17007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: update notification badge to support 99+
  • Loading branch information
BrunoQuaresma committed Mar 19, 2025
commit 899f45f09bc461450542ea42ac8175ea5190d8ae
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ const meta: Meta<typeof UnreadBadge> = {
export default meta;
type Story = StoryObj<typeof UnreadBadge>;

export const Default: Story = {
export const Until10: Story = {
args: {
count: 3,
},
};

export const MoreThanNine: Story = {
export const MoreThan10: Story = {
args: {
count: 12,
},
};

export const MoreThan99: Story = {
args: {
count: 1000,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export const UnreadBadge: FC<UnreadBadgeProps> = ({
return (
<span
className={cn([
"flex size-[18px] rounded text-2xs items-center justify-center",
"flex min-w-[18px] h-[18px] w-fit px-1 rounded text-2xs items-center justify-center",
"bg-surface-sky text-highlight-sky",
className,
])}
{...props}
>
{count > 9 ? "9+" : count}
{count > 99 ? "99+" : count}
</span>
);
};
Loading