git ssb

0+

dangerousbeans / patchwork



forked from Matt McKegg / patchwork

Commit ac1bcdbde1d6b8d0519d3a78ac78ccf02cd253e2

mark people you follow on profile lists

closes #475
Matt McKegg committed on 4/8/2017, 11:25:23 AM
Parent: b0fea93657f2867c9c1bcefd95d6f067af29d40e

Files changed

modules/page/html/render/profile.jschanged
styles/profile-list.mcsschanged
modules/page/html/render/profile.jsView
@@ -175,11 +175,11 @@
175175 ]),
176176 h('div.side.-right', [
177177 when(friendsLoaded,
178178 h('div', [
179- renderContactBlock('Friends', friends),
180- renderContactBlock('Followers', followers),
181- renderContactBlock('Following', following)
179+ renderContactBlock('Friends', friends, yourFollows),
180+ renderContactBlock('Followers', followers, yourFollows),
181+ renderContactBlock('Following', following, yourFollows)
182182 ]),
183183 h('div', {className: 'Loading'})
184184 )
185185 ])
@@ -189,18 +189,22 @@
189189 container.reload = feedView.reload
190190 return container
191191 })
192192
193- function renderContactBlock (title, profiles) {
193+ function renderContactBlock (title, profiles, yourFollows) {
194194 profiles = api.profile.obs.rank(profiles)
195195 return [
196196 when(computed(profiles, x => x.length), h('h2', title)),
197197 h('div', {
198198 classList: 'ProfileList'
199199 }, [
200200 map(profiles, (id) => {
201+ var following = computed(yourFollows, f => f.has(id))
201202 return h('a.profile', {
202- href: id
203+ href: id,
204+ classList: [
205+ when(following, '-following')
206+ ]
203207 }, [
204208 h('div.avatar', [api.about.html.image(id)]),
205209 h('div.main', [
206210 h('div.name', [ api.about.obs.name(id) ])
styles/profile-list.mcssView
@@ -12,8 +12,12 @@
1212
1313 background-repeat: no-repeat
1414 background-position: right
1515
16+ -following {
17+ background-image: svg(following)
18+ }
19+
1620 -connected {
1721 background-image: svg(connected)
1822 }
1923
@@ -22,8 +26,14 @@
2226 height: 12px
2327 content: "<circle cx='6' stroke='none' fill='green' cy='6' r='5' />"
2428 }
2529
30+ @svg following {
31+ width: 20px
32+ height: 12px
33+ content: "<circle cx='6' stroke='#888' fill='none' cy='6' r='5' /> <circle cx='6' cy='6' r='3' fill='#888'/>"
34+ }
35+
2636 :hover {
2737 background-color: rgba(255, 255, 255, 0.4);
2838 }
2939

Built with git-ssb-web