From 247d57887a694af1dd2fe1825cf387a2eee7b7bb Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 24 Oct 2024 09:07:36 +0100 Subject: [PATCH 1/8] Remove lightest and dark themes, use enums for themes, standardise naming --- .../commandPalette/CommandPalette.svelte | 4 +- .../src/components/settings/ThemeModal.svelte | 4 +- .../_components/Screen/AppThemeSelect.svelte | 15 +++--- .../builder/portal/apps/[appId]/index.svelte | 9 ++-- packages/builder/src/stores/builder/theme.js | 14 +++--- packages/builder/src/stores/portal/theme.js | 46 +++++++++---------- .../client/src/components/ClientApp.svelte | 8 +++- packages/client/src/stores/theme.js | 7 ++- packages/frontend-core/src/constants.js | 32 +++++++------ packages/frontend-core/src/utils/theme.js | 45 ++++++++++++++---- 10 files changed, 107 insertions(+), 77 deletions(-) diff --git a/packages/builder/src/components/commandPalette/CommandPalette.svelte b/packages/builder/src/components/commandPalette/CommandPalette.svelte index f48fdf4929..a8b4dedbdb 100644 --- a/packages/builder/src/components/commandPalette/CommandPalette.svelte +++ b/packages/builder/src/components/commandPalette/CommandPalette.svelte @@ -141,13 +141,13 @@ icon: "ShareAndroid", action: () => $goto(`./automation/${automation._id}`), })) ?? []), - ...Constants.Themes.map(theme => ({ + ...Constants.ThemeOptions.map(theme => ({ type: "Change Builder Theme", name: theme.name, icon: "ColorPalette", action: () => themeStore.update(state => { - state.theme = theme.class + state.theme = theme.id return state }), })), diff --git a/packages/builder/src/components/settings/ThemeModal.svelte b/packages/builder/src/components/settings/ThemeModal.svelte index cd1649fcb4..eb63a49b02 100644 --- a/packages/builder/src/components/settings/ThemeModal.svelte +++ b/packages/builder/src/components/settings/ThemeModal.svelte @@ -6,10 +6,10 @@ x.name} diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/AppThemeSelect.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/AppThemeSelect.svelte index 1185236924..eb7a839b22 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/AppThemeSelect.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/AppThemeSelect.svelte @@ -1,7 +1,7 @@