Skip to content

Commit

Permalink
Display Cabin name if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
brundonsmith committed Jun 18, 2024
1 parent b763cfb commit c71a458
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions front-end/src/components/Tickets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export default React.memo(() => {
const tickets = store.purchasedTicketsByFestival[festival.festival_id] ?? []
const otherPurchases = store.nonTicketPurchasesByFestival[festival.festival_id] ?? []

// HACK: Attendees under one account may have separate cabin names, which
// is assumed not to be true as this is currently written
const cabinName = store.accountInfo.state.result?.cabins.filter(c => c.festival_id === festival.festival_id)?.[0]?.cabin_name

return (
<div key={festival.festival_id} style={festival.end_date.isBefore(dayjs.utc()) ? { opacity: 0.5 } : undefined}>
<h2>
Expand All @@ -68,6 +72,11 @@ export default React.memo(() => {
<Ticket name={undefined} ticketType='adult' ownedByAccountId={ticket.owned_by_account_id} />
</React.Fragment>)}

{cabinName &&
<div>
Cabin: {cabinName}
</div>}

{store.purchaseTypes.state.result && otherPurchases.length > 0 &&
<div>
Other purchases:
Expand Down

0 comments on commit c71a458

Please sign in to comment.