From e3f6e3e639aeee3973c23bba728506326030360d Mon Sep 17 00:00:00 2001 From: Gheorghe Pinzaru Date: Thu, 23 Jan 2020 11:23:11 +0300 Subject: [PATCH] Remove react/modal view from android navigation Fixes #9884 React modal is drawn above the app (maximum z-index) while the bottom sheet and popover are part of the app. https://facebook.github.io/react-native/docs/modal.html documentation also suggest to not use modal in that case cause we lose some control over navigation. Now modal are handled by navigation and we can draw our popover and bottom sheet on bigger z-index and better control what should be on the top. Signed-off-by: Churikova Tetiana --- .../src/status_im/ui/components/react.cljs | 5 +--- src/status_im/ui/screens/routing/core.cljs | 24 +++---------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/components/src/status_im/ui/components/react.cljs b/components/src/status_im/ui/components/react.cljs index c651e1ee49..3be989f7b2 100644 --- a/components/src/status_im/ui/components/react.cljs +++ b/components/src/status_im/ui/components/react.cljs @@ -311,10 +311,7 @@ children))) (defn main-screen-modal-view [current-view & components] - ;; NOTE on Android we use Modal component and it manages statusbar area by itself - [(if platform/ios? - (create-main-screen-view current-view) - view) + [(create-main-screen-view current-view) styles/flex [(if (= current-view :chat-modal) view diff --git a/src/status_im/ui/screens/routing/core.cljs b/src/status_im/ui/screens/routing/core.cljs index 6774db424c..a757196757 100644 --- a/src/status_im/ui/screens/routing/core.cljs +++ b/src/status_im/ui/screens/routing/core.cljs @@ -99,27 +99,9 @@ (fn [args] (let [params (get-in args [:navigation :state :params]) active? (reagent.core/atom true)] - (if platform/android? - [react/view common-styles/modal - [react/modal - {:transparent true - :animation-type :slide - :on-request-close (fn [] - (cond - (#{:wallet-send-transaction-modal - :wallet-sign-message-modal} - modal-view) - (re-frame/dispatch - [:wallet/discard-transaction-navigate-back]) - - :else - (re-frame/dispatch [:navigate-back])))} - [react/main-screen-modal-view modal-view - [component params active?]] - [navigation-events modal-view true active?]]] - [react/main-screen-modal-view modal-view - [component params active?] - [navigation-events modal-view true active?]])))) + [react/main-screen-modal-view modal-view + [component params active?] + [navigation-events modal-view true active?]]))) (defn prepare-config [config] (-> config