From b4abdb00ef83aa824e8a05d5b75df48adb7b9629 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 3 May 2023 10:38:52 +0700 Subject: semi dynamic page --- src/lib/cart/components/Cart.jsx | 147 ++++++++++++++------------- src/lib/category/components/Category.jsx | 6 +- src/lib/flashSale/components/FlashSale.jsx | 12 ++- src/lib/form/components/KunjunganService.jsx | 66 +++++++----- src/lib/form/components/Merchant.jsx | 4 +- src/lib/form/components/PembayaranTempo.jsx | 2 +- src/lib/form/components/SuratDukungan.jsx | 2 +- src/lib/product/api/productSearchApi.js | 2 +- src/lib/product/components/ProductSearch.jsx | 8 +- 9 files changed, 141 insertions(+), 108 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx index b0de5168..3a61e9be 100644 --- a/src/lib/cart/components/Cart.jsx +++ b/src/lib/cart/components/Cart.jsx @@ -329,91 +329,92 @@ const Cart = () => { Keranjang belanja anda masih kosong )} - {products && products?.map((product) => ( - - - toggleSelected(product.id)} - checked={product?.selected} - className='accent-danger-500 w-4' - /> - - - - {product?.name} ( + + + toggleSelected(product.id)} + checked={product?.selected} + className='accent-danger-500 w-4' /> - -
+ + - {product?.parent?.name} + {product?.name} -
- {product?.code}{' '} - {product?.attributes.length > 0 - ? `| ${product?.attributes.join(', ')}` - : ''} -
-
- - - updateQuantity(e.target.value, product?.id)} - onBlur={(e) => updateQuantity(e.target.value, product?.id, 'BLUR')} - /> - - - {product?.price?.discountPercentage > 0 && ( -
-
- {currencyFormat(product?.price?.price)} +
+ + {product?.parent?.name} + +
+ {product?.code}{' '} + {product?.attributes.length > 0 + ? `| ${product?.attributes.join(', ')}` + : ''}
-
- {product?.price?.discountPercentage}% +
+ + + updateQuantity(e.target.value, product?.id)} + onBlur={(e) => updateQuantity(e.target.value, product?.id, 'BLUR')} + /> + + + {product?.price?.discountPercentage > 0 && ( +
+
+ {currencyFormat(product?.price?.price)} +
+
+ {product?.price?.discountPercentage}% +
+ )} +
+ {currencyFormat(product?.price?.priceDiscount)}
- )} -
- {currencyFormat(product?.price?.priceDiscount)} -
- - -
- {currencyFormat(product?.price?.priceDiscount * product?.quantity)} -
- - -
- -
- - - ))} + + +
+ {currencyFormat(product?.price?.priceDiscount * product?.quantity)} +
+ + +
+ +
+ + + ))} diff --git a/src/lib/category/components/Category.jsx b/src/lib/category/components/Category.jsx index eddedd24..884a871f 100644 --- a/src/lib/category/components/Category.jsx +++ b/src/lib/category/components/Category.jsx @@ -51,7 +51,11 @@ const Category = () => {
{child1Category.childs.map((child2Category) => ( diff --git a/src/lib/flashSale/components/FlashSale.jsx b/src/lib/flashSale/components/FlashSale.jsx index f0f95c8b..e4a4a25c 100644 --- a/src/lib/flashSale/components/FlashSale.jsx +++ b/src/lib/flashSale/components/FlashSale.jsx @@ -27,8 +27,16 @@ const FlashSale = () => {
- {flashSale.name} - {flashSale.name} + {flashSale.name} + {flashSale.name}
diff --git a/src/lib/form/components/KunjunganService.jsx b/src/lib/form/components/KunjunganService.jsx index 7797444d..076f6814 100644 --- a/src/lib/form/components/KunjunganService.jsx +++ b/src/lib/form/components/KunjunganService.jsx @@ -41,18 +41,32 @@ const CreateKunjunganService = () => { } const data = { ...values, - name : 'Pengajuan Kunjungan Service - ' + values.company, - contact_name : values.cp, - email_from : values.email, - phone : values.mobile, - description : "\r\n Nama Perusahaan : " + values.company + " \r\n Alamat : " + values.address + " \r\n Propinsi : " + values.city + " \r\n Telepon: " + values.phone + " \r\n Handphone : " + values.mobile +" \r\n Email : " + values.email + " \r\n Keterangan : " + values.description , + name: 'Pengajuan Kunjungan Service - ' + values.company, + contact_name: values.cp, + email_from: values.email, + phone: values.mobile, + description: + '\r\n Nama Perusahaan : ' + + values.company + + ' \r\n Alamat : ' + + values.address + + ' \r\n Propinsi : ' + + values.city + + ' \r\n Telepon: ' + + values.phone + + ' \r\n Handphone : ' + + values.mobile + + ' \r\n Email : ' + + values.email + + ' \r\n Keterangan : ' + + values.description } const create_leads = await createLeadApi({ data }) if (create_leads) { toast.success('Berhasil menambahkan alamat') reset() - recaptchaRef.current.reset() + recaptchaRef.current.reset() } } return ( @@ -125,9 +139,7 @@ const CreateKunjunganService = () => { type='text' className='form-input' /> -
- {errors.cp?.message} -
+
{errors.cp?.message}
@@ -156,7 +168,9 @@ const CreateKunjunganService = () => {
- +