From 0e1c9c213b6051be728944730a0e23beadd4c35e Mon Sep 17 00:00:00 2001 From: Miqdad Date: Wed, 24 Sep 2025 17:36:08 +0700 Subject: don cart --- .../modules/cart/components/CartSummaryMobile.tsx | 36 +++++++++++++--------- src-migrate/pages/shop/cart/cart.module.css | 14 ++++++++- src-migrate/pages/shop/cart/index.tsx | 15 +++++---- 3 files changed, 44 insertions(+), 21 deletions(-) (limited to 'src-migrate') diff --git a/src-migrate/modules/cart/components/CartSummaryMobile.tsx b/src-migrate/modules/cart/components/CartSummaryMobile.tsx index 02258204..7a334fed 100644 --- a/src-migrate/modules/cart/components/CartSummaryMobile.tsx +++ b/src-migrate/modules/cart/components/CartSummaryMobile.tsx @@ -29,7 +29,7 @@ const CartSummaryMobile = ({ isLoaded = false, }: Props) => { const [showPopup, setShowPopup] = useState(false); - const PPN : number = process.env.NEXT_PUBLIC_PPN ? parseFloat(process.env.NEXT_PUBLIC_PPN) : 0; + const PPN: number = process.env.NEXT_PUBLIC_PPN ? parseFloat(process.env.NEXT_PUBLIC_PPN) : 0; return ( <>
- - + + {/* Left: label */} + Grand Total - - - - - Rp {formatCurrency(grandTotal || 0)} - + + {/* Right: amount + chevron */} +
+ + Rp {formatCurrency(grandTotal || 0)} + + +
+
); diff --git a/src-migrate/pages/shop/cart/cart.module.css b/src-migrate/pages/shop/cart/cart.module.css index b756fb15..af5a2abc 100644 --- a/src-migrate/pages/shop/cart/cart.module.css +++ b/src-migrate/pages/shop/cart/cart.module.css @@ -3,7 +3,7 @@ } .content { - @apply flex flex-wrap ; + @apply flex flex-wrap; } .item-wrapper { @@ -33,3 +33,15 @@ .summary-buttons-step-approval { @apply grid grid-cols-1 gap-y-3 mt-6; } + +@media (max-width: 768px) { + .item-wrapper { + /* adjust if your bar is taller/shorter */ + padding-bottom: calc(env(safe-area-inset-bottom) + 9rem); + } + + .summary-wrapper { + @apply fixed inset-x-0 bottom-0 z-50 md:sticky w-full; + } + +} \ No newline at end of file diff --git a/src-migrate/pages/shop/cart/index.tsx b/src-migrate/pages/shop/cart/index.tsx index 795dfa72..031aa45b 100644 --- a/src-migrate/pages/shop/cart/index.tsx +++ b/src-migrate/pages/shop/cart/index.tsx @@ -301,9 +301,8 @@ const CartPage: React.FC = () => { <> {/* Sticky Header */}

Keranjang Belanja

@@ -392,13 +391,17 @@ const CartPage: React.FC = () => {
+
+ {/* Cart Summary */}
{device.isMobile ? ( -- cgit v1.2.3