Browse Source
refactor(shop): clean up test pages, improve mobile shell layout, and enhance address and cookie handling
main
refactor(shop): clean up test pages, improve mobile shell layout, and enhance address and cookie handling
main
55 changed files with 3516 additions and 4387 deletions
-
147index.html
-
25src/App.tsx
-
5src/components/account/AccountMenuRow.tsx
-
5src/components/account/OrderCounterCard.tsx
-
7src/components/checkout/AddressCard.tsx
-
11src/components/checkout/CartItemCard.tsx
-
5src/components/checkout/OrderSummaryRows.tsx
-
3src/components/checkout/PaymentMethodCard.tsx
-
3src/components/checkout/ReviewItemCard.tsx
-
5src/components/common/CategoryCard.tsx
-
5src/components/common/CompactProductCard.tsx
-
5src/components/common/GridProductCard.tsx
-
15src/components/common/PhoneNumberInput.tsx
-
16src/components/common/SearchBar.tsx
-
7src/components/common/ShimmerSkeletons.tsx
-
17src/components/layout/BottomNavBar.tsx
-
381src/components/layout/MobileShell.tsx
-
7src/components/layout/StickyFooterBar.tsx
-
5src/components/layout/TopHeader.tsx
-
1067src/components/modals/AddressFormSheet.tsx
-
9src/components/modals/LoginRequiredModal.tsx
-
7src/components/modals/OrderSummarySheet.tsx
-
7src/components/modals/PaymentMethodsSheet.tsx
-
19src/components/modals/ShipmentTrackingSheet.tsx
-
11src/components/orders/OrderFilterTabs.tsx
-
9src/components/orders/OrderListCard.tsx
-
9src/components/orders/ShipmentStatusCard.tsx
-
176src/context/ShopAppContext.tsx
-
425src/data/routesRegistry.ts
-
3src/hooks/useSmartBack.ts
-
1388src/lib/cookies.ts
-
1src/lib/routes.ts
-
32src/pages/account/LanguageSettingPage.tsx
-
85src/pages/account/ProviderRequestPage.tsx
-
128src/pages/account/ShopAccountPage.tsx
-
3src/pages/account/ShopAddressPage.tsx
-
120src/pages/catalog/ShopBoothPage.tsx
-
9src/pages/catalog/ShopCatItemsPage.tsx
-
3src/pages/catalog/ShopCategoryPage.tsx
-
83src/pages/catalog/ShopSinglePage.tsx
-
48src/pages/chat/ShopChatPage.tsx
-
19src/pages/checkout/ShopBuy01Page.tsx
-
15src/pages/checkout/ShopCartPage.tsx
-
14src/pages/checkout/ShopOrderSummaryPage.tsx
-
24src/pages/checkout/ShopPayResultPage.tsx
-
16src/pages/checkout/ShopPaymentMethodsPage.tsx
-
9src/pages/checkout/ShopPaymentPage.tsx
-
35src/pages/home/ShopHomePage.tsx
-
27src/pages/orders/ShopOrderDetailPage.tsx
-
5src/pages/orders/ShopOrdersPage.tsx
-
37src/pages/orders/ShopSupportPage.tsx
-
602src/pages/test/PixelVerificationModal.tsx
-
2207src/pages/test/SellerChatButtonTestLab.tsx
-
576src/pages/test/TestDirectoryPage.tsx
-
1src/types/window.d.ts
1067
src/components/modals/AddressFormSheet.tsx
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,425 +0,0 @@ |
|||
export interface ScreenRouteEntry { |
|||
id: string; |
|||
figmaNodeId: string; |
|||
figmaName: string; |
|||
title: string; |
|||
route: string; |
|||
aliases?: string[]; |
|||
category: 'Home & Discovery' | 'Product & Store' | 'Cart & Checkout' | 'Orders & Support' | 'Account & Settings' | 'Standalone Nodes'; |
|||
width: number; |
|||
height: number; |
|||
refImage?: string; |
|||
description: string; |
|||
scenarios: { |
|||
label: string; |
|||
route: string; |
|||
description: string; |
|||
}[]; |
|||
} |
|||
|
|||
export const ALL_IMPLEMENTED_ROUTES: ScreenRouteEntry[] = [ |
|||
// 1. Home & Discovery
|
|||
{ |
|||
id: 'shop-home', |
|||
figmaNodeId: '4080:9587', |
|||
figmaName: 'shop-home', |
|||
title: 'Shop Home (Marketplace Landing)', |
|||
route: '/shop-home', |
|||
aliases: ['/'], |
|||
category: 'Home & Discovery', |
|||
width: 375, |
|||
height: 1074, |
|||
refImage: '/assets/images/references/ref-shop-home.png', |
|||
description: 'Main Habib Shop landing page with Islamic pattern header, search bar, green hero banner, 5 quick categories, Populars & New Stores product carousels, and bottom navigation.', |
|||
scenarios: [ |
|||
{ label: 'Default Landing View', route: '/shop-home', description: 'Initial marketplace home state (375×1074).' }, |
|||
{ label: 'Open Category Grid via "More"', route: '/shop-category', description: 'Navigate to full 2×6 category grid.' }, |
|||
{ label: 'Open Single Product Card', route: '/shop-single-page', description: 'Click any product card to view product details.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-category', |
|||
figmaNodeId: '4181:12170', |
|||
figmaName: 'shop-category', |
|||
title: 'Shop Category Grid', |
|||
route: '/shop-category', |
|||
category: 'Home & Discovery', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-category.png', |
|||
description: '2-column × 6-row category grid with "24" count badges, search bar, and active Category bottom navigation tab.', |
|||
scenarios: [ |
|||
{ label: 'Default Category Grid', route: '/shop-category', description: 'Full 12-tile category view (375×814).' }, |
|||
{ label: 'Select Category -> Category Items', route: '/shop-catitems', description: 'Click any category tile to open Home & Living items.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-catitems', |
|||
figmaNodeId: '4181:12817', |
|||
figmaName: 'shop-catitems', |
|||
title: 'Category Items (Home & Living)', |
|||
route: '/shop-catitems', |
|||
category: 'Home & Discovery', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-catitems.png', |
|||
description: 'Category product listing for "Home & Living" with back button, search bar, and 2-column × 3-row product grid.', |
|||
scenarios: [ |
|||
{ label: 'Default Category Items Grid', route: '/shop-catitems', description: '6 product cards in 2 columns (375×814).' }, |
|||
], |
|||
}, |
|||
|
|||
// 2. Product & Store
|
|||
{ |
|||
id: 'shop-single-page', |
|||
figmaNodeId: '4153:19198', |
|||
figmaName: 'shop-single page', |
|||
title: 'Single Product Page', |
|||
route: '/shop-single-page', |
|||
category: 'Product & Store', |
|||
width: 375, |
|||
height: 1233, |
|||
refImage: '/assets/images/references/ref-shop-single-page.png', |
|||
description: 'Product detail page for "Islam in the Bible Book" with hero image, condition/processing/type badges, Al-Hujjah Books seller row, Information/Review tabs, Populars row, and sticky Add to Cart footer.', |
|||
scenarios: [ |
|||
{ label: 'Information Tab (Default)', route: '/shop-single-page', description: 'Default product details with Information tab active (375×1233).' }, |
|||
{ label: 'Visit Seller Booth (Al-Hujjah Books)', route: '/shop-booth', description: 'Click seller row to open shop-Booth.' }, |
|||
{ label: 'Add to Cart Action', route: '/shop-cart', description: 'Click Add to Cart button to navigate to Cart.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-booth', |
|||
figmaNodeId: '4129:15733', |
|||
figmaName: 'shop-Booth', |
|||
title: 'Shop Booth (Seller Storefront)', |
|||
route: '/shop-booth', |
|||
category: 'Product & Store', |
|||
width: 375, |
|||
height: 1233, |
|||
refImage: '/assets/images/references/ref-shop-booth.png', |
|||
description: 'Storefront page for "Al-Hujjah Books" with banner cover, circular logo, Iran flag, 4.2 rating, Chat/Delivery/Guarantee action cards, search bar, and 2×3 product grid.', |
|||
scenarios: [ |
|||
{ label: 'Default Storefront View', route: '/shop-booth', description: 'Al-Hujjah Books booth page (375×1233).' }, |
|||
{ label: 'Open Booth Chat', route: '/shop-chat', description: 'Click Chat card to message Al-Hujjah Books.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-chat', |
|||
figmaNodeId: '4129:17403', |
|||
figmaName: 'shop-chat', |
|||
title: 'Shop Chat (Direct Messaging)', |
|||
route: '/shop-chat', |
|||
category: 'Product & Store', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-chat.png', |
|||
description: 'Direct chat interface with Al-Hujjah Books featuring encryption notice, support notice card, incoming/outgoing message bubbles, delivery error retry, and message composer.', |
|||
scenarios: [ |
|||
{ label: 'Default Conversation State', route: '/shop-chat', description: 'Exact Figma conversation state with retry indicator (375×814).' }, |
|||
], |
|||
}, |
|||
|
|||
// 3. Cart & Checkout
|
|||
{ |
|||
id: 'shop-cart', |
|||
figmaNodeId: '4129:17527', |
|||
figmaName: 'shop-cart', |
|||
title: 'Shopping Cart', |
|||
route: '/shop-cart', |
|||
category: 'Cart & Checkout', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-cart.png', |
|||
description: 'Shopping cart with "3 item from 2 Shops", "Clear all" action, 2 cart item cards with quantity steppers, sticky checkout bar, and active Cart bottom nav tab.', |
|||
scenarios: [ |
|||
{ label: 'Default Cart View', route: '/shop-cart', description: '2 cart items with sticky checkout bar (375×814).' }, |
|||
{ label: 'Open Order Summary Sheet', route: '/shop-order-summery', description: 'Click "Total 4 item ^" to open order summary modal.' }, |
|||
{ label: 'Proceed to Shipping Details', route: '/shop-buy01', description: 'Click checkout button to select delivery address.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-order-summery', |
|||
figmaNodeId: '4154:20497', |
|||
figmaName: 'shop-order summery', |
|||
title: 'Order Summary Modal Sheet', |
|||
route: '/shop-order-summery', |
|||
category: 'Cart & Checkout', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-order-summery.png', |
|||
description: 'Cart screen overlaid with dark backdrop (opacity 0.9) and "Orded Summery" bottom sheet showing line items ($70.50), Total, and "Got it" button.', |
|||
scenarios: [ |
|||
{ label: 'Modal Open State (Default)', route: '/shop-order-summery', description: 'Order Summary bottom sheet open over Cart (375×814).' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-buy01', |
|||
figmaNodeId: '4159:367', |
|||
figmaName: 'shop-buy01', |
|||
title: 'Shipping Details (Checkout Step 1)', |
|||
route: '/shop-buy01', |
|||
category: 'Cart & Checkout', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-buy01.png', |
|||
description: 'Shipping details page with Delivery Address selection (Ali Ghaderi selected, Sina Sajjadi, Add New adress), Standard shiping ($5,00), encryption notice, and Continue footer.', |
|||
scenarios: [ |
|||
{ label: 'Default Shipping Details', route: '/shop-buy01', description: 'Ali Ghaderi address & Standard shipping selected (375×814).' }, |
|||
{ label: 'Continue to Review & Confirm', route: '/shop-payment', description: 'Click Continue to review order items.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-payment', |
|||
figmaNodeId: '4160:11203', |
|||
figmaName: 'shop-payment', |
|||
title: 'Review & Confirm (Checkout Step 2)', |
|||
route: '/shop-payment', |
|||
category: 'Cart & Checkout', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-payment.png', |
|||
description: 'Order review screen showing Review items (2 book cards with quantities 1 and 2), Delivery Address (Ali Ghaderi), Orded Summery ($70.50), and Payment CTA footer.', |
|||
scenarios: [ |
|||
{ label: 'Default Review & Confirm', route: '/shop-payment', description: 'Review items, address, and summary (375×814).' }, |
|||
{ label: 'Open Payment Methods Sheet', route: '/shop-payment-methods', description: 'Click Payment button to choose payment method.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-payment-methods', |
|||
figmaNodeId: '4171:1394', |
|||
figmaName: 'shop-payment (modal)', |
|||
title: 'Payment Methods Modal Sheet', |
|||
route: '/shop-payment-methods', |
|||
category: 'Cart & Checkout', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-payment-methods.png', |
|||
description: 'Bottom sheet modal "Payment methos" with Google Pay (selected), PayPal, and Master Card options, plus "Purchase $24.00" CTA button.', |
|||
scenarios: [ |
|||
{ label: 'Google Pay Selected (Default)', route: '/shop-payment-methods', description: 'Payment methods modal sheet (375×814).' }, |
|||
{ label: 'Complete Purchase -> Payment Result', route: '/shop-payresult', description: 'Click Purchase button to view payment receipt.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-payresult', |
|||
figmaNodeId: '4162:11664', |
|||
figmaName: 'shop-payresult', |
|||
title: 'Payment Result (Success Receipt)', |
|||
route: '/shop-payresult', |
|||
category: 'Cart & Checkout', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-payresult.png', |
|||
description: 'Payment Successful screen with 3D shopping basket & green checkmark, Total Paid ($70.50), Order Code (ORD-28465), PayPal, Mar 15,2025 | 9:41 PM, track Order, and Continue Shoping.', |
|||
scenarios: [ |
|||
{ label: 'Payment Success Receipt', route: '/shop-payresult', description: 'Confirmed order receipt (375×814).' }, |
|||
{ label: 'Track Order -> Order Details', route: '/shop-order-detail', description: 'Click track Order to inspect shipment progress.' }, |
|||
], |
|||
}, |
|||
|
|||
// 4. Orders & Support
|
|||
{ |
|||
id: 'shop-orders', |
|||
figmaNodeId: '4175:9811', |
|||
figmaName: 'shop-orders', |
|||
title: 'Orders List', |
|||
route: '/shop-orders', |
|||
category: 'Orders & Support', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-orders.png', |
|||
description: 'Orders list page with segmented filter tabs (Current 2, Delivered 5, Canceled 0) and 2 order summary cards with item thumbnails, delivery status badges, and View Details buttons.', |
|||
scenarios: [ |
|||
{ label: 'Current Orders Tab (Default)', route: '/shop-orders', description: 'Current orders tab active with 2 orders (375×814).' }, |
|||
{ label: 'Open Order Details', route: '/shop-order-detail', description: 'Click View Details on any order card.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-order-detail', |
|||
figmaNodeId: '4175:10421', |
|||
figmaName: 'shop-order detail', |
|||
title: 'Order Details (Multi-Shipment Stepper)', |
|||
route: '/shop-order-detail', |
|||
category: 'Orders & Support', |
|||
width: 375, |
|||
height: 1061, |
|||
refImage: '/assets/images/references/ref-shop-order-detail.png', |
|||
description: 'Detailed order view for ORD-28465 showing 3 shipment cards (Packed, Delivered, Shiping) with 4-step progress bars (Order, Packed, Shiping, Delivery) and Order support CTA.', |
|||
scenarios: [ |
|||
{ label: 'All 3 Shipment States (Default)', route: '/shop-order-detail', description: 'Packed, Delivered, and Shiping shipment cards (375×1061).' }, |
|||
{ label: 'Request Order Support', route: '/shop-support', description: 'Click Order support button at bottom.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-support', |
|||
figmaNodeId: '4177:11244', |
|||
figmaName: 'shop-support', |
|||
title: 'Order Support Request Form', |
|||
route: '/shop-support', |
|||
category: 'Orders & Support', |
|||
width: 375, |
|||
height: 1061, |
|||
refImage: '/assets/images/references/ref-shop-support.png', |
|||
description: 'Support form with product summary, Order support info banner, 6 Request Subject* tiles (Counterfeit Item selected), Description* textarea, Upload Image dropzone, and Submit Order CTA.', |
|||
scenarios: [ |
|||
{ label: 'Counterfeit Item Selected (Default)', route: '/shop-support', description: 'Exact Figma support form state (375×1061).' }, |
|||
], |
|||
}, |
|||
|
|||
// 5. Account & Settings
|
|||
{ |
|||
id: 'shop-account', |
|||
figmaNodeId: '4214:345', |
|||
figmaName: 'shop-category (Account)', |
|||
title: 'Shop Account Overview', |
|||
route: '/shop-account', |
|||
aliases: ['/shop-category-4214-345'], |
|||
category: 'Account & Settings', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-account.png', |
|||
description: 'User account dashboard for "Habib shoper" (09102036523) with 3 order status counters (In Progress, Delivered, Returned), 7 settings rows (Accunt detail, Adresses, Language, Notifications, Bookmarks, FAQ, Support & Requests), Sign out button, and active Account nav tab.', |
|||
scenarios: [ |
|||
{ label: 'Default Account Overview', route: '/shop-account', description: 'Habib shoper profile & order counters (375×814).' }, |
|||
{ label: 'Account Details', route: '/provider-requst', description: 'Click Accunt detail row to edit profile details.' }, |
|||
{ label: 'Manage Addresses', route: '/shop-adreess', description: 'Click Adresses row to manage saved addresses.' }, |
|||
{ label: 'Open Language & Provider Hub', route: '/language-setting', description: 'Click Language row.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'shop-adreess', |
|||
figmaNodeId: '4182:13316', |
|||
figmaName: 'shop-adreess', |
|||
title: 'My Addresses', |
|||
route: '/shop-adreess', |
|||
category: 'Account & Settings', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-shop-adreess.png', |
|||
description: 'Saved addresses screen ("My Adresses") with Ali Ghaderi (selected) and Sina Sajjadi cards featuring delete/edit icon buttons, plus "Add New adress" row.', |
|||
scenarios: [ |
|||
{ label: 'Default Saved Addresses', route: '/shop-adreess', description: 'Ali Ghaderi & Sina Sajjadi addresses (375×814).' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'provider-requst', |
|||
figmaNodeId: '4220:13695', |
|||
figmaName: 'cs (Accunt detail)', |
|||
title: 'Account Detail', |
|||
route: '/provider-requst', |
|||
category: 'Account & Settings', |
|||
width: 375, |
|||
height: 814, |
|||
refImage: '/assets/images/references/ref-provider-requst.png', |
|||
description: 'Account detail form ("Accunt detail") with avatar & camera badge, email subtitle, Full Name*, Date of Birth*, Whatsapp Number*, Email input, and Submit button.', |
|||
scenarios: [ |
|||
{ label: 'Account Detail Form (Default)', route: '/provider-requst', description: 'Account detail screen (375×814).' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'language-setting', |
|||
figmaNodeId: '4214:11018', |
|||
figmaName: 'language-setting', |
|||
title: 'Language Setting & Provider Status', |
|||
route: '/language-setting', |
|||
category: 'Account & Settings', |
|||
width: 375, |
|||
height: 813, |
|||
refImage: '/assets/images/references/ref-language-setting.png', |
|||
description: 'Profile & language overview for "Ahd Art" (Ahdart14@gmail.com) with Pending/rejected provider requests, Donate Habib green banner, 21 Habib Coins, Apply as Provider, My Wallet ($24), and Location/Language rows.', |
|||
scenarios: [ |
|||
{ label: 'Default Language & Provider Overview', route: '/language-setting', description: 'Ahd Art profile & settings (375×813).' }, |
|||
], |
|||
}, |
|||
|
|||
// 6. Standalone Component / Icon / Text Nodes
|
|||
{ |
|||
id: 'node-boxicons-user-filled', |
|||
figmaNodeId: '4128:14530', |
|||
figmaName: 'boxicons:user-filled', |
|||
title: 'Standalone Node: boxicons:user-filled', |
|||
route: '/node/boxicons-user-filled', |
|||
category: 'Standalone Nodes', |
|||
width: 28, |
|||
height: 28, |
|||
refImage: '/assets/images/references/ref-boxicons-user-filled.png', |
|||
description: 'Standalone 28×28 user icon frame extracted at top-level of data.md.', |
|||
scenarios: [ |
|||
{ label: 'Exact 28×28 Node', route: '/node/boxicons-user-filled', description: 'View standalone 28×28 node.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'node-frame-4175-10154', |
|||
figmaNodeId: '4175:10154', |
|||
figmaName: 'Frame 2095586758 (Packed)', |
|||
title: 'Standalone Node: Packed Step Icon', |
|||
route: '/node/frame-4175-10154', |
|||
category: 'Standalone Nodes', |
|||
width: 42, |
|||
height: 39.15, |
|||
refImage: '/assets/images/references/ref-frame-4175-10154.png', |
|||
description: 'Standalone 42×39.15 "Packed" step icon and label frame.', |
|||
scenarios: [ |
|||
{ label: 'Exact 42×39.15 Node', route: '/node/frame-4175-10154', description: 'View standalone Packed step node.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'node-frame-4175-10157', |
|||
figmaNodeId: '4175:10157', |
|||
figmaName: 'Frame 2095586759 (Delivery)', |
|||
title: 'Standalone Node: Delivery Step Icon', |
|||
route: '/node/frame-4175-10157', |
|||
category: 'Standalone Nodes', |
|||
width: 48, |
|||
height: 39.15, |
|||
refImage: '/assets/images/references/ref-frame-4175-10157.png', |
|||
description: 'Standalone 48×39.15 "Delivery" step icon and label frame.', |
|||
scenarios: [ |
|||
{ label: 'Exact 48×39.15 Node', route: '/node/frame-4175-10157', description: 'View standalone Delivery step node.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'node-frame-4175-10160', |
|||
figmaNodeId: '4175:10160', |
|||
figmaName: 'Frame 2095586760 (Shiping)', |
|||
title: 'Standalone Node: Shiping Step Icon', |
|||
route: '/node/frame-4175-10160', |
|||
category: 'Standalone Nodes', |
|||
width: 48, |
|||
height: 40, |
|||
refImage: '/assets/images/references/ref-frame-4175-10160.png', |
|||
description: 'Standalone 48×40 "Shiping" step icon and label frame.', |
|||
scenarios: [ |
|||
{ label: 'Exact 48×40 Node', route: '/node/frame-4175-10160', description: 'View standalone Shiping step node.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'node-group-4175-10166', |
|||
figmaNodeId: '4175:10166', |
|||
figmaName: 'Group 1597880489 (Order)', |
|||
title: 'Standalone Node: Order Step Icon', |
|||
route: '/node/group-4175-10166', |
|||
category: 'Standalone Nodes', |
|||
width: 48, |
|||
height: 40, |
|||
refImage: '/assets/images/references/ref-group-4175-10166.png', |
|||
description: 'Standalone 48×40 "Order" step icon and label group.', |
|||
scenarios: [ |
|||
{ label: 'Exact 48×40 Node', route: '/node/group-4175-10166', description: 'View standalone Order step node.' }, |
|||
], |
|||
}, |
|||
{ |
|||
id: 'node-shop-home-text', |
|||
figmaNodeId: '4182:13493', |
|||
figmaName: 'shop-home (TEXT)', |
|||
title: 'Standalone Node: "shop-home" Label', |
|||
route: '/node/shop-home-text', |
|||
category: 'Standalone Nodes', |
|||
width: 62, |
|||
height: 18, |
|||
description: 'Standalone 62×18 "shop-home" text node (Segoe UI Semibold 12px #000000).', |
|||
scenarios: [ |
|||
{ label: 'Exact 62×18 Text Node', route: '/node/shop-home-text', description: 'View standalone shop-home text node.' }, |
|||
], |
|||
}, |
|||
]; |
|||
1388
src/lib/cookies.ts
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,602 +0,0 @@ |
|||
import React, { useState, useRef, useEffect } from 'react'; |
|||
import type { ScreenRouteEntry } from '../../data/routesRegistry'; |
|||
|
|||
interface PixelVerificationModalProps { |
|||
entry: ScreenRouteEntry; |
|||
onClose: () => void; |
|||
onSelectEntry?: (entry: ScreenRouteEntry) => void; |
|||
allEntries?: ScreenRouteEntry[]; |
|||
} |
|||
|
|||
type CompareMode = 'side-by-side' | 'onion-skin' | 'difference'; |
|||
|
|||
export const PixelVerificationModal: React.FC<PixelVerificationModalProps> = ({ |
|||
entry, |
|||
onClose, |
|||
onSelectEntry, |
|||
allEntries = [], |
|||
}) => { |
|||
const [mode, setMode] = useState<CompareMode>('side-by-side'); |
|||
const [overlayOpacity, setOverlayOpacity] = useState<number>(0.5); |
|||
const [scenarioOverrides, setScenarioOverrides] = useState<Record<string, string>>({}); |
|||
const [showGrid, setShowGrid] = useState<boolean>(false); |
|||
const viewportRef = useRef<HTMLDivElement>(null); |
|||
|
|||
const activeScenarioRoute = scenarioOverrides[entry.id] ?? entry.route; |
|||
const setActiveScenarioRoute = (route: string) => { |
|||
setScenarioOverrides((prev) => ({ ...prev, [entry.id]: route })); |
|||
}; |
|||
|
|||
useEffect(() => { |
|||
if (viewportRef.current) { |
|||
viewportRef.current.scrollTop = 0; |
|||
} |
|||
}, [entry.id]); |
|||
|
|||
const currentIndex = allEntries.findIndex((item) => item.id === entry.id); |
|||
const prevEntry = currentIndex > 0 ? allEntries[currentIndex - 1] : null; |
|||
const nextEntry = |
|||
currentIndex >= 0 && currentIndex < allEntries.length - 1 |
|||
? allEntries[currentIndex + 1] |
|||
: null; |
|||
|
|||
const iframeSrc = `${activeScenarioRoute}${activeScenarioRoute.includes('?') ? '&' : '?'}bare=1`; |
|||
|
|||
return ( |
|||
<div |
|||
style={{ |
|||
position: 'fixed', |
|||
inset: 0, |
|||
zIndex: 9999, |
|||
backgroundColor: 'rgba(10, 15, 13, 0.92)', |
|||
backdropFilter: 'blur(6px)', |
|||
display: 'flex', |
|||
flexDirection: 'column', |
|||
color: '#ffffff', |
|||
fontFamily: "'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif", |
|||
}} |
|||
> |
|||
{/* Top Toolbar */} |
|||
<div |
|||
style={{ |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
justifyContent: 'space-between', |
|||
padding: '10px var(--page-px, 16px)', |
|||
backgroundColor: '#111916', |
|||
borderBottom: '1px solid rgba(255, 255, 255, 0.12)', |
|||
flexWrap: 'wrap', |
|||
gap: 10, |
|||
maxHeight: '42vh', |
|||
overflowY: 'auto', |
|||
}} |
|||
> |
|||
<div style={{ display: 'flex', alignItems: 'center', gap: 10, flexWrap: 'wrap', minWidth: 0 }}> |
|||
<span |
|||
style={{ |
|||
backgroundColor: '#00714f', |
|||
color: '#ffffff', |
|||
fontSize: 12, |
|||
fontWeight: 600, |
|||
padding: '4px 10px', |
|||
borderRadius: 6, |
|||
flexShrink: 0, |
|||
}} |
|||
> |
|||
Node {entry.figmaNodeId} |
|||
</span> |
|||
<div style={{ minWidth: 0 }}> |
|||
<div style={{ fontSize: 15, fontWeight: 700, lineHeight: '20px', wordBreak: 'break-word' }}> |
|||
{entry.title}{' '} |
|||
<span style={{ color: '#9ca3af', fontWeight: 400, fontSize: 12 }}> |
|||
({entry.figmaName} — {entry.width}×{entry.height}px) |
|||
</span> |
|||
</div> |
|||
<div style={{ fontSize: 12, color: '#9ca3af', marginTop: 2, wordBreak: 'break-all' }}> |
|||
Route:{' '} |
|||
<a |
|||
href={activeScenarioRoute} |
|||
target="_blank" |
|||
rel="noreferrer" |
|||
style={{ color: '#38ae8a', textDecoration: 'underline' }} |
|||
> |
|||
<code style={{ color: '#38ae8a' }}>{activeScenarioRoute}</code> |
|||
</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
{/* Mode Controls */} |
|||
<div style={{ display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' }}> |
|||
<div |
|||
style={{ |
|||
display: 'inline-flex', |
|||
flexWrap: 'wrap', |
|||
backgroundColor: '#1c2823', |
|||
padding: 3, |
|||
borderRadius: 8, |
|||
border: '1px solid rgba(255,255,255,0.1)', |
|||
}} |
|||
> |
|||
{( |
|||
[ |
|||
{ id: 'side-by-side', label: 'Side-by-Side' }, |
|||
{ id: 'onion-skin', label: 'Onion Skin Overlay' }, |
|||
{ id: 'difference', label: 'Pixel Difference' }, |
|||
] as { id: CompareMode; label: string }[] |
|||
).map((tab) => ( |
|||
<button |
|||
key={tab.id} |
|||
type="button" |
|||
onClick={() => setMode(tab.id)} |
|||
style={{ |
|||
padding: '6px 12px', |
|||
fontSize: 12, |
|||
fontWeight: 600, |
|||
borderRadius: 6, |
|||
border: 'none', |
|||
cursor: 'pointer', |
|||
backgroundColor: mode === tab.id ? '#00714f' : 'transparent', |
|||
color: mode === tab.id ? '#ffffff' : '#d1d5db', |
|||
}} |
|||
> |
|||
{tab.label} |
|||
</button> |
|||
))} |
|||
</div> |
|||
|
|||
{mode === 'onion-skin' && ( |
|||
<div |
|||
style={{ |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
gap: 8, |
|||
backgroundColor: '#1c2823', |
|||
padding: '6px 12px', |
|||
borderRadius: 8, |
|||
}} |
|||
> |
|||
<span style={{ fontSize: 12, color: '#d1d5db' }}> |
|||
Figma Opacity: {Math.round(overlayOpacity * 100)}% |
|||
</span> |
|||
<input |
|||
type="range" |
|||
min={0} |
|||
max={1} |
|||
step={0.05} |
|||
value={overlayOpacity} |
|||
onChange={(e) => setOverlayOpacity(parseFloat(e.target.value))} |
|||
style={{ width: 100, accentColor: '#00714f', cursor: 'pointer' }} |
|||
/> |
|||
</div> |
|||
)} |
|||
|
|||
<button |
|||
type="button" |
|||
onClick={() => setShowGrid((prev) => !prev)} |
|||
style={{ |
|||
padding: '6px 12px', |
|||
fontSize: 12, |
|||
fontWeight: 600, |
|||
borderRadius: 8, |
|||
border: '1px solid rgba(255,255,255,0.15)', |
|||
backgroundColor: showGrid ? '#00714f' : '#1c2823', |
|||
color: '#ffffff', |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
{showGrid ? 'Hide 8px Grid' : 'Show 8px Grid'} |
|||
</button> |
|||
|
|||
<div |
|||
style={{ |
|||
display: 'inline-flex', |
|||
backgroundColor: '#1c2823', |
|||
padding: 3, |
|||
borderRadius: 8, |
|||
border: '1px solid rgba(255,255,255,0.1)', |
|||
gap: 2, |
|||
}} |
|||
> |
|||
<button |
|||
type="button" |
|||
onClick={() => { |
|||
if (viewportRef.current) viewportRef.current.scrollTop = 0; |
|||
}} |
|||
style={{ |
|||
padding: '4px 8px', |
|||
fontSize: 11, |
|||
fontWeight: 600, |
|||
borderRadius: 5, |
|||
border: 'none', |
|||
backgroundColor: '#25352f', |
|||
color: '#d1d5db', |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
↑ Top |
|||
</button> |
|||
<button |
|||
type="button" |
|||
onClick={() => { |
|||
if (viewportRef.current) { |
|||
viewportRef.current.scrollTop = Math.max( |
|||
0, |
|||
(viewportRef.current.scrollHeight - viewportRef.current.clientHeight) / 2 |
|||
); |
|||
} |
|||
}} |
|||
style={{ |
|||
padding: '4px 8px', |
|||
fontSize: 11, |
|||
fontWeight: 600, |
|||
borderRadius: 5, |
|||
border: 'none', |
|||
backgroundColor: '#25352f', |
|||
color: '#d1d5db', |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
↕ Mid |
|||
</button> |
|||
<button |
|||
type="button" |
|||
onClick={() => { |
|||
if (viewportRef.current) { |
|||
viewportRef.current.scrollTop = viewportRef.current.scrollHeight; |
|||
} |
|||
}} |
|||
style={{ |
|||
padding: '4px 8px', |
|||
fontSize: 11, |
|||
fontWeight: 600, |
|||
borderRadius: 5, |
|||
border: 'none', |
|||
backgroundColor: '#25352f', |
|||
color: '#d1d5db', |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
↓ Bottom |
|||
</button> |
|||
</div> |
|||
|
|||
{prevEntry && onSelectEntry && ( |
|||
<button |
|||
type="button" |
|||
onClick={() => { |
|||
setActiveScenarioRoute(prevEntry.route); |
|||
onSelectEntry(prevEntry); |
|||
}} |
|||
style={{ |
|||
padding: '6px 12px', |
|||
fontSize: 12, |
|||
borderRadius: 8, |
|||
border: '1px solid rgba(255,255,255,0.15)', |
|||
backgroundColor: '#1c2823', |
|||
color: '#ffffff', |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
← Prev |
|||
</button> |
|||
)} |
|||
|
|||
{nextEntry && onSelectEntry && ( |
|||
<button |
|||
type="button" |
|||
onClick={() => { |
|||
setActiveScenarioRoute(nextEntry.route); |
|||
onSelectEntry(nextEntry); |
|||
}} |
|||
style={{ |
|||
padding: '6px 12px', |
|||
fontSize: 12, |
|||
borderRadius: 8, |
|||
border: '1px solid rgba(255,255,255,0.15)', |
|||
backgroundColor: '#1c2823', |
|||
color: '#ffffff', |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
Next → |
|||
</button> |
|||
)} |
|||
|
|||
<a |
|||
href={activeScenarioRoute} |
|||
target="_blank" |
|||
rel="noreferrer" |
|||
style={{ |
|||
padding: '6px 12px', |
|||
fontSize: 12, |
|||
fontWeight: 600, |
|||
borderRadius: 8, |
|||
backgroundColor: '#25352f', |
|||
color: '#38ae8a', |
|||
textDecoration: 'none', |
|||
border: '1px solid rgba(56, 174, 138, 0.35)', |
|||
}} |
|||
> |
|||
Open Route ↗ |
|||
</a> |
|||
|
|||
<button |
|||
type="button" |
|||
onClick={onClose} |
|||
style={{ |
|||
padding: '6px 14px', |
|||
fontSize: 12, |
|||
fontWeight: 700, |
|||
borderRadius: 8, |
|||
border: 'none', |
|||
backgroundColor: '#dc2626', |
|||
color: '#ffffff', |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
Close ✕ |
|||
</button> |
|||
</div> |
|||
</div> |
|||
|
|||
{/* Scenarios Bar */} |
|||
{entry.scenarios.length > 0 && ( |
|||
<div |
|||
style={{ |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
gap: 8, |
|||
padding: '8px 24px', |
|||
backgroundColor: '#16201c', |
|||
borderBottom: '1px solid rgba(255,255,255,0.08)', |
|||
overflowX: 'auto', |
|||
}} |
|||
> |
|||
<span style={{ fontSize: 12, color: '#9ca3af', fontWeight: 600, marginRight: 4 }}> |
|||
Scenarios: |
|||
</span> |
|||
{entry.scenarios.map((sc, idx) => { |
|||
const isSelected = activeScenarioRoute === sc.route; |
|||
return ( |
|||
<button |
|||
key={`${sc.route}-${idx}`} |
|||
type="button" |
|||
onClick={() => setActiveScenarioRoute(sc.route)} |
|||
title={sc.description} |
|||
style={{ |
|||
padding: '4px 10px', |
|||
fontSize: 12, |
|||
borderRadius: 6, |
|||
border: isSelected |
|||
? '1px solid #38ae8a' |
|||
: '1px solid rgba(255,255,255,0.12)', |
|||
backgroundColor: isSelected ? 'rgba(0, 113, 79, 0.35)' : '#1c2823', |
|||
color: isSelected ? '#ffffff' : '#d1d5db', |
|||
cursor: 'pointer', |
|||
whiteSpace: 'nowrap', |
|||
}} |
|||
> |
|||
{sc.label} ({sc.route}) |
|||
</button> |
|||
); |
|||
})} |
|||
</div> |
|||
)} |
|||
|
|||
{/* Main Comparison Viewport */} |
|||
<div |
|||
id="pixel-comparison-viewport" |
|||
ref={viewportRef} |
|||
style={{ |
|||
flex: 1, |
|||
overflow: 'auto', |
|||
padding: '20px var(--page-px, 16px)', |
|||
}} |
|||
> |
|||
<div |
|||
style={{ |
|||
display: 'flex', |
|||
flexWrap: 'wrap', |
|||
justifyContent: 'center', |
|||
alignItems: 'flex-start', |
|||
gap: 28, |
|||
minWidth: 'min-content', |
|||
}} |
|||
> |
|||
{mode === 'side-by-side' ? ( |
|||
<> |
|||
{/* Live Implementation */} |
|||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}> |
|||
<div |
|||
style={{ |
|||
marginBottom: 10, |
|||
fontSize: 13, |
|||
fontWeight: 600, |
|||
color: '#38ae8a', |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
gap: 8, |
|||
}} |
|||
> |
|||
<span>Live React Implementation ({entry.width}×{entry.height}px)</span> |
|||
</div> |
|||
<div |
|||
style={{ |
|||
position: 'relative', |
|||
width: entry.width, |
|||
height: Math.ceil(entry.height), |
|||
backgroundColor: entry.width < 100 ? '#ffffff' : '#f8f8f8', |
|||
boxShadow: '0 12px 36px rgba(0,0,0,0.45)', |
|||
outline: '1px solid rgba(255,255,255,0.2)', |
|||
overflow: 'hidden', |
|||
}} |
|||
> |
|||
<iframe |
|||
title={`Live ${entry.title}`} |
|||
src={iframeSrc} |
|||
style={{ |
|||
width: entry.width, |
|||
height: Math.ceil(entry.height), |
|||
border: 'none', |
|||
display: 'block', |
|||
backgroundColor: 'transparent', |
|||
}} |
|||
/> |
|||
{showGrid && ( |
|||
<div |
|||
style={{ |
|||
position: 'absolute', |
|||
inset: 0, |
|||
pointerEvents: 'none', |
|||
backgroundImage: |
|||
'linear-gradient(to right, rgba(255,0,128,0.15) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,0,128,0.15) 1px, transparent 1px)', |
|||
backgroundSize: '8px 8px', |
|||
}} |
|||
/> |
|||
)} |
|||
</div> |
|||
</div> |
|||
|
|||
{/* Figma Reference PNG */} |
|||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}> |
|||
<div |
|||
style={{ |
|||
marginBottom: 10, |
|||
fontSize: 13, |
|||
fontWeight: 600, |
|||
color: '#f59e0b', |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
gap: 8, |
|||
}} |
|||
> |
|||
<span>Figma Extracted Reference PNG ({entry.width}×{entry.height}px)</span> |
|||
</div> |
|||
<div |
|||
style={{ |
|||
position: 'relative', |
|||
width: entry.width, |
|||
height: Math.ceil(entry.height), |
|||
backgroundColor: entry.width < 100 ? '#ffffff' : '#f8f8f8', |
|||
boxShadow: '0 12px 36px rgba(0,0,0,0.45)', |
|||
outline: '1px solid rgba(245, 158, 11, 0.35)', |
|||
overflow: 'hidden', |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
justifyContent: 'center', |
|||
}} |
|||
> |
|||
{entry.refImage ? ( |
|||
<img |
|||
src={entry.refImage} |
|||
alt={`Figma Reference ${entry.title}`} |
|||
style={{ |
|||
width: entry.width, |
|||
height: entry.height, |
|||
display: 'block', |
|||
objectFit: 'contain', |
|||
}} |
|||
/> |
|||
) : ( |
|||
<div |
|||
style={{ |
|||
fontSize: 11, |
|||
color: '#374151', |
|||
textAlign: 'center', |
|||
padding: 4, |
|||
}} |
|||
> |
|||
Pure TEXT node (no PNG exported in archive) |
|||
</div> |
|||
)} |
|||
{showGrid && ( |
|||
<div |
|||
style={{ |
|||
position: 'absolute', |
|||
inset: 0, |
|||
pointerEvents: 'none', |
|||
backgroundImage: |
|||
'linear-gradient(to right, rgba(255,0,128,0.15) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,0,128,0.15) 1px, transparent 1px)', |
|||
backgroundSize: '8px 8px', |
|||
}} |
|||
/> |
|||
)} |
|||
</div> |
|||
</div> |
|||
</> |
|||
) : ( |
|||
/* Onion-Skin or Difference Overlay */ |
|||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}> |
|||
<div |
|||
style={{ |
|||
marginBottom: 10, |
|||
fontSize: 13, |
|||
fontWeight: 600, |
|||
color: '#38ae8a', |
|||
}} |
|||
> |
|||
{mode === 'onion-skin' |
|||
? `Onion-Skin Overlay (Figma PNG Opacity: ${Math.round(overlayOpacity * 100)}%)` |
|||
: 'Pixel Difference Mode (Identical pixels render black)'} |
|||
</div> |
|||
<div |
|||
style={{ |
|||
position: 'relative', |
|||
width: entry.width, |
|||
height: Math.ceil(entry.height), |
|||
backgroundColor: entry.width < 100 ? '#ffffff' : '#f8f8f8', |
|||
boxShadow: '0 12px 36px rgba(0,0,0,0.45)', |
|||
outline: '1px solid rgba(255,255,255,0.25)', |
|||
overflow: 'hidden', |
|||
}} |
|||
> |
|||
<iframe |
|||
title={`Live ${entry.title}`} |
|||
src={iframeSrc} |
|||
style={{ |
|||
width: entry.width, |
|||
height: Math.ceil(entry.height), |
|||
border: 'none', |
|||
display: 'block', |
|||
backgroundColor: 'transparent', |
|||
}} |
|||
/> |
|||
{entry.refImage && ( |
|||
<img |
|||
src={entry.refImage} |
|||
alt={`Figma Overlay ${entry.title}`} |
|||
style={{ |
|||
position: 'absolute', |
|||
left: 0, |
|||
top: 0, |
|||
width: entry.width, |
|||
height: entry.height, |
|||
pointerEvents: 'none', |
|||
opacity: mode === 'onion-skin' ? overlayOpacity : 1, |
|||
mixBlendMode: mode === 'difference' ? 'difference' : 'normal', |
|||
}} |
|||
/> |
|||
)} |
|||
{showGrid && ( |
|||
<div |
|||
style={{ |
|||
position: 'absolute', |
|||
inset: 0, |
|||
pointerEvents: 'none', |
|||
backgroundImage: |
|||
'linear-gradient(to right, rgba(255,0,128,0.15) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,0,128,0.15) 1px, transparent 1px)', |
|||
backgroundSize: '8px 8px', |
|||
}} |
|||
/> |
|||
)} |
|||
</div> |
|||
</div> |
|||
)} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
); |
|||
}; |
|||
|
|||
export default PixelVerificationModal; |
|||
2207
src/pages/test/SellerChatButtonTestLab.tsx
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,576 +0,0 @@ |
|||
import React, { useState, useMemo } from 'react'; |
|||
import { Link } from 'react-router-dom'; |
|||
import { |
|||
ALL_IMPLEMENTED_ROUTES, |
|||
type ScreenRouteEntry, |
|||
} from '../../data/routesRegistry'; |
|||
import { PixelVerificationModal } from './PixelVerificationModal'; |
|||
|
|||
const CATEGORIES: Array<'All' | ScreenRouteEntry['category']> = [ |
|||
'All', |
|||
'Home & Discovery', |
|||
'Product & Store', |
|||
'Cart & Checkout', |
|||
'Orders & Support', |
|||
'Account & Settings', |
|||
'Standalone Nodes', |
|||
]; |
|||
|
|||
export const TestDirectoryPage: React.FC = () => { |
|||
const [selectedCategory, setSelectedCategory] = useState<'All' | ScreenRouteEntry['category']>('All'); |
|||
const [searchQuery, setSearchQuery] = useState<string>(''); |
|||
const [inspectingEntry, setInspectingEntry] = useState<ScreenRouteEntry | null>(null); |
|||
|
|||
const filteredRoutes = useMemo(() => { |
|||
return ALL_IMPLEMENTED_ROUTES.filter((entry) => { |
|||
const matchesCat = |
|||
selectedCategory === 'All' || entry.category === selectedCategory; |
|||
const q = searchQuery.trim().toLowerCase(); |
|||
if (!q) return matchesCat; |
|||
return ( |
|||
matchesCat && |
|||
(entry.title.toLowerCase().includes(q) || |
|||
entry.figmaName.toLowerCase().includes(q) || |
|||
entry.figmaNodeId.toLowerCase().includes(q) || |
|||
entry.route.toLowerCase().includes(q) || |
|||
entry.description.toLowerCase().includes(q) || |
|||
entry.scenarios.some((s) => s.label.toLowerCase().includes(q))) |
|||
); |
|||
}); |
|||
}, [selectedCategory, searchQuery]); |
|||
|
|||
const fullScreenCount = ALL_IMPLEMENTED_ROUTES.filter( |
|||
(r) => r.category !== 'Standalone Nodes' |
|||
).length; |
|||
const standaloneCount = ALL_IMPLEMENTED_ROUTES.filter( |
|||
(r) => r.category === 'Standalone Nodes' |
|||
).length; |
|||
const totalScenarios = ALL_IMPLEMENTED_ROUTES.reduce( |
|||
(acc, r) => acc + r.scenarios.length, |
|||
0 |
|||
); |
|||
|
|||
return ( |
|||
<div |
|||
style={{ |
|||
minHeight: '100vh', |
|||
backgroundColor: '#0e1512', |
|||
color: '#f3f4f6', |
|||
fontFamily: "'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif", |
|||
paddingBottom: 64, |
|||
}} |
|||
> |
|||
{/* Header Banner */} |
|||
<header |
|||
style={{ |
|||
background: 'linear-gradient(135deg, #004d36 0%, #00714f 55%, #0a2e22 100%)', |
|||
borderBottom: '1px solid rgba(255,255,255,0.12)', |
|||
padding: '28px var(--page-px, 16px)', |
|||
}} |
|||
> |
|||
<div style={{ maxWidth: 1280, margin: '0 auto' }}> |
|||
<div |
|||
style={{ |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
justifyContent: 'space-between', |
|||
flexWrap: 'wrap', |
|||
gap: 16, |
|||
}} |
|||
> |
|||
<div style={{ minWidth: 0, flex: '1 1 260px' }}> |
|||
<div |
|||
style={{ |
|||
display: 'inline-flex', |
|||
alignItems: 'center', |
|||
gap: 8, |
|||
backgroundColor: 'rgba(0,0,0,0.28)', |
|||
padding: '4px 12px', |
|||
borderRadius: 999, |
|||
fontSize: 12, |
|||
fontWeight: 600, |
|||
color: '#a7f3d0', |
|||
marginBottom: 10, |
|||
maxWidth: '100%', |
|||
}} |
|||
> |
|||
<span style={{ wordBreak: 'break-word' }}> |
|||
Habib Shop — Figma Design Extraction QA & Test Hub |
|||
</span> |
|||
</div> |
|||
<h1 |
|||
style={{ |
|||
margin: 0, |
|||
fontSize: 'clamp(20px, 4.5vw, 28px)', |
|||
fontWeight: 700, |
|||
letterSpacing: '-0.02em', |
|||
color: '#ffffff', |
|||
wordBreak: 'break-word', |
|||
}} |
|||
> |
|||
Implemented Pages, Scenarios & Pixel Verification (`/test`) |
|||
</h1> |
|||
<p |
|||
style={{ |
|||
margin: '8px 0 0', |
|||
fontSize: 14, |
|||
color: '#d1fae5', |
|||
maxWidth: 780, |
|||
lineHeight: '20px', |
|||
}} |
|||
> |
|||
Complete directory of all {ALL_IMPLEMENTED_ROUTES.length} top-level Figma nodes from{' '} |
|||
<code>data.md</code> ({fullScreenCount} full-screen mobile pages + {standaloneCount}{' '} |
|||
standalone component/icon/text nodes) and {totalScenarios} interactive scenarios. |
|||
</p> |
|||
</div> |
|||
|
|||
<div style={{ display: 'flex', gap: 10, flexWrap: 'wrap' }}> |
|||
<Link |
|||
to="/shop-home" |
|||
style={{ |
|||
padding: '10px 18px', |
|||
borderRadius: 10, |
|||
backgroundColor: '#ffffff', |
|||
color: '#00714f', |
|||
fontSize: 13, |
|||
fontWeight: 700, |
|||
textDecoration: 'none', |
|||
boxShadow: '0 4px 14px rgba(0,0,0,0.25)', |
|||
}} |
|||
> |
|||
Launch App (`/shop-home`) → |
|||
</Link> |
|||
<button |
|||
type="button" |
|||
onClick={() => setInspectingEntry(ALL_IMPLEMENTED_ROUTES[0])} |
|||
style={{ |
|||
padding: '10px 18px', |
|||
borderRadius: 10, |
|||
backgroundColor: 'rgba(0,0,0,0.35)', |
|||
color: '#ffffff', |
|||
border: '1px solid rgba(255,255,255,0.25)', |
|||
fontSize: 13, |
|||
fontWeight: 600, |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
Open Pixel Inspector |
|||
</button> |
|||
</div> |
|||
</div> |
|||
|
|||
{/* Summary Metrics */} |
|||
<div |
|||
style={{ |
|||
display: 'grid', |
|||
gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 160px), 1fr))', |
|||
gap: 12, |
|||
marginTop: 24, |
|||
}} |
|||
> |
|||
{[ |
|||
{ label: 'Total Top-Level Figma Nodes', value: ALL_IMPLEMENTED_ROUTES.length }, |
|||
{ label: 'Full-Screen Mobile Pages (375px)', value: fullScreenCount }, |
|||
{ label: 'Standalone Component Nodes', value: standaloneCount }, |
|||
{ label: 'Interactive Scenarios Mapped', value: totalScenarios }, |
|||
].map((stat) => ( |
|||
<div |
|||
key={stat.label} |
|||
style={{ |
|||
backgroundColor: 'rgba(0, 0, 0, 0.28)', |
|||
border: '1px solid rgba(255, 255, 255, 0.14)', |
|||
borderRadius: 10, |
|||
padding: '12px 16px', |
|||
}} |
|||
> |
|||
<div style={{ fontSize: 22, fontWeight: 700, color: '#ffffff' }}> |
|||
{stat.value} |
|||
</div> |
|||
<div style={{ fontSize: 12, color: '#a7f3d0', marginTop: 2 }}> |
|||
{stat.label} |
|||
</div> |
|||
</div> |
|||
))} |
|||
</div> |
|||
</div> |
|||
</header> |
|||
|
|||
{/* Filter & Search Controls */} |
|||
<div |
|||
style={{ |
|||
maxWidth: 1280, |
|||
margin: '24px auto 0', |
|||
padding: '0 var(--page-px, 16px)', |
|||
}} |
|||
> |
|||
<div |
|||
style={{ |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
justifyContent: 'space-between', |
|||
flexWrap: 'wrap', |
|||
gap: 14, |
|||
backgroundColor: '#15201b', |
|||
padding: 14, |
|||
borderRadius: 12, |
|||
border: '1px solid rgba(255,255,255,0.08)', |
|||
}} |
|||
> |
|||
{/* Category Pills */} |
|||
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}> |
|||
{CATEGORIES.map((category) => { |
|||
const active = selectedCategory === category; |
|||
const count = |
|||
category === 'All' |
|||
? ALL_IMPLEMENTED_ROUTES.length |
|||
: ALL_IMPLEMENTED_ROUTES.filter((r) => r.category === category).length; |
|||
return ( |
|||
<button |
|||
key={category} |
|||
type="button" |
|||
onClick={() => setSelectedCategory(category)} |
|||
style={{ |
|||
padding: '7px 13px', |
|||
borderRadius: 8, |
|||
border: active |
|||
? '1px solid #38ae8a' |
|||
: '1px solid rgba(255,255,255,0.1)', |
|||
backgroundColor: active ? '#00714f' : '#1c2a24', |
|||
color: active ? '#ffffff' : '#d1d5db', |
|||
fontSize: 12, |
|||
fontWeight: 600, |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
{category} ({count}) |
|||
</button> |
|||
); |
|||
})} |
|||
</div> |
|||
|
|||
{/* Search Input */} |
|||
<input |
|||
type="text" |
|||
placeholder="Search by screen name, node ID, route, or scenario..." |
|||
value={searchQuery} |
|||
onChange={(e) => setSearchQuery(e.target.value)} |
|||
style={{ |
|||
flex: '1 1 220px', |
|||
minWidth: 0, |
|||
width: '100%', |
|||
maxWidth: 360, |
|||
padding: '8px 14px', |
|||
borderRadius: 8, |
|||
border: '1px solid rgba(255,255,255,0.15)', |
|||
backgroundColor: '#0e1512', |
|||
color: '#ffffff', |
|||
fontSize: 13, |
|||
outline: 'none', |
|||
}} |
|||
/> |
|||
</div> |
|||
|
|||
{/* Cards Grid */} |
|||
<div |
|||
style={{ |
|||
display: 'grid', |
|||
gridTemplateColumns: 'repeat(auto-fill, minmax(min(100%, 340px), 1fr))', |
|||
gap: 20, |
|||
marginTop: 24, |
|||
}} |
|||
> |
|||
{filteredRoutes.map((entry, idx) => ( |
|||
<div |
|||
key={entry.id} |
|||
style={{ |
|||
backgroundColor: '#15201b', |
|||
border: '1px solid rgba(255,255,255,0.1)', |
|||
borderRadius: 14, |
|||
overflow: 'hidden', |
|||
display: 'flex', |
|||
flexDirection: 'column', |
|||
justifyContent: 'space-between', |
|||
minWidth: 0, |
|||
}} |
|||
> |
|||
<div> |
|||
{/* Top Card Header */} |
|||
<div |
|||
style={{ |
|||
padding: '12px 14px', |
|||
borderBottom: '1px solid rgba(255,255,255,0.08)', |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
justifyContent: 'space-between', |
|||
flexWrap: 'wrap', |
|||
gap: 8, |
|||
}} |
|||
> |
|||
<div style={{ display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' }}> |
|||
<span |
|||
style={{ |
|||
backgroundColor: '#00714f', |
|||
color: '#ffffff', |
|||
fontSize: 11, |
|||
fontWeight: 700, |
|||
padding: '2px 8px', |
|||
borderRadius: 6, |
|||
}} |
|||
> |
|||
#{idx + 1} |
|||
</span> |
|||
<span |
|||
style={{ |
|||
backgroundColor: '#1f2f28', |
|||
color: '#6ee7b7', |
|||
fontSize: 11, |
|||
fontWeight: 600, |
|||
padding: '2px 8px', |
|||
borderRadius: 6, |
|||
}} |
|||
> |
|||
Node {entry.figmaNodeId} |
|||
</span> |
|||
<span |
|||
style={{ |
|||
fontSize: 11, |
|||
color: '#9ca3af', |
|||
}} |
|||
> |
|||
{entry.width}×{entry.height}px |
|||
</span> |
|||
</div> |
|||
<span |
|||
style={{ |
|||
fontSize: 11, |
|||
color: '#9ca3af', |
|||
backgroundColor: 'rgba(255,255,255,0.05)', |
|||
padding: '2px 8px', |
|||
borderRadius: 6, |
|||
}} |
|||
> |
|||
{entry.category} |
|||
</span> |
|||
</div> |
|||
|
|||
{/* Main Body with Reference Thumbnail & Details */} |
|||
<div |
|||
style={{ |
|||
padding: 14, |
|||
display: 'flex', |
|||
gap: 14, |
|||
alignItems: 'flex-start', |
|||
flexWrap: 'wrap', |
|||
}} |
|||
> |
|||
{/* Reference Thumbnail Preview */} |
|||
<div |
|||
onClick={() => setInspectingEntry(entry)} |
|||
title="Click to open Pixel Comparison Modal" |
|||
style={{ |
|||
width: 88, |
|||
height: 140, |
|||
flexShrink: 0, |
|||
backgroundColor: '#0b110e', |
|||
borderRadius: 8, |
|||
border: '1px solid rgba(255,255,255,0.12)', |
|||
overflow: 'hidden', |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
justifyContent: 'center', |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
{entry.refImage ? ( |
|||
<img |
|||
src={entry.refImage} |
|||
alt={entry.title} |
|||
style={{ |
|||
maxWidth: '100%', |
|||
maxHeight: '100%', |
|||
objectFit: 'contain', |
|||
display: 'block', |
|||
}} |
|||
/> |
|||
) : ( |
|||
<span |
|||
style={{ |
|||
fontSize: 11, |
|||
color: '#9ca3af', |
|||
textAlign: 'center', |
|||
padding: 6, |
|||
}} |
|||
> |
|||
TEXT Node |
|||
</span> |
|||
)} |
|||
</div> |
|||
|
|||
{/* Text Details */} |
|||
<div style={{ flex: '1 1 160px', minWidth: 0 }}> |
|||
<h2 |
|||
style={{ |
|||
margin: 0, |
|||
fontSize: 16, |
|||
fontWeight: 700, |
|||
color: '#ffffff', |
|||
lineHeight: '22px', |
|||
wordBreak: 'break-word', |
|||
}} |
|||
> |
|||
{entry.title} |
|||
</h2> |
|||
<div |
|||
style={{ |
|||
fontSize: 12, |
|||
color: '#9ca3af', |
|||
marginTop: 2, |
|||
wordBreak: 'break-word', |
|||
}} |
|||
> |
|||
Figma Name: <strong style={{ color: '#e5e7eb' }}>{entry.figmaName}</strong> |
|||
</div> |
|||
<div |
|||
style={{ |
|||
fontSize: 12, |
|||
color: '#38ae8a', |
|||
marginTop: 4, |
|||
fontFamily: 'monospace', |
|||
wordBreak: 'break-all', |
|||
}} |
|||
> |
|||
{entry.route} |
|||
{entry.aliases && entry.aliases.length > 0 |
|||
? ` (alias: ${entry.aliases.join(', ')})` |
|||
: ''} |
|||
</div> |
|||
<p |
|||
style={{ |
|||
margin: '8px 0 0', |
|||
fontSize: 12, |
|||
color: '#d1d5db', |
|||
lineHeight: '17px', |
|||
wordBreak: 'break-word', |
|||
}} |
|||
> |
|||
{entry.description} |
|||
</p> |
|||
</div> |
|||
</div> |
|||
|
|||
{/* Scenarios List */} |
|||
<div style={{ padding: '0 14px 14px' }}> |
|||
<div |
|||
style={{ |
|||
fontSize: 11, |
|||
fontWeight: 700, |
|||
textTransform: 'uppercase', |
|||
letterSpacing: '0.05em', |
|||
color: '#9ca3af', |
|||
marginBottom: 8, |
|||
}} |
|||
> |
|||
Scenarios ({entry.scenarios.length}) |
|||
</div> |
|||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}> |
|||
{entry.scenarios.map((sc, sIdx) => ( |
|||
<Link |
|||
key={`${entry.id}-sc-${sIdx}`} |
|||
to={sc.route} |
|||
style={{ |
|||
display: 'flex', |
|||
alignItems: 'center', |
|||
justifyContent: 'space-between', |
|||
flexWrap: 'wrap', |
|||
gap: 6, |
|||
padding: '6px 10px', |
|||
borderRadius: 6, |
|||
backgroundColor: '#1c2a24', |
|||
border: '1px solid rgba(255,255,255,0.06)', |
|||
color: '#e5e7eb', |
|||
textDecoration: 'none', |
|||
fontSize: 12, |
|||
}} |
|||
> |
|||
<span style={{ wordBreak: 'break-word' }}>{sc.label}</span> |
|||
<span |
|||
style={{ |
|||
color: '#38ae8a', |
|||
fontSize: 11, |
|||
fontFamily: 'monospace', |
|||
wordBreak: 'break-all', |
|||
}} |
|||
> |
|||
{sc.route} → |
|||
</span> |
|||
</Link> |
|||
))} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
{/* Card Footer Actions */} |
|||
<div |
|||
style={{ |
|||
padding: '12px 14px', |
|||
backgroundColor: '#111a16', |
|||
borderTop: '1px solid rgba(255,255,255,0.08)', |
|||
display: 'flex', |
|||
flexWrap: 'wrap', |
|||
gap: 10, |
|||
}} |
|||
> |
|||
<Link |
|||
to={entry.route} |
|||
style={{ |
|||
flex: '1 1 110px', |
|||
textAlign: 'center', |
|||
padding: '8px 12px', |
|||
borderRadius: 8, |
|||
backgroundColor: '#00714f', |
|||
color: '#ffffff', |
|||
fontSize: 12, |
|||
fontWeight: 600, |
|||
textDecoration: 'none', |
|||
}} |
|||
> |
|||
Open Screen |
|||
</Link> |
|||
<button |
|||
type="button" |
|||
onClick={() => setInspectingEntry(entry)} |
|||
style={{ |
|||
flex: '1 1 130px', |
|||
padding: '8px 12px', |
|||
borderRadius: 8, |
|||
backgroundColor: '#1f2f28', |
|||
color: '#6ee7b7', |
|||
border: '1px solid rgba(110, 231, 183, 0.3)', |
|||
fontSize: 12, |
|||
fontWeight: 600, |
|||
cursor: 'pointer', |
|||
}} |
|||
> |
|||
Verify Pixels vs PNG |
|||
</button> |
|||
</div> |
|||
</div> |
|||
))} |
|||
</div> |
|||
</div> |
|||
|
|||
{/* Pixel Comparison Modal */} |
|||
{inspectingEntry && ( |
|||
<PixelVerificationModal |
|||
entry={inspectingEntry} |
|||
onClose={() => setInspectingEntry(null)} |
|||
onSelectEntry={(next) => setInspectingEntry(next)} |
|||
allEntries={ALL_IMPLEMENTED_ROUTES} |
|||
/> |
|||
)} |
|||
</div> |
|||
); |
|||
}; |
|||
|
|||
export default TestDirectoryPage; |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue