Files: 314000baff3b2045fe13f8edf6519b9bdd1779d5 / app / page / home.js
702 bytesRaw
1 | const nest = require('depnest') |
2 | const { h } = require('mutant') |
3 | |
4 | const dummyMsg = require('../../test/fixtures/thread')[0] |
5 | |
6 | exports.gives = nest('app.page.home') |
7 | |
8 | exports.needs = nest({ |
9 | 'app.sync.goTo': 'first' |
10 | }) |
11 | |
12 | exports.create = (api) => { |
13 | return nest('app.page.home', home) |
14 | |
15 | function home (location) { |
16 | // location here can expected to be: { page: 'home' } |
17 | const { goTo } = api.app.sync |
18 | |
19 | return h('div', [ |
20 | h('h1', 'Home'), |
21 | h('div', { 'ev-click': () => goTo({ page: 'home' }) }, 'Home'), |
22 | h('div', { 'ev-click': () => goTo({ type: 'group', key: '%sadlkjas;lkdjas' }) }, 'Group'), |
23 | h('div', { 'ev-click': () => goTo(dummyMsg) }, 'Private message') |
24 | ]) |
25 | } |
26 | } |
27 |
Built with git-ssb-web