-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
46 lines (40 loc) · 1.58 KB
/
App.js
File metadata and controls
46 lines (40 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React from 'react';
import { NavigationContainer, DefaultTheme, DarkTheme } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { Provider, useSelector } from 'react-redux';
import { SafeAreaView, StyleSheet } from 'react-native';
import MainNavigator from './Navigation/AppNavigator';
import SplashScreen from './Screens/SplashScreen';
import AuthStack from './Navigation/AuthStack';
import store from './Store/Store';
const RootStack = createStackNavigator();
function AppContent() {
const isDarkMode = useSelector((state) => state.darkMode.isDarkMode);
const language = useSelector((state) => state.language.language); // 👈 lấy ngôn ngữ từ Redux
// siuuuuuuuuuuuuuuuusiuuuuuuuuuuuuuuuu
// Có thể in log để debug (nếu cần)
console.log('Language đang dùng:', language);
return (
<SafeAreaView style={[styles.container, { backgroundColor: isDarkMode ? '#000' : '#fff' }]}>
<NavigationContainer theme={isDarkMode ? DarkTheme : DefaultTheme}>
<RootStack.Navigator screenOptions={{ headerShown: false }}>
<RootStack.Screen name="SplashScreen" component={SplashScreen} />
<RootStack.Screen name="AuthStack" component={AuthStack} />
<RootStack.Screen name="MainNavigator" component={MainNavigator} />
</RootStack.Navigator>
</NavigationContainer>
</SafeAreaView>
);
}
export default function App() {
return (
<Provider store={store}>
<AppContent />
</Provider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});