@@ -5,8 +5,8 @@ import Image from "next/image";
5
5
import Link from "next/link" ;
6
6
import { usePathname } from "next/navigation" ;
7
7
import { motion , useAnimate } from "framer-motion" ;
8
- import { MenuIcon , SearchIcon } from "lucide-react" ;
9
- import { SearchDialog } from "@/components/search-command " ;
8
+ import { MenuIcon } from "lucide-react" ;
9
+ import { GitHubIcon , TwitterIcon } from "@/components/icons " ;
10
10
import { Button } from "@/components/ui/button" ;
11
11
import { Sheet , SheetContent , SheetTrigger } from "@/components/ui/sheet" ;
12
12
import { useScroll } from "@/hooks/use-scroll" ;
@@ -17,9 +17,7 @@ const config = siteConfig.header;
17
17
18
18
export const Header = ( ) => {
19
19
const { scrolled } = useScroll ( ) ;
20
- const [ searchOpen , setSearchOpen ] = React . useState ( false ) ;
21
20
const [ refLogo , animate ] = useAnimate ( ) ;
22
- const [ refCTA ] = useAnimate ( ) ;
23
21
24
22
React . useEffect ( ( ) => {
25
23
void animate (
@@ -30,14 +28,6 @@ export const Header = () => {
30
28
} ,
31
29
{ duration : 0.3 }
32
30
) ;
33
- void animate (
34
- refCTA . current ,
35
- {
36
- x : scrolled ? 120 : 180 ,
37
- opacity : scrolled ? 1 : 0 ,
38
- } ,
39
- { duration : 0.3 }
40
- ) ;
41
31
// eslint-disable-next-line react-hooks/exhaustive-deps
42
32
} , [ scrolled ] ) ;
43
33
@@ -81,7 +71,7 @@ export const Header = () => {
81
71
< div
82
72
suppressHydrationWarning
83
73
className = { cn ( "relative transition-all duration-300" , {
84
- "ml-[38px] mr-[120px] " : scrolled ,
74
+ "ml-[38px]" : scrolled ,
85
75
} ) }
86
76
>
87
77
< motion . div
@@ -100,22 +90,6 @@ export const Header = () => {
100
90
</ Link >
101
91
</ motion . div >
102
92
< Nav items = { config . nav . links } />
103
- < motion . div
104
- ref = { refCTA }
105
- className = "absolute right-0"
106
- initial = { { x : 0 , y : - 28 , opacity : 0 } }
107
- >
108
- < Button
109
- size = "sm"
110
- variant = "secondary"
111
- onClick = { ( ) => {
112
- setSearchOpen ( true ) ;
113
- } }
114
- >
115
- < SearchIcon size = { 18 } className = "mr-2" />
116
- < span > Search</ span >
117
- </ Button >
118
- </ motion . div >
119
93
</ div >
120
94
</ div >
121
95
</ div >
@@ -129,21 +103,20 @@ export const Header = () => {
129
103
) }
130
104
>
131
105
< div className = "flex items-center space-x-2" >
132
- < Button
133
- size = "sm"
134
- variant = "secondary"
135
- onClick = { ( ) => {
136
- setSearchOpen ( true ) ;
137
- } }
138
- >
139
- < SearchIcon size = { 18 } className = "mr-2" />
140
- < span > Search </ span >
106
+ < Button asChild size = "icon" variant = "ghost" className = "h-8 w-8" >
107
+ < Link href = { siteConfig . links . github } target = "_blank" >
108
+ < GitHubIcon size = { 18 } />
109
+ </ Link >
110
+ </ Button >
111
+ < Button asChild size = "icon" variant = "ghost" className = "h-8 w-8" >
112
+ < Link href = { siteConfig . links . twitter } target = "_blank" >
113
+ < TwitterIcon size = { 18 } />
114
+ </ Link >
141
115
</ Button >
142
116
</ div >
143
117
</ div >
144
118
< MobileNav />
145
119
</ div >
146
- < SearchDialog open = { searchOpen } onOpenChange = { setSearchOpen } />
147
120
</ header >
148
121
) ;
149
122
} ;
0 commit comments