Skip to content

Commit 5f9c302

Browse files
authored
Develop (#217)
PR com as mudanças do @pedrosilvaadev [PAV-96 — Criar página de Termos de Uso](https://linear.app/tatame/issue/PAV-96/criar-pagina-de-termos-de-uso) [PAV-97 — Criar página de Política de Privacidade](https://linear.app/tatame/issue/PAV-97/criar-pagina-de-politica-de-privacidade)
2 parents 587b491 + 53885ed commit 5f9c302

8 files changed

Lines changed: 147 additions & 15 deletions

File tree

77.3 KB
Binary file not shown.
164 KB
Binary file not shown.

‎frontend/src/app/AppRoutes.tsx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import AuthCallbackPage from "@/domains/auth/presentation/pages/AuthCallbackPage
44
import LoginPage from "@/domains/auth/presentation/pages/LoginPage";
55
import RegisterPage from "@/domains/auth/presentation/pages/RegisterPage";
66
import LandingPage from "@/domains/marketing/presentation/pages/LandingPage";
7+
import PrivacyPolicyPage from "@/domains/marketing/presentation/pages/PrivacyPolicyPage";
8+
import TermsOfUsePage from "@/domains/marketing/presentation/pages/TermsOfUsePage";
79
import NewDashboardPage from "@/domains/new_dashboard/NewDashboardPage";
810
import NewDashboardLayout from "@/domains/new_dashboard/layout";
911
import Loading from "@/shared/ui/Loading";
@@ -65,6 +67,11 @@ export function AppRoutes() {
6567
}
6668
/>
6769
<Route path="/auth/callback" element={<AuthCallbackPage />} />
70+
<Route
71+
path="/politica-de-privacidade"
72+
element={<PrivacyPolicyPage />}
73+
/>
74+
<Route path="/termos-de-uso" element={<TermsOfUsePage />} />
6875
<Route
6976
path="/perfil/conexoes"
7077
element={<Navigate to="/perfil" replace />}

‎frontend/src/domains/marketing/presentation/components/Footer.tsx‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Github } from "lucide-react";
22
import LogoWhite from "@/shared/assets/logo-painel-vagas.svg";
33
import LogoBlack from "@/shared/assets/black.svg";
4+
import { Link } from "react-router-dom";
45

56
export function Footer() {
67
return (
@@ -79,20 +80,20 @@ export function Footer() {
7980
</h4>
8081
<ul className="space-y-4 text-gray-500 dark:text-gray-400">
8182
<li>
82-
<a
83-
href="#"
83+
<Link
84+
to="/termos-de-uso"
8485
className="hover:text-emerald-500 dark:hover:text-emerald-400 transition-colors"
8586
>
8687
Termos de Uso
87-
</a>
88+
</Link>
8889
</li>
8990
<li>
90-
<a
91-
href="#"
91+
<Link
92+
to="/politica-de-privacidade"
9293
className="hover:text-emerald-500 dark:hover:text-emerald-400 transition-colors"
9394
>
9495
Privacidade
95-
</a>
96+
</Link>
9697
</li>
9798
</ul>
9899
</div>
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import { ExternalLink, FileText } from "lucide-react";
2+
import { Link } from "react-router-dom";
3+
import { Footer } from "./Footer";
4+
import { Navbar } from "./Navbar";
5+
6+
type LegalDocumentPageProps = {
7+
title: string;
8+
description: string;
9+
documentUrl: string;
10+
};
11+
12+
export function LegalDocumentPage({
13+
title,
14+
description,
15+
documentUrl,
16+
}: LegalDocumentPageProps) {
17+
return (
18+
<div className="min-h-screen bg-white text-neutral-900 dark:bg-background dark:text-white">
19+
<Navbar />
20+
21+
<main className="mx-auto w-full max-w-7xl px-4 pb-16 pt-28 sm:px-6 md:px-12">
22+
<div className="mb-8 flex flex-col gap-5 sm:flex-row sm:items-end sm:justify-between">
23+
<div>
24+
<Link
25+
to="/"
26+
className="mb-4 inline-flex text-sm font-medium text-blue-600 transition-colors hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
27+
>
28+
Voltar para o início
29+
</Link>
30+
<div className="flex items-center gap-3">
31+
<span className="rounded-xl bg-blue-500/10 p-2.5 text-blue-600 dark:text-blue-400">
32+
<FileText aria-hidden="true" size={24} />
33+
</span>
34+
<div>
35+
<h1 className="text-2xl font-bold tracking-tight sm:text-3xl">
36+
{title}
37+
</h1>
38+
<p className="mt-1 text-sm text-neutral-500 dark:text-neutral-400">
39+
{description}
40+
</p>
41+
</div>
42+
</div>
43+
</div>
44+
45+
<a
46+
href={documentUrl}
47+
target="_blank"
48+
rel="noopener noreferrer"
49+
className="inline-flex w-fit items-center gap-2 rounded-full bg-gradient-to-r from-blue-500 via-purple-500 to-amber-500 px-5 py-2.5 text-sm font-semibold text-white shadow-md transition-opacity hover:opacity-90"
50+
>
51+
Abrir PDF em nova aba
52+
<ExternalLink aria-hidden="true" size={16} />
53+
</a>
54+
</div>
55+
56+
<section
57+
aria-label={`Documento: ${title}`}
58+
className="overflow-hidden rounded-2xl border border-neutral-200 bg-neutral-100 shadow-xl dark:border-white/10 dark:bg-neutral-900"
59+
>
60+
<object
61+
data={documentUrl}
62+
type="application/pdf"
63+
className="h-[70vh] min-h-[520px] w-full md:h-[78vh]"
64+
aria-label={`Visualização do documento: ${title}`}
65+
>
66+
<div className="flex min-h-[520px] flex-col items-center justify-center gap-4 px-6 text-center">
67+
<FileText aria-hidden="true" size={40} />
68+
<p className="max-w-md text-neutral-600 dark:text-neutral-300">
69+
Seu navegador não conseguiu exibir o documento nesta página.
70+
</p>
71+
<a
72+
href={documentUrl}
73+
target="_blank"
74+
rel="noopener noreferrer"
75+
className="font-semibold text-blue-600 underline underline-offset-4 dark:text-blue-400"
76+
>
77+
Abra o documento em uma nova aba
78+
</a>
79+
</div>
80+
</object>
81+
</section>
82+
</main>
83+
84+
<Footer />
85+
</div>
86+
);
87+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { LegalDocumentPage } from "@/domains/marketing/presentation/components/LegalDocumentPage";
2+
3+
const privacyPolicyUrl = "/politica-de-privacidade-candidate.pdf";
4+
5+
export default function PrivacyPolicyPage() {
6+
return (
7+
<LegalDocumentPage
8+
title="Política de Privacidade"
9+
description="Consulte como o Cand!Date! trata e protege seus dados."
10+
documentUrl={privacyPolicyUrl}
11+
/>
12+
);
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { LegalDocumentPage } from "@/domains/marketing/presentation/components/LegalDocumentPage";
2+
3+
const termsOfUseUrl = "/termos-de-uso-candidate.pdf";
4+
5+
export default function TermsOfUsePage() {
6+
return (
7+
<LegalDocumentPage
8+
title="Termos de Uso"
9+
description="Consulte as regras e condições de uso do Cand!Date!."
10+
documentUrl={termsOfUseUrl}
11+
/>
12+
);
13+
}

‎frontend/tests/unit/components/Footer.test.tsx‎

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
11
import { render, screen } from "@testing-library/react";
2+
import { MemoryRouter } from "react-router-dom";
23
import { describe, expect, it } from "vitest";
34
import { Footer } from "../../../src/domains/marketing/presentation/components/Footer";
45

56
describe("Footer", () => {
7+
function renderFooter() {
8+
return render(
9+
<MemoryRouter>
10+
<Footer />
11+
</MemoryRouter>,
12+
);
13+
}
14+
615
it("não exibe o link inativo de Contato", () => {
7-
render(<Footer />);
16+
renderFooter();
817

918
expect(screen.queryByRole("link", { name: "Contato" })).toBeNull();
1019
});
1120

1221
it("mantém os demais links da seção Legal", () => {
13-
render(<Footer />);
22+
renderFooter();
1423

15-
expect(
16-
screen.getByRole("link", { name: "Termos de Uso" }),
17-
).toBeInTheDocument();
18-
expect(
19-
screen.getByRole("link", { name: "Privacidade" }),
20-
).toBeInTheDocument();
24+
expect(screen.getByRole("link", { name: "Termos de Uso" })).toHaveAttribute(
25+
"href",
26+
"/termos-de-uso",
27+
);
28+
expect(screen.getByRole("link", { name: "Privacidade" })).toHaveAttribute(
29+
"href",
30+
"/politica-de-privacidade",
31+
);
2132
});
2233

2334
it("direciona o ícone do GitHub para o repositório do projeto", () => {
24-
render(<Footer />);
35+
renderFooter();
2536

2637
expect(
2738
screen.getByRole("link", { name: /repositório do projeto no github/i }),

0 commit comments

Comments
 (0)