Files: 3c9b18facfb73339b585ecdd2141a23586ab0095 / modules / public.js
977 bytesRaw
1 | var h = require('hyperscript') |
2 | var u = require('../util') |
3 | var pull = require('pull-stream') |
4 | var Scroller = require('pull-scroll') |
5 | |
6 | var plugs = require('../plugs') |
7 | var message_render = plugs.first(exports.message_render = []) |
8 | var message_compose = plugs.first(exports.message_compose = []) |
9 | var sbot_log = plugs.first(exports.sbot_log = []) |
10 | |
11 | exports.screen_view = function (path, sbot) { |
12 | if(path === '/public') { |
13 | |
14 | var content = h('div.column.scroller__content') |
15 | var div = h('div.column.scroller', |
16 | {style: {'overflow':'auto'}}, |
17 | h('div.scroller__wrapper', |
18 | message_compose({type: 'post'}, {placeholder: 'Write a public message'}), |
19 | content |
20 | ) |
21 | ) |
22 | |
23 | pull( |
24 | sbot_log({old: false}), |
25 | Scroller(div, content, message_render, true, false) |
26 | ) |
27 | |
28 | pull( |
29 | u.next(sbot_log, {reverse: true, limit: 100, live: false}), |
30 | Scroller(div, content, message_render, false, false) |
31 | ) |
32 | |
33 | return div |
34 | } |
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