45 changed files with 7382 additions and 8310 deletions
-
BINpublic/assets/images/banner-habib-marketplace-relatable.jpg
-
129src/components/account/AccountMenuRow.tsx
-
111src/components/account/HabibCoinsBanner.tsx
-
129src/components/account/OrderCounterCard.tsx
-
131src/components/account/ProviderBadgeCard.tsx
-
355src/components/checkout/AddressCard.tsx
-
565src/components/checkout/CartItemCard.tsx
-
95src/components/checkout/OrderSummaryRows.tsx
-
144src/components/checkout/PaymentMethodCard.tsx
-
141src/components/checkout/ReviewItemCard.tsx
-
81src/components/common/CategoryCard.tsx
-
213src/components/common/CompactProductCard.tsx
-
220src/components/common/GridProductCard.tsx
-
76src/components/common/SearchBar.tsx
-
634src/components/layout/BottomNavBar.tsx
-
40src/components/layout/MobileShell.tsx
-
53src/components/layout/StatusBar.tsx
-
227src/components/layout/StickyFooterBar.tsx
-
71src/components/layout/TopHeader.tsx
-
166src/components/orders/OrderFilterTabs.tsx
-
418src/components/orders/OrderListCard.tsx
-
286src/components/orders/ShipmentStatusCard.tsx
-
4src/data/routesRegistry.ts
-
628src/index.css
-
1546src/pages/account/LanguageSettingPage.tsx
-
1085src/pages/account/ProviderRequestPage.tsx
-
356src/pages/account/ShopAccountPage.tsx
-
44src/pages/account/ShopAddressPage.tsx
-
1051src/pages/catalog/ShopBoothPage.tsx
-
30src/pages/catalog/ShopCatItemsPage.tsx
-
31src/pages/catalog/ShopCategoryPage.tsx
-
974src/pages/catalog/ShopSinglePage.tsx
-
1208src/pages/chat/ShopChatPage.tsx
-
381src/pages/checkout/ShopBuy01Page.tsx
-
418src/pages/checkout/ShopCartPage.tsx
-
279src/pages/checkout/ShopOrderSummaryPage.tsx
-
541src/pages/checkout/ShopPayResultPage.tsx
-
375src/pages/checkout/ShopPaymentMethodsPage.tsx
-
337src/pages/checkout/ShopPaymentPage.tsx
-
950src/pages/home/ShopHomePage.tsx
-
410src/pages/orders/ShopOrderDetailPage.tsx
-
40src/pages/orders/ShopOrdersPage.tsx
-
614src/pages/orders/ShopSupportPage.tsx
-
37src/pages/test/PixelVerificationModal.tsx
-
68src/pages/test/TestDirectoryPage.tsx
|
After Width: 1376 | Height: 768 | Size: 634 KiB |
@ -1,311 +1,411 @@ |
|||||
import React from 'react'; |
|
||||
|
import React, { useEffect, useSyncExternalStore } from 'react'; |
||||
import { useNavigate } from 'react-router-dom'; |
import { useNavigate } from 'react-router-dom'; |
||||
|
|
||||
export type BottomNavTab = 'home' | 'category' | 'account' | 'cart'; |
export type BottomNavTab = 'home' | 'category' | 'account' | 'cart'; |
||||
|
|
||||
interface BottomNavBarProps { |
interface BottomNavBarProps { |
||||
activeTab: BottomNavTab; |
activeTab: BottomNavTab; |
||||
top: number; |
|
||||
|
top?: number; |
||||
showCartBadge?: boolean; |
showCartBadge?: boolean; |
||||
cartBadgeCount?: number; |
cartBadgeCount?: number; |
||||
} |
} |
||||
|
|
||||
|
type WavePhase = 'idle' | 'flatten' | 'rise'; |
||||
|
|
||||
|
interface NavWaveSnapshot { |
||||
|
leaving: BottomNavTab | null; |
||||
|
entering: BottomNavTab | null; |
||||
|
seq: number; |
||||
|
} |
||||
|
|
||||
|
const NAV_ICON_ASSETS = [ |
||||
|
'/assets/images/nav-home-active.svg', |
||||
|
'/assets/images/nav-home-inactive.svg', |
||||
|
'/assets/images/nav-category-active.svg', |
||||
|
'/assets/images/nav-category-inactive.svg', |
||||
|
'/assets/images/nav-account-active.svg', |
||||
|
'/assets/images/nav-account-inactive.svg', |
||||
|
'/assets/images/nav-cart-active.svg', |
||||
|
'/assets/images/nav-cart-inactive.svg', |
||||
|
]; |
||||
|
|
||||
|
// Persists across per-page BottomNavBar unmounts on route navigation.
|
||||
|
let lastCommittedTab: BottomNavTab | null = null; |
||||
|
let waveSnapshot: NavWaveSnapshot = { leaving: null, entering: null, seq: 0 }; |
||||
|
let settleTimerId: number | undefined; |
||||
|
const waveListeners = new Set<() => void>(); |
||||
|
|
||||
|
function tabFromPathname(pathname: string): BottomNavTab | null { |
||||
|
if (pathname === '/' || pathname === '/shop-home') return 'home'; |
||||
|
if (pathname === '/shop-category') return 'category'; |
||||
|
if (pathname === '/shop-account' || pathname === '/shop-category-4214-345') return 'account'; |
||||
|
if (pathname === '/shop-cart') return 'cart'; |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
function subscribeWave(listener: () => void): () => void { |
||||
|
waveListeners.add(listener); |
||||
|
return () => { |
||||
|
waveListeners.delete(listener); |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
function getWaveSnapshot(): NavWaveSnapshot { |
||||
|
return waveSnapshot; |
||||
|
} |
||||
|
|
||||
|
function emitWaveSnapshot(next: NavWaveSnapshot): void { |
||||
|
waveSnapshot = next; |
||||
|
waveListeners.forEach((listener) => listener()); |
||||
|
} |
||||
|
|
||||
|
function completeWaveTransition(seq: number): void { |
||||
|
if (waveSnapshot.seq !== seq) { |
||||
|
return; |
||||
|
} |
||||
|
if (waveSnapshot.leaving === null && waveSnapshot.entering === null) { |
||||
|
return; |
||||
|
} |
||||
|
window.clearTimeout(settleTimerId); |
||||
|
emitWaveSnapshot({ leaving: null, entering: null, seq }); |
||||
|
} |
||||
|
|
||||
|
function startWaveTransition(fromTab: BottomNavTab, toTab: BottomNavTab): void { |
||||
|
if (fromTab === toTab) { |
||||
|
lastCommittedTab = toTab; |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
lastCommittedTab = toTab; |
||||
|
const nextSeq = waveSnapshot.seq + 1; |
||||
|
|
||||
|
window.clearTimeout(settleTimerId); |
||||
|
emitWaveSnapshot({ leaving: fromTab, entering: toTab, seq: nextSeq }); |
||||
|
|
||||
|
// Fallback cleanup when prefers-reduced-motion disables CSS animations.
|
||||
|
settleTimerId = window.setTimeout(() => { |
||||
|
completeWaveTransition(nextSeq); |
||||
|
}, 650); |
||||
|
} |
||||
|
|
||||
|
if (typeof window !== 'undefined') { |
||||
|
for (const src of NAV_ICON_ASSETS) { |
||||
|
const img = new Image(); |
||||
|
img.src = src; |
||||
|
} |
||||
|
|
||||
|
window.addEventListener( |
||||
|
'popstate', |
||||
|
() => { |
||||
|
const nextTab = tabFromPathname(window.location.pathname); |
||||
|
if (lastCommittedTab !== null && nextTab !== null && nextTab !== lastCommittedTab) { |
||||
|
startWaveTransition(lastCommittedTab, nextTab); |
||||
|
} |
||||
|
}, |
||||
|
{ capture: true } |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
function getItemVisualClass(isActive: boolean, phase: WavePhase | null): string { |
||||
|
if (phase === 'rise') return 'is-entering'; |
||||
|
if (phase === 'flatten') return 'is-leaving'; |
||||
|
return isActive ? 'is-active' : 'is-inactive'; |
||||
|
} |
||||
|
|
||||
|
const NavTabIcon: React.FC<{ |
||||
|
activeSrc: string; |
||||
|
inactiveSrc: string; |
||||
|
alt: string; |
||||
|
visualClass: string; |
||||
|
}> = ({ activeSrc, inactiveSrc, alt, visualClass }) => ( |
||||
|
<span className={`habib-nav-icon-wrap ${visualClass}`}> |
||||
|
<img |
||||
|
src={inactiveSrc} |
||||
|
alt="" |
||||
|
aria-hidden="true" |
||||
|
decoding="sync" |
||||
|
className="habib-nav-icon habib-nav-icon-inactive" |
||||
|
/> |
||||
|
<img |
||||
|
src={activeSrc} |
||||
|
alt={alt} |
||||
|
decoding="sync" |
||||
|
className="habib-nav-icon habib-nav-icon-active" |
||||
|
/> |
||||
|
</span> |
||||
|
); |
||||
|
|
||||
|
const IndicatorWave: React.FC<{ |
||||
|
phase: WavePhase; |
||||
|
onSettled?: () => void; |
||||
|
}> = ({ phase, onSettled }) => ( |
||||
|
<svg |
||||
|
width="42" |
||||
|
height="7" |
||||
|
viewBox="0 0 42 7" |
||||
|
fill="none" |
||||
|
className={phase === 'idle' ? 'habib-nav-wave' : `habib-nav-wave is-${phase}`} |
||||
|
onAnimationEnd={phase === 'rise' ? onSettled : undefined} |
||||
|
> |
||||
|
<path |
||||
|
d="M 0.106 7 C 7.1945 7 13.9115 0 21 0 C 28.0885 0 34.8055 7 41.894 7 Z" |
||||
|
fill="#d78e06" |
||||
|
/> |
||||
|
</svg> |
||||
|
); |
||||
|
|
||||
export const BottomNavBar: React.FC<BottomNavBarProps> = ({ |
export const BottomNavBar: React.FC<BottomNavBarProps> = ({ |
||||
activeTab, |
activeTab, |
||||
top, |
|
||||
showCartBadge = true, |
showCartBadge = true, |
||||
cartBadgeCount = 2, |
cartBadgeCount = 2, |
||||
}) => { |
}) => { |
||||
const navigate = useNavigate(); |
const navigate = useNavigate(); |
||||
|
const snapshot = useSyncExternalStore(subscribeWave, getWaveSnapshot, getWaveSnapshot); |
||||
|
|
||||
|
useEffect(() => { |
||||
|
lastCommittedTab = activeTab; |
||||
|
}, [activeTab]); |
||||
|
|
||||
|
const handleTabNavigate = (targetTab: BottomNavTab, route: string) => { |
||||
|
if (activeTab !== targetTab) { |
||||
|
startWaveTransition(activeTab, targetTab); |
||||
|
} |
||||
|
navigate(route); |
||||
|
}; |
||||
|
|
||||
|
const handleRiseSettled = () => { |
||||
|
completeWaveTransition(snapshot.seq); |
||||
|
}; |
||||
|
|
||||
// Indicator wave center X inside Subtract boolean operation (Ellipse 2 x + 9)
|
|
||||
const cx = |
|
||||
activeTab === 'home' |
|
||||
? 44 |
|
||||
: activeTab === 'category' |
|
||||
? 116 |
|
||||
: activeTab === 'account' |
|
||||
? 260 |
|
||||
: 331; |
|
||||
|
const getWavePhase = (tab: BottomNavTab): WavePhase | null => { |
||||
|
if (activeTab === tab) { |
||||
|
return snapshot.entering === tab ? 'rise' : 'idle'; |
||||
|
} |
||||
|
return snapshot.leaving === tab ? 'flatten' : null; |
||||
|
}; |
||||
|
|
||||
const indicatorWavePath = `M ${cx - 20.894} 78 C ${cx - 13.8055} 78 ${cx - 7.0885} 71 ${cx} 71 C ${cx + 7.0885} 71 ${cx + 13.8055} 78 ${cx + 20.894} 78 Z`; |
|
||||
|
const homePhase = getWavePhase('home'); |
||||
|
const categoryPhase = getWavePhase('category'); |
||||
|
const accountPhase = getWavePhase('account'); |
||||
|
const cartPhase = getWavePhase('cart'); |
||||
|
|
||||
|
const homeVisual = getItemVisualClass(activeTab === 'home', homePhase); |
||||
|
const categoryVisual = getItemVisualClass(activeTab === 'category', categoryPhase); |
||||
|
const accountVisual = getItemVisualClass(activeTab === 'account', accountPhase); |
||||
|
const cartVisual = getItemVisualClass(activeTab === 'cart', cartPhase); |
||||
|
|
||||
return ( |
return ( |
||||
<div |
|
||||
|
<nav |
||||
|
aria-label="Bottom Navigation" |
||||
style={{ |
style={{ |
||||
position: 'absolute', |
|
||||
left: 0, |
|
||||
top: `${top}px`, |
|
||||
width: '375px', |
|
||||
|
position: 'sticky', |
||||
|
bottom: 0, |
||||
|
marginTop: 'auto', |
||||
|
width: '100%', |
||||
height: '78px', |
height: '78px', |
||||
|
flexShrink: 0, |
||||
|
zIndex: 30, |
||||
}} |
}} |
||||
> |
> |
||||
{/* Subtract white shape with active boolean wave indicator */} |
|
||||
|
{/* White rounded background */} |
||||
<div |
<div |
||||
style={{ |
style={{ |
||||
position: 'absolute', |
|
||||
left: 0, |
|
||||
top: 0, |
|
||||
width: '375px', |
|
||||
|
position: 'relative', |
||||
|
width: '100%', |
||||
height: '78px', |
height: '78px', |
||||
borderRadius: '17px', |
|
||||
|
borderRadius: '17px 17px 0 0', |
||||
backgroundColor: '#ffffff', |
backgroundColor: '#ffffff', |
||||
boxShadow: '0px -7px 12px rgba(103, 110, 124, 0.15)', |
boxShadow: '0px -7px 12px rgba(103, 110, 124, 0.15)', |
||||
overflow: 'hidden', |
|
||||
}} |
|
||||
> |
|
||||
<svg |
|
||||
width="375" |
|
||||
height="78" |
|
||||
viewBox="0 0 375 78" |
|
||||
fill="none" |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: 0, |
|
||||
top: 0, |
|
||||
width: '375px', |
|
||||
height: '78px', |
|
||||
pointerEvents: 'none', |
|
||||
}} |
|
||||
> |
|
||||
<path d={indicatorWavePath} fill="#d78e06" /> |
|
||||
</svg> |
|
||||
</div> |
|
||||
|
|
||||
{/* Home Tab */} |
|
||||
<div |
|
||||
onClick={() => navigate('/shop-home')} |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '21px', |
|
||||
top: '17px', |
|
||||
width: '47px', |
|
||||
height: '44px', |
|
||||
cursor: 'pointer', |
|
||||
}} |
|
||||
> |
|
||||
<img |
|
||||
src={ |
|
||||
activeTab === 'home' |
|
||||
? '/assets/images/nav-home-active.svg' |
|
||||
: '/assets/images/nav-home-inactive.svg' |
|
||||
} |
|
||||
alt="Home" |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '9px', |
|
||||
top: 0, |
|
||||
width: '28px', |
|
||||
height: '28px', |
|
||||
}} |
|
||||
/> |
|
||||
<span |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: 0, |
|
||||
top: '27px', |
|
||||
width: '47px', |
|
||||
height: '17px', |
|
||||
fontFamily: 'var(--font-sans)', |
|
||||
fontWeight: 600, |
|
||||
fontSize: '12px', |
|
||||
lineHeight: '17px', |
|
||||
color: activeTab === 'home' ? '#d78e06' : '#3d3d3d', |
|
||||
textAlign: 'center', |
|
||||
}} |
|
||||
> |
|
||||
Home |
|
||||
</span> |
|
||||
</div> |
|
||||
|
|
||||
{/* Category Tab */} |
|
||||
<div |
|
||||
onClick={() => navigate('/shop-category')} |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '91px', |
|
||||
top: '17px', |
|
||||
width: '50px', |
|
||||
height: '44px', |
|
||||
cursor: 'pointer', |
|
||||
}} |
}} |
||||
> |
> |
||||
<img |
|
||||
src={ |
|
||||
activeTab === 'category' |
|
||||
? '/assets/images/nav-category-active.svg' |
|
||||
: '/assets/images/nav-category-inactive.svg' |
|
||||
} |
|
||||
alt="Category" |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '11px', |
|
||||
top: 0, |
|
||||
width: '28px', |
|
||||
height: '28px', |
|
||||
}} |
|
||||
/> |
|
||||
<span |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: 0, |
|
||||
top: '27px', |
|
||||
width: '50px', |
|
||||
height: '17px', |
|
||||
fontFamily: 'var(--font-sans)', |
|
||||
fontWeight: 600, |
|
||||
fontSize: '12px', |
|
||||
lineHeight: '17px', |
|
||||
color: activeTab === 'category' ? '#d78e06' : '#3d3d3d', |
|
||||
textAlign: 'left', |
|
||||
}} |
|
||||
> |
|
||||
Category |
|
||||
</span> |
|
||||
</div> |
|
||||
|
<div className="habib-bottom-nav-inner"> |
||||
|
{/* Home Tab */} |
||||
|
<button |
||||
|
type="button" |
||||
|
onClick={() => handleTabNavigate('home', '/shop-home')} |
||||
|
style={{ |
||||
|
position: 'relative', |
||||
|
height: '78px', |
||||
|
display: 'flex', |
||||
|
flexDirection: 'column', |
||||
|
alignItems: 'center', |
||||
|
justifyContent: 'center', |
||||
|
gap: '1px', |
||||
|
cursor: 'pointer', |
||||
|
padding: 0, |
||||
|
}} |
||||
|
> |
||||
|
<NavTabIcon |
||||
|
activeSrc="/assets/images/nav-home-active.svg" |
||||
|
inactiveSrc="/assets/images/nav-home-inactive.svg" |
||||
|
alt="Home" |
||||
|
visualClass={homeVisual} |
||||
|
/> |
||||
|
<span className={`habib-nav-label ${homeVisual}`}>Home</span> |
||||
|
{homePhase && ( |
||||
|
<IndicatorWave |
||||
|
key={snapshot.seq} |
||||
|
phase={homePhase} |
||||
|
onSettled={handleRiseSettled} |
||||
|
/> |
||||
|
)} |
||||
|
</button> |
||||
|
|
||||
{/* Center Habib Emblem Pill (54x54 node at rel=(161, 12), exported SVG 114x85 with shadow padding) */} |
|
||||
<img |
|
||||
src="/assets/images/nav-center-habib-pill.svg" |
|
||||
alt="Habib" |
|
||||
onClick={() => navigate('/shop-home')} |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '131px', |
|
||||
top: '-7px', |
|
||||
width: '114px', |
|
||||
height: '85px', |
|
||||
cursor: 'pointer', |
|
||||
}} |
|
||||
/> |
|
||||
|
{/* Category Tab */} |
||||
|
<button |
||||
|
type="button" |
||||
|
onClick={() => handleTabNavigate('category', '/shop-category')} |
||||
|
style={{ |
||||
|
position: 'relative', |
||||
|
height: '78px', |
||||
|
display: 'flex', |
||||
|
flexDirection: 'column', |
||||
|
alignItems: 'center', |
||||
|
justifyContent: 'center', |
||||
|
gap: '1px', |
||||
|
cursor: 'pointer', |
||||
|
padding: 0, |
||||
|
}} |
||||
|
> |
||||
|
<NavTabIcon |
||||
|
activeSrc="/assets/images/nav-category-active.svg" |
||||
|
inactiveSrc="/assets/images/nav-category-inactive.svg" |
||||
|
alt="Category" |
||||
|
visualClass={categoryVisual} |
||||
|
/> |
||||
|
<span className={`habib-nav-label ${categoryVisual}`}>Category</span> |
||||
|
{categoryPhase && ( |
||||
|
<IndicatorWave |
||||
|
key={snapshot.seq} |
||||
|
phase={categoryPhase} |
||||
|
onSettled={handleRiseSettled} |
||||
|
/> |
||||
|
)} |
||||
|
</button> |
||||
|
|
||||
{/* Account Tab */} |
|
||||
<div |
|
||||
onClick={() => navigate('/shop-account')} |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '237px', |
|
||||
top: '17px', |
|
||||
width: '45px', |
|
||||
height: '44px', |
|
||||
cursor: 'pointer', |
|
||||
}} |
|
||||
> |
|
||||
<img |
|
||||
src={ |
|
||||
activeTab === 'account' |
|
||||
? '/assets/images/nav-account-active.svg' |
|
||||
: '/assets/images/nav-account-inactive.svg' |
|
||||
} |
|
||||
alt="Account" |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '9px', |
|
||||
top: 0, |
|
||||
width: '28px', |
|
||||
height: '28px', |
|
||||
}} |
|
||||
/> |
|
||||
<span |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: 0, |
|
||||
top: '27px', |
|
||||
width: '45px', |
|
||||
height: '17px', |
|
||||
fontFamily: 'var(--font-sans)', |
|
||||
fontWeight: 600, |
|
||||
fontSize: '12px', |
|
||||
lineHeight: '17px', |
|
||||
color: activeTab === 'account' ? '#d78e06' : '#3d3d3d', |
|
||||
textAlign: 'left', |
|
||||
}} |
|
||||
> |
|
||||
Account |
|
||||
</span> |
|
||||
</div> |
|
||||
|
{/* Center Habib Emblem Pill */} |
||||
|
<div |
||||
|
style={{ |
||||
|
position: 'relative', |
||||
|
height: '78px', |
||||
|
display: 'flex', |
||||
|
alignItems: 'center', |
||||
|
justifyContent: 'center', |
||||
|
}} |
||||
|
> |
||||
|
<img |
||||
|
src="/assets/images/nav-center-habib-pill.svg" |
||||
|
alt="Habib" |
||||
|
decoding="sync" |
||||
|
onClick={() => handleTabNavigate('home', '/shop-home')} |
||||
|
style={{ |
||||
|
position: 'absolute', |
||||
|
top: '-7px', |
||||
|
left: '50%', |
||||
|
transform: 'translateX(-50%)', |
||||
|
width: '114px', |
||||
|
height: '85px', |
||||
|
cursor: 'pointer', |
||||
|
}} |
||||
|
/> |
||||
|
</div> |
||||
|
|
||||
{/* Cart Tab */} |
|
||||
<div |
|
||||
onClick={() => navigate('/shop-cart')} |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '316px', |
|
||||
top: '17px', |
|
||||
width: '28px', |
|
||||
height: '44px', |
|
||||
cursor: 'pointer', |
|
||||
}} |
|
||||
> |
|
||||
<img |
|
||||
src={ |
|
||||
activeTab === 'cart' |
|
||||
? '/assets/images/nav-cart-active.svg' |
|
||||
: '/assets/images/nav-cart-inactive.svg' |
|
||||
} |
|
||||
alt="Cart" |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: 0, |
|
||||
top: 0, |
|
||||
width: '28px', |
|
||||
height: '28px', |
|
||||
}} |
|
||||
/> |
|
||||
<span |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '2px', |
|
||||
top: '27px', |
|
||||
width: '23px', |
|
||||
height: '17px', |
|
||||
fontFamily: 'var(--font-sans)', |
|
||||
fontWeight: 600, |
|
||||
fontSize: '12px', |
|
||||
lineHeight: '17px', |
|
||||
color: activeTab === 'cart' ? '#d78e06' : '#3d3d3d', |
|
||||
textAlign: 'left', |
|
||||
}} |
|
||||
> |
|
||||
Cart |
|
||||
</span> |
|
||||
</div> |
|
||||
|
{/* Account Tab */} |
||||
|
<button |
||||
|
type="button" |
||||
|
onClick={() => handleTabNavigate('account', '/shop-account')} |
||||
|
style={{ |
||||
|
position: 'relative', |
||||
|
height: '78px', |
||||
|
display: 'flex', |
||||
|
flexDirection: 'column', |
||||
|
alignItems: 'center', |
||||
|
justifyContent: 'center', |
||||
|
gap: '1px', |
||||
|
cursor: 'pointer', |
||||
|
padding: 0, |
||||
|
}} |
||||
|
> |
||||
|
<NavTabIcon |
||||
|
activeSrc="/assets/images/nav-account-active.svg" |
||||
|
inactiveSrc="/assets/images/nav-account-inactive.svg" |
||||
|
alt="Account" |
||||
|
visualClass={accountVisual} |
||||
|
/> |
||||
|
<span className={`habib-nav-label ${accountVisual}`}>Account</span> |
||||
|
{accountPhase && ( |
||||
|
<IndicatorWave |
||||
|
key={snapshot.seq} |
||||
|
phase={accountPhase} |
||||
|
onSettled={handleRiseSettled} |
||||
|
/> |
||||
|
)} |
||||
|
</button> |
||||
|
|
||||
{/* Optional Cart Badge at rel=(332, 13) */} |
|
||||
{showCartBadge && cartBadgeCount > 0 && ( |
|
||||
<div |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '332px', |
|
||||
top: '13px', |
|
||||
width: '16px', |
|
||||
height: '16px', |
|
||||
borderRadius: '8px', |
|
||||
backgroundColor: '#d44747', |
|
||||
pointerEvents: 'none', |
|
||||
}} |
|
||||
> |
|
||||
<span |
|
||||
|
{/* Cart Tab */} |
||||
|
<button |
||||
|
type="button" |
||||
|
onClick={() => handleTabNavigate('cart', '/shop-cart')} |
||||
style={{ |
style={{ |
||||
position: 'absolute', |
|
||||
left: 0, |
|
||||
top: '3.5px', |
|
||||
width: '16px', |
|
||||
height: '8px', |
|
||||
|
position: 'relative', |
||||
|
height: '78px', |
||||
display: 'flex', |
display: 'flex', |
||||
|
flexDirection: 'column', |
||||
alignItems: 'center', |
alignItems: 'center', |
||||
justifyContent: 'center', |
justifyContent: 'center', |
||||
fontFamily: 'var(--font-sans)', |
|
||||
fontWeight: 700, |
|
||||
fontSize: '10px', |
|
||||
lineHeight: '13.9px', |
|
||||
color: '#ffffff', |
|
||||
|
gap: '1px', |
||||
|
cursor: 'pointer', |
||||
|
padding: 0, |
||||
}} |
}} |
||||
> |
> |
||||
{cartBadgeCount} |
|
||||
</span> |
|
||||
|
<div style={{ position: 'relative', width: '28px', height: '28px' }}> |
||||
|
<NavTabIcon |
||||
|
activeSrc="/assets/images/nav-cart-active.svg" |
||||
|
inactiveSrc="/assets/images/nav-cart-inactive.svg" |
||||
|
alt="Cart" |
||||
|
visualClass={cartVisual} |
||||
|
/> |
||||
|
{showCartBadge && cartBadgeCount > 0 && ( |
||||
|
<div |
||||
|
style={{ |
||||
|
position: 'absolute', |
||||
|
right: '-6px', |
||||
|
top: '-4px', |
||||
|
width: '16px', |
||||
|
height: '16px', |
||||
|
borderRadius: '8px', |
||||
|
backgroundColor: '#d44747', |
||||
|
display: 'flex', |
||||
|
alignItems: 'center', |
||||
|
justifyContent: 'center', |
||||
|
pointerEvents: 'none', |
||||
|
}} |
||||
|
> |
||||
|
<span |
||||
|
style={{ |
||||
|
fontFamily: 'var(--font-sans)', |
||||
|
fontWeight: 700, |
||||
|
fontSize: '10px', |
||||
|
lineHeight: '14px', |
||||
|
color: '#ffffff', |
||||
|
}} |
||||
|
> |
||||
|
{cartBadgeCount} |
||||
|
</span> |
||||
|
</div> |
||||
|
)} |
||||
|
</div> |
||||
|
<span className={`habib-nav-label ${cartVisual}`}>Cart</span> |
||||
|
{cartPhase && ( |
||||
|
<IndicatorWave |
||||
|
key={snapshot.seq} |
||||
|
phase={cartPhase} |
||||
|
onSettled={handleRiseSettled} |
||||
|
/> |
||||
|
)} |
||||
|
</button> |
||||
</div> |
</div> |
||||
)} |
|
||||
</div> |
|
||||
|
</div> |
||||
|
</nav> |
||||
); |
); |
||||
}; |
}; |
||||
@ -1,53 +0,0 @@ |
|||||
import React from 'react'; |
|
||||
|
|
||||
interface StatusBarProps { |
|
||||
variant?: 'light' | 'dark'; |
|
||||
height?: number; |
|
||||
} |
|
||||
|
|
||||
export const StatusBar: React.FC<StatusBarProps> = ({ variant = 'dark', height = 35 }) => { |
|
||||
const leftSrc = |
|
||||
variant === 'light' |
|
||||
? '/assets/images/status-bar-left-light.svg' |
|
||||
: '/assets/images/status-bar-left-dark.svg'; |
|
||||
const rightSrc = |
|
||||
variant === 'light' |
|
||||
? '/assets/images/status-bar-right-light.svg' |
|
||||
: '/assets/images/status-bar-right-dark.svg'; |
|
||||
|
|
||||
return ( |
|
||||
<div |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: 0, |
|
||||
top: 0, |
|
||||
width: '375px', |
|
||||
height: `${height}px`, |
|
||||
pointerEvents: 'none', |
|
||||
}} |
|
||||
> |
|
||||
<img |
|
||||
src={leftSrc} |
|
||||
alt="" |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '16.58px', |
|
||||
top: '9.47px', |
|
||||
width: '42.62px', |
|
||||
height: '16.58px', |
|
||||
}} |
|
||||
/> |
|
||||
<img |
|
||||
src={rightSrc} |
|
||||
alt="" |
|
||||
style={{ |
|
||||
position: 'absolute', |
|
||||
left: '310.8px', |
|
||||
top: '13.68px', |
|
||||
width: '52.62px', |
|
||||
height: '8.95px', |
|
||||
}} |
|
||||
/> |
|
||||
</div> |
|
||||
); |
|
||||
}; |
|
||||
1546
src/pages/account/LanguageSettingPage.tsx
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1085
src/pages/account/ProviderRequestPage.tsx
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1051
src/pages/catalog/ShopBoothPage.tsx
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
974
src/pages/catalog/ShopSinglePage.tsx
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1208
src/pages/chat/ShopChatPage.tsx
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
950
src/pages/home/ShopHomePage.tsx
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue