Files: 81ca6a35c2987aabfa0164ebca0408a78e413dcf / modules / feed.js
1173 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) { |
14 | //TODO: header of user info, avatars, names, follows. |
15 | |
16 | if(ref.isFeed(id)) { |
17 | |
18 | var content = h('div.column.scroller__content') |
19 | var div = h('div.column.scroller', |
20 | {style: {'overflow':'auto'}}, |
21 | h('div.scroller__wrapper', |
22 | h('div', avatar_profile(id)), |
23 | content |
24 | ) |
25 | ) |
26 | |
27 | pull( |
28 | sbot_user_feed({id: id, old: false, live: true}), |
29 | Scroller(div, content, message_render, true, false) |
30 | ) |
31 | |
32 | //how to handle when have scrolled past the start??? |
33 | |
34 | pull( |
35 | u.next(sbot_user_feed, { |
36 | id: id, reverse: true, |
37 | limit: 50, live: false |
38 | }, ['value', 'sequence']), |
39 | Scroller(div, content, message_render, false, false) |
40 | ) |
41 | |
42 | return div |
43 | |
44 | } |
45 | } |
46 | |
47 | |
48 | |
49 | |
50 | |
51 | |
52 | |
53 |
Built with git-ssb-web