2022-02-24 15:41:24 +01:00
|
|
|
<script>
|
|
|
|
import "@spectrum-css/toast/dist/index-vars.css"
|
|
|
|
import Portal from "svelte-portal"
|
|
|
|
import { banner } from "../Stores/banner"
|
|
|
|
import Banner from "./Banner.svelte"
|
|
|
|
import { fly } from "svelte/transition"
|
2022-09-13 12:52:31 +02:00
|
|
|
import TooltipWrapper from "../Tooltip/TooltipWrapper.svelte"
|
2022-02-24 15:41:24 +01:00
|
|
|
</script>
|
|
|
|
|
2022-03-08 17:31:07 +01:00
|
|
|
<Portal target=".banner-container">
|
2022-02-24 15:41:24 +01:00
|
|
|
<div class="banner">
|
2022-09-13 12:52:31 +02:00
|
|
|
{#each $banner.messages as message}
|
2022-02-24 15:41:24 +01:00
|
|
|
<div transition:fly={{ y: -30 }}>
|
|
|
|
<Banner
|
2022-09-13 12:52:31 +02:00
|
|
|
type={message.type}
|
|
|
|
extraButtonText={message.extraButtonText}
|
|
|
|
extraButtonAction={message.extraButtonAction}
|
|
|
|
on:change={() => {
|
|
|
|
message.onChange()
|
|
|
|
}}
|
|
|
|
showCloseButton={typeof message.showCloseButton === "boolean"
|
|
|
|
? message.showCloseButton
|
|
|
|
: true}
|
2022-02-24 15:41:24 +01:00
|
|
|
>
|
2022-09-13 12:52:31 +02:00
|
|
|
<TooltipWrapper tooltip={"test"}>
|
|
|
|
{message.message}
|
|
|
|
</TooltipWrapper>
|
2022-02-24 15:41:24 +01:00
|
|
|
</Banner>
|
|
|
|
</div>
|
2022-09-13 12:52:31 +02:00
|
|
|
{/each}
|
2022-02-24 15:41:24 +01:00
|
|
|
</div>
|
|
|
|
</Portal>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.banner {
|
|
|
|
pointer-events: none;
|
2022-03-08 17:31:07 +01:00
|
|
|
width: 100%;
|
2022-02-24 15:41:24 +01:00
|
|
|
}
|
|
|
|
</style>
|