Commit cf72ae678d205ad1c930cfc58496027bd47d38b9
Add calendar to menu items
Changes to make it so that /calendar is available in the menu far right.Lance Wicks committed on 7/26/2018, 10:20:17 PM
Parent: f7fe8b6d565d3823c3d5cf96317c609472e7cdbf
Files changed
app/page/calendar.js | changed |
app/page/calendar.js | |||
---|---|---|---|
@@ -1,20 +1,36 @@ | |||
1 | 1 … | const nest = require('depnest') | |
2 | 2 … | const { h, Array: MutantArray, map, Struct, computed, watch, throttle, resolve } = require('mutant') | |
3 … | + | ||
3 | 4 … | const pull = require('pull-stream') | |
4 | 5 … | const { isMsg } = require('ssb-ref') | |
5 | 6 … | ||
6 | -exports.gives = nest('app.page.calendar') | ||
7 … | +exports.gives = nest({ | ||
8 … | + 'app.page.calendar': true, | ||
9 … | + 'app.html.menuItem': true | ||
10 … | +}) | ||
7 | 11 … | ||
8 | 12 … | exports.needs = nest({ | |
9 | 13 … | 'message.html.render': 'first', | |
14 … | + 'app.html.scroller': 'first', | ||
15 … | + 'app.sync.goTo': 'first', | ||
10 | 16 … | 'sbot.async.get': 'first', | |
11 | 17 … | 'sbot.pull.stream': 'first' | |
12 | 18 … | }) | |
13 | 19 … | ||
14 | 20 … | exports.create = (api) => { | |
15 | - return nest('app.page.calendar', calendarPage) | ||
21 … | + return nest({ | ||
22 … | + 'app.html.menuItem': menuItem, | ||
23 … | + 'app.page.calendar': calendarPage | ||
24 … | + }) | ||
16 | 25 … | ||
26 … | + function menuItem () { | ||
27 … | + return h('a', { | ||
28 … | + style: { order: 1 }, | ||
29 … | + 'ev-click': () => api.app.sync.goTo({ page: 'calendar' }) | ||
30 … | + }, '/calendar') | ||
31 … | + } | ||
32 … | + | ||
17 | 33 … | function calendarPage (location) { | |
18 | 34 … | const d = new Date() | |
19 | 35 … | const state = Struct({ | |
20 | 36 … | today: new Date(d.getFullYear(), d.getMonth(), d.getDate()), |
Built with git-ssb-web