From d1c09d1cb96808ff144575c6e01535948eb8f8d4 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 20 Nov 2024 10:45:43 +0700
Subject: <iman> add price action mengambang di product mobile variant

---
 .../components/Product/ProductMobileVariant.jsx    | 154 ++++++++++-----------
 1 file changed, 77 insertions(+), 77 deletions(-)

(limited to 'src/lib/product/components/Product/ProductMobileVariant.jsx')

diff --git a/src/lib/product/components/Product/ProductMobileVariant.jsx b/src/lib/product/components/Product/ProductMobileVariant.jsx
index b87bcbc8..de5c3f10 100644
--- a/src/lib/product/components/Product/ProductMobileVariant.jsx
+++ b/src/lib/product/components/Product/ProductMobileVariant.jsx
@@ -168,44 +168,14 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => {
 
   return (
     <MobileView>
-      <Image
-        src={product.image + '?variant=True'}
-        alt={product.name}
-        className='h-72 object-contain object-center w-full border-b border-gray_r-4'
-      />
-
-      <div className='p-4'>
-        <div className='flex items-end mb-2'>
-          {product.manufacture?.name ? (
-            <Link
-              href={createSlug(
-                '/shop/brands/',
-                product.manufacture?.name,
-                product.manufacture?.id
-              )}
-            >
-              {product.manufacture?.name}
-            </Link>
-          ) : (
-            <div>-</div>
-          )}
-          <button type='button' className='ml-auto' onClick={toggleWishlist}>
-            {wishlist.data?.productTotal > 0 ? (
-              <HeartIcon className='w-6 fill-danger-500 text-danger-500' />
-            ) : (
-              <HeartIcon className='w-6' />
-            )}
-          </button>
-        </div>
-        <h1 className='font-medium text-h-lg leading-8 md:text-title-md md:leading-10 mb-3'>
-          {activeVariant?.name}
-        </h1>
-
+      <div
+        className={`px-4 block md:sticky md:top-[150px] md:py-6 fixed  bottom-0 left-0 right-0 bg-white p-2 z-10 pb-6 pt-6  rounded-lg  shadow-[rgba(0,0,4,0.1)_0px_-4px_4px_0px] `}
+      >
         {activeVariant.isFlashSale &&
         activeVariant?.price?.discountPercentage > 0 ? (
           <>
             <div className='flex gap-x-1 items-center'>
-              <div className='badge-solid-red'>
+              <div className='bg-danger-500 px-2 py-1.5 rounded text-white text-caption-2'>
                 {activeVariant?.price?.discountPercentage}%
               </div>
               <div className='text-gray_r-11 line-through text-caption-1'>
@@ -223,7 +193,7 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => {
             </div>
           </>
         ) : (
-          <h3 className='text-danger-500 font-semibold mt-1'>
+          <div className='text-danger-500 font-semibold mt-1 text-3xl'>
             {activeVariant?.price?.price > 0 ? (
               <>
                 {currencyFormat(activeVariant?.price?.price)}
@@ -253,54 +223,84 @@ const ProductMobileVariant = ({ product, wishlist, toggleWishlist }) => {
                 </a>
               </span>
             )}
-          </h3>
+          </div>
         )}
+        <div className=''>
+          <div className='mt-4 mb-2'>Jumlah</div>
+          <div className='flex gap-x-3'>
+            <div className='w-2/12'>
+              <input
+                name='quantity'
+                type='number'
+                className='form-input'
+                value={quantity}
+                onChange={(e) => setQuantity(e.target.value)}
+              />
+            </div>
+            <button
+              type='button'
+              className='btn-yellow flex-1'
+              onClick={handleClickCart}
+            >
+              Keranjang
+            </button>
+            <button
+              type='button'
+              className='btn-solid-red flex-1'
+              onClick={handleClickBuy}
+            >
+              Beli
+            </button>
+          </div>
+          <Button
+            onClick={() => handleButton(product.id)}
+            color={'red'}
+            colorScheme='white'
+            className='w-full border-2 p-2 gap-1 mt-2 hover:bg-slate-100 flex items-center'
+          >
+            <ImageNext
+              src='/images/writing.png'
+              alt='penawaran instan'
+              className=''
+              width={25}
+              height={25}
+            />
+            Penawaran Harga Instan
+          </Button>
+        </div>
       </div>
-
-      <Divider />
+      <Image
+        src={product.image + '?variant=True'}
+        alt={product.name}
+        className='h-72 object-contain object-center w-full border-b border-gray_r-4'
+      />
 
       <div className='p-4'>
-        <div className='mt-4 mb-2'>Jumlah</div>
-        <div className='flex gap-x-3'>
-          <div className='w-2/12'>
-            <input
-              name='quantity'
-              type='number'
-              className='form-input'
-              value={quantity}
-              onChange={(e) => setQuantity(e.target.value)}
-            />
-          </div>
-          <button
-            type='button'
-            className='btn-yellow flex-1'
-            onClick={handleClickCart}
-          >
-            Keranjang
-          </button>
-          <button
-            type='button'
-            className='btn-solid-red flex-1'
-            onClick={handleClickBuy}
-          >
-            Beli
+        <div className='flex items-end mb-2'>
+          {product.manufacture?.name ? (
+            <Link
+              href={createSlug(
+                '/shop/brands/',
+                product.manufacture?.name,
+                product.manufacture?.id
+              )}
+            >
+              {product.manufacture?.name}
+            </Link>
+          ) : (
+            <div>-</div>
+          )}
+          <button type='button' className='ml-auto' onClick={toggleWishlist}>
+            {wishlist.data?.productTotal > 0 ? (
+              <HeartIcon className='w-6 fill-danger-500 text-danger-500' />
+            ) : (
+              <HeartIcon className='w-6' />
+            )}
           </button>
         </div>
-        <Button
-          onClick={() => handleButton(product.id)}
-          color={'red'}
-          colorScheme='white'
-          className='w-full border-2 p-2 gap-1 mt-2 hover:bg-slate-100 flex items-center'
-        >
-          <ImageNext
-            src='/images/writing.png'
-            alt='penawaran instan'
-            className=''
-            width={25}
-            height={25}
-          />
-          Penawaran Harga Instan
-        </Button>
+        <h1 className='font-medium text-h-lg leading-8 md:text-title-md md:leading-10 mb-3'>
+          {activeVariant?.name}
+        </h1>
       </div>
 
       <Divider />
-- 
cgit v1.2.3

