From 09f4afedd141d20c588adf514afeb3d5e04d4961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Miko=C5=82ajczak?= Date: Tue, 2 Jan 2024 17:14:54 +0100 Subject: [PATCH] disable OnyxTabNavigator animations on website --- src/libs/Navigation/OnyxTabNavigator.tsx | 2 ++ src/libs/Navigation/OnyxTabNavigatorConfig/index.ts | 8 ++++++++ .../Navigation/OnyxTabNavigatorConfig/index.website.ts | 8 ++++++++ 3 files changed, 18 insertions(+) create mode 100644 src/libs/Navigation/OnyxTabNavigatorConfig/index.ts create mode 100644 src/libs/Navigation/OnyxTabNavigatorConfig/index.website.ts diff --git a/src/libs/Navigation/OnyxTabNavigator.tsx b/src/libs/Navigation/OnyxTabNavigator.tsx index ef41269045c6..b81bb39af4c0 100644 --- a/src/libs/Navigation/OnyxTabNavigator.tsx +++ b/src/libs/Navigation/OnyxTabNavigator.tsx @@ -6,6 +6,7 @@ import {OnyxEntry} from 'react-native-onyx/lib/types'; import Tab from '@userActions/Tab'; import ONYXKEYS from '@src/ONYXKEYS'; import ChildrenProps from '@src/types/utils/ChildrenProps'; +import {defaultScreenOptions} from './OnyxTabNavigatorConfig'; type OnyxTabNavigatorOnyxProps = { selectedTab: OnyxEntry; @@ -50,6 +51,7 @@ function OnyxTabNavigator({id, selectedTab = '', children, onTabSelected = () => }, ...(screenListeners ?? {}), }} + screenOptions={defaultScreenOptions} > {children} diff --git a/src/libs/Navigation/OnyxTabNavigatorConfig/index.ts b/src/libs/Navigation/OnyxTabNavigatorConfig/index.ts new file mode 100644 index 000000000000..8f61e38ca531 --- /dev/null +++ b/src/libs/Navigation/OnyxTabNavigatorConfig/index.ts @@ -0,0 +1,8 @@ +const defaultScreenOptions = { + animationEnabled: true, +} as const; + +export { + // eslint-disable-next-line import/prefer-default-export + defaultScreenOptions, +}; diff --git a/src/libs/Navigation/OnyxTabNavigatorConfig/index.website.ts b/src/libs/Navigation/OnyxTabNavigatorConfig/index.website.ts new file mode 100644 index 000000000000..724e8be05123 --- /dev/null +++ b/src/libs/Navigation/OnyxTabNavigatorConfig/index.website.ts @@ -0,0 +1,8 @@ +const defaultScreenOptions = { + animationEnabled: false, +} as const; + +export { + // eslint-disable-next-line import/prefer-default-export + defaultScreenOptions, +};