Files: c2515fc07d5df937b0ab574f42b22ed788831215 / message / html / layout / default.js
939 bytesRaw
1 | const h = require('mutant/h') |
2 | var nest = require('depnest') |
3 | |
4 | exports.needs = nest('message.html', { |
5 | backlinks: 'first', |
6 | author: 'first', |
7 | meta: 'map', |
8 | action: 'map', |
9 | timestamp: 'first' |
10 | }) |
11 | |
12 | exports.gives = nest('message.html.layout') |
13 | |
14 | exports.create = (api) => { |
15 | return nest('message.html.layout', messageLayout) |
16 | |
17 | function messageLayout (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