summaryrefslogtreecommitdiff
path: root/src-migrate/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src-migrate/modules')
-rw-r--r--src-migrate/modules/product-detail/components/Information.tsx22
-rw-r--r--src-migrate/modules/product-detail/components/PriceAction.tsx2
-rw-r--r--src-migrate/modules/register/components/TermCondition.tsx48
3 files changed, 46 insertions, 26 deletions
diff --git a/src-migrate/modules/product-detail/components/Information.tsx b/src-migrate/modules/product-detail/components/Information.tsx
index b9f4be91..5e1ea186 100644
--- a/src-migrate/modules/product-detail/components/Information.tsx
+++ b/src-migrate/modules/product-detail/components/Information.tsx
@@ -96,7 +96,7 @@ const Information = ({ product }: Props) => {
<label className='form-label mb-2 text-lg text-red-600'>
Pilih Variant * :{' '}
<span className='text-gray_r-9 text-sm'>
- {product?.variant_total} Variants
+ {product?.variants?.length} Variants
</span>{' '}
</label>
<AutoComplete
@@ -190,13 +190,19 @@ const Information = ({ product }: Props) => {
product.manufacture.id.toString()
)}
>
- <Image
- height={50}
- width={100}
- src={product.manufacture.logo}
- alt={product.manufacture.name}
- className='h-8 object-fit'
- />
+ {product?.manufacture.logo ? (
+ <Image
+ height={50}
+ width={100}
+ src={product.manufacture.logo}
+ alt={product.manufacture.name}
+ className='h-8 object-fit'
+ />
+ ) : (
+ <p className='font-bold text-red-500'>
+ {product.manufacture.name}
+ </p>
+ )}
</Link>
) : (
'-'
diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx
index 413c643a..0b27b1b3 100644
--- a/src-migrate/modules/product-detail/components/PriceAction.tsx
+++ b/src-migrate/modules/product-detail/components/PriceAction.tsx
@@ -162,7 +162,7 @@ const PriceAction = ({ product }: Props) => {
</span> */}
</div>
<div>
- {product?.is_in_bu && (
+ {selectedVariant?.is_in_bu && (
<Link href='/panduan-pick-up-service' className='group'>
<Image
src='/images/PICKUP-NOW.png'
diff --git a/src-migrate/modules/register/components/TermCondition.tsx b/src-migrate/modules/register/components/TermCondition.tsx
index d54fe921..44275917 100644
--- a/src-migrate/modules/register/components/TermCondition.tsx
+++ b/src-migrate/modules/register/components/TermCondition.tsx
@@ -1,34 +1,48 @@
-import { Checkbox } from '@chakra-ui/react'
-import React from 'react'
-import { Modal } from '~/components/ui/modal'
-import { useRegisterStore } from "../stores/useRegisterStore";
-import PageContent from '~/modules/page-content'
+import { Checkbox } from '@chakra-ui/react';
+import React from 'react';
+import { Modal } from '~/components/ui/modal';
+import { useRegisterStore } from '../stores/useRegisterStore';
+
+import dynamic from 'next/dynamic';
+const PageContent = dynamic(
+ () => import('@/lib/content/components/PageContent')
+);
const TermCondition = () => {
- const { isOpenTNC, closeTNC, isCheckedTNC, toggleCheckTNC, openTNC } = useRegisterStore()
+ const { isOpenTNC, closeTNC, isCheckedTNC, toggleCheckTNC, openTNC } =
+ useRegisterStore();
return (
<>
- <div className="mt-4 flex items-center gap-x-2">
- <Checkbox id='tnc' name='tnc' colorScheme='red' isChecked={isCheckedTNC} onChange={toggleCheckTNC} />
+ <div className='mt-4 flex items-center gap-x-2'>
+ <Checkbox
+ id='tnc'
+ name='tnc'
+ colorScheme='red'
+ isChecked={isCheckedTNC}
+ onChange={toggleCheckTNC}
+ />
<div>
- <label htmlFor="tnc" className="cursor-pointer">Dengan ini saya menyetujui</label>
- {' '}
+ <label htmlFor='tnc' className='cursor-pointer'>
+ Dengan ini saya menyetujui
+ </label>{' '}
<span
- className="font-medium text-danger-500 cursor-pointer"
+ className='font-medium text-danger-500 cursor-pointer'
onClick={openTNC}
>
syarat dan ketentuan
</span>
- <label htmlFor="tnc" className="ml-2 cursor-pointer">yang berlaku</label>
+ <label htmlFor='tnc' className='ml-2 cursor-pointer'>
+ yang berlaku
+ </label>
</div>
</div>
- <Modal active={isOpenTNC} close={closeTNC} >
- <PageContent path='/register#tnd' />
+ <Modal active={isOpenTNC} close={closeTNC}>
+ <PageContent path='/registerTnd' />
</Modal>
</>
- )
-}
+ );
+};
-export default TermCondition \ No newline at end of file
+export default TermCondition;