Files: b825cc4a398547f81f4d9c4336f2f619ab910f54 / modules / feed.js
1107 bytesRaw
1 | var ref = require('ssb-ref') |
2 | var ui = require('../ui') |
3 | var Scroller = require('pull-scroll') |
4 | var h = require('hyperscript') |
5 | var pull = require('pull-stream') |
6 | var u = require('../util') |
7 | |
8 | var plugs = require('../plugs') |
9 | var sbot_user_feed = plugs.first(exports.sbot_user_feed = []) |
10 | var message_render = plugs.first(exports.message_render = []) |
11 | var avatar_profile = plugs.first(exports.avatar_profile = []) |
12 | |
13 | exports.screen_view = function (id, sbot) { |
14 | //TODO: header of user info, avatars, names, follows. |
15 | |
16 | if(ref.isFeed(id)) { |
17 | |
18 | var content = h('div.column') |
19 | var div = h('div.column', |
20 | {style: {'overflow':'auto'}}, |
21 | h('div', avatar_profile(id)), |
22 | content |
23 | ) |
24 | |
25 | pull( |
26 | sbot_user_feed({id: id, old: false, live: true}), |
27 | Scroller(div, content, message_render, true, false) |
28 | ) |
29 | |
30 | //how to handle when have scrolled past the start??? |
31 | |
32 | pull( |
33 | u.next(sbot_user_feed, { |
34 | id: id, reverse: true, |
35 | limit: 50, live: false |
36 | }, ['value', 'sequence']), |
37 | Scroller(div, content, message_render, false, false) |
38 | ) |
39 | |
40 | return div |
41 | |
42 | } |
43 | } |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | |
50 | |
51 |
Built with git-ssb-web