Skip to content

Commit 3af760b

Browse files
authored
Feat/login fix (#113)
# ✨ Atualização do Time de Contribuidores ## O que mudou? Foi realizada a atualização da seção **"Nosso Time de Contribuidores"** da landing page do **<Cand!date!>**, incluindo novos membros que contribuíram diretamente para a evolução do projeto. ### Novos integrantes destacados - **Jeremias Santos** — Full Stack Developer - **Thalita Oliveira** — UX/UI Designer - **Pedro Pinheiro** — QA ### Melhorias técnicas - Inclusão de membros fixos na exibição do time, mesmo quando não aparecem na API de contribuidores do GitHub. - Garantia de exibição dos perfis de: - Benevanio (Founder & Backend Developer) - Pedro Pinheiro (QA) - Thalita Oliveira (UX/UI Designer) - Jeremias Santos (Full Stack Developer) - Tratamento de avatares personalizados para membros do time. - Remoção de duplicidades entre contribuidores retornados pela API e membros fixos. - Preservação da lista local em caso de indisponibilidade da API do GitHub. ## Objetivo Reconhecer todos os profissionais que participaram da construção do **<Cand!date!>**, destacando não apenas contribuições em commits, mas também atuações em: - Desenvolvimento Backend - Desenvolvimento Full Stack - Qualidade de Software (QA) - UX/UI Design - Branding e Experiência do Produto ## Resultado A seção de equipe agora representa melhor a estrutura real do projeto e evidencia a colaboração multidisciplinar que impulsiona a evolução da plataforma. --- 🚀 Projeto: <Cand!date!> 🔗 Produção: https://painel-vagas-lake.vercel.app/ 💻 Repositório: https://github.com/Benevanio/Jobs_Scraper_Global
2 parents 8f1a84a + 8392d4f commit 3af760b

2 files changed

Lines changed: 131 additions & 38 deletions

File tree

frontend/src/components/landing/TeamSection.tsx

Lines changed: 122 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { useEffect, useState } from 'react';
2+
import { Autoplay, Pagination } from 'swiper/modules';
23
import { Swiper, SwiperSlide } from 'swiper/react';
3-
import { Pagination, Autoplay } from 'swiper/modules';
44

5+
import { Github } from 'lucide-react';
56
import 'swiper/css';
67
import 'swiper/css/pagination';
7-
import { Github } from 'lucide-react';
88

99
interface Contributor {
1010
id: number;
@@ -31,6 +31,22 @@ const INITIAL_TEAM: Contributor[] = [
3131
html_url: "https://github.com/PedroLucas1337",
3232
contributions: 0,
3333
type: "User"
34+
},
35+
{
36+
id: 110640572,
37+
login: "thalitat",
38+
avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4",
39+
html_url: "https://github.com/thalitat",
40+
contributions: 0,
41+
type: "User"
42+
},
43+
{
44+
id: 999999998,
45+
login: "jeremiassnts",
46+
avatar_url: "https://github.com/jeremiassnts.png",
47+
html_url: "https://github.com/jeremiassnts",
48+
contributions: 0,
49+
type: "User"
3450
}
3551
];
3652

@@ -43,58 +59,121 @@ export default function TeamSection() {
4359
useEffect(() => {
4460
fetch(`https://api.github.com/repos/${OWNER}/${REPO}/contributors`, {
4561
headers: {
46-
'Accept': 'application/vnd.github.v3+json',
62+
Accept: 'application/vnd.github.v3+json',
4763
}
4864
})
4965
.then((res) => {
5066
if (!res.ok) throw new Error(`Erro HTTP: ${res.status}`);
5167
return res.json();
5268
})
5369
.then((data: unknown) => {
54-
if (Array.isArray(data)) {
55-
let realUsers = (data as Contributor[])
56-
.filter(user => user.type === 'User')
57-
.map(user => {
58-
if (user.login.toLowerCase() === "pedrolucas1337") {
59-
return { ...user, avatar_url: "https://github.com/PedroLucas1337.png" };
60-
}
61-
return user;
62-
});
63-
64-
const hasPedro = realUsers.some(user => user.login.toLowerCase() === "pedrolucas1337");
65-
66-
if (!hasPedro) {
67-
const pedroObj: Contributor = {
68-
id: 104951475,
69-
login: "PedroLucas1337",
70-
avatar_url: "https://github.com/PedroLucas1337.png",
71-
html_url: "https://github.com/PedroLucas1337",
72-
contributions: 0,
73-
type: "User"
74-
};
75-
realUsers = [...realUsers, pedroObj];
70+
if (!Array.isArray(data)) return;
71+
72+
const realUsers = (data as Contributor[])
73+
.filter(user => user.type === 'User')
74+
.map(user => {
75+
const login = user.login.toLowerCase();
76+
77+
if (login === "pedrolucas1337") {
78+
return {
79+
...user,
80+
avatar_url: "https://github.com/PedroLucas1337.png"
81+
};
82+
}
83+
84+
if (login === "thalitat") {
85+
return {
86+
...user,
87+
avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4"
88+
};
89+
}
90+
91+
if (login === "jeremiassnts") {
92+
return {
93+
...user,
94+
avatar_url: "https://github.com/jeremiassnts.png"
95+
};
96+
}
97+
98+
return user;
99+
});
100+
101+
const fixedMembers: Contributor[] = [
102+
{
103+
id: 104951475,
104+
login: "PedroLucas1337",
105+
avatar_url: "https://github.com/PedroLucas1337.png",
106+
html_url: "https://github.com/PedroLucas1337",
107+
contributions: 0,
108+
type: "User"
109+
},
110+
{
111+
id: 110640572,
112+
login: "thalitat",
113+
avatar_url: "https://avatars.githubusercontent.com/u/110640572?v=4",
114+
html_url: "https://github.com/thalitat",
115+
contributions: 0,
116+
type: "User"
117+
},
118+
{
119+
id: 999999998,
120+
login: "jeremiassnts",
121+
avatar_url: "https://github.com/jeremiassnts.png",
122+
html_url: "https://github.com/jeremiassnts",
123+
contributions: 0,
124+
type: "User"
76125
}
126+
];
77127

78-
if (realUsers.length > 0) setContributors(realUsers);
79-
}
128+
fixedMembers.forEach(member => {
129+
const exists = realUsers.some(
130+
user => user.login.toLowerCase() === member.login.toLowerCase()
131+
);
132+
133+
if (!exists) {
134+
realUsers.push(member);
135+
}
136+
});
137+
138+
const merged = [...INITIAL_TEAM, ...realUsers];
139+
140+
const unique = merged.filter(
141+
(user, index, self) =>
142+
index === self.findIndex(
143+
u => u.login.toLowerCase() === user.login.toLowerCase()
144+
)
145+
);
146+
147+
setContributors(unique);
80148
})
81149
.catch((err) => {
82-
console.warn("GitHub API offline ou limitada. Mantendo lista local:", err.message);
150+
console.warn(
151+
"GitHub API offline ou limitada. Mantendo lista local:",
152+
err.message
153+
);
83154
});
84155
}, []);
85156

86157
return (
87-
<section id="time" className="flex flex-col text-center justify-center items-center py-16 px-4 w-full min-h-[400px]">
158+
<section
159+
id="time"
160+
className="flex flex-col text-center justify-center items-center py-16 px-4 w-full min-h-[400px]"
161+
>
88162
<div className="max-w-6xl w-full">
89163
<h2 className="text-3xl font-bold mb-2 text-gray-800 dark:text-white">
90-
Nosso <span className="bg-gradient-to-r from-blue-600 to-violet-500 bg-clip-text text-transparent">Time</span> de Contribuidores
164+
Nosso{" "}
165+
<span className="bg-gradient-to-r from-blue-600 to-violet-500 bg-clip-text text-transparent">
166+
Time
167+
</span>{" "}
168+
de Contribuidores
91169
</h2>
92170

93171
<div className="text-gray-500 dark:text-gray-400 mb-10 text-sm sm:text-base">
94172
Conheça as mentes brilhantes por trás do{" "}
95-
<span className='font-bold text-gray-800 dark:text-white inline-block block sm:inline'>
173+
<span className="font-bold text-gray-800 dark:text-white inline-block sm:inline">
96174
<span className="text-blue-500 font-bold">&lt;</span>
97-
Cand<span className="text-amber-500 font-bold">!</span>Date<span className="text-purple-500 font-bold">!</span>
175+
Cand<span className="text-amber-500 font-bold">!</span>Date
176+
<span className="text-purple-500 font-bold">!</span>
98177
<span className="text-blue-500 font-bold">&gt;</span>
99178
</span>
100179
</div>
@@ -128,24 +207,32 @@ export default function TeamSection() {
128207
alt={user.login}
129208
className="w-24 h-24 rounded-full mb-4 border-2 border-violet-500/60 shadow-sm object-cover"
130209
/>
210+
131211
<h4 className="font-semibold text-lg text-gray-900 dark:text-zinc-100 mb-1 truncate w-full">
132212
{user.login}
133213
</h4>
134214

135215
<p className="text-xs font-medium text-gray-400 dark:text-zinc-500 mb-4">
136-
{user.login.toLowerCase() === "pedrolucas1337"
216+
{user.login.toLowerCase() === "benevanio"
217+
? "Founder & Backend Dev"
218+
: user.login.toLowerCase() === "pedrolucas1337"
137219
? "QA"
220+
: user.login.toLowerCase() === "thalitat"
221+
? "UX/UI Designer"
222+
: user.login.toLowerCase() === "jeremiassnts"
223+
? "Engenheiro de Software Senior"
138224
: `${user.contributions} ${user.contributions === 1 ? 'commit' : 'commits'}`}
139225
</p>
140226
</div>
227+
141228
<a
142229
href={user.html_url}
143230
target="_blank"
144231
rel="noreferrer"
145232
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"
146233
>
147234
Ver Perfil
148-
<Github className='h-4 w-4 flex justify-center items-center'/>
235+
<Github className="h-4 w-4" />
149236
</a>
150237
</div>
151238
</SwiperSlide>
@@ -164,4 +251,4 @@ export default function TeamSection() {
164251
`}</style>
165252
</section>
166253
);
167-
}
254+
}

frontend/tests/unit/components/landing/TeamSection.test.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("TeamSection", () => {
1919
vi.restoreAllMocks();
2020
});
2121

22-
it("renderiza lista da API, filtra bots e garante presença do Pedro", async () => {
22+
it("renderiza lista da API, filtra bots e garante presença de membros fixos", async () => {
2323
vi.spyOn(globalThis, "fetch").mockResolvedValue({
2424
ok: true,
2525
json: async () => [
@@ -49,9 +49,13 @@ describe("TeamSection", () => {
4949
});
5050

5151
expect(screen.queryByText("bot-user")).not.toBeInTheDocument();
52+
53+
// membros fixos
5254
expect(screen.getByText("PedroLucas1337")).toBeInTheDocument();
55+
expect(screen.getByText("thalitat")).toBeInTheDocument();
56+
5357
expect(screen.getByText("QA")).toBeInTheDocument();
54-
expect(screen.getByText("1 commit")).toBeInTheDocument();
58+
expect(screen.getByText("UX/UI Designer")).toBeInTheDocument();
5559
});
5660

5761
it("mantém fallback local quando API retorna resposta inválida", async () => {
@@ -117,6 +121,7 @@ describe("TeamSection", () => {
117121
await waitFor(() => {
118122
expect(screen.getByText("Benevanio")).toBeInTheDocument();
119123
expect(screen.getByText("PedroLucas1337")).toBeInTheDocument();
124+
expect(screen.getByText("thalitat")).toBeInTheDocument();
120125
});
121126
});
122127

@@ -175,6 +180,7 @@ describe("TeamSection", () => {
175180
await waitFor(() => {
176181
expect(screen.getByText("Benevanio")).toBeInTheDocument();
177182
expect(screen.getByText("PedroLucas1337")).toBeInTheDocument();
183+
expect(screen.getByText("thalitat")).toBeInTheDocument();
178184
});
179185
});
180-
});
186+
});

0 commit comments

Comments
 (0)