first commit

This commit is contained in:
Romulus21
2021-12-17 15:37:05 +01:00
commit 2d49672d20
43 changed files with 39806 additions and 0 deletions

38
src/components/App.js Normal file
View File

@@ -0,0 +1,38 @@
import { h } from 'preact';
import { Router } from 'preact-router';
import ContextsProviders from '../Contexts';
import Header from './Header';
// Code-splitting is automated for `routes` directory
import Home from '../routes/Home';
import Plant from '../routes/Plant';
import Profile from '../routes/Profile';
import {useEffect} from "preact/hooks";
const App = () => {
useEffect(() => {
if (!Notification) {
alert('Le navigateur ne supporte pas les notifications.');
} else if (Notification.permission !== 'granted') {
Notification.requestPermission();
}
}, [])
return (
<div id="app" class="h-screen overflow-auto flex flex-col">
<ContextsProviders>
<Header />
<main className="flex-1 dark:bg-gray-800 dark:text-white">
<Router>
<Home path="/" />
<Plant path="plant/:id" />
<Profile path="/profile" />
</Router>
</main>
</ContextsProviders>
</div>
)}
export default App;