git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: be8e636ad6ac100c2299cc221a5e35e396a1ece6

Files: be8e636ad6ac100c2299cc221a5e35e396a1ece6 / 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