Skip to content
Merged
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
69 changes: 57 additions & 12 deletions frontend/src/components/landing/TeamSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ const INITIAL_TEAM: Contributor[] = [
html_url: "https://github.com/thalitat",
contributions: 0,
type: "User"
},
{
id: 999999998,
login: "jeremiassnts",
avatar_url: "https://github.com/jeremiassnts.png",
html_url: "https://github.com/jeremiassnts",
contributions: 0,
type: "User"
}
];

Expand All @@ -51,7 +59,7 @@ export default function TeamSection() {
useEffect(() => {
fetch(`https://api.github.com/repos/${OWNER}/${REPO}/contributors`, {
headers: {
'Accept': 'application/vnd.github.v3+json',
Accept: 'application/vnd.github.v3+json',
}
})
.then((res) => {
Expand All @@ -64,20 +72,29 @@ export default function TeamSection() {
const realUsers = (data as Contributor[])
.filter(user => user.type === 'User')
.map(user => {
if (user.login.toLowerCase() === "pedrolucas1337") {
const login = user.login.toLowerCase();

if (login === "pedrolucas1337") {
return {
...user,
avatar_url: "https://github.com/PedroLucas1337.png"
};
}

if (user.login.toLowerCase() === "thalitat") {
if (login === "thalitat") {
return {
...user,
avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4"
};
}

if (login === "jeremiassnts") {
return {
...user,
avatar_url: "https://github.com/jeremiassnts.png"
};
}

return user;
});

Expand All @@ -97,6 +114,14 @@ export default function TeamSection() {
html_url: "https://github.com/thalitat",
contributions: 0,
type: "User"
},
{
id: 999999998,
login: "jeremiassnts",
avatar_url: "https://github.com/jeremiassnts.png",
html_url: "https://github.com/jeremiassnts",
contributions: 0,
type: "User"
}
];

Expand All @@ -110,27 +135,45 @@ export default function TeamSection() {
}
});

if (realUsers.length > 0) {
setContributors(realUsers);
}
const merged = [...INITIAL_TEAM, ...realUsers];

const unique = merged.filter(
(user, index, self) =>
index === self.findIndex(
u => u.login.toLowerCase() === user.login.toLowerCase()
)
);

setContributors(unique);
})
.catch((err) => {
console.warn("GitHub API offline ou limitada. Mantendo lista local:", err.message);
console.warn(
"GitHub API offline ou limitada. Mantendo lista local:",
err.message
);
});
}, []);

return (
<section id="time" className="flex flex-col text-center justify-center items-center py-16 px-4 w-full min-h-[400px]">
<section
id="time"
className="flex flex-col text-center justify-center items-center py-16 px-4 w-full min-h-[400px]"
>
<div className="max-w-6xl w-full">
<h2 className="text-3xl font-bold mb-2 text-gray-800 dark:text-white">
Nosso <span className="bg-gradient-to-r from-blue-600 to-violet-500 bg-clip-text text-transparent">Time</span> de Contribuidores
Nosso{" "}
<span className="bg-gradient-to-r from-blue-600 to-violet-500 bg-clip-text text-transparent">
Time
</span>{" "}
de Contribuidores
</h2>

<div className="text-gray-500 dark:text-gray-400 mb-10 text-sm sm:text-base">
Conheça as mentes brilhantes por trás do{" "}
<span className='font-bold text-gray-800 dark:text-white inline-block sm:inline'>
<span className="font-bold text-gray-800 dark:text-white inline-block sm:inline">
<span className="text-blue-500 font-bold">&lt;</span>
Cand<span className="text-amber-500 font-bold">!</span>Date<span className="text-purple-500 font-bold">!</span>
Cand<span className="text-amber-500 font-bold">!</span>Date
<span className="text-purple-500 font-bold">!</span>
<span className="text-blue-500 font-bold">&gt;</span>
</span>
</div>
Expand Down Expand Up @@ -177,6 +220,8 @@ export default function TeamSection() {
? "QA"
: user.login.toLowerCase() === "thalitat"
? "UX/UI Designer"
: user.login.toLowerCase() === "jeremiassnts"
? "Engenheiro de Software Senior"
: `${user.contributions} ${user.contributions === 1 ? 'commit' : 'commits'}`}
</p>
</div>
Expand All @@ -188,7 +233,7 @@ export default function TeamSection() {
className="w-full py-2 px-4 bg-gradient-to-r from-blue-600 via-indigo-600 to-violet-600 hover:opacity-90 text-white flex items-center justify-center text-sm font-medium rounded-lg transition-all duration-200 gap-2 shadow-sm"
>
Ver Perfil
<Github className='h-4 w-4' />
<Github className="h-4 w-4" />
</a>
</div>
</SwiperSlide>
Expand Down
Loading