Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | 8x 78x 78x 78x 78x 78x 78x 78x 65x 65x 65x | import { Stack } from "@mui/material";
import { DonationType } from "@customTypes/products/fundraiser.types";
import GiveSearchBar from "@shared/SearchBar/GiveSearchBar";
import GiveTabs from "@shared/Tabs/GiveTabs";
import { useCustomThemeV2 } from "@theme/hooks/useCustomThemeV2";
import { styled } from "@theme/v2/Provider";
import EventBreadcrumb from "./EventBreadcrumb";
import EventDetailHeader from "./EventDetailHeader";
import EventInfoCards from "./EventInfoCards";
import EventTransactionsFilter from "./EventTransactionsFilter";
import EventTicketsExport from "./tickets/EventTicketsExport";
import EventTicketsFilter from "./tickets/EventTicketsFilter";
import EventTicketsMobileActions from "./tickets/EventTicketsMobileActions";
import HostToolbarActions from "./host/HostToolbarActions";
import {
EVENT_DETAIL_TABS,
EventDetailTab,
VIEWPORT_WIDTH_CAP,
} from "./constants";
type Props = {
event?: DonationType;
tab: EventDetailTab;
onTabChange: (tab: string) => void;
search: string;
onSearchChange: (value: string) => void;
/**
* The event both tabs' controls act on — the tickets export downloads it, and
* either filter panel scopes its Ticket Name chips to it.
*/
eventId?: string;
/**
* Drop the search + right-hand controls entirely. Set by a tab whose list is
* empty with no search applied (frame 7397-90358).
*/
hideToolbar?: boolean;
/**
* PayBuilder 034 — the Reviews tab is behind a feature flag, so the tab is
* absent (not disabled) until the flag is on.
*/
showReviewsTab?: boolean;
};
/**
* PayBuilder 032-b — everything above the transactions table: the header with
* the (…) menu (AC001), the Date/Location cards, the Transactions/Tickets tabs
* and the search field (AC006.5).
*
* On the Transactions tab this is handed to `<Table Head={…} />`, which renders
* it inside the table's `<caption>` so it scrolls with the rows.
*/
const EventDetailHead = ({
event,
tab,
onTabChange,
showReviewsTab,
search,
onSearchChange,
eventId,
hideToolbar,
}: Props) => {
const { isMobileView } = useCustomThemeV2();
return (
<Container>
{/* Mobile only — desktop draws the trail in EventDetailPage's sticky
overlay bar instead, so it stays pinned while the table scrolls. */}
<BreadcrumbRow>
<EventBreadcrumb name={event?.name} />
</BreadcrumbRow>
<HeaderRow>
<EventDetailHeader event={event} />
</HeaderRow>
<CardsRow>
<EventInfoCards event={event} />
</CardsRow>
{/* Mobile puts search above the tabs; desktop puts it below. `order` is
used rather than two branches so the DOM order (and therefore the tab
sequence for keyboard users) stays stable. */}
{/* `gradient` is the variant that paints the selected pill with the
Ocean Blue highlight + blue label the mockup shows. Without a variant
`GivePill` renders no selected state at all. */}
<TabsRow>
<GiveTabs
type="pill"
variant="gradient"
selected={tab}
onClick={onTabChange}
// `max-content` + non-shrinking pills so an overflowing row slides
// within TabsRow's scroller instead of compressing the labels.
containerSx={{
gap: "4px",
width: "max-content",
"& > *": { flexShrink: 0 },
}}
items={[
{ label: "Transactions", value: EVENT_DETAIL_TABS.TRANSACTIONS },
{ label: "Inventory", value: EVENT_DETAIL_TABS.INVENTORY },
{ label: "Tickets", value: EVENT_DETAIL_TABS.TICKETS },
{ label: "Host", value: EVENT_DETAIL_TABS.HOST },
...(showReviewsTab
? [{ label: "Reviews", value: EVENT_DETAIL_TABS.REVIEWS }]
: []),
]}
/>
</TabsRow>
{/* Both tabs carry the search row (frames 7397-80297 / 7397-90421); the
right-hand controls differ. Transactions has its own Filter; Tickets has
Filter (the shared side panel, frame 7397-90376) then Export, in that
order per frame 7397-90412 — collapsed into one overflow icon on mobile
(frame 7397-90578). */}
{!hideToolbar && (
<SearchRow direction="row" alignItems="center" gap="16px">
<SearchContainer>
<GiveSearchBar
value={search}
handleChange={onSearchChange}
placeholder="Search"
/>
</SearchContainer>
{/* One group, so `space-between` pushes the pair to the right edge as a
unit instead of spreading Filter into the middle of the row. */}
<ControlsGroup direction="row" alignItems="center">
{tab === EVENT_DETAIL_TABS.TRANSACTIONS && (
<EventTransactionsFilter eventId={eventId} />
)}
{tab === EVENT_DETAIL_TABS.TICKETS &&
// Mobile fits one 32px icon beside the 302px search field, so the
// two collapse into an overflow sheet (frame 7397-90578).
(isMobileView ? (
<EventTicketsMobileActions eventId={eventId} />
) : (
<>
<EventTicketsFilter eventId={eventId} />
<EventTicketsExport eventId={eventId} />
</>
))}
{/* Two buttons on desktop (Assign Host, Invite Host), collapsed
into one overflow control on a 390px row — see
HostToolbarActions. */}
{tab === EVENT_DETAIL_TABS.HOST && (
<HostToolbarActions eventId={eventId} />
)}
</ControlsGroup>
</SearchRow>
)}
</Container>
);
};
export default EventDetailHead;
/**
* Vertical rhythm is taken from the mockup's banner frame rather than a uniform
* gap: breadcrumb 0–40, title row 176–264, cards 324–452, tabs at 496. Small
* screens collapse the large breadcrumb gap, which only exists to let the
* banner backdrop breathe on desktop.
*/
// On the Transactions tab this whole block is rendered inside the table's
// <caption>. With `table-layout: auto` a caption's max-content width can widen
// the table, so nothing in here may report a natural width larger than the
// viewport — otherwise the table (and with it the banner, tabs and rows) scrolls
// sideways as one. Children cap themselves with `VIEWPORT_WIDTH` below; the
// container itself just fills whatever width the table settled on.
const Container = styled(Stack)(() => ({
width: "100%",
minWidth: 0,
maxWidth: "100%",
}));
// Mobile only — desktop draws the trail in EventDetailPage's sticky overlay.
const BreadcrumbRow = styled(Stack)(({ theme }) => ({
display: "none",
[theme.breakpoints.down("v2_sm")]: {
display: "flex",
justifyContent: "center",
// Event names are long; the mockup truncates the trailing crumb rather
// than letting it wrap or push the layout wider.
width: "100%",
maxWidth: VIEWPORT_WIDTH_CAP,
overflow: "hidden",
// Mobile frame: nav 0–64 (fixed, drawn OVER the banner), breadcrumb at
// y120. The page wrapper deliberately has no mobile top padding (see
// EventDetailPage), so this margin must clear the fixed MobileNavBar
// itself: 64px of nav + 56px of backdrop above the trail.
marginTop: "120px",
"& .MuiBreadcrumbs-ol": { flexWrap: "nowrap" },
"& .MuiBreadcrumbs-li": {
minWidth: 0,
"& > *": {
display: "block",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
},
},
},
}));
// Mobile rhythm, from the 390px frame: breadcrumb ends y140, thumbnail y188
// (48), title block ends y348, cards y392 (44), search y574 — 40 below the
// cards row.
const HeaderRow = styled(Stack)(({ theme }) => ({
// Desktop frame: title row at y176. The 40px breadcrumb strip above it is
// the sticky overlay (not in this flow), so the full offset lives here.
marginTop: "176px",
[theme.breakpoints.down("v2_sm")]: {
marginTop: "48px",
},
}));
const CardsRow = styled(Stack)(({ theme }) => ({
marginTop: "60px",
minWidth: 0,
maxWidth: "100%",
[theme.breakpoints.down("v2_sm")]: {
marginTop: "44px",
},
}));
// Five tabs no longer fit a narrow viewport, so the row scrolls rather than
// being clipped. Same treatment as the Date/Location cards above it, and for
// the same reason: on the Transactions tab this block renders inside the
// table's <caption>, and that table is `table-layout: auto` — anything here
// reporting a max-content width wider than the screen widens the table itself
// and scrolls the banner, tabs and rows together. The viewport cap is a
// definite max-width, so the row can only ever scroll internally.
const TabsRow = styled(Stack)(({ theme }) => ({
marginTop: "44px",
minWidth: 0,
[theme.breakpoints.down("v2_sm")]: {
marginTop: "16px",
order: 2,
// Four pills outgrow a phone row, and like CardsRow this lives inside the
// table's <caption> — so cap the row at the viewport and let it scroll
// sideways internally instead of squeezing the pills (or widening the
// table).
maxWidth: VIEWPORT_WIDTH_CAP,
overflowX: "auto",
overscrollBehaviorX: "contain",
scrollbarWidth: "none",
"&::-webkit-scrollbar": { display: "none" },
},
}));
// Desktop frame: search 320px on the left, "Filter" at the far right of the
// same row. Mobile frame: search fills the row with the 32px funnel icon
// trailing it.
const SearchRow = styled(Stack)(({ theme }) => ({
width: "100%",
minWidth: 0,
marginTop: "24px",
justifyContent: "space-between",
[theme.breakpoints.down("v2_sm")]: {
marginTop: "40px",
order: 1,
// Same story as CardsRow: inside the table's <caption> this row's
// max-content (search field + the Host tab's labeled Invite button) widened
// the whole table past the viewport. The definite cap makes the row report
// no more than the screen; the search field flexes down inside it.
maxWidth: VIEWPORT_WIDTH_CAP,
},
}));
/**
* Filter + Export sit 12px apart at the right edge — frame 7397-90412 puts them at
* x 0–101 and 113–223 inside a 223px group.
*/
const ControlsGroup = styled(Stack)(() => ({
gap: "12px",
flexShrink: 0,
}));
const SearchContainer = styled(Stack)(({ theme }) => ({
width: "320px",
[theme.breakpoints.down("v2_sm")]: {
flex: 1,
width: "auto",
minWidth: 0,
},
}));
|