8
8
TableOfContentsIcon ,
9
9
} from "lucide-react" ;
10
10
import Link from "next/link" ;
11
- import { usePathname , useRouter } from "next/navigation" ;
11
+ import { usePathname } from "next/navigation" ;
12
12
import { useState } from "react" ;
13
13
import { DocSearch } from "@/components/others/DocSearch" ;
14
14
import { Button } from "@/components/ui/button" ;
@@ -191,13 +191,12 @@ const supportLinks = [
191
191
192
192
export function Header ( ) {
193
193
const [ showBurgerMenu , setShowBurgerMenu ] = useState ( false ) ;
194
- const router = useRouter ( ) ;
195
194
const pathname = usePathname ( ) ;
196
195
197
196
return (
198
- < header className = "flex w-full flex-col gap-2 border-b bg-background pt-4 px-4 lg:px-8 overflow-hidden" >
197
+ < header className = "flex w-full flex-col gap-2 border-b bg-background pt-4 px-4 pb-4 xl:pb-0 lg:px-8 overflow-hidden" >
198
+ { /* Top row */ }
199
199
< div className = "container flex items-center justify-between gap-6" >
200
- { /* Top row */ }
201
200
< div className = "flex items-center gap-2" >
202
201
< Link
203
202
aria-label = "thirdweb Docs"
@@ -219,7 +218,7 @@ export function Header() {
219
218
href = "https://github.com/thirdweb-dev"
220
219
target = "_blank"
221
220
>
222
- < GithubIcon className = "mx-3 size-6 " />
221
+ < GithubIcon className = "size-6 lg: size-5 " />
223
222
</ Link >
224
223
</ div >
225
224
@@ -232,25 +231,21 @@ export function Header() {
232
231
</ div >
233
232
234
233
< div className = "hidden xl:block" >
235
- < Button
236
- onClick = { ( ) => {
237
- router . push ( "/chat" ) ;
238
- } }
239
- >
240
- < MessageCircleIcon className = "mr-2 size-4" />
241
- Ask AI
234
+ < Button asChild >
235
+ < Link href = "/chat" >
236
+ < MessageCircleIcon className = "mr-2 size-4" />
237
+ Ask AI
238
+ </ Link >
242
239
</ Button >
243
240
</ div >
244
241
245
242
< div className = "flex items-center gap-1 xl:hidden" >
246
243
< ThemeSwitcher className = "border-none bg-transparent" />
247
244
< DocSearch variant = "icon" />
248
- < Button
249
- className = "p-2"
250
- onClick = { ( ) => router . push ( "/chat" ) }
251
- variant = "ghost"
252
- >
253
- < MessageCircleIcon className = "size-7" />
245
+ < Button className = "p-2" asChild variant = "ghost" >
246
+ < Link href = "/chat" >
247
+ < MessageCircleIcon className = "size-6" />
248
+ </ Link >
254
249
</ Button >
255
250
< Button
256
251
className = "p-2"
@@ -264,13 +259,13 @@ export function Header() {
264
259
</ div >
265
260
266
261
{ /* Bottom row - hidden on mobile */ }
267
- < div className = "container hidden items-center justify-between gap-6 xl:flex" >
262
+ < div className = "container hidden items-center justify-between gap-6 xl:flex mt-1 " >
268
263
< nav className = "flex grow gap-5" >
269
- < ul className = "flex flex-row items-center gap-5 " >
264
+ < ul className = "flex flex-row items-center gap-0 mb-1 " >
270
265
{ links . map ( ( link ) => {
271
266
return (
272
267
< li
273
- className = "flex items-center py-4 relative overflow-hidden "
268
+ className = "flex items-center py-2 relative px-2.5 rounded-lg hover:bg-accent hover:text-foreground "
274
269
key = { link . href }
275
270
onClick = { ( ) => {
276
271
setShowBurgerMenu ( false ) ;
@@ -281,7 +276,7 @@ export function Header() {
281
276
>
282
277
< NavLink href = { link . href } name = { link . name } />
283
278
{ pathname . includes ( link . href ) && (
284
- < div className = "bg-violet-700 h-1 inset-x-0.5 rounded-full absolute -bottom-0.5 " />
279
+ < div className = "bg-violet-700 h-[2px] inset-x-0 rounded-full absolute -bottom-1 " />
285
280
) }
286
281
</ li >
287
282
) ;
0 commit comments