rename useRootTheme to createRootTheme
This commit is contained in:
parent
d55a117aa4
commit
62d3a5a3d0
3 changed files with 19 additions and 18 deletions
|
@ -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();
|
||||
|
|
|
@ -5,21 +5,22 @@ import { Accessor } from "solid-js";
|
|||
/**
|
||||
* The MUI theme.
|
||||
*/
|
||||
export function useRootTheme(): Accessor<Theme> {
|
||||
return () =>
|
||||
createTheme({
|
||||
palette: {
|
||||
primary: {
|
||||
main: deepPurple[500],
|
||||
},
|
||||
error: {
|
||||
main: red[900],
|
||||
},
|
||||
secondary: {
|
||||
main: amber.A200,
|
||||
},
|
||||
export function createRootTheme(): Accessor<Theme> {
|
||||
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)";
|
||||
|
|
|
@ -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<void> {
|
|||
|
||||
const dispose = render(() => {
|
||||
const [open, setOpen] = createSignal(true);
|
||||
const theme = useRootTheme();
|
||||
const theme = createRootTheme();
|
||||
onCleanup(() => {
|
||||
element.remove();
|
||||
resolve();
|
||||
|
|
Loading…
Add table
Reference in a new issue