git ssb

16+

Dominic / patchbay



Tree: 79d1c71afb7e8054f9bb37aedaa506e33c61ec8a

Files: 79d1c71afb7e8054f9bb37aedaa506e33c61ec8a / modules_basic / message-header.js

817 bytesRaw
1var fs = require('fs')
2var Path = require('path')
3var h = require('../h')
4
5exports.needs = {
6 avatar_link: 'first',
7 avatar_image: 'first',
8 avatar_name: 'first',
9 message_meta: 'map',
10 message_link: 'first',
11 timestamp: 'first'
12}
13
14exports.gives = {
15 message_header: true,
16 mcss: true
17}
18
19exports.create = function (api) {
20 return {
21 message_header,
22 mcss: () => fs.readFileSync(Path.join(__dirname, 'message-header.mcss'))
23 }
24
25 function message_header (msg) {
26 var { value } = msg
27 var { author } = value
28 return h('MessageHeader', [
29 h('section.author', [
30 api.avatar_link(author, api.avatar_image(author, 'thumbnail')),
31 api.avatar_link(author, api.avatar_name(author)),
32 api.timestamp(msg)
33 ]),
34 h('section.meta', api.message_meta(msg))
35 ])
36 }
37}
38
39
40

Built with git-ssb-web