Skip to content

Commit d19f8ee

Browse files
authored
Merge pull request #470 from thekamalkashyap/master
fixed glitch in mobile navbar
2 parents c3f8f2f + f8ae4d5 commit d19f8ee

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

components/MobileNav.js

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,39 @@ const MobileNav = () => {
3131
fill="currentColor"
3232
className="text-gray-900 dark:text-gray-100"
3333
>
34-
{navShow ? (
35-
<path
36-
fillRule="evenodd"
37-
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
38-
clipRule="evenodd"
39-
/>
40-
) : (
41-
<path
42-
fillRule="evenodd"
43-
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
44-
clipRule="evenodd"
45-
/>
46-
)}
34+
<path
35+
fillRule="evenodd"
36+
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
37+
clipRule="evenodd"
38+
/>
4739
</svg>
4840
</button>
4941
<div
50-
className={`fixed top-24 right-0 z-10 h-full w-full transform bg-gray-200 opacity-95 duration-300 ease-in-out dark:bg-gray-800 ${
42+
className={`fixed top-0 left-0 z-10 h-full w-full transform bg-gray-200 opacity-95 duration-300 ease-in-out dark:bg-gray-800 ${
5143
navShow ? 'translate-x-0' : 'translate-x-full'
5244
}`}
5345
>
54-
<button
55-
type="button"
56-
aria-label="toggle modal"
57-
className="fixed h-full w-full cursor-auto focus:outline-none"
58-
onClick={onToggleNav}
59-
></button>
46+
<div className="flex justify-end">
47+
<button
48+
type="button"
49+
className="mr-5 mt-11 h-8 w-8 rounded"
50+
aria-label="Toggle Menu"
51+
onClick={onToggleNav}
52+
>
53+
<svg
54+
xmlns="http://www.w3.org/2000/svg"
55+
viewBox="0 0 20 20"
56+
fill="currentColor"
57+
className="text-gray-900 dark:text-gray-100"
58+
>
59+
<path
60+
fillRule="evenodd"
61+
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
62+
clipRule="evenodd"
63+
/>
64+
</svg>
65+
</button>
66+
</div>
6067
<nav className="fixed mt-8 h-full">
6168
{headerNavLinks.map((link) => (
6269
<div key={link.title} className="px-12 py-4">

0 commit comments

Comments
 (0)