diff --git a/apps/edr-freight-web/portal/src/components/AppLayout.tsx b/apps/edr-freight-web/portal/src/components/AppLayout.tsx index 7931dd2e3..b66bbd85b 100644 --- a/apps/edr-freight-web/portal/src/components/AppLayout.tsx +++ b/apps/edr-freight-web/portal/src/components/AppLayout.tsx @@ -22,7 +22,7 @@ import { Sun, User, } from "lucide-react"; -import { Fragment, type ReactNode, useState } from "react"; +import { type CSSProperties, Fragment, type ReactNode, useState } from "react"; export interface SidebarItem { label: string; @@ -47,6 +47,18 @@ export interface AppLayoutProps { type Theme = "light" | "dark"; const THEME_KEY = "edr-theme"; +const EDR = { + primary: "#0EA371", + primaryDark: "#0A6F4D", + soft: "#ECF6F1", + border: "#E6ECF2", + bg: "#F4F7FA", + text: "#10202F", + muted: "#6B7C8E", + ink: "#0C1A2B", + accent: "#F2A516", +}; + function getStoredTheme(): Theme { if (typeof window === "undefined") return "light"; const stored = localStorage.getItem(THEME_KEY); @@ -82,24 +94,18 @@ function getActivePage(items: SidebarItem[], activePath: string): { label: strin const navClassNames = (active: boolean) => { if (active) { return { - root: "rounded-[10px] font-medium transition-all duration-150 bg-[var(--mantine-color-edr-soft-0)]! ring-1 ring-inset ring-[var(--mantine-color-edr-green-5)]/15", - label: "text-[var(--mantine-color-edr-green-7)]! font-bold!", - section: "text-[var(--mantine-color-edr-green-7)]!", + root: `rounded-[10px] font-medium transition-all duration-150 bg-[#ECF6F1]! ring-1 ring-inset ring-[#0EA371]/15`, + label: `text-[#0A6F4D]! font-bold!`, + section: `text-[#0A6F4D]!`, }; } return { - root: "rounded-[10px] font-medium transition-all duration-150 hover:bg-[var(--mantine-color-edr-slate-soft-0)]!", - label: "text-[var(--mantine-color-edr-slate-0)]! font-semibold! hover:text-[var(--mantine-color-edr-ink-0)]!", - section: "text-[var(--mantine-color-edr-muted-0)]! hover:text-[var(--mantine-color-edr-ink-0)]!", + root: `rounded-[10px] font-medium transition-all duration-150 hover:bg-[#F1F4F7]!`, + label: `text-[#3D4D5C]! font-semibold! hover:text-[#0C1A2B]!`, + section: `text-[#54657A]! hover:text-[#0C1A2B]!`, }; }; -// 36×36 header control chips -const islandCls = - "size-9 rounded-full border border-[var(--mantine-color-edr-border-0)] bg-white flex items-center justify-center shrink-0 cursor-pointer"; -const squareIslandCls = - "size-9 rounded-[10px] border border-[var(--mantine-color-edr-border-0)] bg-white flex items-center justify-center shrink-0 cursor-pointer"; - export function AppLayout({ title = "EDR Freight", sidebarItems, @@ -133,6 +139,21 @@ export function AppLayout({ activePath === item.href.toLowerCase() || activePath.startsWith(item.href.toLowerCase() + "/"); + // Shared header "island" styles — every control is a consistent 36px chip. + const islandStyle: CSSProperties = { + width: 36, + height: 36, + borderRadius: 999, + border: `1px solid ${EDR.border}`, + backgroundColor: "#fff", + display: "flex", + alignItems: "center", + justifyContent: "center", + flexShrink: 0, + cursor: "pointer", + }; + const toggleStyle: CSSProperties = { ...islandStyle, borderRadius: 10 }; + return ( - {/* ── Header ── */} + {/* ── Header (frosted glass; compact floating islands, mirrors the pen) ── */} + {/* Left: sidebar toggle + page title */} - - + + - + {activePage ? activePage.label : title} + {/* Right: search + bell + avatar */} {/* Search pill */} - - + + Search shipments, bookings… {/* Bell */} - - + + {enableThemeToggle && ( - + {theme === "dark" - ? - : } + ? + : } )} - {/* Avatar dropdown */} + {/* Avatar pill */} {initials} - + + - {userName} + {userName} {userEmail && {userEmail}} @@ -255,33 +287,49 @@ export function AppLayout({ {/* Brand */} - + EDR EDR FREIGHT - + Ethio–Djibouti Railway @@ -302,13 +350,17 @@ export function AppLayout({ item.section && item.section !== prevSection ? ( {item.section} @@ -369,38 +421,42 @@ export function AppLayout({ marginBottom: 10, }} > + {/* Train image fills the full card */} + + {/* Diagonal green overlay: lower-left → upper-right cut */} - - + + {/* Text sits on top of the green overlay */} + + Moving Africa Forward Reliable. Efficient. Connected. + + {/* Learn More — visible on the image area */} - - Learn More - - + Learn More + - {/* Profile footer */} + {/* Profile */} - + {initials} - + {userName} {userEmail && ( - + {userEmail} )} - + @@ -456,9 +515,9 @@ export function AppLayout({ {/* ── Main ── */} shippingLines.find((l) => l.name === name)?.id; - const findCargoTypeId = (name: string): string | undefined => { - for (const group of cargoTree) { - const child = group.children?.find((c) => c.name === name); - if (child) return child.id; - } - return undefined; - }; - const findContainerCargoTypeId = (): string => { const group = cargoTree.find( (g) => g.code === "CONTAINER" || /container/i.test(g.name), @@ -199,102 +191,145 @@ export default function NewBookingPage() { }); return ( -
- {/* Step indicator — sticky */} - - - + {/* ── Page header ─────────────────────────────────────────────────── */} + + + + New Booking + + + Fill in the details below to book your freight shipment. + - + + - {/* Step content */} - - - {createMutation.isError && ( - } - radius="md" - mb="lg" - > - - Failed to save draft - - - {createMutation.error instanceof Error - ? createMutation.error.message - : "An unexpected error occurred. Please try again."} - - - )} - - {step === 1 && } - {step === 2 && } - {step === 3 && ( - - )} - {step === 4 && ( - - )} - {step === 5 && ( - - )} + + {/* Step indicator */} + + + + - - {/* Navigation footer — sticky */} - - - + {/* Step content */} + + + {createMutation.isError && ( + } + radius="md" + mb="lg" + > + + Failed to save draft + + + {createMutation.error instanceof Error + ? createMutation.error.message + : "An unexpected error occurred. Please try again."} + + + )} - {step < STEPS.length ? ( + {step === 1 && } + {step === 2 && } + {step === 3 && ( + + )} + {step === 4 && ( + + )} + {step === 5 && ( + + )} + + + + {/* Navigation footer */} + + - ) : ( - - )} + + {step < STEPS.length ? ( + + ) : ( + + )} + - - + + ); } diff --git a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/StepIndicator.tsx b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/StepIndicator.tsx index d7ca51476..7ac5411fb 100644 --- a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/StepIndicator.tsx +++ b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/StepIndicator.tsx @@ -1,5 +1,5 @@ -import { Fragment } from "react"; import { Check } from "lucide-react"; +import { Fragment } from "react"; import { STEPS } from "./schema"; export function StepIndicator({ step }: { step: number }) { @@ -9,29 +9,73 @@ export function StepIndicator({ step }: { step: number }) {
item.id - ? "bg-emerald-600 text-white shadow-sm shadow-emerald-600/40" + style={{ + width: 28, + height: 28, + borderRadius: "50%", + display: "flex", + alignItems: "center", + justifyContent: "center", + fontSize: 12, + fontWeight: 600, + flexShrink: 0, + transition: "all 0.2s", + ...(step > item.id + ? { + backgroundColor: "var(--mantine-color-edr-green-5)", + color: "#fff", + boxShadow: "0 2px 8px rgba(14,163,113,0.4)", + } : step === item.id - ? "border-2 border-emerald-500 text-emerald-600 shadow-sm shadow-emerald-500/30" - : "bg-gray-100 text-gray-400" - }`} + ? { + border: "2.5px solid var(--mantine-color-edr-green-5)", + color: "var(--mantine-color-edr-green-7)", + backgroundColor: "#fff", + boxShadow: "0 0 0 3px rgba(14,163,113,0.12)", + } + : { + backgroundColor: "#fff", + color: "var(--mantine-color-edr-muted-0)", + border: "2px solid var(--mantine-color-edr-border-0)", + }), + }} > - {step > item.id ? : item.id} + {step > item.id ? ( + + ) : ( + item.id + )}
= item.id ? "text-gray-800" : "text-gray-400" - }`} + style={{ + fontSize: 10, + fontWeight: 500, + display: "none", + transition: "color 0.2s", + color: + step >= item.id + ? "var(--mantine-color-edr-text-0)" + : "var(--mantine-color-edr-muted-0)", + }} + className="lg:!block" > {item.short}
{index < STEPS.length - 1 && (
item.id ? "bg-emerald-500" : "bg-gray-200" - }`} + style={{ + flex: 1, + height: 2, + borderRadius: 999, + margin: "0 6px", + marginBottom: 14, + transition: "background-color 0.3s", + backgroundColor: + step > item.id + ? "var(--mantine-color-edr-green-5)" + : "var(--mantine-color-edr-border-0)", + }} /> )}