git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 8261134eb7daa7f16ad7f83ebb1549e60b37b70d

Files: 8261134eb7daa7f16ad7f83ebb1549e60b37b70d / plugs / message_render / zz_fallback.js

616 bytesRaw
1var h = require('mutant/h')
2
3exports.needs = {
4 message_layout: 'first',
5 message_decorate: 'reduce'
6}
7
8exports.gives = {
9 message_render: true
10}
11
12exports.create = function (api) {
13 return {
14 message_render
15 }
16
17 function message_render (msg) {
18 var element = api.message_layout(msg, {
19 content: message_content(msg),
20 layout: 'mini'
21 })
22
23 return api.message_decorate(element, { msg })
24 }
25
26 function message_content (msg) {
27 if (typeof msg.value.content === 'string') {
28 return h('code', {}, 'PRIVATE')
29 } else {
30 return h('code', {}, msg.value.content.type)
31 }
32 }
33}
34

Built with git-ssb-web