11"use client" ;
22
3+ import { useState } from "react" ;
34import Link from "next/link" ;
45import Image from "next/image" ;
6+ import { Modal } from "./Modal" ;
57
68/**
79 * HeroSection - Full viewport width hero section
@@ -19,6 +21,8 @@ import Image from "next/image";
1921 * @param {Object } hero - Hero configuration object with all content
2022 */
2123export function HeroSection ( { hero } ) {
24+ const [ isModalOpen , setIsModalOpen ] = useState ( false ) ;
25+
2226 if ( ! hero ) return null ;
2327
2428 const {
@@ -65,7 +69,7 @@ export function HeroSection({ hero }) {
6569
6670 return (
6771 < section
68- className = "relative flex items-start md:pt-[15vh] min-h-screen md:min-h-[calc(100vh+300px)] z-0 hero-background"
72+ className = "relative flex items-center justify-center md:items- start md:justify-start md: pt-[15vh] min-h-dvh md:min-h-[calc(100vh+300px)] z-0 hero-background"
6973 { ...( backgroundImage && {
7074 style : {
7175 backgroundImage : getResponsiveBackgroundImage ( backgroundImage ) ,
@@ -122,7 +126,7 @@ export function HeroSection({ hero }) {
122126
123127
124128 { /* Content Container */ }
125- < div className = "relative z-20 mx-[15px] md:ml-[5%] lg:ml-[10%] sm:mx-auto md:px-16 flex flex-col max-w-4xl xl:max-w-[60vw]" >
129+ < div className = "relative z-20 mx-[15px] md:ml-[5%] lg:ml-[10%] md:px-16 flex flex-col max-w-4xl xl:max-w-[60vw] py-[10vh] md:py-0 " >
126130 < div className = "hidden md:block" >
127131 < Image
128132 src = "/icons/urbit-digi-accent-2.svg"
@@ -147,7 +151,7 @@ export function HeroSection({ hero }) {
147151 alt = "urbit digi logo"
148152 width = { 90 }
149153 height = { 90 }
150- className = "mt-24 md:hidden"
154+ className = "md:hidden"
151155 />
152156 </ div >
153157 ) }
@@ -182,14 +186,25 @@ export function HeroSection({ hero }) {
182186
183187 { /* Secondary Mobile CTA */ }
184188 { secondaryMobileCta && (
185- < Link
186- href = { secondaryMobileCta . link }
187- className = "font-sans text-2xl flex w-fit items-center justify-center my-2 px-2 py-1
188- bg-background text-accent-1 border border-accent-1 rounded-lg
189- hover:bg-primary hover:text-secondary transition-all transform"
190- >
191- { secondaryMobileCta . label }
192- </ Link >
189+ secondaryMobileCta . link . startsWith ( 'http' ) ? (
190+ < button
191+ onClick = { ( ) => setIsModalOpen ( true ) }
192+ className = "font-sans text-2xl flex w-fit items-center justify-center my-2 px-2 py-1
193+ bg-background text-accent-1 border border-accent-1 rounded-lg
194+ hover:bg-primary hover:text-secondary transition-all transform"
195+ >
196+ { secondaryMobileCta . label }
197+ </ button >
198+ ) : (
199+ < Link
200+ href = { secondaryMobileCta . link }
201+ className = "font-sans text-2xl flex w-fit items-center justify-center my-2 px-2 py-1
202+ bg-background text-accent-1 border border-accent-1 rounded-lg
203+ hover:bg-primary hover:text-secondary transition-all transform"
204+ >
205+ { secondaryMobileCta . label }
206+ </ Link >
207+ )
193208 ) }
194209 </ div >
195210
@@ -237,18 +252,52 @@ export function HeroSection({ hero }) {
237252
238253 { /* Desktop Tertiary Link */ }
239254 { tertiaryLink && (
255+ tertiaryLink . link . startsWith ( 'http' ) ? (
256+ < button
257+ onClick = { ( ) => setIsModalOpen ( true ) }
258+ className = "hidden md:block font-mono text-sm text-contrast-2 hover:text-primary transition-colors text-left"
259+ >
260+ { tertiaryLink . label }
261+ </ button >
262+ ) : (
263+ < Link
264+ href = { tertiaryLink . link }
265+ className = "hidden md:block font-mono text-sm text-contrast-2 hover:text-primary transition-colors"
266+ >
267+ { tertiaryLink . label }
268+ </ Link >
269+ )
270+ ) }
271+ </ div >
272+
273+ { /* Leaving Site Modal */ }
274+ < Modal isOpen = { isModalOpen } onClose = { ( ) => setIsModalOpen ( false ) } >
275+ < h2 className = "text-2xl font-serif italic font-semibold text-primary mb-4" >
276+ Quickstart with Tlon Messenger
277+ </ h2 >
278+ < p className = "font-sans text-large leading-120 text-primary mb-6" >
279+ Tlon will onboard you to Urbit without needing to run your own node. They provide free hosting and a free Urbit ID with their mobile app.</ p >
280+ < p className = "font-sans text-large leading-120 text-primary mb-6" >
281+ The link below will get you set up and added to the Urbit Foundation public group; say hello and someone will show you around!</ p >
282+ < div className = "flex gap-3 justify-end" >
240283 < Link
241- href = { tertiaryLink . link }
242- className = "hidden md:block font-mono text-sm text-contrast-2 hover:text-primary transition-colors"
243- { ...( tertiaryLink . link . startsWith ( 'http' ) && {
244- target : "_blank" ,
245- rel : "noopener noreferrer" ,
246- } ) }
284+ href = "/overview/running-urbit"
285+ onClick = { ( ) => setIsModalOpen ( false ) }
286+ className = "font-sans text-lg flex items-center py-1 px-3 rounded-lg text-contrast-2 hover:text-primary font-[600]"
247287 >
248- { tertiaryLink . label }
288+ Help me self-host
249289 </ Link >
250- ) }
251- </ div >
290+ < a
291+ href = { tertiaryLink ?. link || tertiaryMobileLink ?. link }
292+ target = "_blank"
293+ rel = "noopener noreferrer"
294+ className = "font-sans text-lg flex items-center py-1 px-3 rounded-lg text-background bg-foreground hover:text-contrast-1 font-[600]"
295+ onClick = { ( ) => setIsModalOpen ( false ) }
296+ >
297+ Onboard via Tlon
298+ </ a >
299+ </ div >
300+ </ Modal >
252301 </ section >
253302 ) ;
254303}
0 commit comments