Moved Toast logic into own directory

This commit is contained in:
Luke Else 2023-09-19 14:22:00 +01:00
parent f31f180687
commit 1b33bd398d
9 changed files with 6 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import Toast from "./Toast.svelte"; import Toast from "./Toast.svelte";
import { dismissToast, toasts } from "./store"; import { dismissToast, toasts } from "$lib/store";
</script> </script>
{#if $toasts} {#if $toasts}
@ -15,7 +15,7 @@
<style lang="postcss"> <style lang="postcss">
section { section {
position: fixed; position: fixed;
top: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
width: 100%; width: 100%;
@ -23,6 +23,6 @@
margin-top: 1rem; margin-top: 1rem;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
z-index: 1000; z-index: 10;
} }
</style> </style>

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { getJson } from "$lib/data"; import { getJson } from "$lib/data";
import { Toast, ToastType } from "$lib/toast"; import { Toast, ToastType } from "$lib/toast";
import { addToast } from "./store"; import { addToast } from "$lib/store";
</script> </script>
<style> <style>
@ -30,7 +30,6 @@
font-size: 125%; font-size: 125%;
} }
@media (max-width: 800px) { @media (max-width: 800px) {
.flex-container { .flex-container {
align-items: center; align-items: center;
@ -73,12 +72,11 @@
<p class="about">{@html info.about}</p> <p class="about">{@html info.about}</p>
</div> </div>
</div> </div>
{:catch} {:catch}
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h1>Unable to load portfolio overview data</h1> <h1>Unable to load portfolio overview data</h1>
</div> </div>
</div> </div>
{addToast(new Toast("Unable to load me.json", ToastType.Error, true, 3000))} <div style="display: none;">{addToast(new Toast("Unable to load me.json", ToastType.Error, true, 3000))}</div>
{/await} {/await}

View File

@ -1,9 +1,8 @@
<script> <script>
import Toasts from "../Toasts.svelte"; import Toasts from "../Toasts/Toasts.svelte";
</script> </script>
<style> <style>
.main-container { .main-container {
margin-left: 10%; margin-left: 10%;
margin-right: 10%; margin-right: 10%;