git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 4f3e54eaa5e60f7e8551798b984fbf3d4e0886c1

Files: 4f3e54eaa5e60f7e8551798b984fbf3d4e0886c1 / message / html / layout / default.js

941 bytesRaw
1const h = require('mutant/h')
2var nest = require('depnest')
3
4exports.needs = nest('message.html', {
5 backlinks: 'first',
6 author: 'first',
7 meta: 'map',
8 action: 'map',
9 timestamp: 'first'
10})
11
12exports.gives = nest('message.html.layout')
13
14exports.create = (api) => {
15 return nest('message.html.layout', message_layout)
16
17 function message_layout (msg, opts) {
18 if (!(opts.layout === undefined || opts.layout === 'default')) return
19 return h('div', {
20 classList: 'Message'
21 }, [
22 h('header.author', {}, api.message.html.author(msg)),
23 h('section.timestamp', {}, api.message.html.timestamp(msg)),
24 h('section.title', {}, opts.title),
25 h('section.meta', {}, api.message.html.meta(msg)),
26 h('section.content', {}, opts.content),
27 h('section.raw-content'),
28 h('section.actions', {}, api.message.html.action(msg)),
29 h('footer.backlinks', {}, api.message.html.backlinks(msg))
30 ])
31 }
32}
33

Built with git-ssb-web