Compare commits

...

2 Commits

Author SHA1 Message Date
Tran Anh Tuan
d8874fbe60 uncomment 2025-11-19 15:05:59 +07:00
00fd53bbd4 fix config theme system 2025-11-19 14:52:12 +07:00
3 changed files with 10 additions and 9 deletions

View File

@@ -3,5 +3,6 @@
"source.fixAll": "explicit",
"source.organizeImports": "explicit",
"source.sortMembers": "explicit"
}
},
"postman.settings.dotenv-detection-notification-visibility": false
}

View File

@@ -42,7 +42,7 @@ function AppContent() {
}}
/>
{/* <Stack.Screen
<Stack.Screen
name="(tabs)"
options={{
title: "Home",
@@ -53,7 +53,7 @@ function AppContent() {
<Stack.Screen
name="modal"
options={{ presentation: "formSheet", title: "Modal" }}
/> */}
/>
</Stack>
<StatusBar style="auto" />
<Toast config={toastConfig} visibilityTime={2000} topOffset={60} />

View File

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