import './Auth.scss'
import { useEffect, useState } from "react";

import Login from './Login'
import CreateAccount from './CreateAccount'
import { useRoute } from '@react-navigation/native';

export default function Auth() {
    const route = useRoute();
    const [isSignup, setIsSignup] = useState(route.params && (route.params as any).isLogin?false:true);

    if (isSignup)
        return <CreateAccount login={() => setIsSignup(false)}></CreateAccount>
    return <Login register={() => setIsSignup(true)}></Login>
}