Massive/use-theme.ts

23 lines
607 B
TypeScript
Raw Permalink Normal View History

import { createContext, useContext } from "react";
import { MD3DarkTheme, MD3LightTheme } from "react-native-paper";
export const ThemeContext = createContext<{
theme: string;
lightColor: string;
setTheme: (value: string) => void;
setLightColor: (value: string) => void;
darkColor: string;
setDarkColor: (value: string) => void;
}>({
theme: "system",
2023-07-15 01:21:09 +00:00
lightColor: MD3DarkTheme.colors.primary,
setTheme: () => null,
setLightColor: () => null,
2023-07-15 01:21:09 +00:00
darkColor: MD3LightTheme.colors.primary,
setDarkColor: () => null,
});
export function useAppTheme() {
return useContext(ThemeContext);
}