git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: ff719d8d11108e133fbe0b77d5e7229f2412dd3e

Files: ff719d8d11108e133fbe0b77d5e7229f2412dd3e / modules / page / html / render / all.js

976 bytesRaw
1var nest = require('depnest')
2var { h } = require('mutant')
3
4exports.needs = nest({
5 'feed.pull.public': 'first',
6 'message.html.compose': 'first',
7 'message.async.publish': 'first',
8 'feed.html.rollup': 'first'
9})
10
11exports.gives = nest({
12 'page.html.render': true
13})
14
15exports.create = function (api) {
16 return nest('page.html.render', page)
17
18 function page (path) {
19 if (path !== '/all') return // "/" is a sigil for "page"
20
21 var prepend = [
22 h('PageHeading', [
23 h('h1', [
24 'All Posts from Your ',
25 h('strong', 'Extended Network')
26 ])
27 ]),
28 api.message.html.compose({ meta: { type: 'post' }, placeholder: 'Write a public message' })
29 ]
30
31 var feedView = api.feed.html.rollup(api.feed.pull.public, {
32 prepend
33 })
34
35 var result = h('div.SplitView', [
36 h('div.main', feedView)
37 ])
38
39 result.pendingUpdates = feedView.pendingUpdates
40 result.reload = feedView.reload
41
42 return result
43 }
44}
45

Built with git-ssb-web