Skip to content

Commit cf82961

Browse files
committed
change requests
1 parent ce253c9 commit cf82961

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

src/components/UpcomingEventsList.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,26 @@ import Translation from "@/components/Translation"
55

66
import { trackCustomEvent } from "@/lib/utils/matomo"
77

8-
import CommunityEvents, { CommunityEvent } from "../data/community-events"
8+
import CommunityConferences from "../data/community-events"
9+
10+
import type{ CommunityConference } from "@/lib/types"
911

1012
import { Button } from "./Buttons"
1113
import EventCard from "./EventCard"
1214
import InfoBanner from "./InfoBanner"
1315
import InlineLink from "./Link"
1416

15-
interface IOrderedUpcomingEventType extends CommunityEvent {
17+
type OrderedUpcomingEventType = CommunityConference & {
1618
date: string
1719
formattedDetails: string
1820
}
1921

20-
const UpcomingEventsList: React.FC = () => {
22+
23+
24+
const UpcomingEventsList = () => {
2125
const eventsPerLoad = 10
2226
const [orderedUpcomingEvents, setOrderedUpcomingEvents] = useState<
23-
Array<IOrderedUpcomingEventType>
27+
OrderedUpcomingEventType[]
2428
>([])
2529
const [maxRange, setMaxRange] = useState<number>(eventsPerLoad)
2630

@@ -35,7 +39,7 @@ const UpcomingEventsList: React.FC = () => {
3539
}
3640

3741
useEffect(() => {
38-
const eventsList: CommunityEvent[] = [...CommunityEvents]
42+
const eventsList: CommunityConference[] = [...CommunityConferences]
3943
const yesterday = new Date()
4044
yesterday.setDate(yesterday.getDate() - 1)
4145

src/data/community-events.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
export interface CommunityEvent {
2-
title: string
3-
to: string
4-
location: string
5-
description: string
6-
startDate: string
7-
endDate: string
8-
}
1+
import { CommunityConference } from "@/lib/types"
92

10-
const CommunityEvents: CommunityEvent[] = [
3+
const CommunityConferences: CommunityConference[] = [
114
{
125
title: "ETH Cinco de Mayo",
136
startDate: "2024-02-02",
@@ -399,4 +392,4 @@ const CommunityEvents: CommunityEvent[] = [
399392
},
400393
]
401394

402-
export default CommunityEvents
395+
export default CommunityConferences

src/lib/types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,12 @@ export type StatsBoxMetric = {
346346
apiUrl: string
347347
apiProvider: string
348348
}
349+
350+
export type CommunityConference = {
351+
title: string
352+
to: string
353+
location: string
354+
description: string
355+
startDate: string
356+
endDate: string
357+
}

0 commit comments

Comments
 (0)