Initial commit

This commit is contained in:
2020-04-20 11:14:46 +02:00
commit 364840c665
48 changed files with 20852 additions and 0 deletions

33
src/components/app.tsx Normal file
View File

@ -0,0 +1,33 @@
import { FunctionalComponent, h } from "preact";
import { Route, Router, RouterOnChangeArgs } from "preact-router";
import Home from "../routes/home";
import Project from "../routes/project";
import NotFoundPage from '../routes/notfound';
import Header from "./header";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if ((module as any).hot) {
// tslint:disable-next-line:no-var-requires
require("preact/debug");
}
const App: FunctionalComponent = () => {
let currentUrl: string;
const handleRoute = (e: RouterOnChangeArgs) => {
currentUrl = e.url;
};
return (
<div id="app">
<Header />
<Router onChange={handleRoute}>
<Route path="/" component={Home} />
<Route path="/p/:uuid" component={Project} />
<NotFoundPage default />
</Router>
</div>
);
};
export default App;

View File

@ -0,0 +1,28 @@
import { FunctionalComponent, h } from "preact";
import { Link } from "preact-router/match";
import * as style from "./style.css";
const Header: FunctionalComponent = () => {
return (
<div class="container">
<div class="columns">
<div class="column">
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" href="/">
<h1 class="title is-size-4"> Guesstimate</h1>
</a>
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
</nav>
</div>
</div>
</div>
);
};
export default Header;

View File

3
src/components/header/style.css.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
// This file is automatically generated from your CSS. Any edits will be overwritten.
export const header: string;
export const active: string;