mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 18:25:45 +00:00
[FIX #3852] Back button refinements
This commit is contained in:
parent
0ed067af6a
commit
8effc5974f
@ -20,12 +20,16 @@
|
|||||||
;; in handlers
|
;; in handlers
|
||||||
(let [stack (subscribe [:get :navigation-stack])
|
(let [stack (subscribe [:get :navigation-stack])
|
||||||
result-box (subscribe [:get-current-chat-ui-prop :result-box])
|
result-box (subscribe [:get-current-chat-ui-prop :result-box])
|
||||||
webview (subscribe [:get :webview-bridge])]
|
webview (subscribe [:get :webview-bridge])
|
||||||
|
view-id (subscribe [:get :view-id])]
|
||||||
(cond
|
(cond
|
||||||
|
|
||||||
(and @webview (:can-go-back? @result-box))
|
(and @webview (:can-go-back? @result-box))
|
||||||
(do (.goBack @webview) true)
|
(do (.goBack @webview) true)
|
||||||
|
|
||||||
|
(#{:home :wallet :my-profile} view-id)
|
||||||
|
(do (.exitApp react/back-handler))
|
||||||
|
|
||||||
(< 1 (count @stack))
|
(< 1 (count @stack))
|
||||||
(do (dispatch [:navigate-back]) true)
|
(do (dispatch [:navigate-back]) true)
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
(if (= chat-id constants/console-chat-id)
|
(if (= chat-id constants/console-chat-id)
|
||||||
[toolbar/simple-toolbar name]
|
[toolbar/simple-toolbar name]
|
||||||
[toolbar/platform-agnostic-toolbar {}
|
[toolbar/platform-agnostic-toolbar {}
|
||||||
toolbar/nav-back-count
|
(toolbar/nav-back-count {:home? true})
|
||||||
[toolbar-content/toolbar-content-view]
|
[toolbar-content/toolbar-content-view]
|
||||||
[toolbar/actions [{:icon :icons/options
|
[toolbar/actions [{:icon :icons/options
|
||||||
:icon-opts {:color :black
|
:icon-opts {:color :black
|
||||||
|
@ -18,9 +18,14 @@
|
|||||||
|
|
||||||
(def default-handler #(re-frame/dispatch [:navigate-back]))
|
(def default-handler #(re-frame/dispatch [:navigate-back]))
|
||||||
|
|
||||||
|
(def home-handler #(re-frame/dispatch [:navigate-to-clean :home]))
|
||||||
|
|
||||||
(def default-back
|
(def default-back
|
||||||
(back default-handler))
|
(back default-handler))
|
||||||
|
|
||||||
|
(def home-back
|
||||||
|
(back home-handler))
|
||||||
|
|
||||||
(defn back-white [handler]
|
(defn back-white [handler]
|
||||||
{:icon :icons/back
|
{:icon :icons/back
|
||||||
:icon-opts {:color :white}
|
:icon-opts {:color :white}
|
||||||
|
@ -51,7 +51,11 @@
|
|||||||
|
|
||||||
(def default-nav-back [nav-button actions/default-back])
|
(def default-nav-back [nav-button actions/default-back])
|
||||||
|
|
||||||
(def nav-back-count [nav-button-with-count actions/default-back])
|
(defn nav-back-count
|
||||||
|
([]
|
||||||
|
[nav-button-with-count actions/default-back])
|
||||||
|
([{:keys [home?]}]
|
||||||
|
[nav-button-with-count (if home? actions/home-back actions/default-back)]))
|
||||||
|
|
||||||
(defn default-done
|
(defn default-done
|
||||||
"Renders a touchable icon on Android or a label or iOS."
|
"Renders a touchable icon on Android or a label or iOS."
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
[react/keyboard-avoiding-view styles/browser
|
[react/keyboard-avoiding-view styles/browser
|
||||||
[status-bar/status-bar]
|
[status-bar/status-bar]
|
||||||
[toolbar.view/toolbar {}
|
[toolbar.view/toolbar {}
|
||||||
toolbar.view/nav-back-count
|
(toolbar.view/nav-back-count)
|
||||||
(if dapp?
|
(if dapp?
|
||||||
[toolbar-content-dapp contact unread-messages-number]
|
[toolbar-content-dapp contact unread-messages-number]
|
||||||
[toolbar-content browser unread-messages-number])]
|
[toolbar-content browser unread-messages-number])]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user