Commit c2bff2c69008d859b794893a531baaba7435c819
Add basic mentions functionality.
Piet Geursen committed on 3/17/2017, 1:34:40 AMParent: f441f7e134ae1555c42d5c0bc58be4bd414e97cd
Files changed
router/html/page/notifications.js | changed |
router/html/page/notifications.js | ||
---|---|---|
@@ -1,13 +1,36 @@ | ||
1 | -const { h } = require('mutant') | |
2 | 1 | const nest = require('depnest') |
2 | +const pull = require('pull-stream') | |
3 | +const Scroller = require('pull-scroll') | |
4 | +const next = require('../../../junk/next-stepper') | |
3 | 5 | |
4 | 6 | exports.gives = nest('router.html.page') |
5 | - | |
7 | +exports.needs = nest({ | |
8 | + 'keys.sync.id': 'first', | |
9 | + 'feed.pull.mentions': 'first', | |
10 | + 'feed.pull.public': 'first', | |
11 | + 'message.html': { | |
12 | + render: 'first' | |
13 | + }, | |
14 | + 'main.html.scroller': 'first' | |
15 | +}) | |
6 | 16 | exports.create = function (api) { |
7 | 17 | return nest('router.html.page', (path) => { |
8 | 18 | if (path !== '/notifications') return |
19 | + const id = api.keys.sync.id() | |
20 | + const mentions = api.feed.pull.mentions(id) | |
9 | 21 | |
10 | - return h('div.notifications', 'notifications') | |
22 | + const { container, content } = api.main.html.scroller({}) | |
23 | + | |
24 | + pull( | |
25 | + mentions({old: false, limit: 100}), | |
26 | + Scroller(container, content, api.message.html.render, true, false) | |
27 | + ) | |
28 | + | |
29 | + pull( | |
30 | + mentions({reverse: true, limit: 100, live: false}), | |
31 | + Scroller(container, content, api.message.html.render, false, false) | |
32 | + ) | |
33 | + return container | |
11 | 34 | }) |
12 | 35 | } |
13 | 36 |
Built with git-ssb-web