Skip to content

Commit

Permalink
Fix icon
Browse files Browse the repository at this point in the history
  • Loading branch information
lone-star committed Jan 24, 2024
1 parent 99e09f9 commit 8b329a4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions polaris-react/src/components/Frame/components/Toast/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,21 @@ export function Toast({
</div>
) : null;

const leadingIconMarkup =
error || icon ? (
let leadingIconMarkup = null;

if (error) {
leadingIconMarkup = (
<div className={styles.LeadingIcon}>
<Icon source={AlertCircleIcon} tone="inherit" />
</div>
);
} else if (icon) {
leadingIconMarkup = (
<div className={styles.LeadingIcon}>
<Icon source={error ? AlertCircleIcon : icon} tone="inherit" />
<Icon source={icon} tone="inherit" />
</div>
) : undefined;
);
}

const className = classNames(
styles.Toast,
Expand Down

0 comments on commit 8b329a4

Please sign in to comment.