diff --git a/src/App.tsx b/src/App.tsx index e7ca588..5e69ff3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -10,7 +10,7 @@ import { lazy, onCleanup, } from "solid-js"; -import { useRootTheme } from "./material/theme.js"; +import { createRootTheme } from "./material/theme.js"; import { Provider as ClientProvider, createMastoClientFor, @@ -70,7 +70,7 @@ const Routing: Component = () => { }; const App: Component = () => { - const theme = useRootTheme(); + const theme = createRootTheme(); const accts = useStore($accounts); const lang = createCurrentLanguage(); const region = createCurrentRegion(); diff --git a/src/material/theme.ts b/src/material/theme.ts index 0eb4eaf..a7a68a8 100644 --- a/src/material/theme.ts +++ b/src/material/theme.ts @@ -5,21 +5,22 @@ import { Accessor } from "solid-js"; /** * The MUI theme. */ -export function useRootTheme(): Accessor { - return () => - createTheme({ - palette: { - primary: { - main: deepPurple[500], - }, - error: { - main: red[900], - }, - secondary: { - main: amber.A200, - }, +export function createRootTheme(): Accessor { + const theme = createTheme({ + palette: { + primary: { + main: deepPurple[500], }, - }); + error: { + main: red[900], + }, + secondary: { + main: amber.A200, + }, + }, + }); + + return () => theme; } export const ANIM_CURVE_STD = "cubic-bezier(0.4, 0, 0.2, 1)"; diff --git a/src/platform/share.tsx b/src/platform/share.tsx index 3f1d870..f135736 100644 --- a/src/platform/share.tsx +++ b/src/platform/share.tsx @@ -16,7 +16,7 @@ import { import { Close as CloseIcon, ContentCopy } from "@suid/icons-material"; import { Title } from "~material/typography"; import { render } from "solid-js/web"; -import { useRootTheme } from "~material/theme"; +import { createRootTheme } from "~material/theme"; const ShareBottomSheet: Component<{ data?: ShareData; @@ -78,7 +78,7 @@ export async function share(data?: ShareData): Promise { const dispose = render(() => { const [open, setOpen] = createSignal(true); - const theme = useRootTheme(); + const theme = createRootTheme(); onCleanup(() => { element.remove(); resolve();