Files: a73aa37ff93b9ce8d191f6ab8ad82e4c673126f2 / app / page / private.js
791 bytesRaw
1 | const nest = require('depnest') |
2 | const { h } = require('mutant') |
3 | |
4 | const pull = require('pull-stream') |
5 | const dummyThread = require('../../test/fixtures/thread') |
6 | |
7 | exports.gives = nest('app.page.private') |
8 | |
9 | exports.needs = nest({ |
10 | 'app.sync.goTo': 'first', |
11 | 'app.html.thread': 'first' |
12 | }) |
13 | |
14 | exports.create = (api) => { |
15 | return nest('app.page.private', private) |
16 | |
17 | function private (location) { |
18 | // location here can expected to be an ssb-message |
19 | const { goTo } = api.app.sync |
20 | |
21 | // TODO (mix) : swap for actual source, derived from location |
22 | const source = pull.values(dummyThread) |
23 | const thread = api.app.html.thread(source) |
24 | |
25 | return h('div', [ |
26 | h('h1', 'Private message'), |
27 | h('div', { 'ev-click': () => goTo({ page: 'home' }) }, 'Home'), |
28 | thread |
29 | ]) |
30 | } |
31 | } |
32 |
Built with git-ssb-web