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 <churikova.tm@gmail.com>
This commit is contained in:
Gheorghe Pinzaru 2020-01-23 11:23:11 +03:00 committed by Churikova Tetiana
parent 621e7803a3
commit e3f6e3e639
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
2 changed files with 4 additions and 25 deletions

View File

@ -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

View File

@ -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?]]))))
[navigation-events modal-view true active?]])))
(defn prepare-config [config]
(-> config