add themes, home component, body css

This commit is contained in:
plebeius.eth
2024-02-28 21:18:37 +01:00
parent 6ca08eec4f
commit 71f99ffca5
10 changed files with 99 additions and 4 deletions
+10 -1
View File
@@ -1,10 +1,19 @@
import { useEffect } from 'react';
import { Route, Routes } from 'react-router-dom';
import Home from './views/home';
import styles from './app.module.css';
import useTheme from './hooks/use-theme';
const App = () => {
const [theme] = useTheme();
useEffect(() => {
document.body.classList.forEach((className) => document.body.classList.remove(className));
document.body.classList.add(theme);
}, [theme]);
return (
<div className={styles.app}>
<div className={`${styles.app} ${theme}`}>
<Routes>
<Route path='/' element={<Home />} />
</Routes>