Skip to content

Commit b336ff5

Browse files
committed
fix: add Nextjs router Link for menu navigation
1 parent 6b7c0a1 commit b336ff5

File tree

1 file changed

+22
-31
lines changed

1 file changed

+22
-31
lines changed

src/components/Global/Navbar.js

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ const navigation = [
1515
const Navbar = () => {
1616
return (
1717
<Popover as="header" className="relative">
18-
<div className="bg-transparent pt-6">
18+
<div className="pt-6 bg-transparent">
1919
{/* NAVIGATION BAR */}
2020
<nav
21-
className="relative mx-auto flex max-w-7xl items-center justify-between px-4 sm:px-6"
21+
className="relative flex items-center justify-between px-4 mx-auto max-w-7xl sm:px-6"
2222
aria-label="Global"
2323
>
24-
<div className="flex flex-1 items-center">
25-
<div className="flex w-full items-center justify-between md:w-auto">
24+
<div className="flex items-center flex-1">
25+
<div className="flex items-center justify-between w-full md:w-auto">
2626
<Link href="/">
2727
<>
2828
<span className="sr-only ">WebX DAO</span>
2929
<img
30-
className="h-8 w-auto sm:h-10 cursor-pointer"
30+
className="w-auto h-8 cursor-pointer sm:h-10"
3131
src="/images/logo/white_logo.png"
3232
alt="WebX DAO White Logo"
3333
/>
3434
</>
3535
</Link>
36-
<div className="-mr-2 flex items-center md:hidden">
37-
<Popover.Button className="focus-ring-inset inline-flex items-center justify-center rounded-md bg-transparent p-2 text-gray-400 hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-white">
36+
<div className="flex items-center -mr-2 md:hidden">
37+
<Popover.Button className="inline-flex items-center justify-center p-2 text-gray-400 bg-transparent rounded-md focus-ring-inset hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-white">
3838
<span className="sr-only">Open main menu</span>
39-
<Bars3Icon className="h-6 w-6" aria-hidden="true" />
39+
<Bars3Icon className="w-6 h-6" aria-hidden="true" />
4040
</Popover.Button>
4141
</div>
4242
</div>
@@ -45,25 +45,20 @@ const Navbar = () => {
4545
<div className="hidden md:flex md:items-center md:space-x-6">
4646
<div className="hidden space-x-8 md:ml-10 md:flex">
4747
{navigation.map((item) => (
48-
<a
49-
key={item.name}
50-
href={item.href}
51-
className="text-base font-medium text-white hover:text-gray-300"
52-
>
53-
{item.name}
54-
</a>
48+
<Link href={item.href} key={item.name}>
49+
<a className="text-base font-medium text-white hover:text-gray-300">
50+
{item.name}
51+
</a>
52+
</Link>
5553
))}
5654
</div>
5755

5856
<a
5957
href="#"
60-
className="inline-flex items-center rounded-md border border-transparent bg-gray-100 px-4 py-2 text-base font-medium text-gray-600 hover:text-white/80 hover:bg-gray-700"
58+
className="inline-flex items-center px-4 py-2 text-base font-medium text-gray-600 bg-gray-100 border border-transparent rounded-md hover:text-white/80 hover:bg-gray-700"
6159
>
6260
GitHub
63-
<SiGithubsponsors
64-
className="ml-3 h-5 w-5 text-pink-600"
65-
aria-hidden="true"
66-
/>
61+
<SiGithubsponsors className="w-5 h-5 ml-3 text-pink-600" aria-hidden="true" />
6762
</a>
6863
</div>
6964
</nav>
@@ -80,31 +75,27 @@ const Navbar = () => {
8075
>
8176
<Popover.Panel
8277
focus
83-
className="absolute inset-x-0 top-0 z-10 origin-top transform p-2 transition md:hidden"
78+
className="absolute inset-x-0 top-0 z-10 p-2 transition origin-top transform md:hidden"
8479
>
85-
<div className="overflow-hidden rounded-lg backdrop-blur-sm bg-gradient1/50 shadow-xl ring-1 ring-white ring-opacity-5">
80+
<div className="overflow-hidden rounded-lg shadow-xl backdrop-blur-sm bg-gradient1/50 ring-1 ring-white ring-opacity-5">
8681
<div className="flex items-center justify-between px-5 pt-4">
8782
<div>
88-
<img
89-
className="h-8 w-auto"
90-
src="/images/logo/white_logo.png"
91-
alt="WebX DAO"
92-
/>
83+
<img className="w-auto h-8" src="/images/logo/white_logo.png" alt="WebX DAO" />
9384
</div>
9485
<div className="-mr-2">
95-
<Popover.Button className="inline-flex items-center justify-center rounded-md bg-white/20 p-2 text-gray-400 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-cyber-webx">
86+
<Popover.Button className="inline-flex items-center justify-center p-2 text-gray-400 rounded-md bg-white/20 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-cyber-webx">
9687
<span className="sr-only">Close menu</span>
97-
<XMarkIcon className="h-6 w-6" aria-hidden="true" />
88+
<XMarkIcon className="w-6 h-6" aria-hidden="true" />
9889
</Popover.Button>
9990
</div>
10091
</div>
10192
<div className="pt-5 pb-6">
102-
<div className="space-y-1 px-2">
93+
<div className="px-2 space-y-1">
10394
{navigation.map((item) => (
10495
<a
10596
key={item.name}
10697
href={item.href}
107-
className="block rounded-md px-3 py-2 text-base font-medium text-gray-100 hover:bg-gray-50"
98+
className="block px-3 py-2 text-base font-medium text-gray-100 rounded-md hover:bg-gray-50"
10899
>
109100
{item.name}
110101
</a>

0 commit comments

Comments
 (0)