From e48b07997e5e46d18f239e071a7d75f96763a910 Mon Sep 17 00:00:00 2001 From: Mirha Masala Date: Wed, 9 Oct 2024 09:53:38 +0100 Subject: [PATCH 01/12] Include schedule config to Events --- public/admin/config.yml | 43 ++++++++++++++++++++ src/app/_schemas/event/FrontMatterSchema.ts | 2 + src/app/_schemas/event/ScheduleSchema.ts | 28 +++++++++++++ src/app/_utils/convertMarkdownToEventData.ts | 1 + 4 files changed, 74 insertions(+) create mode 100644 src/app/_schemas/event/ScheduleSchema.ts diff --git a/public/admin/config.yml b/public/admin/config.yml index e00f160b7..636cd2922 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -771,6 +771,49 @@ collections: required: false hint: Paste the embed URL for your Luma event here to display the events directly on the page. Include relevant tags when appropriate, e.g., https://lu.ma/embed/calendar/cal-nlDvL4B7Ko1swF0/events?lt=light&tag=FIL%20Bangkok%202024. - *image_config + - name: "schedule" + label: "Schedule" + widget: "object" + collapsed: true + required: false + fields: + - name: "title" + label: "Section Title" + widget: "string" + required: false + hint: This is the title for the section header. For example, "FIL Bangkok 2024 Main Stage Schedule. Defaults to 'Schedule.'" + - name: "days" + widget: "list" + required: false + fields: + - name: "date" + label: "Date" + widget: "datetime" + hint: "The date of the events." + - name: "events" + label: "Events" + widget: "list" + fields: + - name: "title" + label: "Event Title" + widget: "string" + - name: "description" + label: "Description" + widget: "text" + - name: "start" + label: "Start Time" + widget: "datetime" + - name: "end" + label: "End Time" + widget: "datetime" + required: false + - name: "location" + label: "Location" + widget: "string" + - name: "url" + label: "URL" + widget: "string" + required: false - name: "speakers" label: "Speakers" widget: "list" diff --git a/src/app/_schemas/event/FrontMatterSchema.ts b/src/app/_schemas/event/FrontMatterSchema.ts index ddc0bb8c3..776bb9bbd 100644 --- a/src/app/_schemas/event/FrontMatterSchema.ts +++ b/src/app/_schemas/event/FrontMatterSchema.ts @@ -6,6 +6,7 @@ import { } from '@/utils/categoryUtils' import { DynamicBaseDataSchema } from '@/schemas/DynamicDataBaseSchema' +import { ScheduleSchema } from '@/schemas/event/ScheduleSchema' import { SpeakersSchema } from '@/schemas/event/SpeakerSchema' import { SponsorsSchema } from '@/schemas/event/SponsorSchema' @@ -33,6 +34,7 @@ export const EventFrontMatterSchema = DynamicBaseDataSchema.extend({ .optional(), startDate: z.coerce.date(), endDate: z.coerce.date().optional(), + schedule: ScheduleSchema.optional(), speakers: SpeakersSchema.optional(), sponsors: SponsorsSchema.optional(), }) diff --git a/src/app/_schemas/event/ScheduleSchema.ts b/src/app/_schemas/event/ScheduleSchema.ts new file mode 100644 index 000000000..0c5be64da --- /dev/null +++ b/src/app/_schemas/event/ScheduleSchema.ts @@ -0,0 +1,28 @@ +import { z } from 'zod' + +const EventSchema = z + .object({ + title: z.string(), + description: z.string(), + start: z.coerce.date(), + end: z.coerce.date().optional(), + location: z.string(), + url: z.string().url().optional(), + }) + .strict() + +const EventDaySchema = z + .object({ + date: z.coerce.date(), + events: z.array(EventSchema), + }) + .strict() + +export const ScheduleSchema = z + .object({ + title: z.string().optional(), + days: z.array(EventDaySchema), + }) + .strict() + +export type Schedule = z.infer diff --git a/src/app/_utils/convertMarkdownToEventData.ts b/src/app/_utils/convertMarkdownToEventData.ts index dc22c9338..ebb7df4ae 100644 --- a/src/app/_utils/convertMarkdownToEventData.ts +++ b/src/app/_utils/convertMarkdownToEventData.ts @@ -22,6 +22,7 @@ export function convertMarkdownToEventData(data: Record) { startDate: data['start-date'], endDate: data['end-date'], image: data.image, + schedule: data.schedule, speakers: data.speakers, sponsors: data.sponsors, seo: data.seo, From be50bc85b53ea63dd8c9de63ee6ba1fceb23eab5 Mon Sep 17 00:00:00 2001 From: Mirha Masala Date: Wed, 9 Oct 2024 11:06:50 +0100 Subject: [PATCH 02/12] Style day events cards --- src/app/events/[slug]/components/Schedule.tsx | 51 +++++++++++++++++++ src/app/events/[slug]/utils/dateUtils.ts | 10 ++++ 2 files changed, 61 insertions(+) create mode 100644 src/app/events/[slug]/components/Schedule.tsx create mode 100644 src/app/events/[slug]/utils/dateUtils.ts diff --git a/src/app/events/[slug]/components/Schedule.tsx b/src/app/events/[slug]/components/Schedule.tsx new file mode 100644 index 000000000..ab553668c --- /dev/null +++ b/src/app/events/[slug]/components/Schedule.tsx @@ -0,0 +1,51 @@ +import type { Event } from '@/types/eventType' + +import { BasicCard } from '@/components/BasicCard' +import { Heading } from '@/components/Heading' +import { TextLink } from '@/components/TextLink' + +import { formatDate, formatTime } from '../utils/dateUtils' + +type ScheduleProps = { + schedule: Event['schedule'] +} + +export function Schedule({ schedule }: ScheduleProps) { + return ( + <> + {schedule!.days.map((day) => { + return ( +
+ + {formatDate(day.date)} + + + {day.events.map((event) => ( +
+
+
+ {formatTime(event.start)} + {event.end && – {formatTime(event.end)}} +
+ {event.location} +
+
+ + {event.title} + +

+ {event.description} +

+ {event.url && ( + View Details + )} +
+
+ ))} +
+
+ ) + })} + + ) +} diff --git a/src/app/events/[slug]/utils/dateUtils.ts b/src/app/events/[slug]/utils/dateUtils.ts new file mode 100644 index 000000000..f636e0691 --- /dev/null +++ b/src/app/events/[slug]/utils/dateUtils.ts @@ -0,0 +1,10 @@ +import { format } from 'date-fns' + +export function formatDate(date: Date) { + return format(date, 'EEE, MMM d') +} + +export function formatTime(date: Date) { + const formattedTime = format(date, 'h:mma') + return formattedTime.replace(/(am|pm)/i, ' $1') +} From 00247b8c750ad1cfd7999c1133d7aca9c3f8a14d Mon Sep 17 00:00:00 2001 From: Mirha Masala Date: Wed, 9 Oct 2024 13:21:52 +0100 Subject: [PATCH 03/12] Style desktop Schedule with TabGroup --- src/app/events/[slug]/components/Schedule.tsx | 76 +++++++++++-------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/src/app/events/[slug]/components/Schedule.tsx b/src/app/events/[slug]/components/Schedule.tsx index ab553668c..a6c601b6c 100644 --- a/src/app/events/[slug]/components/Schedule.tsx +++ b/src/app/events/[slug]/components/Schedule.tsx @@ -1,3 +1,5 @@ +import { Tab, TabGroup, TabList, TabPanel, TabPanels } from '@headlessui/react' + import type { Event } from '@/types/eventType' import { BasicCard } from '@/components/BasicCard' @@ -12,40 +14,52 @@ type ScheduleProps = { export function Schedule({ schedule }: ScheduleProps) { return ( - <> - {schedule!.days.map((day) => { - return ( -
- - {formatDate(day.date)} - - + + + {schedule!.days.map((day) => ( + + {formatDate(day.date)} + + ))} + + + {schedule!.days.map((day) => ( + +
{day.events.map((event) => ( -
-
-
- {formatTime(event.start)} - {event.end && – {formatTime(event.end)}} + +
+
+
+ {formatTime(event.start)} + {event.end && – {formatTime(event.end)}} +
+ {event.location} +
+
+ + {event.title} + +

+ {event.description} +

+ {event.url && ( + View Details + )}
- {event.location} -
-
- - {event.title} - -

- {event.description} -

- {event.url && ( - View Details - )}
-
+ ))} - -
- ) - })} - +
+ + ))} + + ) } From 16b7c59a456157ee7700efc748cf5cae723cd4b8 Mon Sep 17 00:00:00 2001 From: Mirha Masala Date: Wed, 9 Oct 2024 14:09:01 +0100 Subject: [PATCH 04/12] Show Schedule --- public/admin/config.yml | 2 +- .../[slug]/components/ScheduleSection.tsx | 17 +++++++++++++++++ .../{Schedule.tsx => ScheduleTabs.tsx} | 8 ++++---- src/app/events/[slug]/page.tsx | 6 ++++++ 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 src/app/events/[slug]/components/ScheduleSection.tsx rename src/app/events/[slug]/components/{Schedule.tsx => ScheduleTabs.tsx} (90%) diff --git a/public/admin/config.yml b/public/admin/config.yml index 636cd2922..6bab1d7a3 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -783,13 +783,13 @@ collections: required: false hint: This is the title for the section header. For example, "FIL Bangkok 2024 Main Stage Schedule. Defaults to 'Schedule.'" - name: "days" + label: "Event Days" widget: "list" required: false fields: - name: "date" label: "Date" widget: "datetime" - hint: "The date of the events." - name: "events" label: "Events" widget: "list" diff --git a/src/app/events/[slug]/components/ScheduleSection.tsx b/src/app/events/[slug]/components/ScheduleSection.tsx new file mode 100644 index 000000000..efc516076 --- /dev/null +++ b/src/app/events/[slug]/components/ScheduleSection.tsx @@ -0,0 +1,17 @@ +import type { Event } from '@/types/eventType' + +import { PageSection } from '@/components/PageSection' + +import { ScheduleTabs } from './ScheduleTabs' + +type ScheduleSectionProps = { + schedule: Event['schedule'] +} + +export function ScheduleSection({ schedule }: ScheduleSectionProps) { + return ( + + + + ) +} diff --git a/src/app/events/[slug]/components/Schedule.tsx b/src/app/events/[slug]/components/ScheduleTabs.tsx similarity index 90% rename from src/app/events/[slug]/components/Schedule.tsx rename to src/app/events/[slug]/components/ScheduleTabs.tsx index a6c601b6c..704ccca4e 100644 --- a/src/app/events/[slug]/components/Schedule.tsx +++ b/src/app/events/[slug]/components/ScheduleTabs.tsx @@ -8,14 +8,14 @@ import { TextLink } from '@/components/TextLink' import { formatDate, formatTime } from '../utils/dateUtils' -type ScheduleProps = { +type ScheduleTabsProps = { schedule: Event['schedule'] } -export function Schedule({ schedule }: ScheduleProps) { +export function ScheduleTabs({ schedule }: ScheduleTabsProps) { return ( - - + + {schedule!.days.map((day) => (
+ {schedule && schedule.days && schedule.days.length > 0 && ( + + )} + {lumaEventsSection && ( )} - {eventHasSpeakers && } + {eventHasSchedule && } {eventHasSponsors && } ) From 01dff48143568a68c9223c640042c693d18b28d6 Mon Sep 17 00:00:00 2001 From: Mirha Masala Date: Fri, 11 Oct 2024 13:40:59 +0100 Subject: [PATCH 12/12] Revert data --- src/content/events/fil-bangkok-2024.md | 138 +------------------------ 1 file changed, 3 insertions(+), 135 deletions(-) diff --git a/src/content/events/fil-bangkok-2024.md b/src/content/events/fil-bangkok-2024.md index 9ebe2f845..7f386d573 100644 --- a/src/content/events/fil-bangkok-2024.md +++ b/src/content/events/fil-bangkok-2024.md @@ -22,138 +22,6 @@ luma-events-section: embed-link: https://lu.ma/embed/calendar/cal-nlDvL4B7Ko1swF0/events?lt=light&tag=FIL%20Bangkok%202024 image: src: /assets/images/fil-bangkok-2024.webp -schedule: - days: - - date: 2024-11-06T09:33:00.000Z - events: - - start: 2024-11-06T09:00:00.000Z - end: 2024-01-01T11:00:00.000Z - location: Upper Deck - title: "Workshop: Introducing Filecoin Data Tools" - description: - This talk introduces Filecoin Data Tools(FDT). It encapsulates a - modern, streamlined, composable toolkit for data preparation, hot - retrieval, and Filecoin deal making. - url: https://www.fil.org - - start: 2024-11-06T09:00:00.000Z - end: 2024-01-01T11:00:00.000Z - location: Upper Deck - title: "Workshop: Introducing Filecoin Data Tools" - description: - This talk introduces Filecoin Data Tools(FDT). It encapsulates a - modern, streamlined, composable toolkit for data preparation, hot - retrieval, and Filecoin deal making. - url: https://www.fil.org - - start: 2024-11-06T09:00:00.000Z - end: 2024-01-01T11:00:00.000Z - location: Upper Deck - title: "Workshop: Introducing Filecoin Data Tools" - description: - This talk introduces Filecoin Data Tools(FDT). It encapsulates a - modern, streamlined, composable toolkit for data preparation, hot - retrieval, and Filecoin deal making. - url: https://www.fil.org - - start: 2024-11-06T09:00:00.000Z - end: 2024-01-01T11:00:00.000Z - location: Upper Deck - title: "Workshop: Introducing Filecoin Data Tools" - description: - This talk introduces Filecoin Data Tools(FDT). It encapsulates a - modern, streamlined, composable toolkit for data preparation, hot - retrieval, and Filecoin deal making. - url: https://www.fil.org - - start: 2024-11-06T09:00:00.000Z - end: 2024-01-01T11:00:00.000Z - location: Upper Deck - title: "Workshop: Introducing Filecoin Data Tools" - description: - This talk introduces Filecoin Data Tools(FDT). It encapsulates a - modern, streamlined, composable toolkit for data preparation, hot - retrieval, and Filecoin deal making. - url: https://www.fil.org - - events: - - location: Lower Deck - title: "Data Centers on Demand: Optimizing the path for new Storage Providers" - description: - Filecoin is on the verge of transforming how the internet works, - ensuring that our data is stored more safely, and more cost - effectively than with current generation of monolithic public - clouds. To speed up global adoption of decentralized storage, - Protocol Labs has partnered with leading Infrastructure as a Service - provider servers.com to reduce the barriers to entry for anyone - wishing to join the storage revolution. Come and learn how we can - get you started on your own Storage Provider journey! - start: 2024-11-07T12:00:00.000Z - end: 2024-11-07T14:00:00.000Z - url: https://www.fil.org - date: 2024-11-07T09:47:00.000Z - - events: - - location: Lower Deck - title: "Data Centers on Demand: Optimizing the path for new Storage Providers" - description: - Filecoin is on the verge of transforming how the internet works, - ensuring that our data is stored more safely, and more cost - effectively than with current generation of monolithic public - clouds. To speed up global adoption of decentralized storage, - Protocol Labs has partnered with leading Infrastructure as a Service - provider servers.com to reduce the barriers to entry for anyone - wishing to join the storage revolution. Come and learn how we can - get you started on your own Storage Provider journey! - start: 2024-11-07T12:00:00.000Z - end: 2024-11-07T14:00:00.000Z - url: https://www.fil.org - date: 2024-11-08T09:47:00.000Z - - events: - - location: Lower Deck - title: "Data Centers on Demand: Optimizing the path for new Storage Providers" - description: - Filecoin is on the verge of transforming how the internet works, - ensuring that our data is stored more safely, and more cost - effectively than with current generation of monolithic public - clouds. To speed up global adoption of decentralized storage, - Protocol Labs has partnered with leading Infrastructure as a Service - provider servers.com to reduce the barriers to entry for anyone - wishing to join the storage revolution. Come and learn how we can - get you started on your own Storage Provider journey! - start: 2024-11-07T12:00:00.000Z - end: 2024-11-07T14:00:00.000Z - url: https://www.fil.org - date: 2024-11-09T09:47:00.000Z - - events: - - location: Lower Deck - title: "Data Centers on Demand: Optimizing the path for new Storage Providers" - description: - Filecoin is on the verge of transforming how the internet works, - ensuring that our data is stored more safely, and more cost - effectively than with current generation of monolithic public - clouds. To speed up global adoption of decentralized storage, - Protocol Labs has partnered with leading Infrastructure as a Service - provider servers.com to reduce the barriers to entry for anyone - wishing to join the storage revolution. Come and learn how we can - get you started on your own Storage Provider journey! - start: 2024-11-07T12:00:00.000Z - end: 2024-11-07T14:00:00.000Z - url: https://www.fil.org - date: 2024-11-10T09:47:00.000Z - - events: - - location: Lower Deck - title: "Data Centers on Demand: Optimizing the path for new Storage Providers" - description: - Filecoin is on the verge of transforming how the internet works, - ensuring that our data is stored more safely, and more cost - effectively than with current generation of monolithic public - clouds. To speed up global adoption of decentralized storage, - Protocol Labs has partnered with leading Infrastructure as a Service - provider servers.com to reduce the barriers to entry for anyone - wishing to join the storage revolution. Come and learn how we can - get you started on your own Storage Provider journey! - start: 2024-11-07T12:00:00.000Z - end: 2024-11-07T14:00:00.000Z - url: https://www.fil.org - date: 2024-11-11T09:47:00.000Z - - events: [] - date: 2024-11-12T09:47:00.000Z - title: "Main Stage Schedule" speakers: - name: Stefaan Vervaet title: CEO @@ -179,10 +47,10 @@ sponsors: website: https://boostylabs.com image: src: /assets/images/boosty-logo.webp - - image: - src: /assets/images/zetacube_logo_white2-1-.webp + - name: ZETACUBE website: https://www.zetacube.net/ - name: ZETACUBE + image: + src: /assets/images/zetacube_logo_white2-1-.webp seo: title: FIL Bangkok 2024 description: Join the Filecoin Community in Bangkok for discussions on