example-mailbox: v2

This commit is contained in:
Yoshua Wuyts
2016-05-12 15:42:44 +07:00
parent 53a1e6026a
commit 1d14f9f26b
6 changed files with 70 additions and 23 deletions
+3 -13
View File
@@ -1,23 +1,13 @@
const pathname = require('pathname-match')
const choo = require('../../../')
module.exports = function (nav) {
module.exports = function (nav, mailbox) {
return function (params, state, send) {
console.log(state)
return choo.view`
<main class="app">
<span>URL: ${'/' + pathname(state.location)}</span>
<span>URL: ${pathname(state.location) || '/'}</span>
${nav(params, state, send)}
<section>
<table>
<tr>
<th>Data</th>
<th>Subject</th>
<th>From</th>
<th>To</th>
</tr>
</table>
</section>
${mailbox(params, state, send)}
</main>
`
}