Commit 99ea145bb810c17eeebbdc499b193be50db160f0
[WIP] display blocking reasons
Daan Wynen committed on 1/15/2021, 12:55:06 AMParent: 57ccce81ba723d27f52cdc30a621ec0e5af16c7d
Files changed
lib/depject/message/html/render/following.js | changed |
lib/depject/message/html/render/following.js | |||
---|---|---|---|
@@ -1,4 +1,5 @@ | |||
1 … | +const { h } = require('mutant') | ||
1 | 2 … | const nest = require('depnest') | |
2 | 3 … | const extend = require('xtend') | |
3 | 4 … | const ref = require('ssb-ref') | |
4 | 5 … | ||
@@ -6,8 +7,9 @@ | |||
6 | 7 … | 'message.html': { | |
7 | 8 … | decorate: 'reduce', | |
8 | 9 … | layout: 'first' | |
9 | 10 … | }, | |
11 … | + 'message.html.markdown': 'first', | ||
10 | 12 … | 'profile.html.person': 'first', | |
11 | 13 … | 'intl.sync.i18n': 'first' | |
12 | 14 … | }) | |
13 | 15 … | ||
@@ -36,13 +38,18 @@ | |||
36 | 38 … | ||
37 | 39 … | function messageContent (msg) { | |
38 | 40 … | const following = msg.value.content.following | |
39 | 41 … | const blocking = msg.value.content.blocking | |
42 … | + const reason = msg.value.content.reason | ||
40 | 43 … | ||
41 | 44 … | if (blocking === true) { | |
42 | - return [ | ||
45 … | + const text = [ | ||
43 | 46 … | i18n('blocked '), api.profile.html.person(msg.value.content.contact) | |
44 | 47 … | ] | |
48 … | + if (reason) { | ||
49 … | + text.push(h('section.content', h('Message', api.message.html.markdown(reason)))) | ||
50 … | + } | ||
51 … | + return text | ||
45 | 52 … | } else if (typeof following === 'boolean') { | |
46 | 53 … | return [ | |
47 | 54 … | following ? i18n('followed ') : i18n('unfollowed '), | |
48 | 55 … | api.profile.html.person(msg.value.content.contact) |
Built with git-ssb-web