diff --git a/content/webapp/components/EventSchedule/EventSchedule.tsx b/content/webapp/components/EventSchedule/EventSchedule.tsx index 9df931a6fd..30bb7a6351 100644 --- a/content/webapp/components/EventSchedule/EventSchedule.tsx +++ b/content/webapp/components/EventSchedule/EventSchedule.tsx @@ -12,7 +12,8 @@ import { font } from '@weco/common/utils/classnames'; const EventScheduleList: FunctionComponent<{ groupedEvents: EventsGroup[]; isNotLinkedIds: string[]; -}> = ({ groupedEvents, isNotLinkedIds }) => ( + parentEvent: EventType; +}> = ({ groupedEvents, isNotLinkedIds, parentEvent }) => ( <> {groupedEvents.map( eventsGroup => @@ -30,6 +31,7 @@ const EventScheduleList: FunctionComponent<{ {eventsGroup.events.map(event => ( -1} /> @@ -41,6 +43,7 @@ const EventScheduleList: FunctionComponent<{ ); type Props = { + parentEvent: EventType; schedule: EventScheduleType; }; @@ -48,7 +51,7 @@ type Props = { // "Festival of Minds and Bodies" (XagmOxAAACIAo0v8), which is // a multi-day event with repeated schedule items. Some of the items // span multiple days. -const EventSchedule: FunctionComponent = ({ schedule }) => { +const EventSchedule: FunctionComponent = ({ parentEvent, schedule }) => { const events = schedule.map(({ event }) => event); const groupedEvents = groupEventsByDay(events); const isNotLinkedIds = schedule @@ -75,6 +78,7 @@ const EventSchedule: FunctionComponent = ({ schedule }) => { )} @@ -84,6 +88,7 @@ const EventSchedule: FunctionComponent = ({ schedule }) => { )} diff --git a/content/webapp/components/EventSchedule/EventScheduleItem.tsx b/content/webapp/components/EventSchedule/EventScheduleItem.tsx index f7a2d494c7..71a2dfae82 100644 --- a/content/webapp/components/EventSchedule/EventScheduleItem.tsx +++ b/content/webapp/components/EventSchedule/EventScheduleItem.tsx @@ -15,6 +15,7 @@ import { Place } from '@weco/content/types/places'; type Props = { event: Event; + parentEvent: Event; isNotLinked: boolean; }; @@ -95,8 +96,33 @@ const eventLocations = (locations: Place[], isHybridEvent: boolean) => { ); }; +// We have a message block on scheduled events which either displays +// 'Just turn up' or 'Arrive early to register' +// We only show this message if: +// - the event isn't past AND +// - it doesn't require booking (either through Eventbrite or by contacting the booking enquiry team) AND +// - it doesn't have it's own event schedule +// We also don't show it if the parent event is Ticketed, unless it will display 'Arrive early to register' +// as we don't want to show 'Just turn up' when the parent event is ticketed +function shouldShowMessage({ + event, + parentEvent, +}: { + event: Event; + parentEvent: Event; +}): boolean { + return ( + !isEventPast(event) && + !event.eventbriteId && + !event.bookingEnquiryTeam && + !(event.schedule && event.schedule.length > 1) && + !(parentEvent.bookingType === 'Ticketed' && !event.hasEarlyRegistration) + ); +} + const EventScheduleItem: FunctionComponent = ({ event, + parentEvent, isNotLinked, }) => { const waitForTicketSales = @@ -191,21 +217,17 @@ const EventScheduleItem: FunctionComponent = ({ )} - - {!isEventPast(event) && - !event.eventbriteId && - !event.bookingEnquiryTeam && - !(event.schedule && event.schedule.length > 1) && ( - - - - )} + {shouldShowMessage({ event, parentEvent }) && ( + + + + )} {event.secondaryLabels.length > 0 && ( diff --git a/content/webapp/pages/events/[eventId]/index.tsx b/content/webapp/pages/events/[eventId]/index.tsx index 28cebfd202..9340f4f612 100644 --- a/content/webapp/pages/events/[eventId]/index.tsx +++ b/content/webapp/pages/events/[eventId]/index.tsx @@ -280,7 +280,7 @@ const EventPage: NextPage = ({ {event.schedule && event.schedule.length > 0 && ( - + )} {event.ticketSalesStart && showTicketSalesStart(event.ticketSalesStart) && (