From fdbb265ae62fd22c520c8e95fa307bb903203487 Mon Sep 17 00:00:00 2001 From: Neshura Date: Tue, 5 Dec 2023 19:25:34 +0100 Subject: [PATCH] Modify some lib components for Svelte 5 --- src/lib/components/Button.svelte | 12 ++++++--- src/lib/components/NavigationElement.svelte | 8 ++++++ src/lib/stores/UserSettingsStore.ts | 6 +++++ src/lib/types/themes.ts | 27 +++++++++++++++++++++ src/lib/types/userSettings.ts | 8 ++++++ 5 files changed, 58 insertions(+), 3 deletions(-) diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte index a046d0b..72e5cc9 100644 --- a/src/lib/components/Button.svelte +++ b/src/lib/components/Button.svelte @@ -1,6 +1,12 @@ + + - + diff --git a/src/lib/components/NavigationElement.svelte b/src/lib/components/NavigationElement.svelte index e69de29..41e8e48 100644 --- a/src/lib/components/NavigationElement.svelte +++ b/src/lib/components/NavigationElement.svelte @@ -0,0 +1,8 @@ + + +
  • + +
  • \ No newline at end of file diff --git a/src/lib/stores/UserSettingsStore.ts b/src/lib/stores/UserSettingsStore.ts index e69de29..b3cf208 100644 --- a/src/lib/stores/UserSettingsStore.ts +++ b/src/lib/stores/UserSettingsStore.ts @@ -0,0 +1,6 @@ +import { writable, type Writable } from "svelte/store"; +import { UserSettings } from '$lib/types/userSettings'; + +const UserSettingsStore: Writable = writable(new UserSettings()); + +export default UserSettingsStore; \ No newline at end of file diff --git a/src/lib/types/themes.ts b/src/lib/types/themes.ts index e69de29..8578112 100644 --- a/src/lib/types/themes.ts +++ b/src/lib/types/themes.ts @@ -0,0 +1,27 @@ +export type Theme = { + backgroundColor: string, + textColor: string, + primaryAction: string, + secondaryAction: string, +} +const lightTheme = { + backgroundColor: "slate-50", + textColor: "slate-950", + primaryAction: "sky-300", + secondaryAction: "sky-600", +} + +const darkTheme = { + backgroundColor: "slate-950", + textColor: "slate-50", + primaryAction: "sky-300", + secondaryAction: "sky-600", +} + +export const themes = [ + lightTheme, + darkTheme +] + + + diff --git a/src/lib/types/userSettings.ts b/src/lib/types/userSettings.ts index e69de29..0fa295e 100644 --- a/src/lib/types/userSettings.ts +++ b/src/lib/types/userSettings.ts @@ -0,0 +1,8 @@ +export class UserSettings { + themeId: number + + constructor() { + this.themeId = 1 // DEBUG + return this + } +} \ No newline at end of file