useTheme applied globally
This commit is contained in:
parent
1f304d41f2
commit
9de2678922
12 changed files with 31 additions and 39 deletions
|
|
@ -4,29 +4,25 @@ import { StyleSheet } from "react-native";
|
|||
import { FontAwesome } from "@expo/vector-icons";
|
||||
import { Redirect } from "expo-router";
|
||||
import React, { useEffect } from "react";
|
||||
import { useThemeColor } from "../../hooks/useThemeColor";
|
||||
import { useTheme } from "../contexts/ThemeContext";
|
||||
import { useAuth } from "../contexts/AuthContext";
|
||||
|
||||
export default function Layout() {
|
||||
// const selectedColor: string = useThemeColor( "tabIconSelected");
|
||||
// const defaultColor: string = useThemeColor("tabIconDefault");
|
||||
// const backgroundColor: string = useThemeColor("backgroundColor");
|
||||
// const tabBarColor: string = useThemeColor("tabBarColor");
|
||||
const {authState} = useAuth()
|
||||
|
||||
const {colors} = useTheme()
|
||||
const styles = StyleSheet.create({
|
||||
sceneContainer: {
|
||||
backgroundColor: useThemeColor("containerColor"),
|
||||
backgroundColor: colors.containerColor,
|
||||
},
|
||||
tabBar: {
|
||||
backgroundColor: useThemeColor("backgroundColor"),
|
||||
borderTopColor: useThemeColor("backgroundColor"),
|
||||
backgroundColor: colors.backgroundColor,
|
||||
borderTopColor: colors.backgroundColor
|
||||
}
|
||||
});
|
||||
|
||||
const screenOptions = {
|
||||
tabBarActiveTintColor: useThemeColor( "tabIconSelected"),
|
||||
tabBarInactiveTintColor: useThemeColor("tabIconDefault"),
|
||||
tabBarActiveTintColor: colors.tabIconSelected,
|
||||
tabBarInactiveTintColor: colors.tabIconDefault,
|
||||
headerShown: false,
|
||||
tabBarStyle: styles.tabBar,
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue