Files: 8261134eb7daa7f16ad7f83ebb1549e60b37b70d / plugs / message_layout / mini.js
705 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: { |
8 | timestamp: 'first' |
9 | } |
10 | } |
11 | |
12 | exports.gives = { |
13 | message_layout: true |
14 | } |
15 | |
16 | exports.create = function (api) { |
17 | return { |
18 | message_layout |
19 | } |
20 | |
21 | function message_layout (msg, opts) { |
22 | if (opts.layout !== 'mini') return |
23 | return h('div', { |
24 | classList: 'Message -mini' |
25 | }, [ |
26 | h('header.author', {}, api.message_author(msg, { size: 'mini' })), |
27 | h('section.timestamp', {}, api.message.timestamp(msg)), |
28 | h('section.meta', {}, api.message_meta(msg)), |
29 | h('section.content', {}, opts.content), |
30 | h('section.raw-content') |
31 | ]) |
32 | } |
33 | } |
34 |
Built with git-ssb-web