feat(home): ofertas que vendem o título, WhatsApp no hero e menu do celular acessível
Três ofertas (site que traz pedidos pelo WhatsApp, sistema para tirar a operação da planilha, revisão de sistema existente) com miniatura e formulário com o tipo escolhido; botão principal do hero abre o WhatsApp; moldura da SEV no hero do celular; menu fecha ao navegar, Esc, foco preso incluindo a barra de cookies e espaço para ela; CinematicHome como componente de servidor com ilha cliente; /ia com H1 de oferta e cartão do que você recebe; botão flutuante em aside com transform; AVIF antes de WebP; copy sem repetir contato direto.
This commit is contained in:
1 parent
de6af74a0c
commit
f8545cd442
44 files changed
+2286
-571
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import type { PortfolioProjectView } from "@/lib/portfolio-data";
|
||||
import CinematicHome from "./CinematicHome";
|
||||
@@ -137,16 +139,12 @@ describe("CinematicHome: props e estrutura", () => {
|
||||
const testimonials = [
|
||||
{ quote: "Ótimo.", name: "Ana", role: "Sócia", company: "Empresa" },
|
||||
];
|
||||
const serviceLinks = [
|
||||
{ href: "/servicos/x", label: "X", description: "Serviço X" },
|
||||
];
|
||||
|
||||
render(
|
||||
<CinematicHome
|
||||
projects={projects}
|
||||
clients={clients}
|
||||
testimonials={testimonials}
|
||||
serviceLinks={serviceLinks}
|
||||
heroStats={{ years: 5 }}
|
||||
/>,
|
||||
);
|
||||
@@ -154,7 +152,8 @@ describe("CinematicHome: props e estrutura", () => {
|
||||
expect(lastHeroProps()).toMatchObject({ stats: { years: 5 }, clients });
|
||||
expect(mockProjectsProps).toHaveBeenCalledWith({ projects });
|
||||
expect(mockTestimonialsProps).toHaveBeenCalledWith({ items: testimonials });
|
||||
expect(mockModalitiesProps).toHaveBeenCalledWith({ serviceLinks });
|
||||
// as ofertas não recebem mais os serviços do hub: a grade duplicada saiu da seção
|
||||
expect(mockModalitiesProps).toHaveBeenCalledWith({});
|
||||
});
|
||||
|
||||
it("path: optional props omitted -> the scenes receive undefined and decide their own defaults", () => {
|
||||
@@ -165,9 +164,7 @@ describe("CinematicHome: props e estrutura", () => {
|
||||
clients: undefined,
|
||||
});
|
||||
expect(mockTestimonialsProps).toHaveBeenCalledWith({ items: undefined });
|
||||
expect(mockModalitiesProps).toHaveBeenCalledWith({
|
||||
serviceLinks: undefined,
|
||||
});
|
||||
expect(mockModalitiesProps).toHaveBeenCalledWith({});
|
||||
});
|
||||
|
||||
it("path: scenes sit in order inside <main> (FAQ right before the contact); the home has no footer of its own (it comes from the layout)", () => {
|
||||
@@ -201,3 +198,25 @@ describe("CinematicHome: props e estrutura", () => {
|
||||
expect(onLayoutReady).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("CinematicHome: componente de servidor", () => {
|
||||
const source = readFileSync(join(__dirname, "CinematicHome.tsx"), "utf8");
|
||||
|
||||
it("path: the file is a server component: no 'use client' and no React hooks, which live in the CinematicMain island", () => {
|
||||
expect(source).not.toMatch(/^["']use client["']/m);
|
||||
expect(source).not.toMatch(
|
||||
/\buse(?:State|Effect|LayoutEffect|Ref|Callback|Memo)\b/,
|
||||
);
|
||||
expect(source).not.toMatch(/useCinematicScroll|useHomeFragmentNavigation/);
|
||||
expect(source).toContain('import CinematicMain from "./CinematicMain"');
|
||||
});
|
||||
|
||||
it("path: the island is the only client file of the pair, and it wraps the scenes as children", () => {
|
||||
const island = readFileSync(join(__dirname, "CinematicMain.tsx"), "utf8");
|
||||
|
||||
expect(island).toMatch(/^"use client";/);
|
||||
expect(island).toMatch(/children/);
|
||||
expect(island).toContain("useCinematicScroll");
|
||||
expect(island).toContain("useHomeFragmentNavigation");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user