From 2bfa2138be7135dc12daa98262fbaf8305698f00 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 7 Nov 2024 13:55:10 +0700 Subject: add logic quotation no po --- src/lib/transaction/components/Transaction.jsx | 116 +++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index 4d401037..777dd771 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -38,7 +38,9 @@ import aprpoveApi from '../api/approveApi'; import rejectApi from '../api/rejectApi'; import rejectProductApi from '../api/rejectProductApi'; import { useRouter } from 'next/router'; - +import { gtagPurchase } from '@/core/utils/googleTag'; +import { deleteItemCart } from '@/core/utils/cart'; +import axios from 'axios'; const Transaction = ({ id }) => { const router = useRouter(); const [isModalOpen, setIsModalOpen] = useState(false); @@ -48,7 +50,7 @@ const Transaction = ({ id }) => { const { transaction } = useTransaction({ id }); const statusApprovalWeb = transaction.data?.approvalStep; - + const [isLoading, setIsLoading] = useState(false); const { queryAirwayBill } = useAirwayBill({ orderId: id }); const [airwayBillPopup, setAirwayBillPopup] = useState(null); @@ -84,8 +86,22 @@ const Transaction = ({ id }) => { }; const [cancelTransaction, setCancelTransaction] = useState(false); + const [continueNoPo, setContinueNoPo] = useState(false); + const [continueTransaction, setContinueTransaction] = useState(false); const openCancelTransaction = () => setCancelTransaction(true); + const openContinueTransaction = () => { + if (!transaction.data?.purchaseOrderFile) { + setContinueTransaction(true); + } else { + checkout(); + } + }; + const ContinueTransaction = () => { + setContinueNoPo(true); + checkoutNoPO(); + }; const closeCancelTransaction = () => setCancelTransaction(false); + const closeContinueTransaction = () => setContinueTransaction(false); const [rejectTransaction, setRejectTransaction] = useState(false); @@ -101,7 +117,6 @@ const Transaction = ({ id }) => { } closeCancelTransaction(); }; - const checkout = async () => { if (!transaction.data?.purchaseOrderFile) { toast.error('Mohon upload dokumen PO anda sebelum melanjutkan pesanan'); @@ -112,6 +127,63 @@ const Transaction = ({ id }) => { transaction.refetch(); }; + const checkoutNoPO = async () => { + setIsLoading(true); + gtagPurchase( + transaction.data.products, + transaction.data.deliveryAmount, + transaction.data.name + ); + + gtag('event', 'conversion', { + send_to: 'AW-954540379/nDymCL3BhaQYENvClMcD', + value: + transaction.data?.amountTotal + + Math.round(parseInt(transaction.data.deliveryAmount * 1.1) / 1000) * + 1000, + currency: 'IDR', + transaction_id: transaction.data.id, + }); + + for (const product of transaction.data.products) + deleteItemCart({ productId: product.id }); + if (transaction.data?.amountTotal > 0) { + const payment = await axios.post( + `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/midtrans-payment?transactionId=${transaction.data.id}` + ); + setIsLoading(false); + window.location.href = payment.data.redirectUrl; + } else { + window.location.href = `${ + process.env.NEXT_PUBLIC_SELF_HOST + }/shop/checkout/success?order_id=${transaction.data.name.replace( + /\//g, + '-' + )}`; + } + + /* const midtrans = async () => { + for (const product of products) deleteItemCart({ productId: product.id }); + if (grandTotal > 0) { + const payment = await axios.post( + `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/midtrans-payment?transactionId=${isCheckouted.id}` + ); + setIsLoading(false); + window.location.href = payment.data.redirectUrl; + } else { + window.location.href = `${ + process.env.NEXT_PUBLIC_SELF_HOST + }/shop/checkout/success?order_id=${isCheckouted.name.replace( + /\//g, + '-' + )}`; + } + };*/ + toast.success('Berhasil melanjutkan pesanan'); + transaction.refetch(); + y; + }; + const handleApproval = async () => { await aprpoveApi({ id }); toast.success('Berhasil melanjutkan approval'); @@ -207,6 +279,32 @@ const Transaction = ({ id }) => { return ( transaction.data?.name && ( <> + +
+ Apakah anda yakin melanjutkan tanpa upload PO?{' '} + {transaction.data?.name}? +
+
+ + +
+
{ )} {transaction.data?.status == 'draft' && !auth?.feature?.soApproval && ( - )} @@ -563,7 +664,10 @@ const Transaction = ({ id }) => { )} {transaction.data?.status == 'draft' && !auth?.feature.soApproval && ( - )} @@ -879,7 +983,7 @@ const Transaction = ({ id }) => { - )} + )} {transaction?.data?.productsRejectLine.length > 0 && (
-- cgit v1.2.3 From 2d99c50da37c2e68ed33a4bc20e9b2ff06578bbe Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 7 Nov 2024 15:55:15 +0700 Subject: update code --- src/lib/transaction/components/Transaction.jsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index 777dd771..f64945f5 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -117,11 +117,12 @@ const Transaction = ({ id }) => { } closeCancelTransaction(); }; + console.log('transaction', transaction); const checkout = async () => { - if (!transaction.data?.purchaseOrderFile) { - toast.error('Mohon upload dokumen PO anda sebelum melanjutkan pesanan'); - return; - } + // if (!transaction.data?.purchaseOrderFile) { + // toast.error('Mohon upload dokumen PO anda sebelum melanjutkan pesanan'); + // return; + // } await checkoutPoApi({ id }); toast.success('Berhasil melanjutkan pesanan'); transaction.refetch(); @@ -161,6 +162,8 @@ const Transaction = ({ id }) => { '-' )}`; } + toast.success('Berhasil melanjutkan pesanan'); + transaction.refetch(); /* const midtrans = async () => { for (const product of products) deleteItemCart({ productId: product.id }); @@ -179,9 +182,6 @@ const Transaction = ({ id }) => { )}`; } };*/ - toast.success('Berhasil melanjutkan pesanan'); - transaction.refetch(); - y; }; const handleApproval = async () => { -- cgit v1.2.3 From f80551e64e7b4fa1463ecd47d744f7f2846abfda Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 7 Nov 2024 16:49:38 +0700 Subject: update quotation --- src/lib/transaction/api/checkoutPoApi.js | 19 ++++++++++--------- src/lib/transaction/components/Transaction.jsx | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/lib/transaction/api/checkoutPoApi.js b/src/lib/transaction/api/checkoutPoApi.js index 04421368..3376e773 100644 --- a/src/lib/transaction/api/checkoutPoApi.js +++ b/src/lib/transaction/api/checkoutPoApi.js @@ -1,13 +1,14 @@ -import odooApi from '@/core/api/odooApi' -import { getAuth } from '@/core/utils/auth' +import odooApi from '@/core/api/odooApi'; +import { getAuth } from '@/core/utils/auth'; -const checkoutPoApi = async ({ id }) => { - const auth = getAuth() +const checkoutPoApi = async ({ id, status }) => { + const auth = getAuth(); const dataCheckout = await odooApi( 'POST', - `/api/v1/partner/${auth?.partnerId}/sale_order/${id}/checkout` - ) - return dataCheckout -} + `/api/v1/partner/${auth?.partnerId}/sale_order/${id}/checkout`, + { status } + ); + return dataCheckout; +}; -export default checkoutPoApi +export default checkoutPoApi; diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index f64945f5..d9edb670 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -123,7 +123,7 @@ const Transaction = ({ id }) => { // toast.error('Mohon upload dokumen PO anda sebelum melanjutkan pesanan'); // return; // } - await checkoutPoApi({ id }); + await checkoutPoApi({ id, status: true }); toast.success('Berhasil melanjutkan pesanan'); transaction.refetch(); }; -- cgit v1.2.3 From 88198c83806b69ce6ab7815cee5c139536849c9f Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 8 Nov 2024 13:55:44 +0700 Subject: update quotation website --- src/lib/transaction/components/Transaction.jsx | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index d9edb670..6277e3e0 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -90,16 +90,20 @@ const Transaction = ({ id }) => { const [continueTransaction, setContinueTransaction] = useState(false); const openCancelTransaction = () => setCancelTransaction(true); const openContinueTransaction = () => { - if (!transaction.data?.purchaseOrderFile) { - setContinueTransaction(true); - } else { + if (auth.partnerTempo) { checkout(); + } else { + if (!transaction.data?.purchaseOrderFile) { + setContinueTransaction(true); + } else { + checkoutNoPO(); + } } }; - const ContinueTransaction = () => { - setContinueNoPo(true); - checkoutNoPO(); - }; + // const ContinueTransaction = () => { + // setContinueNoPo(true); + // checkoutNoPO(); + // }; const closeCancelTransaction = () => setCancelTransaction(false); const closeContinueTransaction = () => setContinueTransaction(false); @@ -119,10 +123,10 @@ const Transaction = ({ id }) => { }; console.log('transaction', transaction); const checkout = async () => { - // if (!transaction.data?.purchaseOrderFile) { - // toast.error('Mohon upload dokumen PO anda sebelum melanjutkan pesanan'); - // return; - // } + if (!transaction.data?.purchaseOrderFile) { + toast.error('Mohon upload dokumen PO anda sebelum melanjutkan pesanan'); + return; + } await checkoutPoApi({ id, status: true }); toast.success('Berhasil melanjutkan pesanan'); transaction.refetch(); -- cgit v1.2.3 From 9a15f2eea3f182ce8b9cf749f3dcd7b7f42efbaf Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Sat, 16 Nov 2024 10:08:14 +0700 Subject: CR website --- src/core/components/elements/Sidebar/Sidebar.jsx | 2 +- src/lib/auth/components/Menu.jsx | 99 ++++++++++++++++++------ src/pages/my/menu.jsx | 97 +++++++++++++++-------- 3 files changed, 143 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/core/components/elements/Sidebar/Sidebar.jsx b/src/core/components/elements/Sidebar/Sidebar.jsx index ddae3e20..08498759 100644 --- a/src/core/components/elements/Sidebar/Sidebar.jsx +++ b/src/core/components/elements/Sidebar/Sidebar.jsx @@ -140,7 +140,7 @@ const Sidebar = ({ active, close }) => { Tentang Indoteknik - + Hubungi Kami
- ) -} + ); +}; const LinkItem = ({ children, ...props }) => ( ( > {children} -) +); -export default Menu +export default Menu; diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index a0ce223e..1b35d6ba 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -1,24 +1,24 @@ -import Divider from '@/core/components/elements/Divider/Divider' -import Link from '@/core/components/elements/Link/Link' -import AppLayout from '@/core/components/layouts/AppLayout' -import useAuth from '@/core/hooks/useAuth' -import { deleteAuth } from '@/core/utils/auth' -import IsAuth from '@/lib/auth/components/IsAuth' -import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid' -import { signOut, useSession } from 'next-auth/react' -import { useRouter } from 'next/router' -import ImageNext from 'next/image' - +import Divider from '@/core/components/elements/Divider/Divider'; +import Link from '@/core/components/elements/Link/Link'; +import AppLayout from '@/core/components/layouts/AppLayout'; +import useAuth from '@/core/hooks/useAuth'; +import { deleteAuth } from '@/core/utils/auth'; +import IsAuth from '@/lib/auth/components/IsAuth'; +import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid'; +import { signOut, useSession } from 'next-auth/react'; +import { useRouter } from 'next/router'; +import ImageNext from 'next/image'; +import whatsappUrl from '@/core/utils/whatsappUrl'; export default function Menu() { - const auth = useAuth() - const router = useRouter() - const { data: session } = useSession() + const auth = useAuth(); + const router = useRouter(); + const { data: session } = useSession(); const logout = () => { deleteAuth().then(() => { - router.push('/login') - }) - } + router.push('/login'); + }); + }; return ( @@ -29,8 +29,12 @@ export default function Menu() {
{auth?.name}
- {auth?.company &&
Akun Bisnis
} - {!auth?.company &&
Akun Individu
} + {auth?.company && ( +
Akun Bisnis
+ )} + {!auth?.company && ( +
Akun Individu
+ )}
@@ -47,32 +51,52 @@ export default function Menu() { {' '}
- +

Daftar Quotation

- +

Daftar Transaksi

- +

Daftar Pengiriman

{' '}
- +

Invoice & Faktur Pajak

- +

Wishlist

@@ -83,10 +107,14 @@ export default function Menu() { Pusat Bantuan
- + {' '}
- +

Layanan Pelanggan

@@ -99,7 +127,11 @@ export default function Menu() {
- +

Daftar Alamat

@@ -112,20 +144,23 @@ export default function Menu() {
- ) + ); } const MenuHeader = ({ children, ...props }) => (
{children}
-) +); const LinkItem = ({ children, ...props }) => ( - + {children}
-) +); -- cgit v1.2.3 From 0f7ce7842c70bc1fee1ae6f3cff0ccf7be8eaa6f Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 18 Nov 2024 10:55:34 +0700 Subject: update --- src/lib/transaction/components/Transaction.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index d001c7f4..a6a9cf6b 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -46,7 +46,7 @@ const Transaction = ({ id }) => { const [reason, setReason] = useState(''); const auth = useAuth(); const { transaction } = useTransaction({ id }); - + console.log('transaction', transaction); const statusApprovalWeb = transaction.data?.approvalStep; const { queryAirwayBill } = useAirwayBill({ orderId: id }); @@ -779,8 +779,10 @@ const Transaction = ({ id }) => { : ''}
- {product.availableQuantity} barang ini bisa di - pickup maksimal pukul 16.00 + {product.soQty !== product.reservedStockQty + ? 'Barang sedang disiapkan' + : `${product.reservedStockQty} barang bisa di + kirim/pickup`}
-- cgit v1.2.3 From 7faf56fa355fcb62df9ff2b4109dbbed8c8e4755 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 18 Nov 2024 13:54:37 +0700 Subject: perbaiki code --- src/lib/transaction/components/Transaction.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index a6a9cf6b..58c824f2 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -778,12 +778,14 @@ const Transaction = ({ id }) => { ? `| ${product?.attributes.join(', ')}` : ''} -
- {product.soQty !== product.reservedStockQty - ? 'Barang sedang disiapkan' - : `${product.reservedStockQty} barang bisa di + {product.soQty && product.reservedStockQty && ( +
+ {product.soQty !== product.reservedStockQty + ? 'Barang sedang disiapkan' + : `${product.reservedStockQty} barang bisa di kirim/pickup`} -
+
+ )} {/* -- cgit v1.2.3 From f7a13c357a6d44f9fa6e0c034292ab782249731e Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 26 Nov 2024 16:56:03 +0700 Subject: update improv --- src/lib/product/components/ProductCard.jsx | 5 ++++- src/lib/transaction/components/Transaction.jsx | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 3e6a6913..16e20703 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -18,7 +18,10 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { const [discount, setDiscount] = useState(0); const { isDesktop, isMobile } = useDevice(); let voucherPastiHemat = 0; - voucherPastiHemat = product?.newVoucherPastiHemat[0]; + voucherPastiHemat = product?.newVoucherPastiHemat[0] + ? product?.newVoucherPastiHemat[0] + : product?.newVoucherPastiHemat; + console.log('voucherPastiHemat', voucherPastiHemat); const callForPriceWhatsapp = whatsappUrl('product', { name: product.name, diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index 58c824f2..93887f4d 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -46,7 +46,6 @@ const Transaction = ({ id }) => { const [reason, setReason] = useState(''); const auth = useAuth(); const { transaction } = useTransaction({ id }); - console.log('transaction', transaction); const statusApprovalWeb = transaction.data?.approvalStep; const { queryAirwayBill } = useAirwayBill({ orderId: id }); -- cgit v1.2.3 From da8350ee1de81d668e117744c3735d848dd53f6e Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 29 Nov 2024 10:13:41 +0700 Subject: delete console log --- src/lib/transaction/components/Transaction.jsx | 1 - src/lib/treckingAwb/component/Manifest.jsx | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index b1e92f1b..63230cb8 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -121,7 +121,6 @@ const Transaction = ({ id }) => { } closeCancelTransaction(); }; - console.log('transaction', transaction); const checkout = async () => { if (!transaction.data?.purchaseOrderFile) { toast.error('Mohon upload dokumen PO anda sebelum melanjutkan pesanan'); diff --git a/src/lib/treckingAwb/component/Manifest.jsx b/src/lib/treckingAwb/component/Manifest.jsx index 02d0bc7a..87e01e38 100644 --- a/src/lib/treckingAwb/component/Manifest.jsx +++ b/src/lib/treckingAwb/component/Manifest.jsx @@ -10,7 +10,6 @@ import { list } from 'postcss'; const Manifest = ({ idAWB, closePopup }) => { const [manifests, setManifests] = useState(null); const [isLoading, setIsLoading] = useState(false); - console.log('manifests', manifests); const formatCustomDate = (date) => { const months = [ 'Jan', -- cgit v1.2.3 From 3f0ad9fcd0827087c0c134cf9ce7608c1d937973 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Fri, 29 Nov 2024 14:09:16 +0700 Subject: fixing redis flash sale --- src/pages/api/flashsale-header.js | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/pages/api/flashsale-header.js b/src/pages/api/flashsale-header.js index 31f8efdd..6916318a 100644 --- a/src/pages/api/flashsale-header.js +++ b/src/pages/api/flashsale-header.js @@ -15,23 +15,36 @@ export default async function handler(req, res) { try { await connectRedis(); const cacheKey = `flashsale_header`; - // await client.del(cacheKey); + + // Cek data yang ada di Redis let cachedData = await client.get(cacheKey); if (cachedData) { - const data = JSON.parse(cachedData); + const data = JSON.parse(cachedData); + + // Periksa apakah data adalah array dan panjangnya 0 + if (!data || (Array.isArray(data) && data.length === 0)) { + await client.del(cacheKey); // Hapus kunci jika data kosong + return res.status(200).json({ data: [] }); + } return res.status(200).json({ data }); } else { const flashSale = await odooApi('GET', `/api/v1/flashsale/header`); + console.log('ini flash sale', flashSale.length); + if (flashSale.length === 0) { + return res.status(200).json({ data: [] }); + } else { + await client.set( + cacheKey, + JSON.stringify(flashSale), + 'EX', + flashSale.duration + ); - await client.set( - cacheKey, - JSON.stringify(flashSale), - 'EX', - flashSale.duration - ); - cachedData = await client.get(cacheKey); - return res.status(200).json({ data: cachedData }); + cachedData = await client.get(cacheKey); + const data = JSON.parse(cachedData); + return res.status(200).json({ data }); + } } } catch (error) { console.error('Error interacting with Redis or fetching data:', error); -- cgit v1.2.3 From f7331b83bd398187728c5ce098ada55053a055df Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Fri, 29 Nov 2024 14:10:18 +0700 Subject: delete cosnole log --- src/pages/api/flashsale-header.js | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/pages/api/flashsale-header.js b/src/pages/api/flashsale-header.js index 6916318a..21cb9c9d 100644 --- a/src/pages/api/flashsale-header.js +++ b/src/pages/api/flashsale-header.js @@ -30,7 +30,6 @@ export default async function handler(req, res) { return res.status(200).json({ data }); } else { const flashSale = await odooApi('GET', `/api/v1/flashsale/header`); - console.log('ini flash sale', flashSale.length); if (flashSale.length === 0) { return res.status(200).json({ data: [] }); } else { -- cgit v1.2.3 From d324d01bb9413a023a158a7bd15ba36bb7beb9bc Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Fri, 29 Nov 2024 14:38:24 +0700 Subject: update performance --- src/lib/home/components/CategoryDynamic.jsx | 176 +++++++++++++++------------ src/lib/home/components/PromotionProgram.jsx | 47 ++----- src/pages/index.jsx | 13 +- 3 files changed, 111 insertions(+), 125 deletions(-) (limited to 'src') diff --git a/src/lib/home/components/CategoryDynamic.jsx b/src/lib/home/components/CategoryDynamic.jsx index cc4f42b7..d72fe1f1 100644 --- a/src/lib/home/components/CategoryDynamic.jsx +++ b/src/lib/home/components/CategoryDynamic.jsx @@ -9,6 +9,7 @@ import 'swiper/css'; import 'swiper/css/navigation'; import 'swiper/css/pagination'; import { Pagination } from 'swiper'; +import { LazyLoadComponent } from 'react-lazy-load-image-component'; const CategoryDynamic = () => { const [categoryManagement, setCategoryManagement] = useState([]); @@ -22,12 +23,17 @@ const CategoryDynamic = () => { if (data) { setCategoryManagement(data); } - setIsLoading(false); }; fetchCategoryData(); }, []); + useEffect(() => { + if (categoryManagement?.length > 0) { + setIsLoading(false); + } + }, [categoryManagement]); + const swiperBanner = { modules: [Pagination], classNames: 'mySwiper', @@ -44,95 +50,103 @@ const CategoryDynamic = () => { {categoryManagement && categoryManagement.map((category) => ( -
-
-

- {category.name} -

- - Lihat Semua - -
+ +
+
+

+ {category.name} +

+ + Lihat Semua + +
- - {category?.categories?.map((subCategory) => ( - -
-
-
- -
-

- {subCategory?.name} -

- - Lihat Semua - -
-
-
- {subCategory.child_frontend_id_i.map( - (childCategory) => ( -
+ + {category?.categories?.map((subCategory) => ( + + +
+
+
+ +
+

+ {subCategory?.name} +

- -
-

- {childCategory.name} -

-
+ Lihat Semua
- ) - )} +
+
+ {subCategory.child_frontend_id_i.map( + (childCategory) => ( + +
+ + +
+

+ {childCategory.name} +

+
+ +
+
+ ) + )} +
+
-
-
- - ))} - -
+ + + ))} + +
+ ))}
diff --git a/src/lib/home/components/PromotionProgram.jsx b/src/lib/home/components/PromotionProgram.jsx index 562fa138..fc23bf78 100644 --- a/src/lib/home/components/PromotionProgram.jsx +++ b/src/lib/home/components/PromotionProgram.jsx @@ -4,56 +4,35 @@ import { bannerApi } from '@/api/bannerApi'; import useDevice from '@/core/hooks/useDevice'; import { Swiper, SwiperSlide } from 'swiper/react'; import BannerPromoSkeleton from '../components/Skeleton/BannerPromoSkeleton'; + import { useEffect, useState } from 'react'; const { useQuery } = require('react-query'); const BannerSection = () => { const { isMobile, isDesktop } = useDevice(); const [data, setData] = useState(null); const [shouldFetch, setShouldFetch] = useState(false); + const [ isLoading, setIsLoading] = useState(true); useEffect(() => { const fetchData = async () => { - const res = await fetch(`/api/hero-banner?type=banner-promotion`); - const { data } = await res.json(); - if (data) { - setData(data); + try { + const res = await fetch(`/api/hero-banner?type=banner-promotion`); + const { data } = await res.json(); + if (data) { + setData(data); + } + } catch (e) { + console.log(e); + } finally { + setIsLoading(false); } }; fetchData(); }, []); - // useEffect(() => { - // const localData = localStorage.getItem('Homepage_promotionProgram'); - // if (localData) { - // setData(JSON.parse(localData)); - // } else { - // setShouldFetch(true); - // } - // }, []); - - // const getPromotionProgram = useQuery( - // 'promotionProgram', - // bannerApi({ type: 'banner-promotion' }), - // { - // enabled: shouldFetch, - // onSuccess: (data) => { - // if (data) { - // localStorage.setItem( - // 'Homepage_promotionProgram', - // JSON.stringify(data) - // ); - // setData(data); - // } - // }, - // } - // ); - const promotionProgram = data; - // if (getPromotionProgram?.isLoading && !data) { - // return ; - // } - if (!data) { + if (isLoading) { return ; } diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 2ec1231a..e685b382 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -16,7 +16,7 @@ import CategoryPilihan from '../lib/home/components/CategoryPilihan'; // import { getAuth } from '~/libs/auth'; const BasicLayout = dynamic(() => - import('@/core/components/layouts/BasicLayout'),{ssr: false} + import('@/core/components/layouts/BasicLayout') ); const HeroBanner = dynamic(() => import('@/components/ui/HeroBanner'), { loading: () => , @@ -40,24 +40,17 @@ const PreferredBrand = dynamic( const FlashSale = dynamic( () => import('@/lib/flashSale/components/FlashSale'), - { - loading: () => , - } ); const ProgramPromotion = dynamic( - () => import('@/lib/home/components/PromotionProgram'), - { - loading: () => , - } + () => import('@/lib/home/components/PromotionProgram') ); const BannerSection = dynamic(() => import('@/lib/home/components/BannerSection') ); const CategoryHomeId = dynamic( - () => import('@/lib/home/components/CategoryHomeId'), - { ssr: false } + () => import('@/lib/home/components/CategoryHomeId') ); const CategoryDynamic = dynamic(() => -- cgit v1.2.3 From 0c142968af5390d4cb615d18fae119aa77fb4654 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 2 Dec 2024 09:41:45 +0700 Subject: update redis search product flash sale --- src/pages/api/search-flashsale.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/pages/api/search-flashsale.js b/src/pages/api/search-flashsale.js index d9e56c83..c00f6c64 100644 --- a/src/pages/api/search-flashsale.js +++ b/src/pages/api/search-flashsale.js @@ -23,20 +23,28 @@ export default async function handler(req, res) { if (cachedData) { const data = JSON.parse(cachedData); + // Periksa apakah data adalah array dan panjangnya 0 + if (!data || (Array.isArray(data) && data.length === 0)) { + await client.del(cacheKey); // Hapus kunci jika data kosong + return res.status(200).json({ data: [] }); + } return res.status(200).json({ data }); } else { const dataProductSearch = await axios( `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/search?${query}&operation=${operation}]` ); - - await client.set( - cacheKey, - JSON.stringify(dataProductSearch.data), - 'EX', - duration - ); - cachedData = await client.get(cacheKey); - return res.status(200).json({ data: cachedData }); + if (dataProductSearch.data.length === 0) { + return res.status(200).json({ data: [] }); + } else { + await client.set( + cacheKey, + JSON.stringify(dataProductSearch.data), + 'EX', + duration + ); + cachedData = await client.get(cacheKey); + return res.status(200).json({ data: cachedData }); + } } } catch (error) { console.error('Error interacting with Redis or fetching data:', error); -- cgit v1.2.3 From 325fe90403cc9febb1017eb27c620e4dd921aa24 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 2 Dec 2024 16:34:52 +0700 Subject: delete console log --- src/lib/product/components/ProductCard.jsx | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 16e20703..174e5cb1 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -21,7 +21,6 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { voucherPastiHemat = product?.newVoucherPastiHemat[0] ? product?.newVoucherPastiHemat[0] : product?.newVoucherPastiHemat; - console.log('voucherPastiHemat', voucherPastiHemat); const callForPriceWhatsapp = whatsappUrl('product', { name: product.name, -- cgit v1.2.3 From 1b4d7f65ee08a56ca6cc57bfc6336ca3ccad3a21 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Tue, 3 Dec 2024 14:42:36 +0700 Subject: update performance desktop --- src/components/ui/HeroBanner.jsx | 11 +--- src/components/ui/HeroBannerSecondary.jsx | 6 +-- src/core/components/elements/Navbar/Navbar.jsx | 6 ++- .../components/elements/Navbar/NavbarDesktop.jsx | 63 ++++++++++++---------- .../components/elements/Navbar/NavbarMobile.jsx | 43 ++++++++++----- src/core/components/layouts/BasicLayout.jsx | 4 +- src/lib/brand/components/BrandCard.jsx | 1 + src/lib/flashSale/components/FlashSale.jsx | 2 + src/lib/home/components/BannerSection.jsx | 1 + src/lib/home/components/CategoryDynamic.jsx | 2 + src/lib/home/components/CategoryDynamicMobile.jsx | 2 + src/lib/home/components/PromotionProgram.jsx | 12 +++-- src/lib/home/components/ServiceList.jsx | 4 ++ src/lib/product/components/ProductCard.jsx | 8 +++ 14 files changed, 100 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/components/ui/HeroBanner.jsx b/src/components/ui/HeroBanner.jsx index 2eea5915..3025fc1e 100644 --- a/src/components/ui/HeroBanner.jsx +++ b/src/components/ui/HeroBanner.jsx @@ -7,9 +7,7 @@ import { Swiper, SwiperSlide } from 'swiper/react'; import Image from 'next/image'; import { useEffect, useMemo, useState } from 'react'; -import { useQuery } from 'react-query'; -import { bannerApi } from '@/api/bannerApi'; import Link from '@/core/components/elements/Link/Link'; import DesktopView from '@/core/components/views/DesktopView'; import MobileView from '@/core/components/views/MobileView'; @@ -52,10 +50,6 @@ const HeroBanner = () => { pagination: { dynamicBullets: false, clickable: true }, }; - const customLoader = ({ src }) => { - return src; // Loader yang mengembalikan URL gambar asli - }; - const BannerComponent = useMemo(() => { if (!heroBanner) return null; @@ -63,14 +57,11 @@ const HeroBanner = () => { {banner.name} { const [heroBannerSecondary, setHeroBannerSecondary] = useState([]); @@ -45,7 +43,7 @@ const HeroBannerSecondary = () => { height={1024} alt={heroBannerSecondary[randomIndex]?.name} className='object-cover object-center h-full' - loading='lazy' + loading='eager' placeholder='blur' blurDataURL='/images/indoteknik-placeholder.png' sizes='(max-width: 768px) 100vw, 50vw' diff --git a/src/core/components/elements/Navbar/Navbar.jsx b/src/core/components/elements/Navbar/Navbar.jsx index 57904498..59f743a2 100644 --- a/src/core/components/elements/Navbar/Navbar.jsx +++ b/src/core/components/elements/Navbar/Navbar.jsx @@ -3,10 +3,12 @@ import dynamic from 'next/dynamic' const NavbarDesktop = dynamic(() => import('./NavbarDesktop')) const NavbarMobile = dynamic(() => import('./NavbarMobile')) -const Navbar = () => { +const Navbar = ({isMobile} ) => { + + if(isMobile) return + return ( <> - ) diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx index fa3df5bf..f4b0d5e1 100644 --- a/src/core/components/elements/Navbar/NavbarDesktop.jsx +++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx @@ -12,12 +12,9 @@ import { MenuButton, MenuItem, MenuList, - useDisclosure + useDisclosure, } from '@chakra-ui/react'; -import { - ChevronDownIcon, - HeartIcon -} from '@heroicons/react/24/outline'; +import { ChevronDownIcon, HeartIcon } from '@heroicons/react/24/outline'; import dynamic from 'next/dynamic'; import { default as Image, default as NextImage } from 'next/image'; import { useRouter } from 'next/router'; @@ -81,21 +78,17 @@ const NavbarDesktop = () => { }; window.addEventListener('scroll', handleScroll); + return () => { window.removeEventListener('scroll', handleScroll); }; }, []); useEffect(() => { - const handleScroll = () => { - setIsTop(window.scrollY < 100); - }; - - window.addEventListener('scroll', handleScroll); - return () => { - window.removeEventListener('scroll', handleScroll); - }; - }, []); + if (auth) { + loadCart(auth.id); + } + }, [auth]); useEffect(() => { setPendingTransactions(data); @@ -115,20 +108,22 @@ const NavbarDesktop = () => { }, [product, router]); useEffect(() => { - const handleCartChange = () => { - const cart = async () => { - const listCart = await getCountCart(); - setCartCount(listCart); - }; - cart(); - }; - handleCartChange(); - - window.addEventListener('localStorageChange', handleCartChange); - - return () => { - window.removeEventListener('localStorageChange', handleCartChange); - }; + // const handleCartChange = () => { + // const cart = async () => { + // const listCart = await getCountCart(); + // setCartCount(listCart); + // }; + // cart(); + // }; + // handleCartChange(); + + setCartCount(cart?.products?.length) + + // window.addEventListener('localStorageChange', handleCartChange); + + // return () => { + // window.removeEventListener('localStorageChange', handleCartChange); + // }; }, [transactions.data, cart]); useEffect(() => { @@ -202,7 +197,9 @@ const NavbarDesktop = () => { src={IndoteknikLogo} alt='Indoteknik Logo' width={210} - height={210 / 3} + height={70} + loading='eager' + priority={true} />
@@ -236,6 +233,7 @@ const NavbarDesktop = () => { alt='Whatsapp' width={48} height={48} + loading='eager' />
Whatsapp
@@ -284,6 +282,7 @@ const NavbarDesktop = () => { quality={100} // className={`fixed ${isTop ? 'md:top-[145px] lg:top-[160px] ' : 'lg:top-[85px] top-[80px]'} rounded-3xl md:left-1/4 lg:left-1/4 xl:left-1/4 left-2/3 w-40 h-12 p-2 z-50 transition-all duration-300 animate-pulse`} className={`inline-block relative -top-8 transition-all duration-300 z-20 animate-pulse`} + loading='eager' />
)} @@ -394,6 +393,7 @@ const SocialMedias = () => ( // alt='Youtube - Indoteknik.com' width={24} height={24} + loading='eager' /> ( // alt='TikTok - Indoteknik.com' width={24} height={24} + loading='eager' /> {/* @@ -426,6 +427,7 @@ const SocialMedias = () => ( // alt='Facebook - Indoteknik.com' width={24} height={24} + loading='eager' /> ( // alt='Instagram - Indoteknik.com' width={24} height={24} + loading='eager' /> ( // alt='Linkedin - Indoteknik.com' width={24} height={24} + loading='eager' /> ( // alt='Maps - Indoteknik.com' width={24} height={24} + loading='eager' />
diff --git a/src/core/components/elements/Navbar/NavbarMobile.jsx b/src/core/components/elements/Navbar/NavbarMobile.jsx index 90314671..47182a47 100644 --- a/src/core/components/elements/Navbar/NavbarMobile.jsx +++ b/src/core/components/elements/Navbar/NavbarMobile.jsx @@ -12,30 +12,44 @@ import { useEffect, useState } from 'react'; import MobileView from '../../views/MobileView'; import Link from '../Link/Link'; import TopBanner from './TopBanner'; +import { useCartStore } from '~/modules/cart/stores/useCartStore'; +import useAuth from '@/core/hooks/useAuth'; const Search = dynamic(() => import('./Search')); const NavbarMobile = () => { const { Sidebar, open } = useSidebar(); + const auth = useAuth(); const [cartCount, setCartCount] = useState(0); + const { loadCart, cart, summary, updateCartItem } = useCartStore(); - useEffect(() => { - const handleCartChange = () => { - const cart = async () => { - const listCart = await getCountCart(); - setCartCount(listCart); - }; - cart(); - }; - handleCartChange(); + // useEffect(() => { + // const handleCartChange = () => { + // const cart = async () => { + // const listCart = await getCountCart(); + // setCartCount(listCart); + // }; + // cart(); + // }; + // handleCartChange(); + + // window.addEventListener('localStorageChange', handleCartChange); - window.addEventListener('localStorageChange', handleCartChange); + // return () => { + // window.removeEventListener('localStorageChange', handleCartChange); + // }; + // }, []); - return () => { - window.removeEventListener('localStorageChange', handleCartChange); - }; - }, []); + useEffect(() => { + if(auth){ + loadCart(auth?.id); + } + }, [auth]); + + useEffect(() => { + setCartCount(cart?.products?.length); + }, [cart]); return ( @@ -48,6 +62,7 @@ const NavbarMobile = () => { alt='Indoteknik Logo' width={120} height={40} + loading='eager' />
diff --git a/src/core/components/layouts/BasicLayout.jsx b/src/core/components/layouts/BasicLayout.jsx index 1b62bf05..2998fa63 100644 --- a/src/core/components/layouts/BasicLayout.jsx +++ b/src/core/components/layouts/BasicLayout.jsx @@ -112,7 +112,7 @@ const BasicLayout = ({ children }) => { onAnimationEnd={() => setHighlight(false)} /> )} - + {children}
{ className='block sm:hidden' width={36} height={36} + loading='eager' /> { className='hidden sm:block' width={44} height={44} + loading='eager' />
diff --git a/src/lib/brand/components/BrandCard.jsx b/src/lib/brand/components/BrandCard.jsx index ebd41a67..8bb4b904 100644 --- a/src/lib/brand/components/BrandCard.jsx +++ b/src/lib/brand/components/BrandCard.jsx @@ -20,6 +20,7 @@ const BrandCard = ({ brand }) => { height={500} quality={85} className='h-full w-[122px] object-contain object-center' + loading='eager' /> )} {!brand.logo && ( diff --git a/src/lib/flashSale/components/FlashSale.jsx b/src/lib/flashSale/components/FlashSale.jsx index 6d90cad7..f4be279e 100644 --- a/src/lib/flashSale/components/FlashSale.jsx +++ b/src/lib/flashSale/components/FlashSale.jsx @@ -47,6 +47,7 @@ const FlashSale = () => { width={1080} height={192} className='w-full rounded mb-4 hidden sm:block' + loading='eager' /> { width={256} height={48} className='w-full rounded mb-4 block sm:hidden' + loading='eager' /> { src={banner.image} alt={banner.name} className='h-auto w-full rounded' + loading='eager' /> ))} diff --git a/src/lib/home/components/CategoryDynamic.jsx b/src/lib/home/components/CategoryDynamic.jsx index d72fe1f1..b6994f60 100644 --- a/src/lib/home/components/CategoryDynamic.jsx +++ b/src/lib/home/components/CategoryDynamic.jsx @@ -85,6 +85,7 @@ const CategoryDynamic = () => { width={90} height={30} className='object-fit p-4' + loading='eager' />

@@ -127,6 +128,7 @@ const CategoryDynamic = () => { height={40} placeholder='blur' blurDataURL='/icon.jpg' + loading='eager' />

diff --git a/src/lib/home/components/CategoryDynamicMobile.jsx b/src/lib/home/components/CategoryDynamicMobile.jsx index 67ae6f5f..5d9e872c 100644 --- a/src/lib/home/components/CategoryDynamicMobile.jsx +++ b/src/lib/home/components/CategoryDynamicMobile.jsx @@ -90,6 +90,7 @@ const CategoryDynamicMobile = () => { width={30} height={30} className='' + loading='eager' />

@@ -123,6 +124,7 @@ const CategoryDynamicMobile = () => { width={40} height={40} className='p-2' + loading='eager' />

diff --git a/src/lib/home/components/PromotionProgram.jsx b/src/lib/home/components/PromotionProgram.jsx index fc23bf78..d8bf3edb 100644 --- a/src/lib/home/components/PromotionProgram.jsx +++ b/src/lib/home/components/PromotionProgram.jsx @@ -69,7 +69,8 @@ const BannerSection = () => { quality={85} src={banner.image} alt={banner.name} - className='h-auto w-full rounded hover:scale-105 transition duration-500 ease-in-out' + className='rounded hover:scale-105 transition duration-500 ease-in-out' + loading='eager' /> ))} @@ -82,12 +83,13 @@ const BannerSection = () => { {banner.name} diff --git a/src/lib/home/components/ServiceList.jsx b/src/lib/home/components/ServiceList.jsx index b3cc8fe5..6d03a587 100644 --- a/src/lib/home/components/ServiceList.jsx +++ b/src/lib/home/components/ServiceList.jsx @@ -18,6 +18,7 @@ const ServiceList = () => { src='/images/icon_service/ONE-STOP-SOLUTIONS.svg' alt='' className='h-20 w-20 rounded' + loading='eager' />

@@ -43,6 +44,7 @@ const ServiceList = () => { src='/images/icon_service/WARRANTY.svg' alt='' className='h-20 w-20 rounded' + loading='eager' />
@@ -68,6 +70,7 @@ const ServiceList = () => { src='/images/icon_service/DUE-PAYMENT.svg' alt='' className='h-20 w-20 rounded' + loading='eager' />
@@ -93,6 +96,7 @@ const ServiceList = () => { src='/images/icon_service/TAX.svg' alt='' className='h-20 w-20 rounded' + loading='eager' />
diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 174e5cb1..4e80083b 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -90,6 +90,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { className='w-4 h-5 object-contain object-top sm:h-6' width={50} height={50} + loading='eager' /> )}
@@ -101,6 +102,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { className='w-11 h-6 object-contain object-top ml-1 mr-1 sm:h-6' width={50} height={50} + loading='eager' /> )}

@@ -115,6 +117,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { className='h-full' width={1000} height={100} + loading='eager' />

@@ -129,6 +132,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { src='/images/ICON_FLASH_SALE_WEBSITE_INDOTEKNIK.svg' width={13} height={5} + loading='eager' /> {product?.flashSale?.tag != 'false' || @@ -164,6 +168,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { alt='pickup now' width={90} height={12} + loading='eager' /> )} @@ -267,6 +272,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { className='w-4 h-5 object-contain object-top sm:h-6' width={50} height={50} + loading='eager' /> )}
@@ -278,6 +284,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { className='w-11 h-6 object-contain object-top ml-1 sm:h-6' width={50} height={50} + loading='eager' /> )}

@@ -297,6 +304,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { src='/images/ICON_FLASH_SALE_WEBSITE_INDOTEKNIK.svg' width={15} height={10} + loading='eager' /> {' '} -- cgit v1.2.3 From 57f400411555351f0b96799f5e4493c9c49b68e0 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Tue, 3 Dec 2024 15:38:11 +0700 Subject: update performance --- src/core/components/elements/Navbar/NavbarDesktop.jsx | 18 ++++++++++++------ src/core/components/elements/Navbar/TopBanner.jsx | 1 + src/lib/brand/components/BrandCard.jsx | 1 + src/lib/product/components/ProductCard.jsx | 16 +++++++++++----- 4 files changed, 25 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/core/components/elements/Navbar/NavbarDesktop.jsx b/src/core/components/elements/Navbar/NavbarDesktop.jsx index f4b0d5e1..7d6d8c9e 100644 --- a/src/core/components/elements/Navbar/NavbarDesktop.jsx +++ b/src/core/components/elements/Navbar/NavbarDesktop.jsx @@ -387,10 +387,11 @@ const SocialMedias = () => ( target='_blank' rel='noreferrer' href='https://www.youtube.com/@indoteknikcom' + aria-label='Youtube - Indoteknik.com' > ( target='_blank' rel='noreferrer' href='https://www.tiktok.com/@indoteknikcom' + aria-label='TikTok - Indoteknik.com' > ( target='_blank' rel='noreferrer' href='https://www.facebook.com/indoteknikcom' + aria-label='Facebook - Indoteknik.com' > ( target='_blank' rel='noreferrer' href='https://www.instagram.com/indoteknikcom/' + aria-label='Instagram - Indoteknik.com' > ( target='_blank' rel='noreferrer' href='https://www.linkedin.com/company/pt-indoteknik-dotcom-gemilang/' + aria-label='Linkedin - Indoteknik.com' > ( target='_blank' rel='noreferrer' href='https://goo.gl/maps/GF8EmDjpQTHZPsJ1A' + aria-label='Maps - Indoteknik.com' > {} }) => { { className={`py-1 px-2 border-gray_r-6 flex justify-center items-center hover:scale-110 transition duration-500 ease-in-out ${ isMobile ? 'h-16' : 'h-24' }`} + aria-label={brand.name} > {brand.logo && ( { if (variant == 'vertical') { return ( -
+
{
{product?.manufacture?.name ? ( - + {product.manufacture.name} ) : (
-
)} {product?.isInBu && ( - + {
@@ -199,6 +200,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { rel='noopener noreferrer' target='_blank' href={callForPriceWhatsapp} + aria-label='Call for Inquiry' > Call for Inquiry @@ -222,6 +224,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { rel='noopener noreferrer' target='_blank' href={callForPriceWhatsapp} + aria-label='Call for Inquiry' > Call for Inquiry @@ -256,7 +259,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { return (
- +
{ )} {product?.manufacture?.name ? (
- + {product.manufacture.name} {/* {product?.is_in_bu && ( @@ -332,6 +335,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} {product?.name} @@ -358,6 +362,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { rel='noopener noreferrer' target='_blank' href={callForPriceWhatsapp} + aria-label='Call for Inquiry' > Call for Inquiry @@ -381,6 +386,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { rel='noopener noreferrer' target='_blank' href={callForPriceWhatsapp} + aria-label='Call for Inquiry' > Call for Inquiry -- cgit v1.2.3 From 4c8d08def514cb441007c0bd2bc78e105e6d0153 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Wed, 4 Dec 2024 11:50:21 +0700 Subject: cr popup information method --- src/components/ui/HeroBanner.jsx | 2 +- src/core/components/elements/Navbar/NavbarDesktop.jsx | 12 ++++++++++-- src/lib/product/components/Product/ProductDesktop.jsx | 1 + src/lib/product/components/Product/ProductMobile.jsx | 1 + src/lib/product/components/ProductCard.jsx | 6 ++++-- src/lib/product/components/ProductSlider.jsx | 2 +- src/pages/api/hero-banner.js | 2 ++ 7 files changed, 20 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/components/ui/HeroBanner.jsx b/src/components/ui/HeroBanner.jsx index 3025fc1e..6f1ef641 100644 --- a/src/components/ui/HeroBanner.jsx +++ b/src/components/ui/HeroBanner.jsx @@ -55,7 +55,7 @@ const HeroBanner = () => { return heroBanner.map((banner, index) => ( - + {banner.name} {