Rename useTheme to useAppTheme
React Native and React Native Paper already have a useTheme so let's not add to the clutter.
This commit is contained in:
parent
a7db87c61a
commit
456af73e91
|
@ -20,7 +20,7 @@ import { DrawerParams } from "./drawer-param-list";
|
|||
import { darkOptions, lightOptions, themeOptions } from "./options";
|
||||
import Settings from "./settings";
|
||||
import { toast } from "./toast";
|
||||
import { useTheme } from "./use-theme";
|
||||
import { useAppTheme } from "./use-theme";
|
||||
|
||||
const twelveHours = [
|
||||
"dd/LL/yyyy",
|
||||
|
@ -66,7 +66,7 @@ export default function SettingsPage() {
|
|||
setLightColor,
|
||||
darkColor,
|
||||
setDarkColor,
|
||||
} = useTheme();
|
||||
} = useAppTheme();
|
||||
|
||||
useEffect(() => {
|
||||
NativeModules.SettingsModule.ignoringBattery(setIgnoring);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { useColorScheme } from "react-native";
|
||||
import { useTheme } from "./use-theme";
|
||||
import { useAppTheme } from "./use-theme";
|
||||
|
||||
export default function useDark() {
|
||||
const dark = useColorScheme() === "dark";
|
||||
const { theme } = useTheme();
|
||||
const { theme } = useAppTheme();
|
||||
|
||||
if (theme === "dark") return true;
|
||||
if (theme === "light") return false;
|
||||
|
|
|
@ -17,6 +17,6 @@ export const ThemeContext = createContext<{
|
|||
setDarkColor: () => null,
|
||||
});
|
||||
|
||||
export function useTheme() {
|
||||
export function useAppTheme() {
|
||||
return useContext(ThemeContext);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue