git ssb

0+

ev / minbase



Tree: c4e6d69c2cdcc875fc3ac222471b3c5d55810b77

Files: c4e6d69c2cdcc875fc3ac222471b3c5d55810b77 / modules / about.js

970 bytesRaw
1var h = require('hyperscript')
2var blobUrl = require('./helpers').bloburl
3var markdown = require('./helpers').markdown
4
5exports.needs = {
6 avatar_name: 'first',
7 avatar_link: 'first'
8}
9
10exports.gives = {
11 message_content_mini: true
12}
13
14exports.create = function (api) {
15 exports.message_content_mini = function (msg) {
16 var about = msg.value.content
17 var id = msg.value.content.about
18 if (msg.value.content.type == 'description') {
19 return h('span', markdown('**Description:** ' + about.description))
20 }
21 if (msg.value.content.type == 'loc') {
22 return h('span', h('strong', 'Location: '), about.loc)
23 }
24 if (msg.value.content.type == 'about') {
25 if (msg.value.content.name) {
26 return h('span', 'identifies as ', about.name)
27 }
28 if (msg.value.content.image) {
29 return h('span', 'identifies as ', h('img.avatar--thumbnail', {src: blobUrl(about.image)}))
30 }
31 } else { return }
32 }
33 return exports
34}
35

Built with git-ssb-web