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:
Brandon Presley 2023-11-14 14:45:15 +13:00
parent a7db87c61a
commit 456af73e91
3 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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;

View File

@ -17,6 +17,6 @@ export const ThemeContext = createContext<{
setDarkColor: () => null,
});
export function useTheme() {
export function useAppTheme() {
return useContext(ThemeContext);
}