Commit 351dcdf50a59c747ae9da7707e703618d9ce6955
show blockers, styling, misc
mix irving committed on 9/15/2017, 10:53:33 AMParent: 1ba824812b72f7bc3dc8f10868e60771aa10e481
Files changed
contact/html/relationships.js | changed |
contact/html/relationships.mcss | changed |
package-lock.json | changed |
package.json | changed |
contact/html/relationships.js | ||
---|---|---|
@@ -11,9 +11,9 @@ | ||
11 | 11 … | 'contact.async.block': 'first', |
12 | 12 … | 'contact.async.unblock': 'first', |
13 | 13 … | 'contact.obs.followers': 'first', |
14 | 14 … | 'contact.obs.following': 'first', |
15 | - // 'contact.obs.blockers': 'first', | |
15 … | + 'contact.obs.blockers': 'first', | |
16 | 16 … | 'keys.sync.id': 'first' |
17 | 17 … | }) |
18 | 18 … | |
19 | 19 … | exports.create = function (api) { |
@@ -54,10 +54,10 @@ | ||
54 | 54 … | ) |
55 | 55 … | } |
56 | 56 … | |
57 | 57 … | const { unfollow, follow, block, unblock } = api.contact.async |
58 | - // const blockedBy = api.contact.obs.blockers(id) | |
59 | - // const ImBlockingThem = computed(blockedBy, blockers => blockers.has(myId)) | |
58 … | + const blockers = api.contact.obs.blockers(id) | |
59 … | + const ImBlockingThem = computed(blockers, blockers => blockers.includes(myId)) | |
60 | 60 … | |
61 | 61 … | return h('Relationships', [ |
62 | 62 … | h('header', 'Relationships'), |
63 | 63 … | when(id !== myId, |
@@ -73,19 +73,31 @@ | ||
73 | 73 … | ), |
74 | 74 … | when(ImFollowing.sync, h('div.relationship-status', relationshipStatus)), |
75 | 75 … | ]), |
76 | 76 … | h('section -blocking', [ |
77 | - // when(ImBlockingThem, | |
78 | - // h('button', { 'ev-click': () => unblock(id, console.log) }, 'unblock'), | |
79 | - // h('button', { 'ev-click': () => block(id, console.log) }, 'BLOCK') | |
80 | - // ), | |
77 … | + when(ImBlockingThem, | |
78 … | + h('button', { 'ev-click': () => unblock(id, console.log) }, 'unblock'), | |
79 … | + h('button', { 'ev-click': () => block(id, console.log) }, 'BLOCK') | |
80 … | + ), | |
81 | 81 … | h('div.explainer', [ |
82 | - "Blocking is a way to tell others that you don't want to communicate with a person ", | |
83 | - "(you don't want to hear from them, and you don't want them to hear about you)." | |
82 … | + "Blocking tells everyone you don't want to communicate with a person.", | |
83 … | + h('ul', [ | |
84 … | + h('li', 'You will no longer receive messages from this person'), | |
85 … | + h('li', "This person won't get any new information about you (including this block)"), | |
86 … | + h('li', "Your followers will see you have blocked this person - their apps need to know so that they don't pass your information on."), | |
87 … | + ]) | |
84 | 88 … | ]) |
85 | 89 … | ]) |
86 | 90 … | ]) |
87 | 91 … | ), |
92 … | + computed(blockers, blockers => { | |
93 … | + if (blockers.length === 0) return '' | |
94 … | + | |
95 … | + return h('div.blockers', [ | |
96 … | + h('header', 'Blocked by'), | |
97 … | + h('section', blockers.map(imageLink)) | |
98 … | + ]) | |
99 … | + }), | |
88 | 100 … | h('div.friends', [ |
89 | 101 … | h('header', 'Friends'), |
90 | 102 … | h('section', map(friends, imageLink)) |
91 | 103 … | ]), |
contact/html/relationships.mcss | |||
---|---|---|---|
@@ -49,8 +49,33 @@ | |||
49 | 49 … | ||
50 | 50 … | } | |
51 | 51 … | -blocking { | |
52 | 52 … | margin-left: 8rem | |
53 … | + position: relative | ||
54 … | + | ||
55 … | + button {} | ||
56 … | + | ||
57 … | + div.explainer { | ||
58 … | + visibility: hidden | ||
59 … | + position: absolute | ||
60 … | + background: #fff | ||
61 … | + width: 24rem | ||
62 … | + left: 1rem | ||
63 … | + bottom: 2rem | ||
64 … | + padding: .5rem | ||
65 … | + box-shadow: rgba(0, 0, 0, 0.2) 2px 2px 8px | ||
66 … | + | ||
67 … | + ul { | ||
68 … | + font-size: .8rem | ||
69 … | + padding-left: 1rem | ||
70 … | + } | ||
71 … | + } | ||
72 … | + | ||
73 … | + :hover { | ||
74 … | + div.explainer { | ||
75 … | + visibility: visible | ||
76 … | + } | ||
77 … | + } | ||
53 | 78 … | } | |
54 | 79 … | } | |
55 | 80 … | ||
56 | 81 … | } |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 305060 bytes New file size: 305122 bytes |
package.json | ||
---|---|---|
@@ -85,9 +85,9 @@ | ||
85 | 85 … | "electron": "~1.6.11", |
86 | 86 … | "ssb-about": "^0.1.0", |
87 | 87 … | "ssb-backlinks": "^0.4.0", |
88 | 88 … | "ssb-blobs": "^1.1.3", |
89 | - "ssb-friends": "^2.2.2", | |
89 … | + "ssb-friends": "^2.2.3", | |
90 | 90 … | "ssb-fulltext": "^1.0.1", |
91 | 91 … | "ssb-keys": "^7.0.10", |
92 | 92 … | "ssb-mentions": "^0.4.0", |
93 | 93 … | "ssb-private": "^0.1.2", |
Built with git-ssb-web