mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 16:55:50 +01:00
refactor(website): move back into website2
This commit is contained in:
30
apps/website2/src/index.tsx
Normal file
30
apps/website2/src/index.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { LocationProvider, Router, Route, hydrate, prerender as ssr } from 'preact-iso';
|
||||
|
||||
import { Header } from './components/Header.jsx';
|
||||
import { Home } from './pages/Home/index.jsx';
|
||||
import { NotFound } from './pages/_404.jsx';
|
||||
import './style.css';
|
||||
import Footer from './components/Footer.js';
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
<LocationProvider>
|
||||
<Header />
|
||||
<main>
|
||||
<Router>
|
||||
<Route path="/" component={Home} />
|
||||
<Route default component={NotFound} />
|
||||
</Router>
|
||||
</main>
|
||||
<Footer />
|
||||
</LocationProvider>
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
hydrate(<App />, document.getElementById('app'));
|
||||
}
|
||||
|
||||
export async function prerender(data) {
|
||||
return await ssr(<App {...data} />);
|
||||
}
|
||||
Reference in New Issue
Block a user