diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-03 10:52:17 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-03 10:52:17 +0700 |
| commit | 495f8cfc8339441fb7256424a3895fb12288fb51 (patch) | |
| tree | ab5a1ff35e29161a68572dfc81c0b90728771aa0 /src/lib/auth | |
| parent | 596c019af400cc21d2890f875a7570f044866210 (diff) | |
| parent | ceaa64aa3273134fb9ffb851c4f23c468fa2519a (diff) | |
Merge branch 'master' of bitbucket.org:altafixco/next-indoteknik
Diffstat (limited to 'src/lib/auth')
| -rw-r--r-- | src/lib/auth/components/RegisterDesktop.jsx | 13 | ||||
| -rw-r--r-- | src/lib/auth/components/RegisterMobile.jsx | 24 | ||||
| -rw-r--r-- | src/lib/auth/hooks/useRegister.js | 5 |
3 files changed, 38 insertions, 4 deletions
diff --git a/src/lib/auth/components/RegisterDesktop.jsx b/src/lib/auth/components/RegisterDesktop.jsx index 71cc29d8..5f0caf73 100644 --- a/src/lib/auth/components/RegisterDesktop.jsx +++ b/src/lib/auth/components/RegisterDesktop.jsx @@ -3,6 +3,7 @@ import useRegister from '../hooks/useRegister' import Link from '@/core/components/elements/Link/Link' import Alert from '@/core/components/elements/Alert/Alert' import PageContent from '@/lib/content/components/PageContent' +import BottomPopup from '@/core/components/elements/Popup/BottomPopup' const RegisterDesktop = () => { const { @@ -14,7 +15,9 @@ const RegisterDesktop = () => { companyNameRef, fullnameRef, emailRef, - passwordRef + passwordRef, + tnd, + setTnd } = useRegister() return ( @@ -86,6 +89,10 @@ const RegisterDesktop = () => { placeholder='••••••••••••' /> </div> + <div class="flex items-center mt-4 "> + <input type="checkbox" id='sdk' className='form-input flex items-start w-fit mr-2' required /> + <label onClick={() => setTnd(true)} className='inline cursor-pointer text-red_r-10'>Syarat dan Ketentuan</label> + </div> <button type='submit' className='btn-yellow w-full mt-2' @@ -95,6 +102,10 @@ const RegisterDesktop = () => { </button> </form> + <div> + <BottomPopup active={tnd} close={() => setTnd(false)}><PageContent path='/register#tnd'></PageContent></BottomPopup> + </div> + <div className='text-gray_r-11 mt-10'> Sudah punya akun Indoteknik?{' '} <Link href='/login' className='inline'> diff --git a/src/lib/auth/components/RegisterMobile.jsx b/src/lib/auth/components/RegisterMobile.jsx index 007b127c..11935439 100644 --- a/src/lib/auth/components/RegisterMobile.jsx +++ b/src/lib/auth/components/RegisterMobile.jsx @@ -4,6 +4,8 @@ import Image from 'next/image' import Link from '@/core/components/elements/Link/Link' import useRegister from '../hooks/useRegister' import MobileView from '@/core/components/views/MobileView' +import BottomPopup from '@/core/components/elements/Popup/BottomPopup' +import PageContent from '@/lib/content/components/PageContent' const RegisterMobile = () => { const { @@ -15,7 +17,9 @@ const RegisterMobile = () => { companyNameRef, fullnameRef, emailRef, - passwordRef + passwordRef, + tnd, + setTnd } = useRegister() return ( @@ -89,12 +93,28 @@ const RegisterMobile = () => { placeholder='••••••••••••' /> </div> - + <div class='flex items-center mt-4 '> + <input + type='checkbox' + id='sdk' + className='form-input flex items-start w-fit mr-2' + required + /> + <label onClick={() => setTnd(true)} className='inline cursor-pointer text-red_r-10'> + Syarat dan Ketentuan + </label> + </div> <button type='submit' className='btn-yellow w-full mt-2' disabled={!isValid || isLoading}> {!isLoading ? 'Daftar' : 'Loading...'} </button> </form> + <div> + <BottomPopup active={tnd} close={() => setTnd(false)}> + <PageContent path='/register#tnd'></PageContent> + </BottomPopup> + </div> + <div className='text-gray_r-11 mt-4'> Sudah punya akun Indoteknik?{' '} <Link href='/login' className='inline'> diff --git a/src/lib/auth/hooks/useRegister.js b/src/lib/auth/hooks/useRegister.js index 7642a666..2375cf19 100644 --- a/src/lib/auth/hooks/useRegister.js +++ b/src/lib/auth/hooks/useRegister.js @@ -6,6 +6,7 @@ const useRegister = () => { const [isLoading, setIsLoading] = useState(false) const [alert, setAlert] = useState(null) const [isValid, setIsValid] = useState(false) + const [tnd, setTnd] = useState(false) const fullnameRef = useRef(null) const emailRef = useRef(null) @@ -73,7 +74,9 @@ const useRegister = () => { companyNameRef, fullnameRef, emailRef, - passwordRef + passwordRef, + tnd, + setTnd } } |
