chore: not passing pwa at navbar

This commit is contained in:
wonderlandpark 2021-05-22 12:13:34 +09:00
parent 77196d057f
commit f03ff02f88
2 changed files with 4 additions and 7 deletions

View File

@ -12,7 +12,7 @@ import { User, UserCache } from '@types'
const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar'))
const Navbar: React.FC<NavbarProps> = ({ token, pwa }) => {
const Navbar: React.FC<NavbarProps> = ({ token }) => {
const [userCache, setUserCache] = useState<UserCache>()
const [navbarOpen, setNavbarOpen] = useState<boolean>(false)
const [dropdownOpen, setDropdownOpen] = useState<boolean>(false)
@ -128,8 +128,7 @@ const Navbar: React.FC<NavbarProps> = ({ token, pwa }) => {
<a tabIndex={0} onClick={()=> {
localStorage.redirectTo = window.location.href
setNavbarOpen(false)
if(pwa) window.open('/api/auth/discord', '_blank')
else redirectTo(router, 'login')
redirectTo(router, 'login')
}} 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 cursor-pointer outline-none'>
</a>
@ -201,8 +200,7 @@ const Navbar: React.FC<NavbarProps> = ({ token, pwa }) => {
</> : <a onClick={() => {
localStorage.redirectTo = window.location.href
setNavbarOpen(false)
if(pwa) window.open('/api/auth/discord', '_blank')
else redirectTo(router, 'login')
redirectTo(router, 'login')
}} className='flex items-center px-8 py-2 text-gray-100 hover:text-gray-300'>
<i className='far fa-user' />
<span className='px-2 font-medium'></span>
@ -216,7 +214,6 @@ const Navbar: React.FC<NavbarProps> = ({ token, pwa }) => {
interface NavbarProps {
token: string
pwa: boolean
}
export default Navbar

View File

@ -125,7 +125,7 @@ const KoreanbotsApp = ({ Component, pageProps, err, cookie }: KoreanbotsProps):
<meta name='screen-orientation' content='portrait' />
</Head>
<Navbar token={cookie.token} pwa={standalone} />
<Navbar token={cookie.token} />
<div className='iu-is-the-best min-h-screen text-black dark:text-gray-100 dark:bg-discord-dark bg-white'>
<Component {...pageProps} err={err} theme={theme} setTheme={setTheme} pwa={standalone} />
</div>