git ssb

16+

Dominic / patchbay



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.jschanged
app/page/calendar.jsView
@@ -1,20 +1,36 @@
11 const nest = require('depnest')
22 const { h, Array: MutantArray, map, Struct, computed, watch, throttle, resolve } = require('mutant')
3 +
34 const pull = require('pull-stream')
45 const { isMsg } = require('ssb-ref')
56
6-exports.gives = nest('app.page.calendar')
7 +exports.gives = nest({
8 + 'app.page.calendar': true,
9 + 'app.html.menuItem': true
10 +})
711
812 exports.needs = nest({
913 'message.html.render': 'first',
14 + 'app.html.scroller': 'first',
15 + 'app.sync.goTo': 'first',
1016 'sbot.async.get': 'first',
1117 'sbot.pull.stream': 'first'
1218 })
1319
1420 exports.create = (api) => {
15- return nest('app.page.calendar', calendarPage)
21 + return nest({
22 + 'app.html.menuItem': menuItem,
23 + 'app.page.calendar': calendarPage
24 + })
1625
26 + function menuItem () {
27 + return h('a', {
28 + style: { order: 1 },
29 + 'ev-click': () => api.app.sync.goTo({ page: 'calendar' })
30 + }, '/calendar')
31 + }
32 +
1733 function calendarPage (location) {
1834 const d = new Date()
1935 const state = Struct({
2036 today: new Date(d.getFullYear(), d.getMonth(), d.getDate()),

Built with git-ssb-web