diff options
Diffstat (limited to 'src/lib/auth/components/LoginMobile.jsx')
| -rw-r--r-- | src/lib/auth/components/LoginMobile.jsx | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/lib/auth/components/LoginMobile.jsx b/src/lib/auth/components/LoginMobile.jsx new file mode 100644 index 00000000..78584a1c --- /dev/null +++ b/src/lib/auth/components/LoginMobile.jsx @@ -0,0 +1,68 @@ +import Image from 'next/image' +import IndoteknikLogo from '@/images/logo.png' +import Link from '@/core/components/elements/Link/Link' +import Alert from '@/core/components/elements/Alert/Alert' +import MobileView from '@/core/components/views/MobileView' +import useLogin from '../hooks/useLogin' + +const LoginMobile = () => { + const { handleSubmit, handleChangeInput, isLoading, isValid, alert, emailRef, passwordRef } = + useLogin() + + return ( + <MobileView> + <div className='p-6 pt-10 flex flex-col items-center min-h-screen'> + <Link href='/'> + <Image src={IndoteknikLogo} alt='Logo Indoteknik' width={150} height={50} /> + </Link> + <h1 className='text-2xl mt-4 font-semibold'>Mulai Belanja Sekarang</h1> + <h2 className='text-gray_r-11 font-normal mt-1 mb-4'>Masuk ke akun kamu untuk belanja</h2> + + {alert && ( + <Alert className='text-center' type={alert.type}> + {alert.children} + </Alert> + )} + + <form className='w-full mt-6 flex flex-col gap-y-4' onSubmit={handleSubmit}> + <div> + <label htmlFor='email'>Alamat Email</label> + <input + type='email' + name='email' + id='email' + className='form-input w-full mt-3' + ref={emailRef} + onChange={handleChangeInput} + placeholder='contoh@email.com' + /> + </div> + <div> + <label htmlFor='password'>Kata Sandi</label> + <input + type='password' + name='password' + id='password' + className='form-input w-full mt-3' + ref={passwordRef} + onChange={handleChangeInput} + placeholder='••••••••••••' + /> + </div> + <button type='submit' className='btn-yellow w-full mt-2' disabled={!isValid || isLoading}> + {!isLoading ? 'Masuk' : 'Loading...'} + </button> + </form> + + <div className='text-gray_r-11 mt-4'> + Belum punya akun Indoteknik?{' '} + <Link href='/register' className='inline'> + Daftar + </Link> + </div> + </div> + </MobileView> + ) +} + +export default LoginMobile |
