From 3692f937130e18cf396f5871d8a15bdd258bdd2b Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 13 Jan 2025 16:37:28 +0700 Subject: update merchant --- src/lib/merchant/components/Dokumen.jsx | 44 ++++++++++++++++------ .../merchant/components/InformasiPerusahaan.jsx | 41 ++++++++++---------- src/lib/merchant/components/Merchant.jsx | 10 ++--- 3 files changed, 60 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/lib/merchant/components/Dokumen.jsx b/src/lib/merchant/components/Dokumen.jsx index a701a36d..fb4d1914 100644 --- a/src/lib/merchant/components/Dokumen.jsx +++ b/src/lib/merchant/components/Dokumen.jsx @@ -84,12 +84,12 @@ const Dokumen = ({ handleIsError }) => { const recaptchaRef = useRef(null); const npwpRef = useRef(null); const sppkpRef = useRef(null); + const ktpDirutRef = useRef(null); const kartuNamaRef = useRef(null); const suratPernyataanRef = useRef(null); const fotoKantorRef = useRef(null); const dataProdukRef = useRef(null); const pricelistRef = useRef(null); - const ktpDirutRef = useRef(null); const router = useRouter(); const auth = useAuth(); @@ -274,27 +274,38 @@ const Dokumen = ({ handleIsError }) => { const dataProduk = DeatailFile.dataProduk; const pricelist = DeatailFile.pricelist; if (!npwp && isPkp) { + if (npwpRef?.current) { + npwpRef.current.scrollIntoView(options); + } toast.error('NPWP wajib di tambahkan'); return; } if (!sppkp && isPkp) { toast.error('SPPKP wajib di tambahkan'); + if (sppkpRef?.current) { + sppkpRef.current.scrollIntoView(options); + } return; } if (!dokumenKtpDirut && !isPkp) { - if (ktpDirutRef.current) { + toast.error('KTP Dirut/Direktur wajib di tambahkan'); + if (ktpDirutRef?.current) { ktpDirutRef.current.scrollIntoView(options); - console.log('MASUK SINI BANG'); } - toast.error('KTP Dirut/Direktur wajib di tambahkan'); return; } if (!fotoKantor) { toast.error('Foto Gudang / Kantor Bagian Depan wajib di tambahkan'); + if (fotoKantorRef?.current) { + fotoKantorRef.current.scrollIntoView(options); + } return; } if (!pricelist) { toast.error('Pricelist wajib di tambahkan'); + if (pricelistRef?.current) { + pricelistRef.current.scrollIntoView(options); + } return; } const toastId = toast.loading('Mengirimkan formulir merchant...'); @@ -447,7 +458,7 @@ const Dokumen = ({ handleIsError }) => {
-