diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-08-20 15:21:31 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-08-20 15:21:31 +0700 |
| commit | 1d3f68f4a61bb084938523dea2869087f915bf61 (patch) | |
| tree | 23afa11c1351c27e116a6ae81bc10dd2521e6ea5 /src-migrate/modules/register/components/RegistrasiBisnis.tsx | |
| parent | cf0f7a934bcf256d1daeee98e9f66397fb64b1ee (diff) | |
<iman> update new register
Diffstat (limited to 'src-migrate/modules/register/components/RegistrasiBisnis.tsx')
| -rw-r--r-- | src-migrate/modules/register/components/RegistrasiBisnis.tsx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src-migrate/modules/register/components/RegistrasiBisnis.tsx b/src-migrate/modules/register/components/RegistrasiBisnis.tsx index c093d556..2c429f2d 100644 --- a/src-migrate/modules/register/components/RegistrasiBisnis.tsx +++ b/src-migrate/modules/register/components/RegistrasiBisnis.tsx @@ -20,8 +20,10 @@ const RegistrasiBisnis = () => { const [isIndividuRequired, setIsIndividuRequired] = useState(true); const [isBisnisRequired, setIsBisnisRequired] = useState(true); const [selectedValue, setSelectedValue] = useState('PKP'); + const [selectedValueBisnis, setSelectedValueBisnis] = useState('true'); const { form, + formBisnis, isCheckedTNC, isValidCaptcha, errors, @@ -44,6 +46,15 @@ const RegistrasiBisnis = () => { } }; + const handleChangeBisnis = (value: string) => { + setSelectedValueBisnis(value); + if (value === "true") { + setIsBisnisRequired(true); // Show and require Individu form + } else { + setIsBisnisRequired(false); // Hide and make optional the Individu form + } + }; + const handleClick = () => { setIsIndividuRequired(!isIndividuRequired) }; @@ -52,6 +63,15 @@ const RegistrasiBisnis = () => { setIsBisnisRequired(!isBisnisRequired) }; + const handleSubmit = () => { + console.log("form",form) + console.log("form Bisnis",formBisnis) + }; + console.log("isFormValid",isFormValid) + console.log("isCheckedTNC",isCheckedTNC) + console.log("mutation.isLoading",mutation.isLoading) + console.log("isValidCaptcha",isValidCaptcha) + return ( <> <div className="mt-4"> @@ -100,7 +120,7 @@ const RegistrasiBisnis = () => { <Divider my={4} /> <div> <p className="text-black font-bold">Bisnis Terdaftar di Indoteknik?</p> - <RadioGroup onChange={handleChange} value={selectedValue}> + <RadioGroup onChange={handleChangeBisnis} value={selectedValueBisnis}> <Stack direction='row'> <Radio value='true'>Sudah Terdaftar</Radio> <Radio value='false'>Belum Terdaftar</Radio> @@ -112,15 +132,16 @@ const RegistrasiBisnis = () => { )} </div> </div> - <FormCaptcha /> <TermCondition /> <button type="submit" className="btn-yellow w-full mt-2" + onClick={handleSubmit} disabled={!isFormValid || !isCheckedTNC || mutation.isLoading || !isValidCaptcha} > {mutation.isLoading ? 'Loading...' : 'Daftar'} </button> + <FormCaptcha /> </> ); }; |
