add preact with webpack

This commit is contained in:
Thomas Ruoff
2017-02-15 00:46:54 +01:00
parent 316d05790b
commit 7668fc3837
15 changed files with 229 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
import { h } from 'preact';
import { Link } from 'preact-router';
export default function () {
return (
<header className="header">
<h1>PDFer</h1>
</header>
)
}

View File

@@ -0,0 +1,13 @@
import { h } from 'preact';
import Header from './Header';
export default function (props) {
return (
<div id="app">
<Header />
<div id="content">
{ props.children }
</div>
</div>
);
}

15
webapp/views/index.js Normal file
View File

@@ -0,0 +1,15 @@
import { h } from 'preact'
import { Router } from 'preact-router';
import Home from './pages/Home';
import Layout from './components/Layout';
import Error404 from './pages/404';
export default (
<Layout>
<Router>
<Home path="/" />
<Error404 default />
</Router>
</Layout>
);

10
webapp/views/pages/404.js Normal file
View File

@@ -0,0 +1,10 @@
import { h } from 'preact';
export default function (props) {
return (
<div>
<h2>No hope!</h2>
<p>Not sure what you desire, but look for somewhere else...</p>
</div>
);
}

View File

@@ -0,0 +1,11 @@
import { h } from 'preact';
export default function (props) {
return (
<div>
<h1>Home</h1>
<p>This is the home page.</p>
<p>Anything is insane</p>
</div>
);
}