diff --git a/frontend/src/components/landing/TeamSection.tsx b/frontend/src/components/landing/TeamSection.tsx index 90e80e33..8ee366e2 100644 --- a/frontend/src/components/landing/TeamSection.tsx +++ b/frontend/src/components/landing/TeamSection.tsx @@ -1,10 +1,10 @@ import { useEffect, useState } from 'react'; +import { Autoplay, Pagination } from 'swiper/modules'; import { Swiper, SwiperSlide } from 'swiper/react'; -import { Pagination, Autoplay } from 'swiper/modules'; +import { Github } from 'lucide-react'; import 'swiper/css'; import 'swiper/css/pagination'; -import { Github } from 'lucide-react'; interface Contributor { id: number; @@ -31,6 +31,14 @@ const INITIAL_TEAM: Contributor[] = [ html_url: "https://github.com/PedroLucas1337", contributions: 0, type: "User" + }, + { + id: 110640572, + login: "thalitat", + avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4", + html_url: "https://github.com/thalitat", + contributions: 0, + type: "User" } ]; @@ -51,31 +59,59 @@ export default function TeamSection() { return res.json(); }) .then((data: unknown) => { - if (Array.isArray(data)) { - let realUsers = (data as Contributor[]) - .filter(user => user.type === 'User') - .map(user => { - if (user.login.toLowerCase() === "pedrolucas1337") { - return { ...user, avatar_url: "https://github.com/PedroLucas1337.png" }; - } - return user; - }); - - const hasPedro = realUsers.some(user => user.login.toLowerCase() === "pedrolucas1337"); - - if (!hasPedro) { - const pedroObj: Contributor = { - id: 104951475, - login: "PedroLucas1337", - avatar_url: "https://github.com/PedroLucas1337.png", - html_url: "https://github.com/PedroLucas1337", - contributions: 0, - type: "User" - }; - realUsers = [...realUsers, pedroObj]; + if (!Array.isArray(data)) return; + + const realUsers = (data as Contributor[]) + .filter(user => user.type === 'User') + .map(user => { + if (user.login.toLowerCase() === "pedrolucas1337") { + return { + ...user, + avatar_url: "https://github.com/PedroLucas1337.png" + }; + } + + if (user.login.toLowerCase() === "thalitat") { + return { + ...user, + avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4" + }; + } + + return user; + }); + + const fixedMembers: Contributor[] = [ + { + id: 104951475, + login: "PedroLucas1337", + avatar_url: "https://github.com/PedroLucas1337.png", + html_url: "https://github.com/PedroLucas1337", + contributions: 0, + type: "User" + }, + { + id: 110640572, + login: "thalitat", + avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4", + html_url: "https://github.com/thalitat", + contributions: 0, + type: "User" + } + ]; + + fixedMembers.forEach(member => { + const exists = realUsers.some( + user => user.login.toLowerCase() === member.login.toLowerCase() + ); + + if (!exists) { + realUsers.push(member); } + }); - if (realUsers.length > 0) setContributors(realUsers); + if (realUsers.length > 0) { + setContributors(realUsers); } }) .catch((err) => { @@ -92,7 +128,7 @@ export default function TeamSection() {
- {user.login.toLowerCase() === "pedrolucas1337" + {user.login.toLowerCase() === "benevanio" + ? "Founder & Backend Dev" + : user.login.toLowerCase() === "pedrolucas1337" ? "QA" + : user.login.toLowerCase() === "thalitat" + ? "UX/UI Designer" : `${user.contributions} ${user.contributions === 1 ? 'commit' : 'commits'}`}