git ssb

0+

ev / microbay



forked from Dominic / patchbay

Tree: 85ac57b8c9b4766586338f320df5f3d4029dd6bc

Files: 85ac57b8c9b4766586338f320df5f3d4029dd6bc / modules / feed.js

1173 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')
7
8var plugs = require('../plugs')
9var sbot_user_feed = plugs.first(exports.sbot_user_feed = [])
10var message_render = plugs.first(exports.message_render = [])
11var avatar_profile = plugs.first(exports.avatar_profile = [])
12
13exports.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