From 20dbe843b44f6975fcf86e7f0617fc176e157998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9B=90=EB=8D=94?= Date: Wed, 27 Jan 2021 22:51:45 +0900 Subject: [PATCH] feat: added onClicks to close navbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 임시 --- components/Navbar.tsx | 51 +++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 2111593..b1db63a 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -1,7 +1,17 @@ +/* eslint-disable jsx-a11y/click-events-have-key-events */ +/* eslint-disable jsx-a11y/no-static-element-interactions */ import Link from 'next/link' import { useState } from 'react' +import DiscordAvatar from './DiscordAvatar' const Navbar = (): JSX.Element => { + let userCache + try { + userCache = JSON.parse(localStorage.userCache) + } catch { + userCache = null + } + const [navbarOpen, setNavbarOpen] = useState(false) return ( <> @@ -9,8 +19,7 @@ const Navbar = (): JSX.Element => {
- setNavbarOpen(false)} className='logofont text-large whitespace-no-wrap inline-block mr-4 py-2 hover:text-gray-300 font-semibold leading-relaxed uppercase sm:text-2xl' > KOREANBOTS @@ -27,8 +36,7 @@ const Navbar = (): JSX.Element => {