From 6115a7b9e9e1cd2231c946609cb1ceac6d167386 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Thu, 12 Oct 2023 13:21:00 +0700 Subject: banner promotion page search --- src/lib/cart/components/Cartheader.jsx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/lib/cart/components') diff --git a/src/lib/cart/components/Cartheader.jsx b/src/lib/cart/components/Cartheader.jsx index 901b1501..aa6980ac 100644 --- a/src/lib/cart/components/Cartheader.jsx +++ b/src/lib/cart/components/Cartheader.jsx @@ -125,7 +125,7 @@ const Cardheader = (cartCount) => { >
-
Keranjang Belanja
+
Keranjang Belanja
Lihat Semua @@ -145,15 +145,15 @@ const Cardheader = (cartCount) => { )} {isLoading && itemLoading.map((item) => ( -
-
-
- +
+
+
+
-
-
-
-
+
+
+
+
@@ -167,13 +167,13 @@ const Cardheader = (cartCount) => { )} {auth && products.length > 0 && !isLoading && ( <> -
    +
      {products && products?.map((product, index) => ( <> -
    • -
      -
      +
    • +
      +
      { />
      -
      +
      { className='line-clamp-2 leading-6 !text-gray_r-12 font-normal' > {' '} -

      +

      {product.parent.name}

      -- cgit v1.2.3 From 6aa5fa70cf5ccd2825e5657ec1a90e370dea3bcf Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 16 Oct 2023 11:16:33 +0700 Subject: Fix buy action before and after login --- src/lib/cart/components/Cartheader.jsx | 325 +++++++++++++++++---------------- 1 file changed, 172 insertions(+), 153 deletions(-) (limited to 'src/lib/cart/components') diff --git a/src/lib/cart/components/Cartheader.jsx b/src/lib/cart/components/Cartheader.jsx index aa6980ac..580dfc8c 100644 --- a/src/lib/cart/components/Cartheader.jsx +++ b/src/lib/cart/components/Cartheader.jsx @@ -8,6 +8,7 @@ import { useRouter } from 'next/router' import odooApi from '@/core/api/odooApi' import { useProductCartContext } from '@/contexts/ProductCartContext' import whatsappUrl from '@/core/utils/whatsappUrl' +import { AnimatePresence, motion } from 'framer-motion' const { ShoppingCartIcon, PhotoIcon } = require('@heroicons/react/24/outline') const { default: Link } = require('next/link') @@ -113,164 +114,182 @@ const Cardheader = (cartCount) => {
      -
      -
      -
      -
      -
      Keranjang Belanja
      - - Lihat Semua - -
      -
      -
      - {!auth && ( -
      -

      - Silahkan{' '} - - Login - {' '} - Untuk Melihat Daftar Keranjang Belanja Anda -

      -
      - )} - {isLoading && - itemLoading.map((item) => ( -
      -
      -
      - + + + {isHovered && ( + <> + + + + +
      +
      Keranjang Belanja
      + + Lihat Semua + +
      +
      +
      + {!auth && ( +
      +

      + Silahkan{' '} + + Login + {' '} + Untuk Melihat Daftar Keranjang Belanja Anda +

      -
      -
      -
      -
      + )} + {isLoading && + itemLoading.map((item) => ( +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      +
      + ))} + {auth && products.length === 0 && !isLoading && ( +
      +

      + Tidak Ada Produk di Keranjang Belanja Anda +

      -
      -
      - ))} - {auth && products.length === 0 && !isLoading && ( -
      -

      - Tidak Ada Produk di Keranjang Belanja Anda -

      -
      - )} - {auth && products.length > 0 && !isLoading && ( - <> -
        - {products && - products?.map((product, index) => ( - <> -
      • -
        -
        - - {product?.name} - -
        -
        - - {' '} -

        - {product.parent.name} -

        - - - {product?.hasFlashsale && ( -
        -
        - {product?.price?.discountPercentage}% + )} + {auth && products.length > 0 && !isLoading && ( + <> +
          + {products && + products?.map((product, index) => ( + <> +
        • +
          +
          + + {product?.name} +
          -
          - {currencyFormat(product?.price?.price)} +
          + + {' '} +

          + {product.parent.name} +

          + + + {product?.hasFlashsale && ( +
          +
          + {product?.price?.discountPercentage}% +
          +
          + {currencyFormat(product?.price?.price)} +
          +
          + )} +
          +
          + {product?.price?.priceDiscount > 0 ? ( + currencyFormat(product?.price?.priceDiscount) + ) : ( + + + Call For Price + + + )} +
          +
          - )} -
          -
          - {product?.price?.priceDiscount > 0 ? ( - currencyFormat(product?.price?.priceDiscount) - ) : ( - - - Call For Price - - - )} -
          -
          -
          -
        -
      • - - ))} -
      -
      - - )} -
      - {auth && products.length > 0 && !isLoading && ( - <> -
      - Subtotal Sebelum PPN : - {currencyFormat(subTotal)} -
      -
      - -
      - - )} -
      -
      +
    • + + ))} +
    +
    + + )} +
+ {auth && products.length > 0 && !isLoading && ( + <> +
+ Subtotal Sebelum PPN : + {currencyFormat(subTotal)} +
+
+ +
+ + )} + + + + )} +
) } -- cgit v1.2.3