Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

RootNavigation.js 981B

123456789101112131415161718192021222324252627282930313233
  1. import React from "react";
  2. import AppStack from "./AppStack";
  3. import AuthStack from "./AuthStack";
  4. import { SafeAreaView } from "react-native";
  5. import { useSelector } from "react-redux";
  6. import { selectTokens } from "@store/selectors/loginSelectors";
  7. import { StatusBar } from "expo-status-bar";
  8. import { useTheme } from "@styles";
  9. const RootNavigation = () => {
  10. const { isDark, colors } = useTheme();
  11. const tokens = useSelector(selectTokens);
  12. return !tokens.JwtToken ? (
  13. <SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}>
  14. <StatusBar
  15. backgroundColor={colors.background}
  16. style={isDark ? "light" : "dark"}
  17. />
  18. <AuthStack />
  19. </SafeAreaView>
  20. ) : (
  21. <SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}>
  22. <StatusBar
  23. backgroundColor={colors.background}
  24. style={isDark ? "light" : "dark"}
  25. />
  26. <AppStack />
  27. </SafeAreaView>
  28. );
  29. };
  30. export default RootNavigation;