Files: 34c4a94f3baa311c5602618ea2ff80e6245b7c62 / message / html / layout / mini.js
745 bytesRaw
1 | const h = require('mutant/h') |
2 | const nest = require('depnest') |
3 | |
4 | exports.needs = nest('message.html', { |
5 | backlinks: 'first', |
6 | author: 'first', |
7 | meta: 'map', |
8 | timestamp: 'first' |
9 | }) |
10 | |
11 | exports.gives = nest('message.html.layout') |
12 | |
13 | exports.create = (api) => { |
14 | return nest('message.html.layout', message_layout) |
15 | |
16 | function message_layout (msg, opts) { |
17 | if (opts.layout !== 'mini') return |
18 | return h('div', { |
19 | classList: 'Message -mini' |
20 | }, [ |
21 | h('header.author', {}, api.message.html.author(msg, { size: 'mini' })), |
22 | h('section.timestamp', {}, api.message.html.timestamp(msg)), |
23 | h('section.meta', {}, api.message.html.meta(msg)), |
24 | h('section.content', {}, opts.content), |
25 | h('section.raw-content') |
26 | ]) |
27 | } |
28 | } |
29 |
Built with git-ssb-web