From 6773165c726ef8beb2a9044be7d66d377a60a3b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9B=90=EB=8D=94?= Date: Wed, 27 Jan 2021 22:59:09 +0900 Subject: [PATCH] feat: added redirect To feature --- components/Navbar.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/Navbar.tsx b/components/Navbar.tsx index b1db63a..ce0dc70 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -2,7 +2,6 @@ /* 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 @@ -65,7 +64,10 @@ const Navbar = (): JSX.Element => {
  • - setNavbarOpen(false)} className='lg:hover:text-gray-300 flex items-center px-3 py-4 w-full hover:text-gray-500 text-gray-700 text-sm font-semibold sm:w-auto lg:py-2 lg:text-gray-100'> + { + localStorage.redirectTo = window.location.href + setNavbarOpen(false) + }} className='lg:hover:text-gray-300 flex items-center px-3 py-4 w-full hover:text-gray-500 text-gray-700 text-sm font-semibold sm:w-auto lg:py-2 lg:text-gray-100'> { userCache ? <> {userCache.username} @@ -117,7 +119,10 @@ const Navbar = (): JSX.Element => { - setNavbarOpen(false)} className='flex items-center px-8 py-2 text-gray-100 hover:text-gray-300'> + { + localStorage.redirectTo = window.location.href + setNavbarOpen(false) + }} className='flex items-center px-8 py-2 text-gray-100 hover:text-gray-300'> { userCache ? <>