git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: a690b3b6fbae95bcc505e502af93903beb3ba86e

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

743 bytesRaw
1const h = require('mutant/h')
2const nest = require('depnest')
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', messageLayout)
15
16 function messageLayout (msg, opts) {
17 if (opts.layout !== 'mini') return
18 return h('div', {
19 classList: 'Message -mini'
20 }, [
21 h('header.author', {}, api.message.html.author(msg, { size: 'mini' })),
22 h('section.timestamp', {}, api.message.html.timestamp(msg)),
23 h('section.meta', {}, api.message.html.meta(msg)),
24 h('section.content', {}, opts.content),
25 h('section.raw-content')
26 ])
27 }
28}
29

Built with git-ssb-web