@@ -22,82 +22,80 @@ export interface LandingHeaderRepository {
2222
2323export interface LandingHeaderProps extends ComponentProps < 'header' > {
2424 hooks : LandingHeaderHook [ ] ;
25- repository : LandingHeaderRepository ;
25+ stars : number ;
2626}
2727
28- export const LandingHeader = ( { hooks, repository, ...props } : LandingHeaderProps ) => {
29- const formattedCount = formatCount ( repository . stargazersCount ) ;
30-
31- return (
32- < header
33- className = 'bg-background/95 supports-[backdrop-filter]:bg-background/80 sticky top-0 z-50 w-full backdrop-blur'
34- { ...props }
35- >
36- < div className = 'container flex h-(--header-height) items-center justify-between gap-3 px-6' >
37- < div className = 'hidden min-w-0 items-center justify-between gap-3 lg:flex' >
38- < Link className = 'inline-flex items-center gap-2' href = '/' prefetch = { false } >
39- < Image alt = 'ReactUse' height = { 12 } src = '/logo.svg' width = { 12 } />
40-
41- < span className = 'text-foreground text-lg font-semibold tracking-tight' >
42- { CONFIG . NAME }
43- </ span >
44- </ Link >
45-
46- < div className = 'flex items-center gap-2' >
47- < Button asChild className = 'rounded-full' size = 'sm' variant = 'ghost' >
48- < Link href = '/docs/installation' prefetch = { false } >
49- Docs
50- </ Link >
51- </ Button >
52-
53- < Button asChild className = 'rounded-full' size = 'sm' variant = 'ghost' >
54- < Link href = '/docs/functions' prefetch = { false } >
55- Functions
56- </ Link >
57- </ Button >
58- </ div >
59- </ div >
60-
61- < div className = 'flex min-w-0 items-center justify-end gap-2' >
62- < Button asChild className = 'rounded-full' size = 'sm' >
28+ export const LandingHeader = ( { hooks, stars, ...props } : LandingHeaderProps ) => (
29+ < header
30+ className = 'bg-background/95 supports-[backdrop-filter]:bg-background/80 sticky top-0 z-50 w-full backdrop-blur'
31+ { ...props }
32+ >
33+ < div className = 'container flex h-(--header-height) items-center justify-between gap-3 px-6' >
34+ < div className = 'hidden min-w-0 items-center justify-between gap-3 lg:flex' >
35+ < Link className = 'inline-flex items-center gap-2' href = '/' prefetch = { false } >
36+ < Image alt = 'ReactUse' height = { 12 } src = '/logo.svg' width = { 12 } />
37+
38+ < span className = 'text-foreground text-lg font-semibold tracking-tight' >
39+ { CONFIG . NAME }
40+ </ span >
41+ </ Link >
42+
43+ < div className = 'flex items-center gap-2' >
44+ < Button asChild className = 'rounded-full' size = 'sm' variant = 'ghost' >
6345 < Link href = '/docs/installation' prefetch = { false } >
64- Getting Started
46+ Docs
6547 </ Link >
6648 </ Button >
6749
68- < div className = 'flex items-center gap-1' >
69- < Button asChild className = 'rounded-full' variant = 'outline' >
70- < Link href = { LINKS . GITHUB } prefetch = { false } rel = 'noreferrer' target = '_blank' >
71- < Icons . gitHub className = 'size-4.5' />
72- < StarIcon className = 'size-3.5' />
50+ < Button asChild className = 'rounded-full' size = 'sm' variant = 'ghost' >
51+ < Link href = '/docs/functions' prefetch = { false } >
52+ Functions
53+ </ Link >
54+ </ Button >
55+ </ div >
56+ </ div >
7357
74- < span className = 'text-muted-foreground text-xs tabular-nums' > { formattedCount } </ span >
75- </ Link >
76- </ Button >
58+ < div className = 'flex min-w-0 items-center justify-end gap-2' >
59+ < Button asChild className = 'rounded-full' size = 'sm' >
60+ < Link href = '/docs/installation' prefetch = { false } >
61+ Getting Started
62+ </ Link >
63+ </ Button >
7764
78- < Button asChild className = 'rounded-full' size = 'icon' variant = 'ghost '>
79- < Link href = { LINKS . NPM } prefetch = { false } rel = 'noreferrer' target = '_blank '>
80- < Icons . npm className = 'size-4.5' / >
81- </ Link >
82- </ Button >
65+ < div className = 'flex items-center gap-1 ' >
66+ < Button asChild className = 'rounded-full' variant = 'outline '>
67+ < Link href = { LINKS . GITHUB } prefetch = { false } rel = 'noreferrer' target = '_blank' >
68+ < Icons . gitHub className = 'size-4.5' / >
69+ < StarIcon className = 'size-3.5' / >
8370
84- < ThemeButton />
85- </ div >
86- </ div >
87- </ div >
71+ < span className = 'text-muted-foreground text-xs tabular-nums' >
72+ { formatCount ( stars ) }
73+ </ span >
74+ </ Link >
75+ </ Button >
8876
89- < div className = 'border-border h-8 overflow-hidden border-t [mask-image:linear-gradient(to_right,transparent_0%,black_8%,black_92%,transparent_100%)] [-webkit-mask-image:linear-gradient(to_right,transparent_0%,black_8%,black_92%,transparent_100%)]' >
90- < Marquee className = 'h-full p-0 [--duration:250s] [--gap:0.25rem]' >
91- { hooks . map ( ( hook ) => (
92- < Fragment key = { hook . name } >
93- < div className = 'text-muted-foreground inline-flex items-center gap-4 px-[18px] font-mono text-xs tracking-tight' >
94- { hook . name }
95- </ div >
96- < div className = 'flex items-center text-[10px]' > •</ div >
97- </ Fragment >
98- ) ) }
99- </ Marquee >
77+ < Button asChild className = 'rounded-full' size = 'icon' variant = 'ghost' >
78+ < Link href = { LINKS . NPM } prefetch = { false } rel = 'noreferrer' target = '_blank' >
79+ < Icons . npm className = 'size-4.5' />
80+ </ Link >
81+ </ Button >
82+
83+ < ThemeButton />
84+ </ div >
10085 </ div >
101- </ header >
102- ) ;
103- } ;
86+ </ div >
87+
88+ < div className = 'border-border h-8 overflow-hidden border-t [mask-image:linear-gradient(to_right,transparent_0%,black_8%,black_92%,transparent_100%)] [-webkit-mask-image:linear-gradient(to_right,transparent_0%,black_8%,black_92%,transparent_100%)]' >
89+ < Marquee className = 'h-full p-0 [--duration:250s] [--gap:0.25rem]' >
90+ { hooks . map ( ( hook ) => (
91+ < Fragment key = { hook . name } >
92+ < div className = 'text-muted-foreground inline-flex items-center gap-4 px-[18px] font-mono text-xs tracking-tight' >
93+ { hook . name }
94+ </ div >
95+ < div className = 'flex items-center text-[10px]' > •</ div >
96+ </ Fragment >
97+ ) ) }
98+ </ Marquee >
99+ </ div >
100+ </ header >
101+ ) ;
0 commit comments