Fix back navigation. Add 'discovery' drawer item.

This commit is contained in:
virvar 2016-05-11 10:36:13 +03:00
parent 6f2acb0f65
commit c89f2820aa
3 changed files with 5 additions and 2 deletions

View File

@ -30,7 +30,7 @@
;; this listener and handle application's closing
;; in handlers
(let [stack (subscribe [:navigation-stack])]
(when (< 1 (count stack))
(when (< 1 (count @stack))
(dispatch [:navigate-back])
true)))]
(add-event-listener "hardwareBackPress" new-listener)))

View File

@ -50,6 +50,9 @@
:handler (fn []
;; TODO not implemented
)}]
[menu-item {:name "Discovery"
:handler (fn []
(dispatch [:navigate-to :discovery]))}]
[menu-item {:name "Contacts"
:handler (fn []
(dispatch [:show-contacts navigator]))}]

View File

@ -4,7 +4,7 @@
;; schema of app-db
(def schema {:greeting s/Str})
(def default-view :discovery)
(def default-view :chat-list)
;; initial state of app-db
(def app-db {:greeting "Hello Clojure in iOS and Android!"