11'use client' ;
22
3+ import { useMediaQuery } from '@onlook/ui/hooks' ;
34import { Icons } from '@onlook/ui/icons/index' ;
45import React , { useEffect , useState } from 'react' ;
56
@@ -11,20 +12,10 @@ interface Contributor {
1112
1213// Floating Circles: two concentric rings
1314const FloatingRings = ( ) => {
14- const [ isMd , setIsMd ] = React . useState (
15- typeof window !== 'undefined' ? window . matchMedia ( '(min-width: 768px)' ) . matches : false
16- ) ;
15+ const isMd = useMediaQuery ( '(min-width: 768px)' ) ;
1716 const [ contributors , setContributors ] = useState < Contributor [ ] > ( [ ] ) ;
1817 const [ isLoading , setIsLoading ] = useState ( true ) ;
1918
20- React . useEffect ( ( ) => {
21- const media = window . matchMedia ( '(min-width: 768px)' ) ;
22- const listener = ( ) => setIsMd ( media . matches ) ;
23- media . addEventListener ( 'change' , listener ) ;
24- setIsMd ( media . matches ) ;
25- return ( ) => media . removeEventListener ( 'change' , listener ) ;
26- } , [ ] ) ;
27-
2819 useEffect ( ( ) => {
2920 const fetchContributors = async ( ) => {
3021 try {
@@ -74,10 +65,10 @@ const FloatingRings = () => {
7465 key = { `inner-${ i } ` }
7566 className = "absolute rounded-full bg-white/20 border border-foreground-primary/40 border-[0.5px] shadow-lg overflow-hidden"
7667 style = { {
77- width : 56 ,
78- height : 56 ,
79- left : x - 28 ,
80- top : y - 28 ,
68+ width : '56px' ,
69+ height : '56px' ,
70+ left : ` ${ x - 28 } px` ,
71+ top : ` ${ y - 28 } px` ,
8172 animation : 'counter-spin 280s linear infinite' ,
8273 transformOrigin : 'center center'
8374 } }
@@ -107,10 +98,10 @@ const FloatingRings = () => {
10798 key = { `outer-${ i } ` }
10899 className = "absolute rounded-full bg-white/20 border border-foreground-primary/40 border-[0.5px] shadow-lg overflow-hidden"
109100 style = { {
110- width : 56 ,
111- height : 56 ,
112- left : x - 28 ,
113- top : y - 28 ,
101+ width : '56px' ,
102+ height : '56px' ,
103+ left : ` ${ x - 28 } px` ,
104+ top : ` ${ y - 28 } px` ,
114105 animation : 'counter-spin-reverse 290s linear infinite' ,
115106 transformOrigin : 'center center'
116107 } }
@@ -207,16 +198,19 @@ export function ContributorSection({
207198 }
208199 ` } </ style >
209200 < h2 className = "text-foreground-primary text-3xl md:text-4xl font-light text-center mb-2" >
210- Supported by You & < br />
211- { isLoading ? '...' : starCount } other builders
201+ Powered by Onlook
212202 </ h2 >
213- < p className = "text-foreground-secondary text-regular text-center mb-8 max-w-xl" > Join our mission and be a part of changing< br /> the way people craft software</ p >
203+ < p className = "text-foreground-secondary text-regular text-center mb-8 max-w-xl" >
204+ Join our mission and be a part of changing
205+ < br />
206+ the way people craft software
207+ </ p >
214208 < div className = "flex gap-4 flex-col md:flex-row w-full justify-center items-center" >
215209 < button
216210 onClick = { ( ) => window . open ( githubLink , '_blank' ) }
217211 className = "bg-foreground-primary text-background-primary text-regularPlus rounded-lg px-6 py-3 flex items-center gap-2 shadow hover:bg-foreground-primary/80 transition cursor-pointer"
218212 >
219- Contribute to Onlook
213+ Contribute to Botcodes
220214 < Icons . GitHubLogo className = "w-4.5 h-4.5" />
221215 </ button >
222216 < button
0 commit comments