diff --git a/.vscode/settings.json b/.vscode/settings.json index e2798e4..e6d8d7f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,6 @@ "source.fixAll": "explicit", "source.organizeImports": "explicit", "source.sortMembers": "explicit" - } + }, + "postman.settings.dotenv-detection-notification-visibility": false } diff --git a/hooks/use-theme-color.ts b/hooks/use-theme-color.ts index ea9e71d..2b36f97 100644 --- a/hooks/use-theme-color.ts +++ b/hooks/use-theme-color.ts @@ -3,19 +3,19 @@ * https://docs.expo.dev/guides/color-schemes/ */ -import { ColorName } from "@/constants/theme"; -import { useThemeContext } from "@/hooks/use-theme-context"; +import { Colors } from "@/constants/theme"; +import { useColorScheme } from "@/hooks/use-color-scheme"; export function useThemeColor( props: { light?: string; dark?: string }, - colorName: ColorName + colorName: keyof typeof Colors.light & keyof typeof Colors.dark ) { - const { colorScheme, getColor } = useThemeContext(); - const colorFromProps = props[colorScheme]; + const theme = useColorScheme() ?? "light"; + const colorFromProps = props[theme]; if (colorFromProps) { return colorFromProps; } else { - return getColor(colorName); + return Colors[theme][colorName]; } }