Commit fdc31e27bc5cf938a560cff2c56cc39de9352cbf
also highlight new subscription, follow and about messages, change flag color
Matt McKegg committed on 4/8/2017, 12:36:09 PMParent: be8e636ad6ac100c2299cc221a5e35e396a1ece6
Files changed
modules/feed/html/rollup.js | changed |
plugs/message/html/layout/mini.js | changed |
styles/feed-event.mcss | changed |
styles/message.mcss | changed |
modules/feed/html/rollup.js | ||
---|---|---|
@@ -175,8 +175,13 @@ | ||
175 | 175 | newSinceRefresh.clear() |
176 | 176 | } |
177 | 177 | |
178 | 178 | function renderItem (item) { |
179 | + var classList = [] | |
180 | + if (item.priority >= 2) { | |
181 | + classList.push('-new') | |
182 | + } | |
183 | + | |
179 | 184 | if (item.type === 'message') { |
180 | 185 | var meta = null |
181 | 186 | var previousId = item.messageId |
182 | 187 | var replies = item.replies.slice(-4).map((msg) => { |
@@ -239,17 +244,17 @@ | ||
239 | 244 | ]) |
240 | 245 | } |
241 | 246 | } |
242 | 247 | } else if (item.type === 'follow') { |
243 | - return h('FeedEvent -follow', [ | |
248 | + return h('FeedEvent -follow', {classList}, [ | |
244 | 249 | h('div.meta', { |
245 | 250 | title: names(item.contacts) |
246 | 251 | }, [ |
247 | 252 | api.profile.html.person(item.id), ' followed ', many(item.contacts, api.profile.html.person) |
248 | 253 | ]) |
249 | 254 | ]) |
250 | 255 | } else if (item.type === 'subscribe') { |
251 | - return h('FeedEvent -subscribe', [ | |
256 | + return h('FeedEvent -subscribe', {classList}, [ | |
252 | 257 | h('div.meta', { |
253 | 258 | title: names(item.subscribers) |
254 | 259 | }, [ |
255 | 260 | many(item.subscribers, api.profile.html.person), |
plugs/message/html/layout/mini.js | ||
---|---|---|
@@ -16,18 +16,25 @@ | ||
16 | 16 | exports.create = (api) => { |
17 | 17 | return nest('message.html.layout', mini) |
18 | 18 | |
19 | 19 | function mini (msg, opts) { |
20 | + var classList = [] | |
21 | + var additionalMeta = [] | |
22 | + if (opts.priority >= 2) { | |
23 | + classList.push('-new') | |
24 | + additionalMeta.push(h('span.flag -new', {title: 'New Message'})) | |
25 | + } | |
20 | 26 | if (opts.layout !== 'mini') return |
21 | - return h('div', { | |
22 | - classList: 'Message -mini' | |
23 | - }, [ | |
27 | + return h('Message -mini', {classList}, [ | |
24 | 28 | h('header', [ |
25 | 29 | h('div.mini', [ |
26 | 30 | api.profile.html.person(msg.value.author), ' ', |
27 | 31 | opts.content |
28 | 32 | ]), |
29 | - h('div.meta', {}, api.message.html.timestamp(msg)) | |
33 | + h('div.meta', {}, [ | |
34 | + api.message.html.timestamp(msg), | |
35 | + additionalMeta | |
36 | + ]) | |
30 | 37 | ]) |
31 | 38 | ]) |
32 | 39 | } |
33 | 40 | } |
Built with git-ssb-web