diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-12-09 15:48:36 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-12-09 15:48:36 +0700 |
| commit | 10cd02d6fcc39c75b8db19a874cc0ba49b890376 (patch) | |
| tree | e99364d3c0846d2b893af55171718a7e4817b90f /src-migrate/modules/register/components | |
| parent | bb118223e541504262da4509e9188610539702fe (diff) | |
<iman> add dynamic to call component
Diffstat (limited to 'src-migrate/modules/register/components')
| -rw-r--r-- | src-migrate/modules/register/components/FormBisnis.tsx | 7 | ||||
| -rw-r--r-- | src-migrate/modules/register/components/RegistrasiBisnis.tsx | 19 |
2 files changed, 2 insertions, 24 deletions
diff --git a/src-migrate/modules/register/components/FormBisnis.tsx b/src-migrate/modules/register/components/FormBisnis.tsx index e4cf3442..12397956 100644 --- a/src-migrate/modules/register/components/FormBisnis.tsx +++ b/src-migrate/modules/register/components/FormBisnis.tsx @@ -1,9 +1,5 @@ import { ChangeEvent, useEffect, useMemo, useRef, useState } from 'react'; -import { useMutation } from 'react-query'; import { useRegisterStore } from '../stores/useRegisterStore'; -import { RegisterProps } from '~/types/auth'; -import { registerUser } from '~/services/auth'; -import { useRouter } from 'next/router'; import { Button, Checkbox, @@ -11,12 +7,10 @@ import { color, useToast, } from '@chakra-ui/react'; -import Link from 'next/link'; import getFileBase64 from '@/core/utils/getFileBase64'; import { Controller, useForm } from 'react-hook-form'; import HookFormSelect from '@/core/components/elements/Select/HookFormSelect'; import odooApi from '~/libs/odooApi'; -import { toast } from 'react-hot-toast'; import { EyeIcon } from '@heroicons/react/24/outline'; import BottomPopup from '@/core/components/elements/Popup/BottomPopup'; import Image from 'next/image'; @@ -60,7 +54,6 @@ const form: React.FC<FormProps> = ({ const [industries, setIndustries] = useState<industry_id[]>([]); const [companyTypes, setCompanyTypes] = useState<companyType[]>([]); - const router = useRouter(); const toast = useToast(); const emailRef = useRef<HTMLInputElement>(null); diff --git a/src-migrate/modules/register/components/RegistrasiBisnis.tsx b/src-migrate/modules/register/components/RegistrasiBisnis.tsx index ce4d3972..40caed65 100644 --- a/src-migrate/modules/register/components/RegistrasiBisnis.tsx +++ b/src-migrate/modules/register/components/RegistrasiBisnis.tsx @@ -1,19 +1,10 @@ -import { ChangeEvent, useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import FormBisnis from './FormBisnis'; import Form from './Form'; -import TermCondition from './TermCondition'; -import FormCaptcha from './FormCaptcha'; import { Radio, RadioGroup, Stack, Divider, Button } from '@chakra-ui/react'; import React from 'react'; import { ChevronDownIcon, ChevronRightIcon } from '@heroicons/react/24/outline'; import { useRegisterStore } from '../stores/useRegisterStore'; -import { useMutation } from 'react-query'; -import { RegisterProps } from '~/types/auth'; -import { registerUser } from '~/services/auth'; -import router from 'next/router'; -import { useRouter } from 'next/router'; -import { UseToastOptions, useToast } from '@chakra-ui/react'; -import Link from 'next/link'; interface FormProps { chekValid: boolean; buttonSubmitClick: boolean; @@ -28,13 +19,7 @@ const RegistrasiBisnis: React.FC<FormProps> = ({ const [isBisnisClicked, setisBisnisClicked] = useState(true); const [selectedValue, setSelectedValue] = useState('PKP'); const [selectedValueBisnis, setSelectedValueBisnis] = useState('false'); - const { form, isCheckedTNC, isValidCaptcha, errors, validate, updateForm } = - useRegisterStore(); - const isFormValid = useMemo(() => Object.keys(errors).length === 0, [errors]); - const toast = useToast(); - const mutation = useMutation({ - mutationFn: (data: RegisterProps) => registerUser(data), - }); + const { validate, updateForm } = useRegisterStore(); useEffect(() => { if (selectedValue === 'PKP') { |
