1
0
Fork 0
mirror of synced 2024-09-19 18:59:06 +12:00
budibase/packages/bbui/src/Notification/NotificationDisplay.svelte
Gerard Burns 4560510069 Customize signup flow BB changes (#11706)
* wip

* wip

* wip

* wip
2023-09-12 12:16:13 +01:00

44 lines
1 KiB
Svelte

<script>
import "@spectrum-css/toast/dist/index-vars.css"
import Portal from "svelte-portal"
import { notifications } from "../Stores/notifications"
import Notification from "./Notification.svelte"
import { fly } from "svelte/transition"
</script>
<Portal target=".modal-container">
<div class="notifications">
{#each $notifications as { type, icon, message, id, dismissable, action, actionMessage, wide } (id)}
<div transition:fly={{ y: 30 }}>
<Notification
{type}
{icon}
{message}
{dismissable}
{action}
{actionMessage}
{wide}
on:dismiss={() => notifications.dismiss(id)}
/>
</div>
{/each}
</div>
</Portal>
<style>
.notifications {
position: fixed;
bottom: 40px;
left: 0;
right: 0;
margin: 0 auto;
padding: 0;
z-index: 9999;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
pointer-events: none;
gap: 10px;
}
</style>