Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bottom section of about us #432

Merged
merged 9 commits into from
Oct 20, 2024
9 changes: 9 additions & 0 deletions src/components/about/team-members.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,62 @@
[
{
"id": 1,
"name": "Youssef El Azizi",
"x_handle": "@ElaziziYoussouf",
"profile_image": "/about/images/team/yosef.jpg",
"status": "active"
},
{
"id": 2,
"name": "Mohammed Aboullaite",
"x_handle": "@laytoun",
"profile_image": "/about/images/team/laytoun.jpg",
"status": "active"
},
{
"id": 3,
"name": "Mriem Zaid",
"x_handle": "@_iMeriem",
"profile_image": "/about/images/team/imeriem.jpg",
"status": "active"
},
{
"id": 4,
"name": "Abderrahim SOUBAI-ELIDRISI",
"x_handle": "@soub4i",
"profile_image": "/about/images/team/isoubei.jpg",
"status": "active"
},
{
"id": 5,
"name": "Otmane Fettal",
"x_handle": "@OFettal",
"profile_image": "/about/images/team/ofettal.jpg",
"status": "active"
},
{
"id": 6,
"name": "Adnan M'RAKCHI",
"x_handle": "@_admerra",
"profile_image": "/about/images/team/adnan.jpg",
"status": "active"
},
{
"id": 7,
"name": "Chaimaa BRITEL",
"x_handle": "@ChaimaaBritel",
"profile_image": "/about/images/team/britel.jpg",
"status": "active"
},
{
"id": 8,
"name": "Abdelati EL ASRI",
"x_handle": "@kaizendae",
"profile_image": "/about/images/team/kaizendae.jpg",
"status": "active"
},
{
"id": 9,
"name": "Soufyan El Foukahi",
"x_handle": "@soufyanAI",
"profile_image": "/about/images/team/soufyan.jpg",
Expand Down
18 changes: 11 additions & 7 deletions src/components/about/team.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
---
import teamMembers from "./team-members.json";
import Member from "./member.astro";
import type { MemberProps } from "./member.astro";
import { getCollection } from "astro:content";

const activeMembers = (teamMembers as MemberProps[]).filter(
member => member.status === "active"
);
const pastMembers = (teamMembers as MemberProps[]).filter(
member => member.status === "past"
);
const teamCollection = await getCollection("team");
const teamMembers: MemberProps[] = teamCollection.map(member => ({
kaizendae marked this conversation as resolved.
Show resolved Hide resolved
name: member.data.name,
x_handle: member.data.x_handle,
profile_image: member.data.profile_image,
status: member.data.status,
}));

const activeMembers = teamMembers.filter(member => member.status === "active");
const pastMembers = teamMembers.filter(member => member.status === "past");
---

<section id="team" class="bg-[#1A1C1E] py-16">
Expand Down
6 changes: 5 additions & 1 deletion src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ const gallery = !import.meta.env.PUBLIC_CLOUDINARY_CLOUD_NAME
}),
});

export const collections = { podcast, gallery };
const team = defineCollection({
loader: file("src/components/about/team-members.json"),
});
kaizendae marked this conversation as resolved.
Show resolved Hide resolved

export const collections = { podcast, gallery, team };