2222 * SOFTWARE.
2323 */
2424
25+ 'use client' ;
26+
2527import { ForwardedRef , forwardRef , ForwardRefExoticComponent , HTMLAttributes , RefAttributes } from 'react' ;
2628import { CalendarDays , Clock , ExternalLink , MapPin } from 'lucide-react' ;
29+ import { useRouter } from 'next/navigation' ;
30+ import { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime' ;
2731import { cn } from '@/lib/utils' ;
2832import { TestableComponent } from '@/types/dom' ;
2933import NelumKuluna from '@/icons/NelumKuluna' ;
@@ -37,67 +41,80 @@ export type HeroProps = HTMLAttributes<HTMLDivElement> & TestableComponent;
3741const Hero : ForwardRefExoticComponent < HeroProps & RefAttributes < HTMLDivElement > > = forwardRef <
3842 HTMLDivElement ,
3943 HeroProps
40- > ( ( { className, ...rest } : HeroProps , ref : ForwardedRef < HTMLDivElement > ) => (
41- < div className = { cn ( 'hero' , className ) } ref = { ref } { ...rest } >
42- < div
43- className = { cn (
44- 'w-auto pb-16 pt-[40px] md:pb-24 lg:pb-32 md:pt-16 lg:pt-25 flex justify-between gap-8 items-center flex-col relative z-0' ,
45- className ,
46- ) }
47- >
48- < div className = "z-50 flex flex-col items-center justify-center gap-5 px-6 text-center lg:gap-6" >
49- < h1 className = "hero__title font-good-brush tracking-[-0.04em] leading-none text-[40px] md:text-5xl lg:text-[12em] max-w-lg md:max-w-xl lg:max-w-4xl text-center text-white" >
50- JavaScript Colombo
51- </ h1 >
52- < h3 className = "flex gap-2 flex-wrap justify-center items-center font-space-grotesk leading-snug dark:text-[#FFFFFFB2] text-[#00000080] text-[20px] lg:text-xl max-w-md md:max-w-xl lg:max-w-[640px] text-center" >
53- Let's meetup in Colombo, grab a < span className = "underlined" > coffee</ span >
54- < CoffeeBeans height = { 28 } width = { 28 } /> and talk{ ' ' }
55- < span >
56- < code className = "font-mono" > `</ code >
57- < span className = "font-bold" > JavaScript</ span >
58- < code className = "font-mono" > `</ code >
59- </ span >
60- </ h3 >
61- < div className = "mt-8 text-left border border-1 px-8 py-6 rounded-md" >
62- < h4 className = "text-lg font-bold text-primary mb-2" > 🔔 Next session</ h4 >
63- < p className = "text-md text-primary flex items-center gap-1" >
64- < span className = "flex items-center gap-1" >
65- < CalendarDays /> Nov 6th 2024
66- </ span >
67- ,{ ' ' }
68- < span className = "flex items-center gap-1" >
69- < Clock />
70- 6:00 PM Eastern
71- </ span > { ' ' }
72- at{ ' ' }
73- < span className = "flex items-center gap-1" >
74- < MapPin className = "text-[red]" />
75- WSO2, Colombo 4, Sri Lanka
44+ > ( ( { className, ...rest } : HeroProps , ref : ForwardedRef < HTMLDivElement > ) => {
45+ const router : AppRouterInstance = useRouter ( ) ;
46+
47+ const handleRegisterClick = ( ) : void => {
48+ const orgName : string | undefined = process . env . NEXT_PUBLIC_ASGARDEO_CLIENT_APP_ORG || '' ;
49+ const clientId : string | undefined = process . env . NEXT_PUBLIC_ASGARDEO_CLIENT_APP_ID || '' ;
50+ const appName : string | undefined = process . env . NEXT_PUBLIC_ASGARDEO_CLIENT_APP_NAME || '' ;
51+
52+ const url : string = `https://accounts.asgardeo.io/t/${ orgName } /accountrecoveryendpoint/register.do?client_id=${ clientId } &sp=${ appName } ` ;
53+ router . push ( url ) ;
54+ } ;
55+
56+ return (
57+ < div className = { cn ( 'hero' , className ) } ref = { ref } { ...rest } >
58+ < div
59+ className = { cn (
60+ 'w-auto pb-16 pt-[40px] md:pb-24 lg:pb-32 md:pt-16 lg:pt-25 flex justify-between gap-8 items-center flex-col relative z-0' ,
61+ className ,
62+ ) }
63+ >
64+ < div className = "z-50 flex flex-col items-center justify-center gap-5 px-6 text-center lg:gap-6" >
65+ < h1 className = "hero__title font-good-brush tracking-[-0.04em] leading-none text-[40px] md:text-5xl lg:text-[12em] max-w-lg md:max-w-xl lg:max-w-4xl text-center text-white" >
66+ JavaScript Colombo
67+ </ h1 >
68+ < h3 className = "flex gap-2 flex-wrap justify-center items-center font-space-grotesk leading-snug dark:text-[#FFFFFFB2] text-[#00000080] text-[20px] lg:text-xl max-w-md md:max-w-xl lg:max-w-[640px] text-center" >
69+ Let's meetup in Colombo, grab a < span className = "underlined" > coffee</ span >
70+ < CoffeeBeans height = { 28 } width = { 28 } /> and talk{ ' ' }
71+ < span >
72+ < code className = "font-mono" > `</ code >
73+ < span className = "font-bold" > JavaScript</ span >
74+ < code className = "font-mono" > `</ code >
7675 </ span >
77- </ p >
78- </ div >
79- < div className = "flex items-center gap-10 mt-10" >
80- < RegisterButton className = "w-60" >
81- < FlipWords words = { [ 'Register' , 'RSVP ✨' ] } className = "text-inverse font-bold" />
82- </ RegisterButton >
83- < div className = "flex items-center gap-10" >
84- < div className = "h-12 w-px bg-gray-400" />
85- < span className = "flex items-center" >
86- check us out on{ ' ' }
87- < span className = "flex items-center underlined cursor-pointer group" >
88- < Meetup height = { 30 } width = { 100 } />
89- < ExternalLink className = "text-secondary opacity-0 group-hover:opacity-100 transition-opacity duration-300" />
76+ </ h3 >
77+ < div className = "mt-8 text-left border border-1 px-8 py-6 rounded-md" >
78+ < h4 className = "text-lg font-bold text-primary mb-2" > 🔔 Next session</ h4 >
79+ < p className = "text-md text-primary flex items-center gap-1" >
80+ < span className = "flex items-center gap-1" >
81+ < CalendarDays /> Nov 6th 2024
9082 </ span >
91- </ span >
83+ ,{ ' ' }
84+ < span className = "flex items-center gap-1" >
85+ < Clock />
86+ 6:00 PM Eastern
87+ </ span > { ' ' }
88+ at{ ' ' }
89+ < span className = "flex items-center gap-1" >
90+ < MapPin className = "text-[red]" />
91+ WSO2, Colombo 4, Sri Lanka
92+ </ span >
93+ </ p >
94+ </ div >
95+ < div className = "flex items-center gap-10 mt-10" >
96+ < RegisterButton className = "w-60" onClick = { handleRegisterClick } >
97+ < FlipWords words = { [ 'Register' , 'RSVP ✨' ] } className = "text-inverse font-bold" />
98+ </ RegisterButton >
99+ < div className = "flex items-center gap-10" >
100+ < div className = "h-12 w-px bg-gray-400" />
101+ < span className = "flex items-center" >
102+ check us out on{ ' ' }
103+ < span className = "flex items-center underlined cursor-pointer group" >
104+ < Meetup height = { 30 } width = { 100 } />
105+ < ExternalLink className = "text-secondary opacity-0 group-hover:opacity-100 transition-opacity duration-300" />
106+ </ span >
107+ </ span >
108+ </ div >
92109 </ div >
93- </ div >
94110
95- < div className = "nelum-kuluna-mask absolute right-[-125px] top-[50px]" >
96- < NelumKuluna />
111+ < div className = "nelum-kuluna-mask absolute right-[-125px] top-[50px]" >
112+ < NelumKuluna />
113+ </ div >
97114 </ div >
98115 </ div >
99116 </ div >
100- </ div >
101- ) ) ;
117+ ) ;
118+ } ) ;
102119
103120export default Hero ;
0 commit comments