Files: c8ebe98ed356a8b95e516ca561f755e05ed43156 / book / html / title.js
483 bytesRaw
1 | const nest = require('depnest') |
2 | const { h, when } = require('mutant') |
3 | |
4 | exports.needs = nest({ |
5 | 'blob.sync.url': 'first' |
6 | }) |
7 | |
8 | exports.gives = nest( |
9 | 'book.html.title' |
10 | ) |
11 | |
12 | exports.create = (api) => { |
13 | return nest('book.html.title', title) |
14 | function title ({title, msg, isEditing, onUpdate}) { |
15 | return h('section.title', |
16 | when(isEditing, |
17 | h('input', {'ev-input': e => onUpdate(e.target.value), value: title}), |
18 | h('a', {href: msg.key}, title) |
19 | ) |
20 | ) |
21 | } |
22 | } |
23 |
Built with git-ssb-web