git ssb

16+

Dominic / patchbay



Tree: 84955f6a151e18bfc8131c8ffbcd043272b13500

Files: 84955f6a151e18bfc8131c8ffbcd043272b13500 / message / html / layout / default.js

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

Built with git-ssb-web