git ssb

16+

Dominic / patchbay



Tree: 437facf41d277081453b193b5e9cc808704399ef

Files: 437facf41d277081453b193b5e9cc808704399ef / modules / feed.js

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

Built with git-ssb-web