git ssb

0+

ev / minbase



Tree: 3ee0398629a78832c2fbe78831ce756faeaeca74

Files: 3ee0398629a78832c2fbe78831ce756faeaeca74 / modules / public.js

1060 bytesRaw
1var h = require('hyperscript')
2var u = require('../util')
3var pull = require('pull-stream')
4var Scroller = require('pull-scroll')
5var log = require('./scuttlebot').log
6
7exports.needs = {
8 message_render: 'first',
9 message_compose: 'first'
10}
11
12exports.gives = {
13 screen_view: true
14}
15
16exports.create = function (api) {
17
18 return {
19
20 screen_view: function (path, sbot) {
21 if(path === 'Public') {
22
23 var content = h('div.column.scroller__content')
24 var div = h('div.column.scroller',
25 {style: {'overflow':'auto'}},
26 h('div.scroller__wrapper',
27 api.message_compose({type: 'post'}, {placeholder: 'What are you doing right now?'}),
28 content
29 )
30 )
31
32 pull(
33 u.next(log, {old: false, limit: 100}),
34 Scroller(div, content, api.message_render, true, false)
35 )
36
37 pull(
38 u.next(log, {reverse: true, limit: 100, live: false}),
39 Scroller(div, content, api.message_render, false, false)
40 )
41
42 return div
43 }
44 }
45 }
46}
47

Built with git-ssb-web