diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-20 14:33:21 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-20 14:33:21 +0700 |
| commit | 833488811b4164d7fbdce9bd70e171f06d62bf8d (patch) | |
| tree | c781a3ced1f27b8f1c81ed5401fd758d79c1de1c /src/lib/auth/components/LoginDesktop.jsx | |
| parent | 87e7292941a251f09b5af39d9020896a3bfb0f97 (diff) | |
login and register
Diffstat (limited to 'src/lib/auth/components/LoginDesktop.jsx')
| -rw-r--r-- | src/lib/auth/components/LoginDesktop.jsx | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/lib/auth/components/LoginDesktop.jsx b/src/lib/auth/components/LoginDesktop.jsx new file mode 100644 index 00000000..7b71b9a6 --- /dev/null +++ b/src/lib/auth/components/LoginDesktop.jsx @@ -0,0 +1,77 @@ +import DesktopView from '@/core/components/views/DesktopView' +import useLogin from '../hooks/useLogin' +import Link from '@/core/components/elements/Link/Link' +import PageContent from '@/lib/content/components/PageContent' +import Alert from '@/core/components/elements/Alert/Alert' + +const LoginDesktop = () => { + const { handleSubmit, handleChangeInput, isLoading, isValid, alert, emailRef, passwordRef } = + useLogin() + + return ( + <DesktopView> + <div className='container mx-auto'> + <div className='grid grid-cols-2 gap-x-10 pt-16'> + <div> + <h1 className='text-2xl font-semibold'>Selamat Datang di Indoteknik</h1> + <h2 className='text-gray_r-11 font-normal mt-1 mb-4'> + Masuk ke akun kamu untuk mulai transaksi! + </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-10'> + Belum punya akun Indoteknik?{' '} + <Link href='/register' className='inline'> + Daftar akun baru + </Link> + </div> + </div> + <div> + <PageContent path='/login' /> + </div> + </div> + </div> + </DesktopView> + ) +} + +export default LoginDesktop |
