git ssb

3+

dangerousbeans / scuttle-vue



Tree: 8dc25143a3f37f1618f7a92b3c46dec512b43bfd

Files: 8dc25143a3f37f1618f7a92b3c46dec512b43bfd / modules / public.js

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

Built with git-ssb-web