fix: menu not closing

close: https://github.com/koreanbots/v2-testing/issues/50
This commit is contained in:
wonderlandpark 2021-05-06 10:54:57 +09:00
parent 2fec571c77
commit 7270591718
No known key found for this signature in database
GPG Key ID: E3E650B146478C64

View File

@ -179,7 +179,7 @@ const Navbar = ({ token }:{ token: string }): JSX.Element => {
strokeLinejoin='round'
/>
</svg>
<span className='px-2 font-medium'></span>
<span onClick={() => setNavbarOpen(!navbarOpen)} className='px-2 font-medium'></span>
</a>
</Link>
<Link href='/addbot'>
@ -194,18 +194,19 @@ const Navbar = ({ token }:{ token: string }): JSX.Element => {
{
logged ? <>
<Link href={`/users/${userCache.id}`}>
<a className='flex items-center px-8 py-2 text-gray-100 hover:text-gray-300'>
<a className='flex items-center px-8 py-2 text-gray-100 hover:text-gray-300' onClick={() => setNavbarOpen(!navbarOpen)}>
<i className='far fa-user' />
<span className='px-2 font-medium'>{userCache.username}</span>
</a>
</Link>
<Link href='/panel'>
<a className='flex items-center px-8 py-2 text-gray-100 hover:text-gray-300'>
<a className='flex items-center px-8 py-2 text-gray-100 hover:text-gray-300' onClick={() => setNavbarOpen(!navbarOpen)}>
<i className='fas fa-cogs' />
<span className='px-2 font-medium'></span>
</a>
</Link>
<a onClick={()=> {
setNavbarOpen(!navbarOpen)
localStorage.removeItem('userCache')
redirectTo(router, 'logout')
}} className='flex items-center px-8 py-2 text-red-500 hover:text-red-400'>