git ssb

16+

Dominic / patchbay



Tree: 3b8af4cbe35ccf838eead48bbab57bb35ac00709

Files: 3b8af4cbe35ccf838eead48bbab57bb35ac00709 / message / html / layout / mini.js

950 bytesRaw
1const nest = require('depnest')
2const { h, Value } = require('mutant')
3
4exports.needs = nest({
5 'app.sync.goTo': 'first',
6 'message.html.backlinks': 'first',
7 'message.html.author': 'first',
8 'message.html.meta': 'map',
9 'message.html.timestamp': 'first'
10})
11
12exports.gives = nest('message.html.layout')
13
14exports.create = (api) => {
15 return nest('message.html.layout', miniLayout)
16
17 function miniLayout (msg, opts) {
18 if (opts.layout !== 'mini') return
19
20 var rawMessage = Value(null)
21
22 return h('Message -mini', {
23 attributes: {
24 tabindex: '0'
25 }
26 }, [
27 h('section.timestamp', {}, api.message.html.timestamp(msg)),
28 h('header.author', {}, api.message.html.author(msg, { size: 'mini' })),
29 h('section.meta', {}, api.message.html.meta(msg, { rawMessage })),
30 h('section.content', { 'ev-click': () => api.app.sync.goTo(msg) }, opts.content),
31 h('section.raw-content', rawMessage)
32 ])
33 }
34}
35

Built with git-ssb-web