Files: 74d21888026f7c2aa923da3565091984d4d311c5 / message / html / layout / mini.js
837 bytesRaw
1 | const nest = require('depnest') |
2 | const { h, Value } = require('mutant') |
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', miniLayout) |
15 | |
16 | function miniLayout (msg, opts) { |
17 | if (opts.layout !== 'mini') return |
18 | |
19 | var rawMessage = Value(null) |
20 | |
21 | return h('Message -mini', { |
22 | attributes: { |
23 | tabindex: '0' |
24 | } |
25 | }, [ |
26 | h('section.timestamp', {}, api.message.html.timestamp(msg)), |
27 | h('header.author', {}, api.message.html.author(msg, { size: 'mini' })), |
28 | h('section.meta', {}, api.message.html.meta(msg, { rawMessage })), |
29 | h('section.content', {}, opts.content), |
30 | h('section.raw-content', rawMessage) |
31 | ]) |
32 | } |
33 | } |
34 | |
35 |
Built with git-ssb-web