Commit bdc8e376 by G

go directly to the home page for logged in user WHEN user is logged in 🙃

parent 2e8bbc7f
import { useUserAuthenticationContext } from "@/contexts/UserAuthenticationContext";
import UnloggedUserStackNavigation from "./UnloggedUserStackNavigation";
const InitialNavigationHandler = () => {
const { isAuthenticated } = useUserAuthenticationContext();
console.log("isAuthenticated", isAuthenticated);
return <UnloggedUserStackNavigation />;
};
export default InitialNavigationHandler;
import { useUserAuthenticationContext } from "@/contexts/UserAuthenticationContext";
import type { UnloggedUserStackScreenComponentProps } from "@/navigations/Types"; import type { UnloggedUserStackScreenComponentProps } from "@/navigations/Types";
import Button from "@components/Button"; import Button from "@components/Button";
import Box from "@components/bases/Box"; import Box from "@components/bases/Box";
...@@ -6,6 +7,12 @@ import { Image, StyleSheet } from "react-native"; ...@@ -6,6 +7,12 @@ import { Image, StyleSheet } from "react-native";
const HomeUserNotLoggedIn: UnloggedUserStackScreenComponentProps<"homeUserNotLoggedIn"> = ({ const HomeUserNotLoggedIn: UnloggedUserStackScreenComponentProps<"homeUserNotLoggedIn"> = ({
navigation, navigation,
}) => { }) => {
const { isAuthenticated } = useUserAuthenticationContext();
if (isAuthenticated) {
navigation.replace("bottomTabs");
}
return ( return (
<Box style={style.container} p={"xl"}> <Box style={style.container} p={"xl"}>
<Box mt={"s"}> <Box mt={"s"}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment