From 7931d306283e4272a186c47e0c2ea8bf8cffb04b Mon Sep 17 00:00:00 2001 From: Jake Ginnivan Date: Fri, 18 Oct 2024 17:39:35 +0800 Subject: [PATCH] More fixes --- .../page-components/SponsorSection.tsx | 2 +- website/app/config/years/2018.ts | 20 ++- website/app/config/years/2019.ts | 35 ++-- website/app/config/years/2021.ts | 45 +++-- website/app/config/years/2022.ts | 65 ++++--- website/app/config/years/2023.ts | 50 +++--- website/app/config/years/2024.ts | 64 +++---- website/app/lib/conf.ts | 164 ------------------ website/app/lib/config-types.ts | 7 +- .../{2024-uwa-di.png => 2024-uwa-di-dark.png} | Bin ...uwa-di-black.png => 2024-uwa-di-light.png} | Bin ...24-verse.png => 2024-verse-group-dark.png} | Bin ...e-black.png => 2024-verse-group-light.png} | Bin 13 files changed, 165 insertions(+), 287 deletions(-) delete mode 100644 website/app/lib/conf.ts rename website/public/images/sponsors/{2024-uwa-di.png => 2024-uwa-di-dark.png} (100%) rename website/public/images/sponsors/{2024-uwa-di-black.png => 2024-uwa-di-light.png} (100%) rename website/public/images/sponsors/{2024-verse.png => 2024-verse-group-dark.png} (100%) rename website/public/images/sponsors/{2024-verse-black.png => 2024-verse-group-light.png} (100%) diff --git a/website/app/components/page-components/SponsorSection.tsx b/website/app/components/page-components/SponsorSection.tsx index a283aa6..807fa7d 100644 --- a/website/app/components/page-components/SponsorSection.tsx +++ b/website/app/components/page-components/SponsorSection.tsx @@ -42,7 +42,7 @@ export function SponsorSection({ sponsors, year }: { sponsors: YearSponsors | un borderRightRadius="full" > -} - -export type ScheduleItemSpeaker = { - slug: string - imgSrc: string - name: string -} - -export type SimpleScheduleItemRaw = { - time: string - title: string - content: string - speakers?: Array -} - -export type TalkScheduleItemRaw = { - time: string - talk: string -} - -type ScheduleItemRaw = SimpleScheduleItemRaw | TalkScheduleItemRaw - -export type ScheduleItem = { - time: string - titleHTML: string - contentHTML: string - speakers?: Array -} - -export function isSpeaker(obj: any): obj is Speaker { - return ( - obj && - typeof obj === 'object' && - obj.name && - obj.title && - obj.imgSrc && - obj.linkText && - obj.link && - obj.bioHTML && - ['emcee', 'speaker'].includes(obj.type) - ) -} - -export function isSponsor(obj: unknown): obj is Sponsor { - return !!( - obj && - typeof obj === 'object' && - 'name' in obj && - typeof obj.name === 'string' && - 'link' in obj && - typeof obj.link === 'string' && - 'imgSrc' in obj && - typeof obj.imgSrc === 'string' && - (!('about' in obj) || typeof obj.about === 'string') && - 'level' in obj && - ['premier', 'gold', 'silver', 'community'].includes(obj.level as string) - ) -} - -export function isTalk(obj: any): obj is Talk { - return ( - obj && - typeof obj === 'object' && - obj.title && - obj.description && - Array.isArray(obj.speakers) && - ['regular', 'lightning', 'backup'].includes(obj.type) && - (!obj.time || typeof obj.time === 'string') && - obj.speakers.every((item: any) => typeof item === 'string') - ) -} - -export function isSimpleScheduleItemRaw(obj: any): obj is SimpleScheduleItemRaw { - return ( - obj && - typeof obj === 'object' && - typeof obj.time === 'string' && - typeof obj.title === 'string' && - typeof obj.content === 'string' && - (!obj.speakers || (Array.isArray(obj.speakers) && obj.speakers.every((item: any) => typeof item === 'string'))) - ) -} - -export function isTalkScheduleItemRaw(obj: any): obj is TalkScheduleItemRaw { - return obj && typeof obj === 'object' && typeof obj.time === 'string' && typeof obj.talk === 'string' -} - -export function isScheduleItemRaw(obj: any): obj is ScheduleItemRaw { - return isSimpleScheduleItemRaw(obj) || isTalkScheduleItemRaw(obj) -} - -export function isScheduleItemRawWithSpeakers(obj: any): obj is SimpleScheduleItemRaw & { speakers: Array } { - return ( - isSimpleScheduleItemRaw(obj) && - Array.isArray(obj.speakers) && - obj.speakers.every((s: any) => typeof s === 'string') - ) -} - -export function isScheduleItem(obj: any): obj is ScheduleItem { - return ( - obj && - typeof obj === 'object' && - typeof obj.time === 'string' && - typeof obj.title === 'string' && - typeof obj.content === 'string' && - (obj.speakers - ? Array.isArray(obj.speakers) && - obj.speakers.every( - (s: any) => - s && - typeof s === 'object' && - typeof s.slug === 'string' && - typeof s.imgSrc === 'string' && - typeof s.name === 'string', - ) - : true) - ) -} - -export function isSpeakerArray(arr: any): arr is Array { - return Array.isArray(arr) && arr.every(isSpeaker) -} - -export function isSponsorArray(arr: any): arr is Array { - return Array.isArray(arr) && arr.every(isSponsor) -} - -export function isTalkArray(arr: any): arr is Array { - return Array.isArray(arr) && arr.every(isTalk) -} - -export function isScheduleItemArray(arr: any): arr is Array { - return Array.isArray(arr) && arr.every(isScheduleItem) -} diff --git a/website/app/lib/config-types.ts b/website/app/lib/config-types.ts index 8448f2b..02d2f4e 100644 --- a/website/app/lib/config-types.ts +++ b/website/app/lib/config-types.ts @@ -87,11 +87,10 @@ export interface YearSponsors { export interface Sponsor { name: string - logoUrlDark: string - logoUrlLight: string + logoUrlDarkMode: string + logoUrlLightMode: string website: string - - quote: string | undefined + quote?: string } export interface ConferenceVenue { diff --git a/website/public/images/sponsors/2024-uwa-di.png b/website/public/images/sponsors/2024-uwa-di-dark.png similarity index 100% rename from website/public/images/sponsors/2024-uwa-di.png rename to website/public/images/sponsors/2024-uwa-di-dark.png diff --git a/website/public/images/sponsors/2024-uwa-di-black.png b/website/public/images/sponsors/2024-uwa-di-light.png similarity index 100% rename from website/public/images/sponsors/2024-uwa-di-black.png rename to website/public/images/sponsors/2024-uwa-di-light.png diff --git a/website/public/images/sponsors/2024-verse.png b/website/public/images/sponsors/2024-verse-group-dark.png similarity index 100% rename from website/public/images/sponsors/2024-verse.png rename to website/public/images/sponsors/2024-verse-group-dark.png diff --git a/website/public/images/sponsors/2024-verse-black.png b/website/public/images/sponsors/2024-verse-group-light.png similarity index 100% rename from website/public/images/sponsors/2024-verse-black.png rename to website/public/images/sponsors/2024-verse-group-light.png