Files: 05c1a0ae31c0547a316baa6497637eba2c85df73 / message / html / layout / mini.js
743 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', messageLayout) |
15 | |
16 | function messageLayout (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