Spaces:
Sleeping
Sleeping
File size: 678 Bytes
de852c2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | import React, { useState } from 'react';
import Login from '../components/Login';
import Signup from '../components/Signup';
const AuthPage = ({ onAuthSuccess }) => {
const [isLogin, setIsLogin] = useState(true);
const handleNavigateToLogin = () => setIsLogin(true);
const handleNavigateToSignup = () => setIsLogin(false);
return (
<>
{isLogin ? (
<Login
onNavigateToSignup={handleNavigateToSignup}
onNavigateToHome={onAuthSuccess}
/>
) : (
<Signup
onNavigateToLogin={handleNavigateToLogin}
onNavigateToHome={onAuthSuccess}
/>
)}
</>
);
};
export default AuthPage; |