From 00fb4639797d1901b7cf71bcb2e2311939858163 Mon Sep 17 00:00:00 2001 From: "Damon L. Montague Jr." Date: Sun, 28 Apr 2024 17:18:38 -0400 Subject: [PATCH] added constant --- ui/src/context/ThemeContext.tsx | 6 ++++-- ui/src/pages/Home.tsx | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/src/context/ThemeContext.tsx b/ui/src/context/ThemeContext.tsx index d886bbb..e31b777 100644 --- a/ui/src/context/ThemeContext.tsx +++ b/ui/src/context/ThemeContext.tsx @@ -12,12 +12,14 @@ export interface IThemeContext { export const ThemeContext = createContext({} as IThemeContext); +const ACCURIBET_THEME_KEY: string = "accuribet-theme"; + export function ThemeContextProvider(props: ThemeContextProviderProps) { - let preferredTheme = localStorage.getItem("accuribet-theme"); + let preferredTheme = localStorage.getItem(ACCURIBET_THEME_KEY); const [themeStore, setThemeStore] = createStore({ theme: preferredTheme ? preferredTheme : "blackout", setTheme(theme: string) { - localStorage.setItem("accuribet-theme", theme); + localStorage.setItem(ACCURIBET_THEME_KEY, theme); setThemeStore("theme", theme); } }); diff --git a/ui/src/pages/Home.tsx b/ui/src/pages/Home.tsx index 653b350..6a60c73 100644 --- a/ui/src/pages/Home.tsx +++ b/ui/src/pages/Home.tsx @@ -3,7 +3,6 @@ import { Button } from "~/components/ui/button.tsx"; import { AiFillGithub } from "solid-icons/ai"; import { AnimationDiv } from "~/components/animated-div.tsx"; import { FaSolidBasketball } from "solid-icons/fa"; -import { BsCloudRain } from 'solid-icons/bs'; import { TbBrain } from 'solid-icons/tb'; export const Home = () => {