From 3fa09ec6443de183b62f8669fec817560b1d39cb Mon Sep 17 00:00:00 2001 From: Nathnael Date: Thu, 11 Jun 2026 08:27:38 +0000 Subject: [PATCH] style: booking detail pages fix --- .../BookingDetailPage/DraftBookingView.tsx | 28 +-- .../BookingDetailPage/ReadonlyBookingView.tsx | 5 + .../BookingDetailPage/components/Notices.tsx | 137 ++++-------- .../components/PageHeader.tsx | 141 ++++++++---- .../components/StatusHero.tsx | 209 ++++++++---------- .../BookingDetailPage/components/layout.tsx | 6 +- 6 files changed, 254 insertions(+), 272 deletions(-) diff --git a/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/DraftBookingView.tsx b/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/DraftBookingView.tsx index 2c2835266..e69a024cc 100644 --- a/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/DraftBookingView.tsx +++ b/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/DraftBookingView.tsx @@ -18,6 +18,7 @@ import { X, XCircle, } from "lucide-react"; + import { useMemo, useRef, useState } from "react"; import { useNavigate } from "react-router-dom"; @@ -136,22 +137,17 @@ export function DraftBookingView({ - } - label="Documents" - onClick={() => - documentsRef.current?.scrollIntoView({ behavior: "smooth" }) - } - /> - } - label="Continue editing" - onClick={() => navigate(`/bookings/${booking.id}/edit`)} - /> - + } + label="Continue editing" + onClick={() => navigate(`/bookings/${booking.id}/edit`)} + /> } + menuActions={{ + onCancel: () => setCancelDialogOpen(true), + onSupport: () => navigate("/support"), + }} /> } - style={{ marginBottom: 12 }} + className="mb-3" > {docError} diff --git a/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/ReadonlyBookingView.tsx b/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/ReadonlyBookingView.tsx index d5281b98b..60efb704e 100644 --- a/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/ReadonlyBookingView.tsx +++ b/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/ReadonlyBookingView.tsx @@ -49,6 +49,11 @@ export function ReadonlyBookingView({ booking }: { booking: Freight.IBooking }) /> ) } + menuActions={{ + onViewContract: booking.signedByCeoAt ? () => {} : undefined, + onRebook: () => navigate("/bookings/new"), + onSupport: () => navigate("/support"), + }} /> {isNegative(status) ? ( diff --git a/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/components/Notices.tsx b/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/components/Notices.tsx index 24f7fbc27..c98cb726d 100644 --- a/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/components/Notices.tsx +++ b/apps/edr-freight-web/portal/src/pages/bookings/BookingDetailPage/components/Notices.tsx @@ -7,13 +7,13 @@ export function NoticeBanner({ icon, title, children, - style, + className, }: { tone: "amber" | "red"; icon: ReactNode; title?: string; children: ReactNode; - style?: React.CSSProperties; + className?: string; }) { const palette = tone === "amber" @@ -21,33 +21,26 @@ export function NoticeBanner({ : { border: "#F3C8C1", bg: "#FBEAE7", color: "#A93226" }; return ( - - - {icon} - - + {icon} +
{title && ( {title} )} - + {children} - - +
+ ); } @@ -61,54 +54,35 @@ export function ActionRequiredBanner({ onAction?: () => void; }) { return ( - - - +
- - +
+
Action required ยท You {title} - + {children} - - +
+ {onAction && (