Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/images/avatar/alejandro-alvarez.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/avatar/jenny-acuna.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/data/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,16 @@ export const volunteerMembers: VolunteerMember[] = [
image: "/images/avatar/mateo-usme.png",
linkedin: "https://www.linkedin.com/in/mateousmevalencia/",
},
{
slug: "alejandro-alvarez",
name: "Alejandro Alvarez",
role: "Redes Sociales",
image: "/images/avatar/alejandro-alvarez.jpg",
},
{
slug: "jenny-acuna",
name: "Jenny Acuña",
role: "Logística",
image: "/images/avatar/jenny-acuna.jpeg",
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { useLanguage, useTranslations } from "@/contexts/language-context";
import { getKeynoteHref, getLocalizedKeynote } from "@/lib/keynotes";
import {
resolveSpeakersForScheduleEvent,
resolveTalkForScheduleEvent,
shouldShowScheduleSpeakers,
} from "@/lib/schedule-speakers";
import {
Expand All @@ -54,7 +55,7 @@ import {
} from "@/lib/schedule-sponsors";
import { resolveSpeakerImageUrl } from "@/lib/speaker-image-url";
import type { SponsorWithTier } from "@/lib/sponsors";
import { getTalkByTalkKey, getTalkHref } from "@/lib/talks";
import { getTalkHref } from "@/lib/talks";
import { assetPath, cn } from "@/lib/utils";

type ScheduleCardProps = {
Expand Down Expand Up @@ -227,9 +228,7 @@ function ScheduleEventCard({ event, t, locale }: ScheduleEventCardProps) {
const keynote = event.keynoteSlug
? getLocalizedKeynote(event.keynoteSlug, locale)
: undefined;
const talk = event.talkKey
? getTalkByTalkKey(event.talkKey, locale)
: undefined;
const talk = resolveTalkForScheduleEvent(event, locale);
const eventSpeakers = resolveSpeakersForScheduleEvent(event, locale);
const showSpeakers =
shouldShowScheduleSpeakers(event, eventSpeakers) &&
Expand Down
6 changes: 4 additions & 2 deletions src/lib/i18n/blocks-en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ export const blocksEn = {
"jesus-mena": "Auditorium Co-host",
"yurley-sanchez-florez": "Auditorium Co-host",
"veruzka-borges": "Auditorium Co-host",
"juan-camilo-velasquez": "Keynotes Patron",
"mateo-usme-valencia": "Keynotes Patron",
"juan-camilo-velasquez": "Keynotes Godfather",
"mateo-usme-valencia": "Keynotes Godfather",
"alejandro-alvarez": "Social Networks",
"jenny-acuna": "Logistics",
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions src/lib/i18n/blocks-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export const blocksEs: BlocksMessages = {
"veruzka-borges": "Co-host de auditorio",
"juan-camilo-velasquez": "Padrino Keynotes",
"mateo-usme-valencia": "Padrino Keynotes",
"alejandro-alvarez": "Redes Sociales",
"jenny-acuna": "Logística",
},
},
},
Expand Down
73 changes: 56 additions & 17 deletions src/lib/schedule-speakers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import type { ScheduleEvent } from "@/assets/data/schedule";
import { speakers } from "@/assets/data/speakers";
import { getLocalizedKeynote } from "@/lib/keynotes";
import type { SiteLocale } from "@/lib/site-messages";
import { getTalkByTalkKey, getTalkSpeakers } from "@/lib/talks";
import {
getTalkBySpeakerSlug,
getTalkByTalkKey,
getTalkSpeakers,
type Talk,
} from "@/lib/talks";

export type ScheduleEventSpeaker = {
name: string;
Expand Down Expand Up @@ -40,6 +45,44 @@ function resolveSpeakerByName(name: string): ScheduleEventSpeaker {
};
}

function getSpeakerNamesFromEvent(event: ScheduleEvent) {
return event.speaker
.split("/")
.map((name) => name.trim())
.filter(Boolean);
}

export function resolveTalkForScheduleEvent(
event: ScheduleEvent,
locale: SiteLocale,
): Talk | undefined {
if (event.keynoteSlug) {
return undefined;
}

if (event.talkKey) {
return getTalkByTalkKey(event.talkKey, locale);
}

const expectedFormat = event.type === "workshop" ? "workshop" : "talk";

for (const name of getSpeakerNamesFromEvent(event)) {
const speaker = speakersByNormalizedName.get(normalizeSpeakerName(name));

if (!speaker) {
continue;
}

const talk = getTalkBySpeakerSlug(speaker.slug, locale);

if (talk?.format === expectedFormat) {
return talk;
}
}

return undefined;
}

export function resolveSpeakersForScheduleEvent(
event: ScheduleEvent,
locale: SiteLocale,
Expand All @@ -59,24 +102,20 @@ export function resolveSpeakersForScheduleEvent(
}
}

if (event.talkKey) {
const talk = getTalkByTalkKey(event.talkKey, locale);

if (talk) {
return getTalkSpeakers(talk, locale).map((speaker) => ({
name: speaker.name,
slug: speaker.slug,
image: speaker.image,
href: `/speakers/${speaker.slug}`,
}));
}
const talk = resolveTalkForScheduleEvent(event, locale);

if (talk) {
return getTalkSpeakers(talk, locale).map((speaker) => ({
name: speaker.name,
slug: speaker.slug,
image: speaker.image,
href: `/speakers/${speaker.slug}`,
}));
}

return event.speaker
.split("/")
.map((name) => name.trim())
.filter(Boolean)
.map((name) => resolveSpeakerByName(name));
return getSpeakerNamesFromEvent(event).map((name) =>
resolveSpeakerByName(name),
);
}

export function shouldShowScheduleSpeakers(
Expand Down
Loading