/* ---------------------------------- @mui ---------------------------------- */ import { styled } from '@mui/material/styles'; import { Box, Card, Divider, Grid, Link, Stack, Typography, IconButton } from '@mui/material'; /* ------------------------------- components ------------------------------- */ import Page from '../../components/Page'; import Logo from '../../components/Logo'; import Iconify from '../../components/Iconify'; /* ---------------------------------- hooks --------------------------------- */ import useLocalStorage from '../../hooks/useLocalStorage'; /* -------------------------------- sections -------------------------------- */ import { LoginEmailForm, LoginPhoneForm, VerifyCodeForm } from '../../sections/auth/login'; /* --------------------------------- styled --------------------------------- */ const RootStyle = styled('div')(({ theme }) => ({ [theme.breakpoints.up('md')]: { display: 'flex', }, minHeight: '100vh', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', })); const ContentStyle = styled(Card)(({ theme }) => ({ [theme.breakpoints.up('md')]: { maxHeight: '600px', maxWidth: '1000px', }, })); // ---------------------------------------------------------------------- export default function Login() { const [emailOrPhone, setEmailOrPhone] = useLocalStorage('emailOrPhone', ''); const [emailOrPhoneForm, setEmailOrPhoneForm] = useLocalStorage('emailOrPhoneForm', false); const [loginOrVerifyCode, setLoginOrVerifyCode] = useLocalStorage('loginOrVerifyCode', false); return ( {loginOrVerifyCode && emailOrPhone ? ( <> { localStorage.removeItem('emailOrPhone'); setLoginOrVerifyCode(false); }} > Verifikasi OTP Masukkan kode OTP anda disini Tidak mendapatkan kode? Kirim Ulang Kode OTP ) : ( <> Sign in to LinkSehat Enter your details below. {emailOrPhoneForm ? ( ) : ( )} )} Atau {emailOrPhoneForm ? ( { setEmailOrPhone(''); setLoginOrVerifyCode(false); setEmailOrPhoneForm(false); }} sx={{ cursor: 'pointer' }} > Masuk menggunakan email ) : ( { setEmailOrPhone(''); setLoginOrVerifyCode(false); setEmailOrPhoneForm(true); }} sx={{ cursor: 'pointer' }} > Masuk menggunakan nomor handphone )} ); }