Files: 66eb3aded58d22467d641cb52da1353212e8219a / plugs / message / html / layout / mini.js
701 bytesRaw
1 | const h = require('mutant/h') |
2 | const nest = require('depnest') |
3 | |
4 | exports.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 | |
14 | exports.gives = nest('message.html.layout') |
15 | |
16 | exports.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