88} from "@react-navigation/material-top-tabs" ;
99import { ParamListBase , TabNavigationState } from "@react-navigation/native" ;
1010
11- import { useConstantTheme , useTheme } from "@/hooks/use- theme" ;
12- import { usePlatform } from "@/hooks/use-platform " ;
11+ import { theme } from "@/constants/ theme" ;
12+ import { setPlatformSettings , setTheme } from "@/utils/setters " ;
1313
1414const { Navigator } = createMaterialTopTabNavigator ( ) ;
1515
@@ -21,54 +21,36 @@ export const MaterialTopTabs = withLayoutContext<
2121> ( Navigator ) ;
2222
2323export default function AuthLayout ( ) {
24- const { setPlatformSettings } = usePlatform ( ) ;
25- const { setTheme } = useTheme ( ) ;
26- const { foregroundColor, backgroundColor, activeBackground } =
27- useConstantTheme ( ) ;
2824 const { width } = useWindowDimensions ( ) ;
2925
3026 return (
3127 < SafeAreaView className = "flex-1" >
3228 < MaterialTopTabs
3329 screenOptions = { {
34- tabBarActiveTintColor : foregroundColor ,
30+ tabBarActiveTintColor : theme . secondary ,
3531 tabBarLabelStyle : {
3632 fontWeight : "bold" ,
3733 textTransform : "capitalize" ,
3834 fontSize : 17 ,
3935 } ,
4036 tabBarIndicatorStyle : {
41- backgroundColor : foregroundColor ,
37+ backgroundColor : theme . secondary ,
4238 height : 4 ,
4339 width : width / 2 ,
4440 borderRadius : 15 ,
4541 } ,
4642 tabBarIndicatorContainerStyle : {
4743 backgroundColor : setPlatformSettings ( {
48- ios : setTheme ( activeBackground , "rgb(245 245 245)" ) ,
49- android : setTheme ( "#000" , backgroundColor ) ,
44+ ios : setTheme ( theme . primary , "rgb(245 245 245)" ) ,
45+ android : setTheme ( "#000" , theme . primary ) ,
5046 } ) ,
5147 } ,
52- tabBarContentContainerStyle : {
53- height : 50 ,
54- } ,
55- tabBarItemStyle : {
56- width : width / 2 ,
57- } ,
48+ tabBarContentContainerStyle : { height : 50 } ,
49+ tabBarItemStyle : { width : width / 2 } ,
5850 } }
5951 >
60- < MaterialTopTabs . Screen
61- name = "login"
62- options = { {
63- title : "Login" ,
64- } }
65- />
66- < MaterialTopTabs . Screen
67- name = "signup"
68- options = { {
69- title : "Sign Up" ,
70- } }
71- />
52+ < MaterialTopTabs . Screen name = "login" options = { { title : "Login" } } />
53+ < MaterialTopTabs . Screen name = "signup" options = { { title : "Sign Up" } } />
7254 </ MaterialTopTabs >
7355 </ SafeAreaView >
7456 ) ;
0 commit comments