Skip to content

Commit

Permalink
Move inner pushs
Browse files Browse the repository at this point in the history
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
  • Loading branch information
kristina-fefelova committed Aug 21, 2024
1 parent 84803fa commit 713b89e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
}
onDestroy(() => {
removeNotificationHandler()
if (closeTimeout && timeout) {
clearTimeout(timeout)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
'top-left': NotificationPosition.TopLeft,
'top-right': NotificationPosition.TopRight
}
const maxVisibleNotifications = 3
</script>

<slot />
<div class="notifications">
{#each Object.entries(positionByClassName) as [className, position]}
<div class={className} style:z-index={9999}>
{#each $store as notification (notification.id)}
{#each $store.slice(0, maxVisibleNotifications) as notification (notification.id)}
{#if notification.position === position}
<Notification {notification} />
{/if}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function addNotification (
title,
subTitle,
severity,
position: NotificationPosition.BottomRight,
position: NotificationPosition.TopRight,
component,
closeTimeout,
params
Expand Down

0 comments on commit 713b89e

Please sign in to comment.