git ssb

3+

arj / patchbook



Tree: 59b2150aa65f622113a8aae8016eb849a7345690

Files: 59b2150aa65f622113a8aae8016eb849a7345690 / book / html / description.js

625 bytesRaw
1const nest = require('depnest')
2const { h, computed, when } = require('mutant')
3
4exports.needs = nest({
5 'message.html.markdown': 'first'
6})
7
8exports.gives = nest('book.html.description')
9
10exports.create = (api) => {
11 return nest('book.html.description', description)
12 function description ({description, isEditing, onUpdate}) {
13 const markdown = api.message.html.markdown
14 const input = h('textarea', {'ev-input': e => onUpdate(e.target.value), value: description})
15
16 return h('Description', [
17 when(isEditing,
18 input,
19 computed(description, (d) => d ? markdown(d) : '')
20 )
21 ])
22 }
23}
24

Built with git-ssb-web