diff --git a/app/actions/navigation/index.js b/app/actions/navigation/index.js index 16ef02b628..fc6f6241b3 100644 --- a/app/actions/navigation/index.js +++ b/app/actions/navigation/index.js @@ -293,7 +293,44 @@ export function showModal(name, title, passProps = {}, options = {}) { export function showModalOverCurrentContext(name, passProps = {}, options = {}) { const title = ''; - const animationsEnabled = (Platform.OS === 'android').toString(); + + let animations; + switch (Platform.OS) { + case 'android': + animations = { + showModal: { + waitForRender: true, + alpha: { + from: 0, + to: 1, + duration: 250, + }, + }, + dismissModal: { + alpha: { + from: 1, + to: 0, + duration: 250, + }, + }, + }; + break; + default: + animations = { + showModal: { + enabled: false, + enter: {}, + exit: {}, + }, + dismissModal: { + enabled: false, + enter: {}, + exit: {}, + }, + }; + break; + } + const defaultOptions = { modalPresentationStyle: 'overCurrentContext', layout: { @@ -304,25 +341,7 @@ export function showModalOverCurrentContext(name, passProps = {}, options = {}) visible: false, height: 0, }, - animations: { - showModal: { - waitForRender: true, - enabled: animationsEnabled, - alpha: { - from: 0, - to: 1, - duration: 250, - }, - }, - dismissModal: { - enabled: animationsEnabled, - alpha: { - from: 1, - to: 0, - duration: 250, - }, - }, - }, + animations, }; const mergeOptions = merge(defaultOptions, options); diff --git a/app/actions/navigation/index.test.js b/app/actions/navigation/index.test.js index 6cb864d7fb..60119b96eb 100644 --- a/app/actions/navigation/index.test.js +++ b/app/actions/navigation/index.test.js @@ -301,7 +301,6 @@ describe('@actions/navigation', () => { test('showModalOverCurrentContext should call Navigation.showModal', () => { const showModal = jest.spyOn(Navigation, 'showModal'); - const animationsEnabled = (Platform.OS === 'android').toString(); const showModalOverCurrentContextTitle = ''; const showModalOverCurrentContextOptions = { modalPresentationStyle: 'overCurrentContext', @@ -315,21 +314,14 @@ describe('@actions/navigation', () => { }, animations: { showModal: { - waitForRender: true, - enabled: animationsEnabled, - alpha: { - from: 0, - to: 1, - duration: 250, - }, + enabled: false, + enter: {}, + exit: {}, }, dismissModal: { - enabled: animationsEnabled, - alpha: { - from: 1, - to: 0, - duration: 250, - }, + enabled: false, + enter: {}, + exit: {}, }, }, };