fix: theme systems

This commit is contained in:
원더 2021-02-11 21:11:28 +09:00
parent 0767d8d5bc
commit 907ad8cd7b
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ import { useState } from 'react'
import { Theme } from '@types'
const Footer = ({ color, theme, setTheme }:FooterProps): JSX.Element => {
const [ checked, setCheck ] = useState(true)
const [ checked, setCheck ] = useState(theme === 'dark')
return (
<div className='releative'>
<Wave color='currentColor' className={`${color ?? 'dark:text-discord-dark text-white bg-discord-black'} hidden md:block`} />

View File

@ -28,7 +28,6 @@ export default function App({ Component, pageProps, err }: KoreanbotsProps): JSX
useEffect(() => {
setBetaKey(localStorage.betaKey)
setTheme(localStorage.theme || 'system')
console.log(
'%c' + 'KOREANBOTS',
'color: #3366FF; -webkit-text-stroke: 2px black; font-size: 72px; font-weight: bold;'
@ -43,10 +42,11 @@ export default function App({ Component, pageProps, err }: KoreanbotsProps): JSX
} catch (e) {
systemColor = 'dark'
}
if (theme === 'system') {
if (!localStorage.theme) {
console.log(`[THEME] ${systemColor.toUpperCase()} THEME DETECTED`)
setTheme(systemColor)
}
else setTheme(localStorage.theme || 'system')
}, [])
return (