git ssb

16+

Dominic / patchbay



Tree: 9e65f9951f21778ee286834004367aa2b46bc882

Files: 9e65f9951f21778ee286834004367aa2b46bc882 / modules / feed.js

1326 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 = [])
12var signifier = plugs.first(exports.signifier = [])
13
14exports.screen_view = function (id) {
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 signifier(id, function (_, names) {
29 if(names.length) div.title = names[0].name
30 })
31
32
33 pull(
34 sbot_user_feed({id: id, old: false, live: true}),
35 Scroller(div, content, message_render, true, false)
36 )
37
38 //how to handle when have scrolled past the start???
39
40 pull(
41 u.next(sbot_user_feed, {
42 id: id, reverse: true,
43 limit: 50, live: false
44 }, ['value', 'sequence']),
45 Scroller(div, content, message_render, false, false)
46 )
47
48 return div
49
50 }
51}
52
53
54
55
56
57

Built with git-ssb-web