add dark theme support and some basic styles

This commit is contained in:
Andres
2022-06-21 12:10:49 +02:00
parent 2f0c8e8bc8
commit e1642e5f26
5 changed files with 158 additions and 94 deletions

View File

@@ -5,20 +5,26 @@ import HW1 from '../s2-homeworks/hw01/HW1'
// import HW3 from '../s2-homeworks/hw03/HW3'
// import HW4 from '../s2-homeworks/hw04/HW4'
import HW5 from '../s2-homeworks/hw05/HW5'
import { useSelector } from 'react-redux'
import { useEffect } from 'react'
const App = () => {
return (
<div className={s.App}>
<div>react homeworks:</div>
const themeId = useSelector((state: any) => state.theme.themeId)
useEffect(() => {
document.documentElement.dataset.theme = themeId
}, [themeId])
return (
<div className={s.App} data-theme={themeId}>
<div>react homeworks:</div>
{/*<HW1/>*/}
{/*<HW2/>*/}
{/*<HW3/>*/}
{/*<HW4/>*/}
{/*<HW1/>*/}
{/*<HW2/>*/}
{/*<HW3/>*/}
{/*<HW4/>*/}
<HW5/>
</div>
)
<HW5 />
</div>
)
}
export default App
export default App