Files: c18b233c6d62741496978cd8dc1f34a093946f8b / message / html / layout / default.js
900 bytesRaw
1 | const h = require('mutant/h') |
2 | |
3 | exports.needs = { |
4 | message_backlinks: 'first', |
5 | message_author: 'first', |
6 | message_meta: 'map', |
7 | message_action: 'map', |
8 | message: { |
9 | timestamp: 'first' |
10 | } |
11 | } |
12 | |
13 | exports.gives = { |
14 | message_layout: true |
15 | } |
16 | |
17 | exports.create = function (api) { |
18 | return { |
19 | message_layout |
20 | } |
21 | |
22 | function message_layout (msg, opts) { |
23 | if (!(opts.layout === undefined || opts.layout === 'default')) return |
24 | return h('div', { |
25 | classList: 'Message' |
26 | }, [ |
27 | h('header.author', {}, api.message_author(msg)), |
28 | h('section.timestamp', {}, api.message.timestamp(msg)), |
29 | h('section.title', {}, opts.title), |
30 | h('section.meta', {}, api.message_meta(msg)), |
31 | h('section.content', {}, opts.content), |
32 | h('section.raw-content'), |
33 | h('section.action', {}, api.message_action(msg)), |
34 | h('footer.backlinks', {}, api.message_backlinks(msg)) |
35 | ]) |
36 | } |
37 | } |
38 |
Built with git-ssb-web