From 80e40195bd780f984a2bcd2af1db3905a1d0f41e Mon Sep 17 00:00:00 2001 From: AaronGibson2 Date: Thu, 18 Apr 2024 17:32:33 -0400 Subject: [PATCH 1/2] added pullstate --- client/src/services/SettingsStore.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 client/src/services/SettingsStore.ts diff --git a/client/src/services/SettingsStore.ts b/client/src/services/SettingsStore.ts new file mode 100644 index 000000000..4239c2ded --- /dev/null +++ b/client/src/services/SettingsStore.ts @@ -0,0 +1,15 @@ +import { Store } from "pullstate"; + +interface SettingsInterface { + isDarkMode: boolean; +}; + +export const SettingStore = new Store({ + isDarkMode: false, +}); + +export const toggleTheme = async() => { + SettingStore.update((store) => { + store.isDarkMode = !store.isDarkMode; + }); +}; From 7478a31309d59d14f415d2341545f3a566a28ab1 Mon Sep 17 00:00:00 2001 From: AaronGibson2 Date: Sun, 21 Apr 2024 22:37:35 -0400 Subject: [PATCH 2/2] ran lint and addressed problems --- client/src/services/SettingsStore.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/src/services/SettingsStore.ts b/client/src/services/SettingsStore.ts index 4239c2ded..1724398da 100644 --- a/client/src/services/SettingsStore.ts +++ b/client/src/services/SettingsStore.ts @@ -1,15 +1,15 @@ import { Store } from "pullstate"; -interface SettingsInterface { +interface SettingsInterface { isDarkMode: boolean; -}; +} export const SettingStore = new Store({ - isDarkMode: false, + isDarkMode: false, }); -export const toggleTheme = async() => { - SettingStore.update((store) => { - store.isDarkMode = !store.isDarkMode; - }); +export const toggleTheme = async () => { + SettingStore.update((store) => { + store.isDarkMode = !store.isDarkMode; + }); };