Skip to content

Commit

Permalink
added constant
Browse files Browse the repository at this point in the history
  • Loading branch information
day-mon committed Apr 28, 2024
1 parent dae5187 commit 00fb463
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ui/src/context/ThemeContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<IThemeContext>({
theme: preferredTheme ? preferredTheme : "blackout",
setTheme(theme: string) {
localStorage.setItem("accuribet-theme", theme);
localStorage.setItem(ACCURIBET_THEME_KEY, theme);
setThemeStore("theme", theme);
}
});
Expand Down
1 change: 0 additions & 1 deletion ui/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 00fb463

Please sign in to comment.