diff --git a/estore/src/components/CartFab.tsx b/estore/src/components/CartFab.tsx index f58833d..aa00d21 100644 --- a/estore/src/components/CartFab.tsx +++ b/estore/src/components/CartFab.tsx @@ -20,13 +20,13 @@ export default function CartFab() { color: '#fff', border: 'none', borderRadius: '999px', - padding: '0.75rem 1.25rem', + padding: '0.55rem 1rem', display: 'flex', alignItems: 'center', - gap: '0.6rem', + gap: '0.45rem', boxShadow: '0 6px 20px rgba(0,0,0,0.22)', cursor: 'pointer', - fontSize: '0.95rem', + fontSize: '0.85rem', fontWeight: 'bold', fontFamily: 'inherit', transition: 'transform 0.15s, box-shadow 0.15s', @@ -42,7 +42,6 @@ export default function CartFab() { > {totalItems} {totalItems === 1 ? 'item' : 'items'} - ยท View order ) } diff --git a/estore/src/components/ScrollToTop.tsx b/estore/src/components/ScrollToTop.tsx index fba208f..66d21ab 100644 --- a/estore/src/components/ScrollToTop.tsx +++ b/estore/src/components/ScrollToTop.tsx @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react' import { useCart } from '@/context/CartContext' export default function ScrollToTop() { - const { drawerOpen } = useCart() + const { drawerOpen, totalItems } = useCart() const [scrolled, setScrolled] = useState(false) useEffect(() => { @@ -24,9 +24,10 @@ export default function ScrollToTop() { onClick={() => window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })} style={{ position: 'fixed', - bottom: '12px', + bottom: totalItems > 0 ? '76px' : '12px', right: '10px', zIndex: 98, + transition: 'bottom 0.15s', border: '1px solid #363636', outline: 'none', background: '#94d601',