git ssb

16+

Dominic / patchbay



Tree: 2227f2f14f1094019ceb5e1cb1a8254841c2fe9e

Files: 2227f2f14f1094019ceb5e1cb1a8254841c2fe9e / modules / public.js

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

Built with git-ssb-web