fix a few issues with dark mode

This commit is contained in:
keyan 2021-11-09 17:04:15 -06:00
parent c255a4b8fe
commit 227d7f14ad
2 changed files with 14 additions and 6 deletions

View File

@ -11,6 +11,7 @@ import useDarkMode from 'use-dark-mode'
import Sun from '../svgs/sun-fill.svg'
import Moon from '../svgs/moon-fill.svg'
import { handleThemeChange } from '../public/darkmode'
import { useEffect, useState } from 'react'
const ChatPopover = (
<Popover>
@ -46,16 +47,23 @@ export default function Footer ({ noLinks }) {
onChange: handleThemeChange
})
const [mounted, setMounted] = useState()
useEffect(() => {
setMounted(true)
})
return (
<footer>
<Container className='mb-3 mt-4'>
{!noLinks &&
<div className='mb-2' style={{ fontWeight: 500, opacity: 0.5 }}>
<div className='mb-2'>
{darkMode.value
? <Sun onClick={() => darkMode.toggle()} className='theme' />
: <Moon onClick={() => darkMode.toggle()} className='theme' />}
</div>
{mounted &&
<div className='mb-2'>
{darkMode.value
? <Sun onClick={() => darkMode.toggle()} className='theme' />
: <Moon onClick={() => darkMode.toggle()} className='theme' />}
</div>}
<Link href='/faq' passHref>
<a className='text-reset d-inline-flex'>
faq

View File

@ -10,7 +10,7 @@ export const COLORS = {
navLinkActive: 'rgba(0, 0, 0, 0.9)',
borderColor: '#ced4da',
inputBg: '#ffffff',
dropdownItemColor: 'inherit',
dropdownItemColor: 'rgba(0, 0, 0, 0.7)',
dropdownItemColorHover: 'rgba(0, 0, 0, 0.9)',
commentBg: 'rgba(0, 0, 0, 0.03)',
clickToContextColor: 'rgba(0, 0, 0, 0.05)',