Skip to content

Commit

Permalink
Allowing navigation to the reader.
Browse files Browse the repository at this point in the history
  • Loading branch information
lakinwecker committed Jun 11, 2017
1 parent f373444 commit 0df377f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/dashboard.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// The import PGN modal dialog.
import { Component, h, ConnectParams, RenderParams } from 'kaiju'
import { Component, h, ConnectParams, Message, RenderParams } from 'kaiju'
// import { update } from 'immupdate'
import { navigate, Route } from '../stores/route'
import routeStore from '../stores/route'

//-----------------------------------------------------------------------------------------
export default function () {
Expand All @@ -12,6 +14,8 @@ export default function () {
})
}

const showReader = Message('showReader')

//-----------------------------------------------------------------------------------------
interface State { }

Expand All @@ -20,14 +24,16 @@ function initState() {
}

//-----------------------------------------------------------------------------------------
function connect({ }: ConnectParams<{}, State>) {
function connect({ on }: ConnectParams<{}, State>) {
on(showReader, () => routeStore.send(navigate(Route.Reader)))
}

//-----------------------------------------------------------------------------------------
function render({ }: RenderParams<{}, State>) {
function render({ msg }: RenderParams<{}, State>) {

return h("dashboard", {}, [
"Dashboard"
h("h1", "Dashboard"),
h("a", { on: { click: () => msg.send(showReader()) } }, ["Reader"])
])
}

Expand Down

0 comments on commit 0df377f

Please sign in to comment.