Merge branch 'develop' into feature/36

This commit is contained in:
Simon Brooke 2017-03-29 06:40:49 +01:00
commit 14ec599fd2
2 changed files with 13 additions and 7 deletions

View file

@ -71,11 +71,16 @@
:map #'map-page
})
(defn page []
(defn page
"Render the single page of the app, taking the current panel from
the :page key in the state map."
[]
[:div
[:header
[ui/navbar]]
[(pages @(rf/subscribe [:page]))]])
[:header
[ui/navbar]]
(let [content (pages @(rf/subscribe [:page]))]
(if content [content]
[:div.error (str "No content in page " :page)]))])
;; -------------------------
;; Routes

View file

@ -34,9 +34,10 @@
(reg-event-db
:set-active-page
(fn [db [_ page]]
(assoc db :page page)))
:set-active-page
(fn [db [_ page]]
(if page
(assoc db :page page))))
(reg-event-db