mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 06:20:24 +00:00
chore: not passing pwa at navbar
This commit is contained in:
parent
77196d057f
commit
f03ff02f88
@ -12,7 +12,7 @@ import { User, UserCache } from '@types'
|
|||||||
|
|
||||||
const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar'))
|
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 [userCache, setUserCache] = useState<UserCache>()
|
||||||
const [navbarOpen, setNavbarOpen] = useState<boolean>(false)
|
const [navbarOpen, setNavbarOpen] = useState<boolean>(false)
|
||||||
const [dropdownOpen, setDropdownOpen] = useState<boolean>(false)
|
const [dropdownOpen, setDropdownOpen] = useState<boolean>(false)
|
||||||
@ -128,8 +128,7 @@ const Navbar: React.FC<NavbarProps> = ({ token, pwa }) => {
|
|||||||
<a tabIndex={0} onClick={()=> {
|
<a tabIndex={0} onClick={()=> {
|
||||||
localStorage.redirectTo = window.location.href
|
localStorage.redirectTo = window.location.href
|
||||||
setNavbarOpen(false)
|
setNavbarOpen(false)
|
||||||
if(pwa) window.open('/api/auth/discord', '_blank')
|
redirectTo(router, 'login')
|
||||||
else 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'>
|
}} 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>
|
</a>
|
||||||
@ -201,8 +200,7 @@ const Navbar: React.FC<NavbarProps> = ({ token, pwa }) => {
|
|||||||
</> : <a onClick={() => {
|
</> : <a onClick={() => {
|
||||||
localStorage.redirectTo = window.location.href
|
localStorage.redirectTo = window.location.href
|
||||||
setNavbarOpen(false)
|
setNavbarOpen(false)
|
||||||
if(pwa) window.open('/api/auth/discord', '_blank')
|
redirectTo(router, 'login')
|
||||||
else redirectTo(router, 'login')
|
|
||||||
}} className='flex items-center px-8 py-2 text-gray-100 hover:text-gray-300'>
|
}} className='flex items-center px-8 py-2 text-gray-100 hover:text-gray-300'>
|
||||||
<i className='far fa-user' />
|
<i className='far fa-user' />
|
||||||
<span className='px-2 font-medium'>로그인</span>
|
<span className='px-2 font-medium'>로그인</span>
|
||||||
@ -216,7 +214,6 @@ const Navbar: React.FC<NavbarProps> = ({ token, pwa }) => {
|
|||||||
|
|
||||||
interface NavbarProps {
|
interface NavbarProps {
|
||||||
token: string
|
token: string
|
||||||
pwa: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Navbar
|
export default Navbar
|
||||||
|
|||||||
@ -125,7 +125,7 @@ const KoreanbotsApp = ({ Component, pageProps, err, cookie }: KoreanbotsProps):
|
|||||||
<meta name='screen-orientation' content='portrait' />
|
<meta name='screen-orientation' content='portrait' />
|
||||||
|
|
||||||
</Head>
|
</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'>
|
<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} />
|
<Component {...pageProps} err={err} theme={theme} setTheme={setTheme} pwa={standalone} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user