11import React from "react" ;
2- // Assuming this is a Next.js environment for the prompt's context
3- import Link from "next/link" ;
42import {
53 Code ,
64 Users ,
@@ -10,139 +8,18 @@ import {
108 GraduationCap ,
119 MessageSquare ,
1210} from "lucide-react" ;
11+ import { CallToActionButton } from "@/components/cta" ;
12+ import { Feature } from "@/components/Features" ;
1313
14- // --- Type Definitions for Props ---
15-
16- // Type definition for Lucide icons, which are React components
17- type IconType = React . ElementType ;
18-
19- interface FeatureProps {
20- title : string ;
21- desc : string ;
22- Icon : IconType ;
23- }
24-
25- interface CallToActionButtonProps {
26- href : string ;
27- children : React . ReactNode ;
28- variant ?: "default" | "secondary" ;
29- className ?: string ;
30- }
31-
32- // --- Utility Components (Simulating shadcn/ui styles and functionality) ---
33-
34- // Feature Card with Icon
35- const Feature : React . FC < FeatureProps > = ( { title, desc, Icon } ) => {
36- return (
37- < div className = "flex flex-col space-y-4 rounded-xl border bg-card p-6 text-card-foreground shadow-lg transition-all duration-300 hover:shadow-xl hover:border-primary/50 md:p-8" >
38- < div className = "p-3 w-fit rounded-full bg-primary/10 text-primary" >
39- { /* Icon prop is rendered here */ }
40- < Icon className = "w-7 h-7" />
41- </ div >
42- < h3 className = "text-xl font-semibold tracking-tight" > { title } </ h3 >
43- < p className = "text-muted-foreground text-base leading-relaxed" > { desc } </ p >
44- </ div >
45- ) ;
46- } ;
47-
48- // Button-like component to simulate shadcn Button and Next.js Link styling
49-
50- const CallToActionButton : React . FC < CallToActionButtonProps > = ( {
51- href,
52- children,
53- variant = "default" ,
54- className = "" ,
55- } ) => {
56- const baseClasses =
57- "inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 h-11 px-6 py-2 tracking-wide" ;
58-
59- const defaultClasses =
60- "bg-primary text-primary-foreground shadow-xl hover:bg-primary/90" ;
61- const secondaryClasses =
62- "bg-secondary text-secondary-foreground shadow-md hover:bg-secondary/80 border border-input" ;
63-
64- const variantClasses =
65- variant === "default" ? defaultClasses : secondaryClasses ;
66-
67- return (
68- < Link
69- href = { href }
70- className = { `${ baseClasses } ${ variantClasses } ${ className } ` }
71- >
72- { children }
73- </ Link >
74- ) ;
75- } ;
76-
77- // Main navigation/header component
78- const Header : React . FC = ( ) => {
79- return (
80- < header className = "py-4 border-b border-border/40 sticky top-0 z-10 bg-background/90 backdrop-blur-sm" >
81- < div className = "mx-auto max-w-5xl px-4 flex justify-between items-center" >
82- < h1 className = "text-2xl font-bold tracking-tighter text-foreground" >
83- Dev< span className = "text-primary" > Ripple</ span >
84- </ h1 >
85- < nav className = "hidden sm:flex space-x-6 text-sm" >
86- { /* Use standard <a> for section links to avoid full page load */ }
87- < a
88- href = "#features"
89- className = "text-muted-foreground hover:text-primary transition-colors"
90- >
91- Features
92- </ a >
93- < a
94- href = "#workflow"
95- className = "text-muted-foreground hover:text-primary transition-colors"
96- >
97- How It Works
98- </ a >
99- < a
100- href = "#cta"
101- className = "text-muted-foreground hover:text-primary transition-colors"
102- >
103- Join
104- </ a >
105- </ nav >
106- < CallToActionButton
107- href = "/dashboard"
108- variant = "secondary"
109- className = "h-9 px-4 py-2"
110- >
111- Go to Dashboard
112- </ CallToActionButton >
113- </ div >
114- </ header >
115- ) ;
116- } ;
117-
118- // CSS string for colors and font import
11914const customCss = `
12015 /* Load Inter font (using a web-safe sans-serif fallback) */
12116 @import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');
122-
123-
12417` ;
12518
126- // The main landing page component
127- const HomePage : React . FC = ( ) => {
19+ export default function HomePage ( ) {
12820 return (
12921 < div className = "min-h-screen bg-background text-foreground font-sans" >
130- { /* FIX: Hydration Error
131- The <style> block is fixed by using dangerouslySetInnerHTML, which
132- tells React not to manage its content during hydration, preventing
133- the server/client content mismatch (due to different string
134- serialization/escaping).
135- */ }
13622 < style dangerouslySetInnerHTML = { { __html : customCss } } />
137-
138- { /* NOTE: In a real project, Tailwind CSS is imported via a global CSS file,
139- not a <script> tag. The script tag is left as it was in the original
140- code for simulation purposes, though it has no effect in a standard
141- Next.js/TSX environment. */ }
142- { /* <script src="https://cdn.tailwindcss.com"></script> */ }
143-
144- { /* <Header /> */ }
145-
14623 < main className = "mx-auto max-w-5xl px-4 py-12 md:py-24" >
14724 { /* === 1. Hero Section === */ }
14825 < section className = "text-center mb-20 md:mb-32" >
@@ -281,6 +158,4 @@ const HomePage: React.FC = () => {
281158 </ footer >
282159 </ div >
283160 ) ;
284- } ;
285-
286- export default HomePage ;
161+ }
0 commit comments