git ssb

10+

Matt McKegg / patchwork



Commit d170e66ba2918935e031c59b154e8a2b42afb08e

Move warning to under post box but above feed. Attempt to improve css styling.

Gordon Martin committed on 12/27/2017, 11:56:59 PM
Parent: ad69c6cd8d7265bc6a681031dc97e6936563f034

Files changed

modules/page/html/render/public.jschanged
styles/dark/public-feed.mcsschanged
styles/light/public-feed.mcsschanged
modules/page/html/render/public.jsView
@@ -60,9 +60,10 @@
6060 var connectedPubs = computed([connectedPeers, localPeers], (c, l) => c.filter(x => !l.includes(x)))
6161 var contact = api.profile.obs.contact(id)
6262
6363 var prepend = [
64- api.message.html.compose({ meta: { type: 'post' }, placeholder: i18n('Write a public message') })
64+ api.message.html.compose({ meta: { type: 'post' }, placeholder: i18n('Write a public message') }),
65+ noVisibleNewPostsWarning()
6566 ]
6667
6768 var lastMessage = null
6869
@@ -131,14 +132,9 @@
131132 var result = h('div.SplitView', [
132133 h('div.side', [
133134 getSidebar()
134135 ]),
135- h('div.main', [
136- when(
137- computed([contact.isNotFollowingAnybody, loading], (a,b) => a && !b),
138- renderNoVisiblePostsWarning(i18n)
139- ),
140- feedView])
136+ h('div.main', feedView)
141137 ])
142138
143139 result.pendingUpdates = feedView.pendingUpdates
144140 result.reload = function () {
@@ -265,8 +261,25 @@
265261 ])
266262 ]
267263 }
268264
265+ function noVisibleNewPostsWarning() {
266+ var content =
267+ h('div', {classList: 'PublicFeed main'}, h('section -notFollowingAnyoneWarning', [
268+ h('h1', i18n('You are not following anybody.')),
269+ h('h3', i18n(`You may not be able to see new posts and replies.`)),
270+ h('h3', i18n('You can only see new posts from people you follow, and people that they follow.')),
271+ h('h3', i18n('Follow one or more users to see some new posts.'))
272+ ]))
273+
274+ return when(
275+ computed([loading, contact.isNotFollowingAnybody],
276+ (isLoading,isNotFollowingAnybody) => !isLoading && isNotFollowingAnybody
277+ ),
278+ content
279+ )
280+ }
281+
269282 function subscribe (id) {
270283 api.message.async.publish({
271284 type: 'channel',
272285 channel: id,
@@ -289,17 +302,8 @@
289302 }
290303 }
291304 }
292305
293-function renderNoVisiblePostsWarning(i18n) {
294- return h('div', {classList: 'PublicFeed main'}, h('section -notFollowingAnyoneWarning', [
295- h('h1', i18n('You are not following anybody.')),
296- h('h3', i18n(`You may not be able to see new posts and replies.`)),
297- h('h3', i18n('You can only see new posts from people you follow, and people that they follow.')),
298- h('h3', i18n('Follow one or more users to see some new posts.'))
299- ]))
300-}
301-
302306 function getType (msg) {
303307 return msg && msg.value && msg.value.content && msg.value.content.type
304308 }
305309
styles/dark/public-feed.mcssView
@@ -3,14 +3,13 @@
33
44 section {
55 background: #4c4a4a
66 color: white
7- padding: 5px
8- text-align: center
7+ padding: 20px
8+ width: 700px
99
1010 -notFollowingAnyoneWarning {
11- padding: 8px;
12- border: 2px solid #D8000C;
11+ border: 1px solid #D8000C;
1312 background: #FFBABA;
1413 margin: 5px 0;
1514 color: #D8000C;
1615 font-size: 110%;
styles/light/public-feed.mcssView
@@ -3,14 +3,13 @@
33
44 section {
55 background: #4c4a4a
66 color: white
7- padding: 5px
8- text-align: center
7+ padding: 20px
8+ width: 700px
99
1010 -notFollowingAnyoneWarning {
11- padding: 8px;
12- border: 2px solid #D8000C;
11+ border: 1px solid #D8000C;
1312 background: #FFBABA;
1413 margin: 5px 0;
1514 color: #D8000C;
1615 font-size: 110%;

Built with git-ssb-web