From c42e3256fa8f059a937629b1e44a2dc50d736928 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 10 Jan 2025 13:33:16 +0700 Subject: update code --- src/lib/merchant/components/Merchant.jsx | 57 +++++++++++++++++--------------- 1 file changed, 31 insertions(+), 26 deletions(-) (limited to 'src/lib/merchant/components/Merchant.jsx') diff --git a/src/lib/merchant/components/Merchant.jsx b/src/lib/merchant/components/Merchant.jsx index 30ad0130..c4661d46 100644 --- a/src/lib/merchant/components/Merchant.jsx +++ b/src/lib/merchant/components/Merchant.jsx @@ -4,6 +4,7 @@ import Image from '~/components/ui/image'; import InformasiPerusahaan from './InformasiPerusahaan'; import InformasiVendor from './InformasiVendor'; import SyaratDagang from './SyaratDagang'; +import Dokumen from './Dokumen'; import { getAuth } from '~/libs/auth'; import { setAuth } from '@/core/utils/auth'; import useAuth from '@/core/hooks/useAuth'; @@ -20,7 +21,7 @@ import PageContent from '@/lib/content/components/PageContent'; const Merchant = () => { const { isDesktop, isMobile } = useDevice(); const [currentStep, setCurrentStep] = React.useState(0); - const NUMBER_OF_STEPS = 6; + const NUMBER_OF_STEPS = 5; const [isLoading, setIsLoading] = useState(false); const [bigData, setBigData] = useState(); const [idTempo, setIdTempo] = useState(0); @@ -30,10 +31,19 @@ const Merchant = () => { const [BannerTempo, setBannerTempo] = useState(); const [notValid, setNotValid] = useState(false); const [buttonSubmitClick, setButtonSubmitClick] = useState(false); + + const [error, setError] = useState(false); + + const handleIsError = (value) => { + console.log('value yang dihasilkan', value); + goToNextStep(); + setError(value); // Memperbarui state berdasarkan isError + }; const stepDivs = [ - , - , + , + , , + , ]; const stepLabels = [ @@ -45,6 +55,13 @@ const Merchant = () => { 'Konfirmasi', ]; + useEffect(() => { + window.scrollTo({ + top: 0, + behavior: 'smooth', + }); + }, [currentStep]); + // useEffect(() => { // const loadBigData = async () => { // const toCamelCase = (str) => @@ -170,9 +187,7 @@ const Merchant = () => { className='w-full mt-6' /> )} -

- Form Pengajuan Tempo -

+

Form Merchant

{ )} {currentStep < 5 && ( <> - - - + + Langkah Selanjutnya + + {} + )} -- cgit v1.2.3