add desktop topnav, update themes

This commit is contained in:
plebeius.eth
2024-03-18 15:04:30 +01:00
parent 7f8a996eec
commit ec20767e13
8 changed files with 191 additions and 31 deletions
+14 -11
View File
@@ -1,10 +1,11 @@
import { useEffect } from 'react';
import { Route, Routes, useLocation } from 'react-router-dom';
import { Outlet, Route, Routes, useLocation } from 'react-router-dom';
import Home from './views/home';
import styles from './app.module.css';
import useTheme from './hooks/use-theme';
import Subplebbit from './views/subplebbit';
import { isHomeView } from './lib/utils/view-utils';
import TopNav from './components/topnav';
const App = () => {
const [theme] = useTheme();
@@ -23,21 +24,23 @@ const App = () => {
// </>
// );
// const boardLayout = (
// <>
// <TopNav />
// <ImageBanner />
// <PostForm />
// <Stats />
// <Outlet />
// </>
// );
const boardLayout = (
<>
<TopNav />
{/* <ImageBanner />
<PostForm />
<Stats /> */}
<Outlet />
</>
);
return (
<div className={`${styles.app} ${isInHomeView ? 'yotsuba' : theme}`}>
<Routes>
<Route path='/' element={<Home />} />
<Route path='/p/:subplebbitAddress' element={<Subplebbit />} />
<Route element={boardLayout}>
<Route path='/p/:subplebbitAddress' element={<Subplebbit />} />
</Route>
</Routes>
</div>
);