From dbcafc4c6a7b83679ceb5c576c4d990c6fed41fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9B=90=EB=8D=94?= Date: Thu, 11 Feb 2021 20:58:36 +0900 Subject: [PATCH] chore: some changes at Navbar --- components/Navbar.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 6c03f2b..bb57451 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -6,11 +6,12 @@ import Link from 'next/link' import { useRouter } from 'next/router' import { redirectTo } from '@utils/Tools' +import { Theme, UserCache } from '@types' import DiscordAvatar from '@components/DiscordAvatar' -const Navbar = (): JSX.Element => { - let userCache +const Navbar = ({ theme, setTheme }:NavbarProps): JSX.Element => { + let userCache:UserCache try { userCache = JSON.parse(localStorage.userCache) } catch { @@ -72,10 +73,10 @@ const Navbar = (): JSX.Element => {
@@ -214,4 +215,9 @@ const Navbar = (): JSX.Element => { ) } +interface NavbarProps { + theme: Theme + setTheme(value: Theme): void +} + export default Navbar