From 4af8c8b9e03d7fc226eaf314a2b7e5b2e0f7f645 Mon Sep 17 00:00:00 2001 From: gewfy Date: Wed, 1 Jan 2025 16:41:59 +0100 Subject: [PATCH 1/5] Bump dependencies: update RNGestureHandler to 2.21.2, RNReanimated to 3.16.4, and RNScreens to 4.3.0; adjust metro config for Reanimated --- client/ios/Podfile.lock | 44 ++++++++++++++++++++++++++++++----------- client/metro.config.js | 7 ++++++- client/package.json | 10 +++++----- client/yarn.lock | 36 ++++++++++++++++++--------------- 4 files changed, 64 insertions(+), 33 deletions(-) diff --git a/client/ios/Podfile.lock b/client/ios/Podfile.lock index 827c20849e..d8462a938b 100644 --- a/client/ios/Podfile.lock +++ b/client/ios/Podfile.lock @@ -2391,7 +2391,7 @@ PODS: - Firebase/Storage (= 10.29.0) - React-Core - RNFBApp - - RNGestureHandler (2.20.0): + - RNGestureHandler (2.21.2): - DoubleConversion - glog - hermes-engine @@ -2434,7 +2434,7 @@ PODS: - React-Core - RNReactNativeHapticFeedback (2.2.0): - React-Core - - RNReanimated (3.15.4): + - RNReanimated (3.16.4): - DoubleConversion - glog - hermes-engine @@ -2454,10 +2454,10 @@ PODS: - React-utils - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNReanimated/reanimated (= 3.15.4) - - RNReanimated/worklets (= 3.15.4) + - RNReanimated/reanimated (= 3.16.4) + - RNReanimated/worklets (= 3.16.4) - Yoga - - RNReanimated/reanimated (3.15.4): + - RNReanimated/reanimated (3.16.4): - DoubleConversion - glog - hermes-engine @@ -2477,8 +2477,9 @@ PODS: - React-utils - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core + - RNReanimated/reanimated/apple (= 3.16.4) - Yoga - - RNReanimated/worklets (3.15.4): + - RNReanimated/reanimated/apple (3.16.4): - DoubleConversion - glog - hermes-engine @@ -2499,7 +2500,28 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - RNScreens (3.34.0): + - RNReanimated/worklets (3.16.4): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.01.01.00) + - RCTRequired + - RCTTypeSafety + - React-Codegen + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-NativeModulesApple + - React-RCTFabric + - React-rendererdebug + - React-utils + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - Yoga + - RNScreens (4.3.0): - DoubleConversion - glog - hermes-engine @@ -3013,15 +3035,15 @@ SPEC CHECKSUMS: RNFBDynamicLinks: 6e5d52576c079e65040110c8a9b895c6e1f02edc RNFBFirestore: 9b5e7d645787f02d5d16c4e060e778e9da762e02 RNFBStorage: a86f59a4adae00b3061e55257d6c3d70851a1810 - RNGestureHandler: 83fd202dbc0b8971414c5c7c56ddd9f5cde05911 + RNGestureHandler: 38b7949a58a56ae0e2a3c38920cb6852cafb6b9f RNImageCropPicker: 771e2ca319d2cf92e04ebf334ece892ee9a6728f RNLocalize: 4f22418187ecd5ca693231093ff1d912d1b3c9bc RNNotifee: 35b5f984d11083b02d7f2990b3408cd99a0aeeac RNPermissions: a58e61bd4e6bd417adcf8ef8ca094b93d772e492 RNRate: ef3bcff84f39bb1d1e41c5593d3eea4aab2bd73a RNReactNativeHapticFeedback: ec56a5f81c3941206fd85625fa669ffc7b4545f9 - RNReanimated: 4e3738c07d997c502b5fa407524700dfa8712777 - RNScreens: db442e7b8c7bc8befec2ce057927305ff8598cc8 + RNReanimated: 13f9f061449dd7a1f6e1b8fb4caf18b880b41bd1 + RNScreens: d090bfb033bb48f8da0983999ea58868e813cb80 RNSentry: d2f4b8dc672fb4e26b50b99e006e52d547e36b3f RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57 @@ -3037,7 +3059,7 @@ SPEC CHECKSUMS: StripePaymentsUI: 7d7cffb2ecfc0d6b5ac3a4488c02893a5ff6cc77 StripeUICore: bb102d453b1e1a10a37f810bc0a9aa0675fb17fd TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654 - Yoga: eed50599a85bd9f6882a9938d118aed6a397db9c + Yoga: bd92064a0d558be92786820514d74fc4dddd1233 PODFILE CHECKSUM: 1e2c5c3ea8152bd7472ee44e381909c2f6afd170 diff --git a/client/metro.config.js b/client/metro.config.js index b3212adade..2c9eb38828 100644 --- a/client/metro.config.js +++ b/client/metro.config.js @@ -1,3 +1,6 @@ +const { + wrapWithReanimatedMetroConfig, +} = require('react-native-reanimated/metro-config'); const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); /** * Metro configuration for React Native @@ -60,4 +63,6 @@ const config = { }, }; -module.exports = mergeConfig(getDefaultConfig(__dirname), config); +module.exports = wrapWithReanimatedMetroConfig( + mergeConfig(getDefaultConfig(__dirname), config), +); diff --git a/client/package.json b/client/package.json index 6862f9b950..2a806903e7 100644 --- a/client/package.json +++ b/client/package.json @@ -24,7 +24,7 @@ "@daily-co/react-native-daily-js": "0.69.0", "@daily-co/react-native-webrtc": "118.0.3-daily.1", "@dotlottie/react-player": "^1.6.19", - "@gorhom/bottom-sheet": "^4.6.4", + "@gorhom/bottom-sheet": "^5.0.6", "@kingstinct/react-native-healthkit": "^8.2.0", "@lottiefiles/react-lottie-player": "^3.5.4", "@notifee/react-native": "^9.1.1", @@ -44,7 +44,7 @@ "@react-navigation/stack": "^6.4.1", "@sentry/react-native": "^5.33.1", "@stripe/stripe-react-native": "^0.39.0", - "@th3rdwave/react-navigation-bottom-sheet": "^0.3.2", + "@th3rdwave/react-navigation-bottom-sheet": "https://github.com/29ki/react-navigation-bottom-sheet.git#overlay-as-containerComponent", "@types/lodash.throttle": "^4.1.9", "dayjs": "^1.11.13", "debug": "^4.3.6", @@ -67,7 +67,7 @@ "react-native-circular-progress": "^1.4.1", "react-native-code-push": "^9.0.0", "react-native-device-info": "^11.1.0", - "react-native-gesture-handler": "^2.20.0", + "react-native-gesture-handler": "^2.21.2", "react-native-get-random-values": "^1.11.0", "react-native-haptic-feedback": "^2.2.0", "react-native-idle-timer": "^2.2.3", @@ -77,9 +77,9 @@ "react-native-markdown-display": "^7.0.2", "react-native-permissions": "^4.1.5", "react-native-rate": "^1.2.12", - "react-native-reanimated": "^3.15.4", + "react-native-reanimated": "^3.16.4", "react-native-safe-area-context": "^4.10.9", - "react-native-screens": "^3.34.0", + "react-native-screens": "^4.3.0", "react-native-svg": "^15.8.0", "react-native-volume-manager": "^1.10.0", "react-native-web": "^0.19.13", diff --git a/client/yarn.lock b/client/yarn.lock index 72338d2268..9bae998f1d 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -2069,10 +2069,10 @@ resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.0.tgz#a0e11b39fa3ef56ed5333bf321f581037aeda033" integrity sha512-zuWxyfXNbsKbm96HhXzainONPFqRcoZblQ++e9cAIGUuHfl2cFSBzW01jtesqWG/lqaUyX3H8O1y9oWboGNQBA== -"@gorhom/bottom-sheet@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-4.6.4.tgz#387d0f0f21e3470eb8575498cb81ce96f5108e79" - integrity sha512-0itLMblLBvepE065w3a60S030c2rNUsGshPC7wbWDm31VyqoaU2xjzh/ojH62YIJOcobBr5QoC30IxBBKDGovQ== +"@gorhom/bottom-sheet@^5.0.6": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-5.0.6.tgz#f20736502399c7bcf8c73ea09e6b571dc07fe0eb" + integrity sha512-SI/AhPvgRfnCWN6/+wbE6TXwRE4X8F2fLyE4L/0bRwgE34Zenq585qLT139uEcfCIyovC2swC3ICqQpkmWEcFA== dependencies: "@gorhom/portal" "1.0.14" invariant "^2.2.4" @@ -3853,6 +3853,10 @@ resolved "https://registry.yarnpkg.com/@th3rdwave/react-navigation-bottom-sheet/-/react-navigation-bottom-sheet-0.3.2.tgz#b7999322d54cb8f9a2b1b39e6c47f482407c5250" integrity sha512-DEqC9tlAWE8qw5DDveyTwG0qjMJH3h8nup5Qi3TBlfW8hG9qx0N1/dfA1D+GKFEb4gw1C2/AWC6umc13z7ytoQ== +"@th3rdwave/react-navigation-bottom-sheet@https://github.com/29ki/react-navigation-bottom-sheet.git#overlay-as-containerComponent": + version "0.3.2" + resolved "https://github.com/29ki/react-navigation-bottom-sheet.git#bb3a34d200f59bb1887803a2b8b5b6af5125e926" + "@tootallnate/quickjs-emscripten@^0.23.0": version "0.23.0" resolved "https://registry.yarnpkg.com/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c" @@ -9943,10 +9947,10 @@ react-native-fit-image@^1.5.5: dependencies: prop-types "^15.5.10" -react-native-gesture-handler@^2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.20.0.tgz#2d9ec4e9bd22619ebe36269dda3ecb1173928276" - integrity sha512-rFKqgHRfxQ7uSAivk8vxCiW4SB3G0U7jnv7kZD4Y90K5kp6YrU8Q3tWhxe3Rx55BIvSd3mBe9ZWbWVJ0FsSHPA== +react-native-gesture-handler@^2.21.2: + version "2.21.2" + resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.21.2.tgz#824a098d7397212fbe51aa3a9df84833a4ea1c3f" + integrity sha512-HcwB225K9aeZ8e/B8nFzEh+2T4EPWTeamO1l/y3PcQ9cyCDYO2zja/G31ITpYRIqkip7XzGs6wI/gnHOQn1LDQ== dependencies: "@egjs/hammerjs" "^2.0.17" hoist-non-react-statics "^3.3.0" @@ -10005,10 +10009,10 @@ react-native-rate@^1.2.12: resolved "https://registry.yarnpkg.com/react-native-rate/-/react-native-rate-1.2.12.tgz#d4307b2994f9c849b987eb65599ec467db4aee04" integrity sha512-A/z3s7Zth08aXcJnru6S4p71NG8acx2w5LhIfItwTJUbQruNJugk8WrN51dLBCSDv8W33kbS5YoUT4M9jOP5gA== -react-native-reanimated@^3.15.4: - version "3.15.4" - resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-3.15.4.tgz#0d4aa65b53f9c845fe8c33aa8a3ad3d06a23f063" - integrity sha512-jcpHE+MnsvSbClhHgAFoken7SnaHrUJ5gVA8BUw8S1j6rkrw2VzRpht6cxn14NlqYx5ytjfG9IXJDOzq8tFvfw== +react-native-reanimated@^3.16.4: + version "3.16.4" + resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-3.16.4.tgz#bb5798366aa6c4db6f53ae8a3b1d7bd6d6d903eb" + integrity sha512-dF1Vvu8gG+p0+DmBhKMTx5X9iw/rH1ZF9WaIn2nW0c5rxsVFf00axmDgaAdPxNWblmtLnroaKwrV7SjMUyOx+g== dependencies: "@babel/plugin-transform-arrow-functions" "^7.0.0-0" "@babel/plugin-transform-class-properties" "^7.0.0-0" @@ -10027,10 +10031,10 @@ react-native-safe-area-context@^4.10.9: resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-4.10.9.tgz#6ab82dc866ab499b101b033cb0f5b40125a4d410" integrity sha512-wz/JXV1kARWyP5q93PFNKQP03StVBimOK7rRYEJjM+blZdXbM6H7EP3XhQUb6OK620+0M1AzpcGgyTHvgSJNAw== -react-native-screens@^3.34.0: - version "3.34.0" - resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-3.34.0.tgz#1291a460c5bc59e2ba581b42d40fa9a58d3b1197" - integrity sha512-8ri3Pd9QcpfXnVckOe/Lnto+BXmSPHV/Q0RB0XW0gDKsCv5wi5k7ez7g1SzgiYHl29MSdiqgjH30zUyOOowOaw== +react-native-screens@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-4.3.0.tgz#c4fef7583535c963e9257cdd1d91a9889961ab61" + integrity sha512-G0u8BPgu2vcRZoQTlRpBXKa0ElQSDvDBlRe6ncWwCeBmd5Uqa2I3tQ6Vn6trIE6+yneW/nD4p5wihEHlAWZPEw== dependencies: react-freeze "^1.0.0" warn-once "^0.1.0" From f5d556d020ac4791e384bac27b947a5bca9254c5 Mon Sep 17 00:00:00 2001 From: gewfy Date: Wed, 1 Jan 2025 16:42:29 +0100 Subject: [PATCH 2/5] Make use of the patched containerComponent prop --- client/src/lib/navigation/ModalStack.tsx | 44 +++++++++++++++++------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/client/src/lib/navigation/ModalStack.tsx b/client/src/lib/navigation/ModalStack.tsx index a9080ce6c6..5b61931f02 100644 --- a/client/src/lib/navigation/ModalStack.tsx +++ b/client/src/lib/navigation/ModalStack.tsx @@ -1,4 +1,6 @@ import React, {useMemo} from 'react'; +import {StyleSheet} from 'react-native'; + import { BottomSheetNavigationOptions, createBottomSheetNavigator, @@ -14,7 +16,10 @@ import SessionErrorModal from '../../routes/modals/SessionErrorModal/SessionErro import {COLORS} from '../../../../shared/src/constants/colors'; import SETTINGS from '../constants/settings'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; -import {BottomSheetBackdrop} from '@gorhom/bottom-sheet'; +import { + BottomSheetBackdrop, + BottomSheetBackdropProps, +} from '@gorhom/bottom-sheet'; import ChangeLanguageModal from '../../routes/modals/ChangeLanguageModal/ChangeLanguageModal'; import ProfileSettingsModal from '../../routes/modals/ProfileSettingsModal/ProfileSettingsModal'; import SignInModal from '../../routes/modals/SignInModal/SignInModal'; @@ -46,22 +51,34 @@ import SessionModal from '../../routes/modals/SessionModal/SessionModal'; import FeedbackPostModal from '../../routes/modals/FeedbackPostModal/FeedbackPostModal'; import LiveSessionsModal from '../../routes/modals/LiveSessionsModal/LiveSessionsModal'; import UnlockCollectionModal from '../../routes/modals/UnlockCollectionModal/UnlockCollectionModal'; +import styled from 'styled-components/native'; const {Navigator, Screen, Group} = createBottomSheetNavigator(); +const ContainerComponent = styled.View.attrs({ + pointerEvents: 'box-none', +})({...StyleSheet.absoluteFillObject}); + +const BackdropComponent = ({ + animatedIndex, + animatedPosition, + style, +}: BottomSheetBackdropProps) => ( + +); + const modalScreenOptions: BottomSheetNavigationOptions = { - backdropComponent: ({animatedIndex, animatedPosition, style}) => ( - - ), + containerComponent: ContainerComponent, + backdropComponent: BackdropComponent, backgroundStyle: { backgroundColor: 'transparent', shadowColor: '#000000', @@ -80,12 +97,13 @@ const modalScreenOptions: BottomSheetNavigationOptions = { left: 0, right: 0, }, + enableDynamicSizing: false, /* TODO: Fixes issues with modals being clipped when focusing on input fields https://github.com/gorhom/react-native-bottom-sheet/issues/618 */ android_keyboardInputMode: 'adjustResize', - stackBehavior: 'replace', + stackBehavior: 'push', }; const ModalStack = () => { From d302a9b43ea9b77ead16a0564c9db07e72d1a793 Mon Sep 17 00:00:00 2001 From: gewfy Date: Wed, 1 Jan 2025 16:48:11 +0100 Subject: [PATCH 3/5] Remove useHideModalUntilResolved --- .../components/ProfileInfo/ProfileInfo.tsx | 5 +--- .../hooks/useHideModalUntilResolved.ts | 25 ------------------- .../AssignNewHostModal/AssignNewHostModal.tsx | 6 ++--- .../components/steps/SelectTypeStep.tsx | 6 ++--- .../ProfileSettingsModal.tsx | 5 +--- .../modals/SessionModal/SessionModal.tsx | 6 ++--- 6 files changed, 8 insertions(+), 45 deletions(-) delete mode 100644 client/src/lib/navigation/hooks/useHideModalUntilResolved.ts diff --git a/client/src/lib/components/ProfileInfo/ProfileInfo.tsx b/client/src/lib/components/ProfileInfo/ProfileInfo.tsx index f7e3d8c910..c015217858 100644 --- a/client/src/lib/components/ProfileInfo/ProfileInfo.tsx +++ b/client/src/lib/components/ProfileInfo/ProfileInfo.tsx @@ -11,7 +11,6 @@ import useUpdateProfileDetails from '../../user/hooks/useUpdateProfileDetails'; import ProfilePicture from '../User/ProfilePicture'; import useUser from '../../user/hooks/useUser'; import {COLORS} from '../../../../../shared/src/constants/colors'; -import useHideModalUntilResolved from '../../navigation/hooks/useHideModalUntilResolved'; const Container = styled.View({ alignItems: 'center', @@ -47,8 +46,6 @@ const ProfileInfo: React.FC = ({onSaveCallback}) => { useChangeProfilePicture(); const {updateProfileDetails, isUpdatingProfileDetails} = useUpdateProfileDetails(); - const hideModalAndChangeProfilePicture = - useHideModalUntilResolved(changeProfilePicture); const [displayName, setDisplayName] = useState(user?.displayName ?? ''); const [nameMissing, setNameMissing] = useState(false); const [pictureMissing, setPictureMissing] = useState(false); @@ -97,7 +94,7 @@ const ProfileInfo: React.FC = ({onSaveCallback}) => { pictureURL={user?.photoURL} hasError={pictureMissing} loading={isUpdatingProfilePicture} - onPress={hideModalAndChangeProfilePicture} + onPress={changeProfilePicture} size={SPACINGS.NINTYSIX} /> diff --git a/client/src/lib/navigation/hooks/useHideModalUntilResolved.ts b/client/src/lib/navigation/hooks/useHideModalUntilResolved.ts deleted file mode 100644 index 7cacc8df43..0000000000 --- a/client/src/lib/navigation/hooks/useHideModalUntilResolved.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {useBottomSheet} from '@gorhom/bottom-sheet'; -import {useCallback} from 'react'; - -/* - This hook hides the current modal and opens the share modal to prevent it from being rendered behind the current modal - Bottom sheet modals are rendered with FullWindowModal, which is a full-screen modal that covers the entire screen - https://github.com/th3rdwave/react-navigation-bottom-sheet/blob/ef8c616559a3fdbb67149d6e1ebc9bb662d71255/src/BottomSheetView.tsx#L27-L31 -*/ -const useHideModalUntilResolved = ( - fn: (...args: TArgs) => Promise, -) => { - const bottomSheet = useBottomSheet(); - return useCallback( - async (...args: TArgs) => { - const currentSnapIndex = bottomSheet.animatedIndex.value; - bottomSheet.snapToPosition(0.0000001); // Hide without closing it - const ret = await fn(...args); - bottomSheet.snapToIndex(currentSnapIndex); // Restore the position - return ret; - }, - [bottomSheet, fn], - ); -}; - -export default useHideModalUntilResolved; diff --git a/client/src/routes/modals/AssignNewHostModal/AssignNewHostModal.tsx b/client/src/routes/modals/AssignNewHostModal/AssignNewHostModal.tsx index dce69751bb..ce29b87d7d 100644 --- a/client/src/routes/modals/AssignNewHostModal/AssignNewHostModal.tsx +++ b/client/src/routes/modals/AssignNewHostModal/AssignNewHostModal.tsx @@ -25,7 +25,6 @@ import {SPACINGS} from '../../../lib/constants/spacings'; import {ModalHeading} from '../../../lib/components/Typography/Heading/Heading'; import useConfirmSessionReminder from '../../../lib/sessions/hooks/useConfirmSessionReminder'; import {getSessionHostingLink} from '../../../lib/sessions/api/session'; -import useHideModalUntilResolved from '../../../lib/navigation/hooks/useHideModalUntilResolved'; const Row = styled(View)({ flexDirection: 'row', @@ -42,18 +41,17 @@ const AssignNewHostModal = () => { const exercise = useExerciseById(session?.exerciseId, session?.language); const confirmToggleReminder = useConfirmSessionReminder(session); - const hideModalAndShare = useHideModalUntilResolved(Share.share); const isHost = user?.uid === session.hostId; const onHostChange = useCallback(async () => { const link = await getSessionHostingLink(session.id); if (link) { - hideModalAndShare({ + Share.share({ message: link, }); } - }, [session.id, hideModalAndShare]); + }, [session.id]); useEffect(() => { if (isHost) { diff --git a/client/src/routes/modals/CreateSessionModal/components/steps/SelectTypeStep.tsx b/client/src/routes/modals/CreateSessionModal/components/steps/SelectTypeStep.tsx index 083d34e52e..7f02e47a4d 100644 --- a/client/src/routes/modals/CreateSessionModal/components/steps/SelectTypeStep.tsx +++ b/client/src/routes/modals/CreateSessionModal/components/steps/SelectTypeStep.tsx @@ -57,7 +57,6 @@ import CoCreators from '../../../../../lib/components/CoCreators/CoCreators'; import CardGraphic from '../../../../../lib/components/CardGraphic/CardGraphic'; import BackgroundBlock from '../../../../../lib/components/BackgroundBlock/BackgroundBlock'; import useGetSessionCardTags from '../../../../../lib/components/Cards/SessionCard/hooks/useGetSessionCardTags'; -import useHideModalUntilResolved from '../../../../../lib/navigation/hooks/useHideModalUntilResolved'; const TypeItemWrapper = styled.View<{isLast?: boolean}>(({isLast}) => ({ flexDirection: 'row', @@ -162,7 +161,6 @@ const SelectTypeStep: React.FC = ({ useNavigation>(); const getExerciseById = useGetExerciseById(); const startSession = useStartAsyncSession(); - const hideModalAndShare = useHideModalUntilResolved(Share.share); const {rating} = useExerciseRating(selectedExercise); const {feedback} = useExerciseFeedback(selectedExercise); @@ -197,11 +195,11 @@ const SelectTypeStep: React.FC = ({ const onShare = useCallback(() => { if (exercise?.link) { - hideModalAndShare({ + Share.share({ message: exercise.link, }); } - }, [exercise?.link, hideModalAndShare]); + }, [exercise?.link]); const onStartPress = useCallback(() => { if (selectedExercise) { diff --git a/client/src/routes/modals/ProfileSettingsModal/ProfileSettingsModal.tsx b/client/src/routes/modals/ProfileSettingsModal/ProfileSettingsModal.tsx index a4871b9a5a..63c92c609d 100644 --- a/client/src/routes/modals/ProfileSettingsModal/ProfileSettingsModal.tsx +++ b/client/src/routes/modals/ProfileSettingsModal/ProfileSettingsModal.tsx @@ -41,7 +41,6 @@ import {SPACINGS} from '../../../lib/constants/spacings'; import useUserState from '../../../lib/user/state/state'; import ActionSwitch from '../../../lib/components/ActionList/ActionItems/ActionSwitch'; import useLogMindfulMinutes from '../../../lib/mindfulMinutes/hooks/useLogMindfulMinutes'; -import useHideModalUntilResolved from '../../../lib/navigation/hooks/useHideModalUntilResolved'; const Picture = styled(ProfilePicture)({ width: 144, @@ -72,8 +71,6 @@ const ProfileSettingsModal = () => { useChangeProfilePicture(); const {updateProfileDetails, isUpdatingProfileDetails} = useUpdateProfileDetails(); - const hideModalAndChangeProfilePicture = - useHideModalUntilResolved(changeProfilePicture); const {deleteUser} = useDeleteUser(); const signOut = useSignOutUser(); const user = useUser(); @@ -160,7 +157,7 @@ const ProfileSettingsModal = () => { pictureURL={user?.photoURL} letter={user?.displayName?.[0]} loading={isUpdatingProfilePicture} - onPress={hideModalAndChangeProfilePicture} + onPress={changeProfilePicture} /> diff --git a/client/src/routes/modals/SessionModal/SessionModal.tsx b/client/src/routes/modals/SessionModal/SessionModal.tsx index 24dc6f403a..7d39e6db1f 100644 --- a/client/src/routes/modals/SessionModal/SessionModal.tsx +++ b/client/src/routes/modals/SessionModal/SessionModal.tsx @@ -78,7 +78,6 @@ import BackgroundBlock from '../../../lib/components/BackgroundBlock/BackgroundB import SheetModal from '../../../lib/components/Modals/SheetModal'; import {BottomSheetScrollView} from '@gorhom/bottom-sheet'; import {SessionMode} from '../../../../../shared/src/schemas/Session'; -import useHideModalUntilResolved from '../../../lib/navigation/hooks/useHideModalUntilResolved'; const Content = styled(Gutters)({ justifyContent: 'space-between', @@ -156,7 +155,6 @@ const SessionModal = () => { const navigation = useNavigation>(); - const hideModalAndshare = useHideModalUntilResolved(Share.share); const addToCalendar = useAddSessionToCalendar(); const exercise = useExerciseById(session.exerciseId, session.language); const tags = useGetSessionCardTags(exercise, SessionMode.live); @@ -205,11 +203,11 @@ const SessionModal = () => { const onShare = useCallback(() => { if (session.link) { - hideModalAndshare({ + Share.share({ message: session.link, }); } - }, [session.link, hideModalAndshare]); + }, [session.link]); const onHostPress = useCallback(() => { navigation.popToTop(); From 1a17c0edb9f8a16ecd507ff607023e97067fbfcc Mon Sep 17 00:00:00 2001 From: gewfy Date: Wed, 1 Jan 2025 16:48:35 +0100 Subject: [PATCH 4/5] Override containerComponent with Fragment --- client/src/lib/navigation/ModalStack.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/client/src/lib/navigation/ModalStack.tsx b/client/src/lib/navigation/ModalStack.tsx index 5b61931f02..87b488c86e 100644 --- a/client/src/lib/navigation/ModalStack.tsx +++ b/client/src/lib/navigation/ModalStack.tsx @@ -1,5 +1,4 @@ -import React, {useMemo} from 'react'; -import {StyleSheet} from 'react-native'; +import React, {Fragment, useMemo} from 'react'; import { BottomSheetNavigationOptions, @@ -51,15 +50,10 @@ import SessionModal from '../../routes/modals/SessionModal/SessionModal'; import FeedbackPostModal from '../../routes/modals/FeedbackPostModal/FeedbackPostModal'; import LiveSessionsModal from '../../routes/modals/LiveSessionsModal/LiveSessionsModal'; import UnlockCollectionModal from '../../routes/modals/UnlockCollectionModal/UnlockCollectionModal'; -import styled from 'styled-components/native'; const {Navigator, Screen, Group} = createBottomSheetNavigator(); -const ContainerComponent = styled.View.attrs({ - pointerEvents: 'box-none', -})({...StyleSheet.absoluteFillObject}); - const BackdropComponent = ({ animatedIndex, animatedPosition, @@ -77,7 +71,7 @@ const BackdropComponent = ({ ); const modalScreenOptions: BottomSheetNavigationOptions = { - containerComponent: ContainerComponent, + containerComponent: Fragment, backdropComponent: BackdropComponent, backgroundStyle: { backgroundColor: 'transparent', From 8eb708302966bccb5c2b4ca4e7a822d62c8b962f Mon Sep 17 00:00:00 2001 From: gewfy Date: Wed, 1 Jan 2025 16:53:47 +0100 Subject: [PATCH 5/5] Updated Podfile --- client/ios/Podfile.lock | 55 +++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/client/ios/Podfile.lock b/client/ios/Podfile.lock index d8462a938b..855596abd8 100644 --- a/client/ios/Podfile.lock +++ b/client/ios/Podfile.lock @@ -2100,9 +2100,9 @@ PODS: - React-Core - react-native-idle-timer (2.2.3): - React-Core - - react-native-netinfo (11.3.2): + - react-native-netinfo (11.4.1): - React-Core - - react-native-safe-area-context (4.10.9): + - react-native-safe-area-context (4.14.0): - React-Core - react-native-volume-manager (1.10.0): - Mute @@ -2368,7 +2368,7 @@ PODS: - React-Core - RNDateTimePicker (8.2.0): - React-Core - - RNDeviceInfo (11.1.0): + - RNDeviceInfo (14.0.2): - React-Core - RNFBApp (20.3.0): - Firebase/CoreOnly (= 10.29.0) @@ -2412,28 +2412,47 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - RNImageCropPicker (0.41.2): + - RNImageCropPicker (0.41.6): - React-Core - React-RCTImage - - RNImageCropPicker/QBImagePickerController (= 0.41.2) + - RNImageCropPicker/QBImagePickerController (= 0.41.6) - TOCropViewController (~> 2.7.4) - - RNImageCropPicker/QBImagePickerController (0.41.2): + - RNImageCropPicker/QBImagePickerController (0.41.6): - React-Core - React-RCTImage - TOCropViewController (~> 2.7.4) - RNLocalize (3.2.1): - React-Core - - RNNotifee (9.1.1): + - RNNotifee (9.1.3): - React-Core - - RNNotifee/NotifeeCore (= 9.1.1) - - RNNotifee/NotifeeCore (9.1.1): + - RNNotifee/NotifeeCore (= 9.1.3) + - RNNotifee/NotifeeCore (9.1.3): - React-Core - RNPermissions (4.1.5): - React-Core - RNRate (1.2.12): - React-Core - - RNReactNativeHapticFeedback (2.2.0): + - RNReactNativeHapticFeedback (2.3.3): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.01.01.00) + - RCTRequired + - RCTTypeSafety + - React-Codegen - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-NativeModulesApple + - React-RCTFabric + - React-rendererdebug + - React-utils + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - Yoga - RNReanimated (3.16.4): - DoubleConversion - glog @@ -2521,7 +2540,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - RNScreens (4.3.0): + - RNScreens (4.4.0): - DoubleConversion - glog - hermes-engine @@ -2996,8 +3015,8 @@ SPEC CHECKSUMS: react-native-daily-js: 6f3b0930d5fd7fc94648eb334a35d3efe538c93c react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06 react-native-idle-timer: b4e9ff189950bcd3ba03257d9f033f3432341db8 - react-native-netinfo: 076df4f9b07f6670acf4ce9a75aac8d34c2e2ccc - react-native-safe-area-context: ab8f4a3d8180913bd78ae75dd599c94cce3d5e9a + react-native-netinfo: f0a9899081c185db1de5bb2fdc1c88c202a059ac + react-native-safe-area-context: 4532f1a0c5d34a46b9324ccaaedcb5582a302b7d react-native-volume-manager: 3c7d8047841b6831730dea7bf25250522388b4f4 react-native-webrtc: f0863a670c08895cebfd74d7790e499397d5be1a react-native-webview: 91800ab1c604389120f4abe895328ff7736513fb @@ -3029,21 +3048,21 @@ SPEC CHECKSUMS: RNCAsyncStorage: ec53e44dc3e75b44aa2a9f37618a49c3bc080a7a RNCPicker: b7873ba797dc586bfaf3307d737cbdc620a9ff3e RNDateTimePicker: 40ffda97d071a98a10fdca4fa97e3977102ccd14 - RNDeviceInfo: b899ce37a403a4dea52b7cb85e16e49c04a5b88e + RNDeviceInfo: 3f2e5fcca3637f75c6d30ba287293c2f97206781 RNFBApp: 793adb33298db7e67dc365dc1ec0dc8a55a7a044 RNFBAuth: e923d3f87088009ac8505140599ec1e784d77bd0 RNFBDynamicLinks: 6e5d52576c079e65040110c8a9b895c6e1f02edc RNFBFirestore: 9b5e7d645787f02d5d16c4e060e778e9da762e02 RNFBStorage: a86f59a4adae00b3061e55257d6c3d70851a1810 RNGestureHandler: 38b7949a58a56ae0e2a3c38920cb6852cafb6b9f - RNImageCropPicker: 771e2ca319d2cf92e04ebf334ece892ee9a6728f + RNImageCropPicker: 8e39c01f205e00d739c31e682f068aac315587bf RNLocalize: 4f22418187ecd5ca693231093ff1d912d1b3c9bc - RNNotifee: 35b5f984d11083b02d7f2990b3408cd99a0aeeac + RNNotifee: 522276e0be010e98173175fb838514b69f18cbe0 RNPermissions: a58e61bd4e6bd417adcf8ef8ca094b93d772e492 RNRate: ef3bcff84f39bb1d1e41c5593d3eea4aab2bd73a - RNReactNativeHapticFeedback: ec56a5f81c3941206fd85625fa669ffc7b4545f9 + RNReactNativeHapticFeedback: dd1df8ab143dfd0ac79fe483cd08822d7a86fc85 RNReanimated: 13f9f061449dd7a1f6e1b8fb4caf18b880b41bd1 - RNScreens: d090bfb033bb48f8da0983999ea58868e813cb80 + RNScreens: a582697173dfacb627c9366a80881ffb5dd92971 RNSentry: d2f4b8dc672fb4e26b50b99e006e52d547e36b3f RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57