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