From 1ba8b0dcea79e4377d359aa5bb73aa54969ae77d Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 3 May 2023 11:33:56 +0700 Subject: semi dynamic page --- src/lib/auth/hooks/useRegister.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/lib/auth/hooks/useRegister.js') 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 } -- cgit v1.2.3