Skip to content

Commit a8e4028

Browse files
committed
feat: Constructo page improvements
1 parent 9402e4d commit a8e4028

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

src/components/packages/Installation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface InstallationProps {
99

1010
const Installation = ({ onPackagistClick, onDocsClick }: InstallationProps) => {
1111
return (
12-
<section className="py-16 px-6 bg-card/30">
12+
<section id="installation" className="py-16 px-6 bg-card/30">
1313
<div className="container mx-auto">
1414
<div className="text-center mb-12">
1515
<h2 className="text-3xl font-bold mb-4">Instalação Rápida</h2>

src/lib/utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ import { twMerge } from "tailwind-merge";
44
export function cn(...inputs: ClassValue[]) {
55
return twMerge(clsx(inputs));
66
}
7+
8+
export function scrollTo(elementId: string) {
9+
const element = document.getElementById(elementId);
10+
if (element) {
11+
element.scrollIntoView({ behavior: "smooth" });
12+
}
13+
}

src/pages/Constructo.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
import Footer from "@/components/Footer";
22
import Header from "@/components/Header";
33
import Hero from "@/components/Hero.tsx";
4-
import { Badge } from "@/components/ui/badge";
5-
import { Button } from "@/components/ui/button";
4+
import Benefits from "@/components/packages/Benefits.tsx";
5+
import CodeExamples from "@/components/packages/CodeExamples.tsx";
6+
7+
import Features from "@/components/packages/Features.tsx";
8+
import Installation from "@/components/packages/Installation.tsx";
9+
import UseCases from "@/components/packages/UseCases.tsx";
10+
import { Badge } from "@/components/ui/badge.tsx";
11+
import { Button } from "@/components/ui/button.tsx";
12+
import { scrollTo } from "@/lib/utils.ts";
613
import {
714
Blocks,
815
Cog,
@@ -17,15 +24,9 @@ import {
1724
Zap,
1825
} from "lucide-react";
1926

20-
import Features from "@/components/packages/Features.tsx";
21-
import CodeExamples from "@/components/packages/CodeExamples.tsx";
22-
import UseCases from "@/components/packages/UseCases.tsx";
23-
import Benefits from "@/components/packages/Benefits.tsx";
24-
import Installation from "@/components/packages/Installation.tsx";
25-
2627
const Constructo = () => {
2728
const handleInstallClick = () => {
28-
navigator.clipboard.writeText("composer require devitools/constructo");
29+
scrollTo("installation");
2930
};
3031

3132
const handleGithubClick = () => {

0 commit comments

Comments
 (0)