From 720b3c5f68a043f95c81bf2362d30f92e2a21f62 Mon Sep 17 00:00:00 2001 From: wukko Date: Sat, 20 Jul 2024 20:34:19 +0600 Subject: [PATCH] web: full SmallDialog component, one flexible meowbalt component - fully stylized small dialog: header, title, subtext, state without meowbalt - moved meowbalt into his own adaptive component, no need to import/create new ones for each emotion - better types for dialog related stuff - type for meowbalt's emotions - better padding in small dialog --- web/src/components/dialog/SmallDialog.svelte | 53 +++++++++++++----- .../components/meowbalt/MeowbaltError.svelte | 19 ------- .../components/meowbalt/MeowbaltLoaf.svelte | 18 ------ web/src/components/misc/Meowbalt.svelte | 31 ++++++++++ web/src/components/misc/Placeholder.svelte | 5 +- .../save/buttons/DownloadButton.svelte | 5 +- web/src/lib/types/dialog.ts | 6 +- web/src/lib/types/meowbalt.ts | 1 + web/src/routes/+layout.svelte | 6 ++ web/src/routes/+page.svelte | 4 +- .../meowbalt/{checking.png => question.png} | Bin 11 files changed, 86 insertions(+), 62 deletions(-) delete mode 100644 web/src/components/meowbalt/MeowbaltError.svelte delete mode 100644 web/src/components/meowbalt/MeowbaltLoaf.svelte create mode 100644 web/src/components/misc/Meowbalt.svelte create mode 100644 web/src/lib/types/meowbalt.ts rename web/static/meowbalt/{checking.png => question.png} (100%) diff --git a/web/src/components/dialog/SmallDialog.svelte b/web/src/components/dialog/SmallDialog.svelte index c14cd102..3820c88e 100644 --- a/web/src/components/dialog/SmallDialog.svelte +++ b/web/src/components/dialog/SmallDialog.svelte @@ -4,10 +4,11 @@ import { killDialog } from "$lib/dialogs"; import type { DialogButton } from "$lib/types/dialog"; - import MeowbaltError from "$components/meowbalt/MeowbaltError.svelte"; + import Meowbalt from "$components/misc/Meowbalt.svelte"; + import type { MeowbaltEmotions } from "$lib/types/meowbalt"; export let id: string; - export let meowbalt: string = ""; + export let meowbalt: MeowbaltEmotions; export let title: string = ""; export let bodyText: string = ""; export let bodySubText: string = ""; @@ -39,16 +40,16 @@
- {#if meowbalt === "error"} + {#if meowbalt}
- +
{/if} - + {/if}