From 2b58ff029107b23617d8c4b246de77876b3bf053 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Wed, 28 Sep 2022 00:21:37 +0800 Subject: feat: Move frontend into layout group (main) This enables /book to load without the usual layout (app layout) --- apps/kit/src/lib/components/alert.svelte | 6 ++-- apps/kit/src/lib/components/button.svelte | 59 +++++++++++++++++++------------ apps/kit/src/lib/helpers.ts | 4 ++- 3 files changed, 42 insertions(+), 27 deletions(-) (limited to 'apps/kit/src/lib') diff --git a/apps/kit/src/lib/components/alert.svelte b/apps/kit/src/lib/components/alert.svelte index 6cc0e63..5bcb3ae 100644 --- a/apps/kit/src/lib/components/alert.svelte +++ b/apps/kit/src/lib/components/alert.svelte @@ -17,12 +17,12 @@ let iconComponent: any; let colorClassPart = ""; - // if no unique id is supplied, cooldown will not work between page loads. - // Therefore we are disabling it with noCooldownSetting in the fallback id. /** * An optional id for this alert, a default is set if not specified. * This value is necessary for closeable cooldown to work. */ + // if no unique id is supplied, cooldown will not work between page loads. + // Therefore we are disabling it with noCooldownSetting in the fallback id. export let id = "alert--" + noCooldownSetting + "--" + random_string(4); /** * The title to communicate, value is optional @@ -42,7 +42,7 @@ export let closeable = false; /** * The amount of seconds that should go by before this alert is shown again, only works when a unique id is set. - * Set to ~ if it should be only shown once per client (State stored in localestorage). + * Set to ~ if it should only be shown once per client (State stored in localestorage). **/ export let closeableCooldown = "-1"; /** diff --git a/apps/kit/src/lib/components/button.svelte b/apps/kit/src/lib/components/button.svelte index 5550e5e..6566cec 100644 --- a/apps/kit/src/lib/components/button.svelte +++ b/apps/kit/src/lib/components/button.svelte @@ -1,19 +1,23 @@ - + + + {#if href && !disabled} - + + {text} {:else} - -{/if} \ No newline at end of file +{/if} diff --git a/apps/kit/src/lib/helpers.ts b/apps/kit/src/lib/helpers.ts index c2a811e..c4e2e51 100644 --- a/apps/kit/src/lib/helpers.ts +++ b/apps/kit/src/lib/helpers.ts @@ -123,7 +123,9 @@ export function set_favicon(url: string) { document.head.appendChild(link); } } - +export function no_type_check(x: any) { + return x; +} export function capitalise(value: string): string { return value.charAt(0).toUpperCase() + value.slice(1); } -- cgit v1.3