Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb9acf7

Browse files
committed
Fix avatar for empty icons
1 parent cd09c3e commit fb9acf7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ export const Custom: Story = {
1515
},
1616
};
1717

18+
export const EmptyIcon: Story = {
19+
args: {
20+
icon: "",
21+
},
22+
};
23+
1824
export const FallbackWorkspace: Story = {
1925
args: {
2026
icon: "DEFAULT_ICON_WORKSPACE",

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

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ type InboxAvatarProps = {
3636
};
3737

3838
export const InboxAvatar: FC<InboxAvatarProps> = ({ icon }) => {
39+
if (icon === "") {
40+
return <Avatar variant="icon">{fallbackIcons.DEFAULT_ICON_OTHER}</Avatar>;
41+
}
42+
3943
if (isInboxNotificationFallbackIcon(icon)) {
4044
return <Avatar variant="icon">{fallbackIcons[icon]}</Avatar>;
4145
}

0 commit comments

Comments
 (0)