From f85b1bd7bd208488bb4af2c7619b46d948fd83c1 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 29 Nov 2023 12:16:46 +0100 Subject: [PATCH 1/2] [TS migration] Migrate 'overscrollBehaviorContain' style to TypeScript --- .../AppNavigator/ReportScreenWrapper.tsx | 27 +++++++++++++++++++ .../overscrollBehaviorContain/index.js | 3 --- .../overscrollBehaviorContain/index.native.js | 1 - .../overscrollBehaviorContain/index.native.ts | 5 ++++ .../overscrollBehaviorContain/index.ts | 7 +++++ .../overscrollBehaviorContain/types.ts | 5 ++++ 6 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx delete mode 100644 src/styles/utilities/overscrollBehaviorContain/index.js delete mode 100644 src/styles/utilities/overscrollBehaviorContain/index.native.js create mode 100644 src/styles/utilities/overscrollBehaviorContain/index.native.ts create mode 100644 src/styles/utilities/overscrollBehaviorContain/index.ts create mode 100644 src/styles/utilities/overscrollBehaviorContain/types.ts diff --git a/src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx b/src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx new file mode 100644 index 000000000000..4fc83ca9fb0b --- /dev/null +++ b/src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +import ReportScreen from '@pages/home/ReportScreen'; +import ReportScreenIDSetter from './ReportScreenIDSetter'; + +type Props = { + route: any; + navigation: any; +}; + +function ReportScreenWrapper({route, navigation}: Props) { + // The ReportScreen without the reportID set will display a skeleton + // until the reportID is loaded and set in the route param + return ( + <> + {/* @ts-expect-error explanation */} + + + + ); +} + +ReportScreenWrapper.displayName = 'ReportScreenWrapper'; + +export default ReportScreenWrapper; diff --git a/src/styles/utilities/overscrollBehaviorContain/index.js b/src/styles/utilities/overscrollBehaviorContain/index.js deleted file mode 100644 index 1377e4b47d28..000000000000 --- a/src/styles/utilities/overscrollBehaviorContain/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - overscrollBehavior: 'contain', -}; diff --git a/src/styles/utilities/overscrollBehaviorContain/index.native.js b/src/styles/utilities/overscrollBehaviorContain/index.native.js deleted file mode 100644 index ff8b4c56321a..000000000000 --- a/src/styles/utilities/overscrollBehaviorContain/index.native.js +++ /dev/null @@ -1 +0,0 @@ -export default {}; diff --git a/src/styles/utilities/overscrollBehaviorContain/index.native.ts b/src/styles/utilities/overscrollBehaviorContain/index.native.ts new file mode 100644 index 000000000000..fd6b2f496912 --- /dev/null +++ b/src/styles/utilities/overscrollBehaviorContain/index.native.ts @@ -0,0 +1,5 @@ +import OverscrollBehaviorStyles from './types'; + +const overscrollBehaviorContain: OverscrollBehaviorStyles = {}; + +export default overscrollBehaviorContain; diff --git a/src/styles/utilities/overscrollBehaviorContain/index.ts b/src/styles/utilities/overscrollBehaviorContain/index.ts new file mode 100644 index 000000000000..18cbe810d336 --- /dev/null +++ b/src/styles/utilities/overscrollBehaviorContain/index.ts @@ -0,0 +1,7 @@ +import OverscrollBehaviorStyles from './types'; + +const overscrollBehaviorContain: OverscrollBehaviorStyles = { + overscrollBehavior: 'contain', +}; + +export default overscrollBehaviorContain; diff --git a/src/styles/utilities/overscrollBehaviorContain/types.ts b/src/styles/utilities/overscrollBehaviorContain/types.ts new file mode 100644 index 000000000000..1e806eb60642 --- /dev/null +++ b/src/styles/utilities/overscrollBehaviorContain/types.ts @@ -0,0 +1,5 @@ +import {ViewStyle} from 'react-native'; + +type OverscrollBehaviorStyles = Pick; + +export default OverscrollBehaviorStyles; From c988129144bb9f3cdb6711c3e594efbee54f86b9 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 29 Nov 2023 12:18:31 +0100 Subject: [PATCH 2/2] Remove ReportScreenWrapper that was added by mistake --- .../AppNavigator/ReportScreenWrapper.tsx | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx diff --git a/src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx b/src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx deleted file mode 100644 index 4fc83ca9fb0b..000000000000 --- a/src/libs/Navigation/AppNavigator/ReportScreenWrapper.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import ReportScreen from '@pages/home/ReportScreen'; -import ReportScreenIDSetter from './ReportScreenIDSetter'; - -type Props = { - route: any; - navigation: any; -}; - -function ReportScreenWrapper({route, navigation}: Props) { - // The ReportScreen without the reportID set will display a skeleton - // until the reportID is loaded and set in the route param - return ( - <> - {/* @ts-expect-error explanation */} - - - - ); -} - -ReportScreenWrapper.displayName = 'ReportScreenWrapper'; - -export default ReportScreenWrapper;