summaryrefslogtreecommitdiff
path: root/src/lib/merchant/components/Merchant.jsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-01-20 10:33:19 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-01-20 10:33:19 +0700
commitcb083185ce59df7143ea258e147a118a1e416e56 (patch)
tree8b003da0e6630df422931215f67cf51095659f08 /src/lib/merchant/components/Merchant.jsx
parentdde82979c57ab0261a802ab4134e65272e3d4a37 (diff)
<iman> update merchant
Diffstat (limited to 'src/lib/merchant/components/Merchant.jsx')
-rw-r--r--src/lib/merchant/components/Merchant.jsx54
1 files changed, 38 insertions, 16 deletions
diff --git a/src/lib/merchant/components/Merchant.jsx b/src/lib/merchant/components/Merchant.jsx
index a995cb19..28244be6 100644
--- a/src/lib/merchant/components/Merchant.jsx
+++ b/src/lib/merchant/components/Merchant.jsx
@@ -5,6 +5,7 @@ import InformasiPerusahaan from './InformasiPerusahaan';
import InformasiVendor from './InformasiVendor';
import SyaratDagang from './SyaratDagang';
import Dokumen from './Dokumen';
+import Konfirmasi from './Konfirmasi';
import { getAuth } from '~/libs/auth';
import { setAuth } from '@/core/utils/auth';
import useAuth from '@/core/hooks/useAuth';
@@ -35,17 +36,30 @@ const Merchant = () => {
const [error, setError] = useState(false);
const handleIsError = (value) => {
- console.log('value yang dihasilkan', value);
+ console.log('LAHKAH SELANJUTNYA', value);
if (!value) {
goToNextStep();
}
setError(value); // Memperbarui state berdasarkan isError
};
const stepDivs = [
- <InformasiPerusahaan handleIsError={handleIsError} />,
- <InformasiVendor handleIsError={handleIsError} />,
- <SyaratDagang handleIsError={handleIsError} />,
- <Dokumen handleIsError={handleIsError} />,
+ <InformasiPerusahaan
+ handleIsError={handleIsError}
+ buttonSubmitClick={buttonSubmitClick}
+ />,
+ <InformasiVendor
+ handleIsError={handleIsError}
+ buttonSubmitClick={buttonSubmitClick}
+ />,
+ <SyaratDagang
+ handleIsError={handleIsError}
+ buttonSubmitClick={buttonSubmitClick}
+ />,
+ <Dokumen
+ handleIsError={handleIsError}
+ buttonSubmitClick={buttonSubmitClick}
+ />,
+ <Konfirmasi handleIsError={handleIsError} />,
];
const stepLabels = [
@@ -64,6 +78,11 @@ const Merchant = () => {
});
}, [currentStep]);
+ useEffect(() => {
+ <InformasiPerusahaan buttonSubmitClick={buttonSubmitClick} />;
+ console.log('MASUK SINI');
+ }, [buttonSubmitClick]);
+
// useEffect(() => {
// const loadBigData = async () => {
// const toCamelCase = (str) =>
@@ -166,6 +185,9 @@ const Merchant = () => {
const goPrevStep = () => {
setCurrentStep((prev) => (prev === NUMBER_OF_STEPS - 1 ? prev : prev - 1));
};
+ const handleDaftarMerchant = () => {
+ setButtonSubmitClick((prev) => !prev);
+ };
useEffect(() => {
const getBanner = async () => {
@@ -210,17 +232,17 @@ const Merchant = () => {
{isMobile && (
<div className='h-[2px] bg-gray-300 w-[120%] inset-0 mt-4 mb-4 relative transform -translate-x-5'></div>
)}
- {/* <div
+ <div
className={`flex ${
isMobile
? 'flex-col justify-start items-start'
: 'flex-col justify-end items-end'
} mb-8 gap-2`}
>
- <span className='text-xs opacity-60'>
+ {/* <span className='text-xs opacity-60'>
*Pastikan data yang anda masukan sudah benar dan sesuai
- </span>
- <div
+ </span> */}
+ {/* <div
className={` flex flex-row ${
currentStep > 0 && currentStep < 5
? 'justify-between'
@@ -254,8 +276,8 @@ const Merchant = () => {
</Button>
</>
)}
- </div>
- {currentStep == 5 && (
+ </div> */}
+ {/* {currentStep == 0 && (
<div
className={`flex flex-col ${
isMobile ? 'items-start' : 'items-end'
@@ -264,14 +286,14 @@ const Merchant = () => {
<Button
colorScheme='red'
w={`${isMobile ? 'full' : '36'}`}
- isDisabled={!isCheckedTNC}
- onClick={handleDaftarTempo}
+ // isDisabled={!isCheckedTNC}
+ onClick={handleDaftarMerchant}
>
- Daftar Tempo {<ChevronRightIcon className='w-5' />}
+ Daftar Merchant {<ChevronRightIcon className='w-5' />}
</Button>
</div>
- )}
- </div> */}
+ )} */}
+ </div>
</div>
</>
);