Add navigation to dashboard.

This commit is contained in:
Andrey Antukh 2015-12-16 13:57:42 +02:00
parent feb00d83f8
commit 61b05613f3
4 changed files with 44 additions and 20 deletions

View file

@ -57,8 +57,8 @@
(def ^:static
routes ["/" [["auth/login" :auth/login]
["auth/register" :auth/register]
["auth/recover" :auth/recover-password]
;; ["auth/register" :auth/register]
;; ["auth/recover" :auth/recover-password]
["dashboard/" [["projects" :dashboard/projects]
["elements" :dashboard/elements]
["icons" :dashboard/icons]
@ -66,13 +66,10 @@
["workspace/" [[project-route :main/project]
[page-route :main/page]]]]])
(defn- on-navigate
[data]
(rs/emit! (update-location data)))
(defonce +router+
(bidi.router/start-router! routes {:on-navigate on-navigate
:default-location {:handler :auth/login}}))
(let [opts {:on-navigate #(rs/emit! (update-location %))
:default-location {:handler :dashboard/projects}}]
(bidi.router/start-router! routes opts)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Public Api