Skip to content

Commit 6597228

Browse files
committed
🎨 fix event page
1 parent c9110b0 commit 6597228

3 files changed

Lines changed: 37 additions & 24 deletions

File tree

web/core/AddToCalendar/AddToCalendar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import ResourceLink from '../Link/ResourceLink'
1010
const ics = require('ics')
1111

1212
type AddToCalendarProps = {
13-
eventDate: EventDateType
14-
startDateTime: Date
15-
endDateTime: Date
13+
eventDate?: EventDateType
14+
startDateTime?: Date
15+
endDateTime?: Date
1616
location?: string
1717
title: string
1818
}

web/templates/event/Event.tsx

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,39 @@ import FormattedDateTime from '@/core/FormattedDateTime/FormattedDateTime'
88
import { getEventDates } from '@/lib/helpers/dateUtilities'
99
import Blocks from '@/portableText/Blocks'
1010
import ContactList from '@/sections/ContactList/ContactList'
11+
import type { EventDateType } from '@/sections/cards/EventCard/EventCard'
1112
import { getBgAndDarkFromBackground } from '@/styles/colorKeyToUtilityMap'
13+
import type {
14+
ContactListData,
15+
IFrameData,
16+
PeopleCardData,
17+
RelatedLinksData,
18+
SeoData,
19+
} from '@/types'
1220
import Promotion from '../../sections/promotions/PromotionsBlock'
1321
import 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

1645
export 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
/>

web/types/pageTypes.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,3 @@ export type LandingPageSchema = {
4949
template: Templates
5050
seoAndSome: SeoData
5151
}
52-
53-
export type EventSchema = {
54-
id: string
55-
title: PortableTextBlock[]
56-
slug: string
57-
seoAndSome: SeoData
58-
content: {
59-
location?: string
60-
eventDate: EventDateType
61-
ingress?: PortableTextBlock[]
62-
content?: PortableTextBlock[]
63-
iframe?: IFrameData
64-
promotedPeople?: {
65-
title?: PortableTextBlock[]
66-
people?: PeopleCardData[]
67-
}
68-
contactList?: ContactListData
69-
relatedLinks?: RelatedLinksData
70-
}
71-
}

0 commit comments

Comments
 (0)