diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-05-08 16:44:09 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-05-08 16:44:09 +0700 |
| commit | 486f85a45fc7e0669576f59824a31be472ed25bb (patch) | |
| tree | 0268afa8efe48746e040611ba41ad2cafda7ad08 /src/lib/auth | |
| parent | cff198277e14450f8d20d9e18548325e6f277682 (diff) | |
| parent | 30fc50600009ca54f085d594d838803c107e87f2 (diff) | |
Merge branch 'master' into development_tri/implementasi_raja_ongkir
# Conflicts:
# src/lib/checkout/components/Checkout.jsx
Diffstat (limited to 'src/lib/auth')
| -rw-r--r-- | src/lib/auth/components/CompanyProfile.jsx | 2 | ||||
| -rw-r--r-- | src/lib/auth/components/Menu.jsx | 7 | ||||
| -rw-r--r-- | src/lib/auth/components/PersonalProfile.jsx | 4 | ||||
| -rw-r--r-- | src/lib/auth/components/RegisterDesktop.jsx | 14 | ||||
| -rw-r--r-- | src/lib/auth/components/RegisterMobile.jsx | 11 | ||||
| -rw-r--r-- | src/lib/auth/hooks/useRegister.js | 13 |
6 files changed, 39 insertions, 12 deletions
diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx index 854aa246..13d4a194 100644 --- a/src/lib/auth/components/CompanyProfile.jsx +++ b/src/lib/auth/components/CompanyProfile.jsx @@ -76,7 +76,7 @@ const CompanyProfile = () => { Dibawah ini adalah data usaha yang anda masukkan, periksa kembali data usaha anda. </div> </div> - <div className='p-2 bg-gray_r-3 rounded'> + <div className='ml-2 p-2 bg-gray_r-3 rounded'> {!isOpen && <ChevronDownIcon className='w-6' />} {isOpen && <ChevronUpIcon className='w-6' />} </div> diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx index 9a73609d..8a8e2e8a 100644 --- a/src/lib/auth/components/Menu.jsx +++ b/src/lib/auth/components/Menu.jsx @@ -9,10 +9,13 @@ const Menu = () => { return ( <div className='grid grid-cols-1 bg-white border border-gray_r-6 rounded py-2 px-4'> <div className='mt-4 mb-1 font-medium'>Menu</div> - <LinkItem href='/my/transactions' active={routeStartWith('/my/transaction')}> + <LinkItem href='/my/quotations' active={routeStartWith('/my/quotations')}> + Daftar Quotation + </LinkItem> + <LinkItem href='/my/transactions' active={routeStartWith('/my/transactions')}> Daftar Transaksi </LinkItem> - <LinkItem href='/my/invoices' active={routeStartWith('/my/invoice')}> + <LinkItem href='/my/invoices' active={routeStartWith('/my/invoices')}> Invoice & Faktur Pajak </LinkItem> <LinkItem href='/my/wishlist' active={routeStartWith('/my/wishlist')}> diff --git a/src/lib/auth/components/PersonalProfile.jsx b/src/lib/auth/components/PersonalProfile.jsx index 4a533ae9..bca54e24 100644 --- a/src/lib/auth/components/PersonalProfile.jsx +++ b/src/lib/auth/components/PersonalProfile.jsx @@ -9,7 +9,7 @@ import editPersonalProfileApi from '../api/editPersonalProfileApi' const PersonalProfile = () => { const auth = useAuth() - const [isOpen, setIsOpen] = useState(false) + const [isOpen, setIsOpen] = useState(true) const toggle = () => setIsOpen(!isOpen) const { register, setValue, handleSubmit } = useForm({ defaultValues: { @@ -54,7 +54,7 @@ const PersonalProfile = () => { Dibawah ini adalah data diri yang anda masukan, periksa kembali data diri anda </div> </div> - <div className='p-2 bg-gray_r-3 rounded'> + <div className='ml-2 p-2 bg-gray_r-3 rounded'> {!isOpen && <ChevronDownIcon className='w-6' />} {isOpen && <ChevronUpIcon className='w-6' />} </div> diff --git a/src/lib/auth/components/RegisterDesktop.jsx b/src/lib/auth/components/RegisterDesktop.jsx index 482a9ce3..f624fba7 100644 --- a/src/lib/auth/components/RegisterDesktop.jsx +++ b/src/lib/auth/components/RegisterDesktop.jsx @@ -4,6 +4,7 @@ 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' +import ReCAPTCHA from 'react-google-recaptcha' const RegisterDesktop = () => { const { @@ -16,6 +17,7 @@ const RegisterDesktop = () => { fullnameRef, emailRef, passwordRef, + recaptchaRef, tnd, setTnd } = useRegister() @@ -89,6 +91,7 @@ const RegisterDesktop = () => { placeholder='••••••••••••' /> </div> + <ReCAPTCHA ref={recaptchaRef} sitekey={process.env.NEXT_PUBLIC_RECAPTCHA_GOOGLE} /> <div class='flex items-center mt-4 '> <input type='checkbox' @@ -96,11 +99,12 @@ const RegisterDesktop = () => { className='form-input flex items-start w-fit mr-2' required /> - <label - onClick={() => setTnd(true)} - className='inline cursor-pointer text-danger-500' - > - Syarat dan Ketentuan + <label className='inline'> + Dengan ini saya menyetujui{' '} + <span onClick={() => setTnd(true)} className='cursor-pointer text-danger-500'> + syarat dan ketentuan + </span>{' '} + yang berlaku </label> </div> <button diff --git a/src/lib/auth/components/RegisterMobile.jsx b/src/lib/auth/components/RegisterMobile.jsx index f5c818e7..80ea6ab0 100644 --- a/src/lib/auth/components/RegisterMobile.jsx +++ b/src/lib/auth/components/RegisterMobile.jsx @@ -6,6 +6,7 @@ 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' +import ReCAPTCHA from 'react-google-recaptcha' const RegisterMobile = () => { const { @@ -18,6 +19,7 @@ const RegisterMobile = () => { fullnameRef, emailRef, passwordRef, + recaptchaRef, tnd, setTnd } = useRegister() @@ -93,6 +95,7 @@ const RegisterMobile = () => { placeholder='••••••••••••' /> </div> + <ReCAPTCHA ref={recaptchaRef} sitekey={process.env.NEXT_PUBLIC_RECAPTCHA_GOOGLE} /> <div class='flex items-center mt-4 '> <input type='checkbox' @@ -100,8 +103,12 @@ const RegisterMobile = () => { className='form-input flex items-start w-fit mr-2' required /> - <label onClick={() => setTnd(true)} className='inline cursor-pointer text-danger-500'> - Syarat dan Ketentuan + <label className='inline'> + Dengan ini saya menyetujui{' '} + <span onClick={() => setTnd(true)} className='cursor-pointer text-danger-500'> + syarat dan ketentuan + </span>{' '} + yang berlaku </label> </div> <button type='submit' className='btn-yellow w-full mt-2' disabled={!isValid || isLoading}> diff --git a/src/lib/auth/hooks/useRegister.js b/src/lib/auth/hooks/useRegister.js index 4b0b0d60..1a9412f8 100644 --- a/src/lib/auth/hooks/useRegister.js +++ b/src/lib/auth/hooks/useRegister.js @@ -33,8 +33,20 @@ const useRegister = () => { companyNameRef.current.value = '' } + const recaptchaRef = useRef(null) + const handleSubmit = async (e) => { e.preventDefault() + + const recaptchaValue = recaptchaRef.current.getValue() + if (!recaptchaValue) { + setAlert({ + children: 'ReCaptcha harus diisi', + type: 'info' + }) + return + } + setAlert(null) setIsLoading(true) const { fullname, email, password, companyName } = inputVal() @@ -75,6 +87,7 @@ const useRegister = () => { fullnameRef, emailRef, passwordRef, + recaptchaRef, tnd, setTnd } |
