Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fix: make sure toast is always on top of modals
Browse files
src/lib/components/Toast.svelte
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<script lang="ts">
|
2 |
import { fade } from "svelte/transition";
|
3 |
-
|
4 |
import IconDazzled from "$lib/components/icons/IconDazzled.svelte";
|
5 |
|
6 |
interface Props {
|
@@ -10,14 +10,16 @@
|
|
10 |
let { message = "" }: Props = $props();
|
11 |
</script>
|
12 |
|
13 |
-
<
|
14 |
-
transition:fade|global={{ duration: 300 }}
|
15 |
-
class="pointer-events-none fixed right-0 top-12 z-20 bg-gradient-to-bl from-red-500/20 via-red-500/0 to-red-500/0 pb-36 pl-36 pr-2 pt-2 md:top-0 md:pr-8 md:pt-5"
|
16 |
-
>
|
17 |
<div
|
18 |
-
|
|
|
19 |
>
|
20 |
-
<
|
21 |
-
|
|
|
|
|
|
|
|
|
22 |
</div>
|
23 |
-
</
|
|
|
1 |
<script lang="ts">
|
2 |
import { fade } from "svelte/transition";
|
3 |
+
import Portal from "./Portal.svelte";
|
4 |
import IconDazzled from "$lib/components/icons/IconDazzled.svelte";
|
5 |
|
6 |
interface Props {
|
|
|
10 |
let { message = "" }: Props = $props();
|
11 |
</script>
|
12 |
|
13 |
+
<Portal>
|
|
|
|
|
|
|
14 |
<div
|
15 |
+
transition:fade|global={{ duration: 300 }}
|
16 |
+
class="pointer-events-none fixed right-0 top-12 z-50 bg-gradient-to-bl from-red-500/20 via-red-500/0 to-red-500/0 pb-36 pl-36 pr-2 pt-2 md:top-0 md:pr-8 md:pt-5"
|
17 |
>
|
18 |
+
<div
|
19 |
+
class="pointer-events-auto flex items-center rounded-full bg-white/90 px-3 py-1 shadow-sm dark:bg-gray-900/80"
|
20 |
+
>
|
21 |
+
<IconDazzled classNames="text-2xl mr-2" />
|
22 |
+
<h2 class="max-w-2xl font-semibold text-gray-800 dark:text-gray-200">{message}</h2>
|
23 |
+
</div>
|
24 |
</div>
|
25 |
+
</Portal>
|