@@ -8,10 +8,39 @@ import FormattedDateTime from '@/core/FormattedDateTime/FormattedDateTime'
88import { getEventDates } from '@/lib/helpers/dateUtilities'
99import Blocks from '@/portableText/Blocks'
1010import ContactList from '@/sections/ContactList/ContactList'
11+ import type { EventDateType } from '@/sections/cards/EventCard/EventCard'
1112import { getBgAndDarkFromBackground } from '@/styles/colorKeyToUtilityMap'
13+ import type {
14+ ContactListData ,
15+ IFrameData ,
16+ PeopleCardData ,
17+ RelatedLinksData ,
18+ SeoData ,
19+ } from '@/types'
1220import Promotion from '../../sections/promotions/PromotionsBlock'
1321import RelatedContent from '../../sections/RelatedContent/RelatedContent'
14- import type { EventSchema } from '../../types/index'
22+
23+ export type EventSchema = {
24+ id : string
25+ title : PortableTextBlock [ ]
26+ slug : string
27+ seoAndSome : SeoData
28+ content : {
29+ location ?: string
30+ eventDate : EventDateType
31+ startDayAndTime ?: any
32+ endDayAndTime ?: any
33+ ingress ?: PortableTextBlock [ ]
34+ content ?: PortableTextBlock [ ]
35+ iframe ?: IFrameData
36+ promotedPeople ?: {
37+ title ?: PortableTextBlock [ ]
38+ people ?: PeopleCardData [ ]
39+ }
40+ contactList ?: ContactListData
41+ relatedLinks ?: RelatedLinksData
42+ }
43+ }
1544
1645export default function Event ( { data } : { data : EventSchema } ) : JSX . Element {
1746 const { title } = data
@@ -25,6 +54,8 @@ export default function Event({ data }: { data: EventSchema }): JSX.Element {
2554 relatedLinks,
2655 contactList,
2756 eventDate,
57+ startDayAndTime,
58+ endDayAndTime,
2859 } = data . content
2960
3061 const plainTitle = title ? toPlainText ( title as PortableTextBlock [ ] ) : ''
@@ -78,6 +109,8 @@ export default function Event({ data }: { data: EventSchema }): JSX.Element {
78109 ) }
79110 < AddToCalendar
80111 eventDate = { eventDate }
112+ startDateTime = { startDayAndTime . dayTime }
113+ endDateTime = { endDayAndTime . dayTime }
81114 location = { location }
82115 title = { plainTitle }
83116 />
0 commit comments