| 123456789101112131415161718192021222324252627282930313233 |
- import React from "react";
- import AppStack from "./AppStack";
- import AuthStack from "./AuthStack";
- import { SafeAreaView } from "react-native";
- import { useSelector } from "react-redux";
- import { selectTokens } from "@store/selectors/loginSelectors";
- import { StatusBar } from "expo-status-bar";
- import { useTheme } from "@styles";
-
- const RootNavigation = () => {
- const { isDark, colors } = useTheme();
- const tokens = useSelector(selectTokens);
-
- return !tokens.JwtToken ? (
- <SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}>
- <StatusBar
- backgroundColor={colors.background}
- style={isDark ? "light" : "dark"}
- />
- <AuthStack />
- </SafeAreaView>
- ) : (
- <SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}>
- <StatusBar
- backgroundColor={colors.background}
- style={isDark ? "light" : "dark"}
- />
- <AppStack />
- </SafeAreaView>
- );
- };
-
- export default RootNavigation;
|