mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
fix: theme systems
This commit is contained in:
parent
0767d8d5bc
commit
907ad8cd7b
@ -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`} />
|
||||
|
||||
@ -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 (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user