Skip to content

Commit

Permalink
🐛 Fix Svelte toast missing icon after migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Frontendland committed Jan 2, 2025
1 parent 819552d commit b93bf20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/components/Badge/badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export type BadgeProps = {
| 'success'
| 'warning'
| 'alert'
| null
hover?: boolean
small?: boolean
rounded?: boolean
Expand Down
19 changes: 12 additions & 7 deletions src/components/Toast/Toast.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@
const iconRender = $derived(icon)
</script>

<Alert {...rest} className={classes} {...additionalProps}>
{#snippet icon()}
{@render iconRender?.()}
{/snippet}
{@render children?.()}
</Alert>

{#if icon}
<Alert {...rest} className={classes} {...additionalProps}>
{#snippet icon()}
{@render iconRender?.()}
{/snippet}
{@render children?.()}
</Alert>
{:else}
<Alert {...rest} className={classes} {...additionalProps}>
{@render children?.()}
</Alert>
{/if}

0 comments on commit b93bf20

Please sign in to comment.