Files: 0baf5414ce7a4d8be1f75148ec7dce869d876d66 / 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 = nest('message.html.layout', (api) => { |
15 | return 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.action', {}, api.message.html.action(msg)), |
29 | h('footer.backlinks', {}, api.message.html.backlinks(msg)) |
30 | ]) |
31 | } |
32 | } |
33 |
Built with git-ssb-web