123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import React from "react";
- import AppStack from "./AppStack";
- import AuthStack from "./AuthStack";
- import { SafeAreaView as SafeArea } from "react-native-safe-area-context";
- import { useSelector } from "react-redux";
- import { selectCurrentToken } from "@features/auth/authSlice";
- import { StatusBar } from "expo-status-bar";
- import { useTheme } from "@styles";
- import { Platform, SafeAreaView } from "react-native";
-
- const RootNavigation = () => {
- const { isDark, colors } = useTheme();
- const tokens = useSelector(selectCurrentToken);
-
- return !tokens ? (
- <>
- <StatusBar
- backgroundColor={colors.background}
- style={isDark ? "light" : "dark"}
- />
- <AuthStack />
- </>
- ) : Platform.OS === "ios" ? (
- <SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}>
- <StatusBar
- backgroundColor={colors.background}
- style={isDark ? "light" : "dark"}
- />
- <AppStack />
- </SafeAreaView>
- ) : (
- <SafeArea style={{ flex: 1 }} edges={["top"]}>
- <StatusBar
- backgroundColor={colors.background}
- style={isDark ? "light" : "dark"}
- />
- <AppStack />
- </SafeArea>
- );
- };
-
- export default RootNavigation;
|