From 5c216b746523c105ce1f7f78240dd0600879388f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 29 Jul 2022 11:53:07 +0100 Subject: [PATCH] Offer custom themes for client apps and improve theme panel --- .../theme/_components/AppThemeSelect.svelte | 71 ++++++++++++------- .../_components/ButtonRoundnessSelect.svelte | 38 ++++++++++ .../_components/ThemeSettingsPanel.svelte | 67 ++--------------- 3 files changed, 88 insertions(+), 88 deletions(-) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ButtonRoundnessSelect.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/AppThemeSelect.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/AppThemeSelect.svelte index accd156c29..86a897bf60 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/AppThemeSelect.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/AppThemeSelect.svelte @@ -1,20 +1,11 @@
- - - + {#each Constants.Themes as theme} +
onChangeTheme(theme.class)} + > +
+ {theme.name} +
+ {/each}
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ButtonRoundnessSelect.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ButtonRoundnessSelect.svelte new file mode 100644 index 0000000000..21b04f694f --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ButtonRoundnessSelect.svelte @@ -0,0 +1,38 @@ + + +
+ +
+ +
+
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ThemeSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ThemeSettingsPanel.svelte index 4bad3b7bc4..19184a8644 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ThemeSettingsPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ThemeSettingsPanel.svelte @@ -11,25 +11,7 @@ import { get } from "svelte/store" import { DefaultAppTheme } from "constants" import AppThemeSelect from "./AppThemeSelect.svelte" - - const ButtonBorderRadiusOptions = [ - { - label: "Square", - value: "0", - }, - { - label: "Soft edge", - value: "4px", - }, - { - label: "Curved", - value: "8px", - }, - { - label: "Round", - value: "16px", - }, - ] + import ButtonRoundnessSelect from "./ButtonRoundnessSelect.svelte" $: customTheme = $store.customTheme || {} @@ -52,22 +34,11 @@ - -
- {#each ButtonBorderRadiusOptions as option} -
- -
- {/each} -
+ + update("buttonBorderRadius", e.detail)} + />
@@ -88,29 +59,3 @@ - -