navigate to home when press chat tab on chat screen
This commit is contained in:
parent
d380186051
commit
b7948b9869
|
@ -75,7 +75,7 @@
|
|||
(def tabs
|
||||
(reagent/adapt-react-class
|
||||
(fn [props]
|
||||
(let [{:keys [navigate index route state]} (bean props)
|
||||
(let [{:keys [navigate index route state popToTop]} (bean props)
|
||||
{:keys [keyboard-shown]
|
||||
:or {keyboard-shown false}} (when platform/android? (rn/use-keyboard))
|
||||
{:keys [bottom]} (safe-area/use-safe-area)
|
||||
|
@ -99,10 +99,12 @@
|
|||
[tab
|
||||
{:icon icon
|
||||
:label title
|
||||
:on-press #(let [view-id (navigation/get-index-route-name route-index (bean state))]
|
||||
:on-press #(if (= (str index) (str route-index))
|
||||
(popToTop)
|
||||
(let [view-id (navigation/get-index-route-name route-index (bean state))]
|
||||
(re-frame/dispatch-sync [:screens/tab-will-change view-id])
|
||||
(reagent/flush)
|
||||
(navigate (name nav-stack)))
|
||||
(navigate (name nav-stack))))
|
||||
:accessibility-label accessibility-label
|
||||
:count-subscription count-subscription
|
||||
:active? (= (str index) (str route-index))
|
||||
|
@ -112,10 +114,12 @@
|
|||
|
||||
(defn tabbar [props]
|
||||
(let [navigate (oget props "navigation" "navigate")
|
||||
pop-to-top (oget props "navigation" "popToTop")
|
||||
state (bean (oget props "state"))
|
||||
index (get state :index)]
|
||||
(reagent/as-element
|
||||
[tabs {:navigate navigate
|
||||
:state (oget props "state")
|
||||
:popToTop pop-to-top
|
||||
:route (navigation/get-active-route-name state)
|
||||
:index index}])))
|
||||
|
|
Loading…
Reference in New Issue