Files: 0baf5414ce7a4d8be1f75148ec7dce869d876d66 / 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 = nest('message.html.layout', (api) => { |
14 | return 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