Files: 50f7c8870ccd7ef8771ac98be8f27c62fea59e60 / render.js
488 bytesRaw
1 | var h = require('hyperscript') |
2 | |
3 | var human = require('human-time') |
4 | |
5 | var avatar = require('./avatar') |
6 | |
7 | module.exports = function (msg) { |
8 | if (msg.value.content.type == 'post') { |
9 | return h('div.message__content', |
10 | h('span.avatar', h('a', {href: '#' + msg.value.author}, avatar.name(msg.value.author))), |
11 | h('span.timestamp', h('a', {href: '#' + msg.key}, human(new Date(msg.value.timestamp)))), |
12 | h('div.message__body', msg.value.content.text) |
13 | ) |
14 | } else { return } |
15 | } |
16 |
Built with git-ssb-web