git ssb

16+

Dominic / patchbay



Tree: 0812b8ec179f8389faf0bb63ce3c45242f21a07b

Files: 0812b8ec179f8389faf0bb63ce3c45242f21a07b / modules / public.js

1045 bytesRaw
1var h = require('hyperscript')
2var ui = require('../ui')
3var u = require('../util')
4var pull = require('pull-stream')
5var Scroller = require('pull-scroll')
6var keyscroll = require('../keyscroll')
7
8var plugs = require('../plugs')
9var message_render = plugs.first(exports.message_render = [])
10var message_compose = plugs.first(exports.message_compose = [])
11var sbot_log = plugs.first(exports.sbot_log = [])
12
13exports.screen_view = function (path, sbot) {
14 if(path === '/public') {
15
16 var content = h('div.column.scroller__content')
17 var div = h('div.column.scroller',
18 {style: {'overflow':'auto'}},
19 h('div.scroller__wrapper',
20 message_compose({type: 'post'}), //header
21 content
22 )
23 )
24
25 pull(
26 sbot_log({old: false}),
27 Scroller(div, content, message_render, true, false)
28 )
29
30 pull(
31 u.next(sbot_log, {reverse: true, limit: 100, live: false}),
32 Scroller(div, content, message_render, false, false)
33 )
34
35 div.scroll = keyscroll(content)
36
37 return div
38 }
39}
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

Built with git-ssb-web