git ssb

16+

Dominic / patchbay



Tree: f1d78b0cacae073b8824fe4935bee0fa93eaad36

Files: f1d78b0cacae073b8824fe4935bee0fa93eaad36 / message / html / layout / mini.js

836 bytesRaw
1const nest = require('depnest')
2const { h, Value } = require('mutant')
3
4exports.needs = nest('message.html', {
5 backlinks: 'first',
6 author: 'first',
7 meta: 'map',
8 timestamp: 'first'
9})
10
11exports.gives = nest('message.html.layout')
12
13exports.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

Built with git-ssb-web