git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: fe2173f46498c968ad5bd79d249d023ca4998f88

Files: fe2173f46498c968ad5bd79d249d023ca4998f88 / plugs / message / html / layout / mini.js

701 bytesRaw
1const h = require('mutant/h')
2const nest = require('depnest')
3
4exports.needs = nest({
5 'message.html': {
6 backlinks: 'first',
7 author: 'first',
8 meta: 'map',
9 timestamp: 'first'
10 },
11 'profile.html.person': 'first'
12})
13
14exports.gives = nest('message.html.layout')
15
16exports.create = (api) => {
17 return nest('message.html.layout', mini)
18
19 function mini (msg, opts) {
20 if (opts.layout !== 'mini') return
21 return h('div', {
22 classList: 'Message -mini'
23 }, [
24 h('header', [
25 h('div.mini', [
26 api.profile.html.person(msg.value.author), ' ',
27 opts.content
28 ]),
29 h('div.meta', {}, api.message.html.timestamp(msg))
30 ])
31 ])
32 }
33}
34

Built with git-ssb-web