diff --git a/client/src/hooks/useEvent.ts b/client/src/hooks/useEvent.ts index 27794c6b..830b3b7d 100644 --- a/client/src/hooks/useEvent.ts +++ b/client/src/hooks/useEvent.ts @@ -12,10 +12,12 @@ type ApiEvent = { startTime: string | null; location: string; cover_image: string | null; + workshop_link: string; }; -type UiEvent = Omit & { +type UiEvent = Omit & { coverImage: string; + workshopLink: string; }; /** @@ -33,6 +35,7 @@ function transformApiEventToUiEvent(data: ApiEvent): UiEvent { return { ...data, coverImage: data.cover_image ?? "/game_dev_club_logo.svg", + workshopLink: data.workshop_link, }; } diff --git a/client/src/hooks/useEvents.ts b/client/src/hooks/useEvents.ts index 674d1a06..5d8922d2 100644 --- a/client/src/hooks/useEvents.ts +++ b/client/src/hooks/useEvents.ts @@ -12,16 +12,19 @@ type ApiEvent = { startTime: string | null; location: string; cover_image: string | null; + workshop_link: string; }; -export type UiEvent = Omit & { +export type UiEvent = Omit & { coverImage: string; + workshopLink: string; }; function transformApiEventToUiEvent(data: ApiEvent): UiEvent { return { ...data, coverImage: data.cover_image ?? "/game_dev_club_logo.svg", + workshopLink: data.workshop_link, }; } diff --git a/client/src/pages/events/[id].tsx b/client/src/pages/events/[id].tsx index 8e8d8803..5f58a89a 100644 --- a/client/src/pages/events/[id].tsx +++ b/client/src/pages/events/[id].tsx @@ -75,6 +75,19 @@ export default function EventPage() {

{event.description}

+ {event.workshopLink && ( +

+ Workshop link: + + {event.workshopLink} + +

+ )}