Skip to content

Commit

Permalink
fix: not showing icon for toast types
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanluongoe committed Jul 4, 2024
1 parent a875d69 commit 378123d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/components/toast-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const ToastIcon: React.FC<ToastIconProps> = (props) => {
return null;
};

const hasIcon = renderIcon() !== null;

if (!hasIcon) return null;

return <AnimatedIconWrapper>{renderIcon()}</AnimatedIconWrapper>;
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/toaster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const Toaster: React.FC<ToasterProps> = (props) => {
alignItems: 'center',
}}
>
{icon && <ToastIcon type={type} icon={icon} />}
<ToastIcon type={type} icon={icon} />
<div>
{title && <ToastTitle>{title}</ToastTitle>}
{description && (
Expand Down

0 comments on commit 378123d

Please sign in to comment.