From 29dcb9d3463cf71a255d12f5e66bdd99ae800394 Mon Sep 17 00:00:00 2001 From: NoobDeveloper412 Date: Mon, 16 Sep 2024 20:10:46 +0500 Subject: [PATCH] Fixed the speakers and core contributors difference. --- src/components/AboutFooter.astro | 12 ++++++++++-- src/components/SpeakerGrid.astro | 24 ++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/AboutFooter.astro b/src/components/AboutFooter.astro index 7a6ea52..2d656be 100644 --- a/src/components/AboutFooter.astro +++ b/src/components/AboutFooter.astro @@ -89,14 +89,22 @@ const sortedSections = sectionsConfig {section.name === "speakers" && (

Speakers

- +
)} {section.name === "core contributors" && (

Core Contributors

- +
)} diff --git a/src/components/SpeakerGrid.astro b/src/components/SpeakerGrid.astro index f6446c7..bec507e 100644 --- a/src/components/SpeakerGrid.astro +++ b/src/components/SpeakerGrid.astro @@ -1,11 +1,12 @@ --- -const { people, team } = Astro.props; +const { people, team, core } = Astro.props; -// Filter the people and limit the results to 12 -const filteredPeople = people - .filter((p) => !team.includes(p.id)) - .filter((p) => p.imageUrl) - .slice(0, 12); // Limit to the first 12 people +// Filter based on the `core` parameter +const members = core + ? people.filter((p) => team.includes(p.id)) // If `core` is true, filter for team members + : people.filter((p) => !team.includes(p.id)); // If `core` is false or undefined, filter for non-team members + +const filteredPeople = members.filter((p) => p.imageUrl).slice(0, 12); function personLink(person) { if (person.refs?.twitter) { @@ -24,15 +25,6 @@ function personLink(person) { return "#"; } } - -function truncateCaption(caption) { - if (!caption) return ""; - const words = caption.split(" "); - if (words.length > 10) { - return words.slice(0, 20).join(" ") + "..."; - } - return caption; -} ---
{ filteredPeople.map((person) => ( -
+