From bc5fefdf83afea5967d0a430c3ab907e6782dd21 Mon Sep 17 00:00:00 2001 From: dwindown Date: Sat, 8 Nov 2025 20:51:58 +0700 Subject: [PATCH] feat: Reorder PageHeader and SubmenuBar using flex-col-reverse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implemented elegant CSS-only solution for header ordering. Solution: - Wrapped PageHeader and SubmenuBar in flex container - Mobile: flex-col (PageHeader first, then SubmenuBar) - Desktop: flex-col-reverse (SubmenuBar first, then PageHeader) Result: ✅ Mobile: Contextual header stays on top (better UX) ✅ Desktop: Submenu tabs appear above contextual header (traditional layout) ✅ No JavaScript logic needed ✅ Pure CSS flexbox solution ✅ Applied to both fullscreen and normal layouts Benefits: - Clean, maintainable code - No conditional rendering complexity - Responsive without media query logic - Performance: CSS-only, no re-renders --- admin-spa/src/App.tsx | 30 +++++++++++-------- .../routes/Orders/components/OrderCard.tsx | 20 +++++++------ 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/admin-spa/src/App.tsx b/admin-spa/src/App.tsx index d2855da..dbf3292 100644 --- a/admin-spa/src/App.tsx +++ b/admin-spa/src/App.tsx @@ -487,12 +487,15 @@ function Shell() { ) : (
- - {!isMorePage && (isDashboardRoute ? ( - - ) : ( - - ))} + {/* Flex wrapper: mobile = col (PageHeader first), desktop = col-reverse (SubmenuBar first) */} +
+ + {!isMorePage && (isDashboardRoute ? ( + + ) : ( + + ))} +
@@ -505,12 +508,15 @@ function Shell() { ) : (
- - {isDashboardRoute ? ( - - ) : ( - - )} + {/* Flex wrapper: mobile = col (PageHeader first), desktop = col-reverse (SubmenuBar first) */} +
+ + {isDashboardRoute ? ( + + ) : ( + + )} +
diff --git a/admin-spa/src/routes/Orders/components/OrderCard.tsx b/admin-spa/src/routes/Orders/components/OrderCard.tsx index 2baa89d..1fa8ff8 100644 --- a/admin-spa/src/routes/Orders/components/OrderCard.tsx +++ b/admin-spa/src/routes/Orders/components/OrderCard.tsx @@ -50,17 +50,19 @@ export function OrderCard({ order, selected, onSelect, currencyConfig }: OrderCa
)} - {/* Order ID Badge with Status Color */} -
- #{order.number} -
- {/* Content */}
- {/* Line 1: Date (small) */} -
- {formatRelativeOrDate(order.date_ts)} -
+
+ + {/* Order ID Badge with Status Color */} +
+ #{order.number} +
+ {/* Line 1: Date (small) */} +
+ {formatRelativeOrDate(order.date_ts)} +
+
{/* Line 2: Customer */}