From 94edc1e58696213c3f1b5f69984036cda4aa424f Mon Sep 17 00:00:00 2001 From: Maksim Nedoshev Date: Mon, 1 May 2023 08:45:23 +0300 Subject: [PATCH] chore(docs): remove useTheme --- .../docs/components/layout/header/ThemeSwitch.vue | 6 ++---- packages/docs/composables/useTheme.ts | 12 ------------ 2 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 packages/docs/composables/useTheme.ts diff --git a/packages/docs/components/layout/header/ThemeSwitch.vue b/packages/docs/components/layout/header/ThemeSwitch.vue index 561e31ce0b..3e6e3cd806 100644 --- a/packages/docs/components/layout/header/ThemeSwitch.vue +++ b/packages/docs/components/layout/header/ThemeSwitch.vue @@ -25,13 +25,11 @@ import { computed } from 'vue' import { useColors } from 'vuestic-ui' -const { currentPresetName } = useColors() - -const { setTheme } = useTheme() +const { currentPresetName, applyPreset } = useColors() const isDark = computed({ get: () => currentPresetName.value === 'dark', - set: (value) => setTheme(value ? 'dark' : 'light'), + set: (value) => applyPreset(value ? 'dark' : 'light'), }) diff --git a/packages/docs/composables/useTheme.ts b/packages/docs/composables/useTheme.ts deleted file mode 100644 index 9d2737ed41..0000000000 --- a/packages/docs/composables/useTheme.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const useTheme = () => { - const { applyPreset } = useColors() - - const setTheme = (theme?: string) => { - if (theme === undefined) { return } - applyPreset(theme) - } - - return { - setTheme - } -}