Skip to content

Commit

Permalink
chore: upgrade nav dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr committed Dec 18, 2024
1 parent bfa857b commit 161ca76
Show file tree
Hide file tree
Showing 66 changed files with 396 additions and 379 deletions.
18 changes: 9 additions & 9 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- MMKV (1.3.7):
- MMKVCore (~> 1.3.7)
- MMKVCore (1.3.7)
- MMKV (2.0.0):
- MMKVCore (~> 2.0.0)
- MMKVCore (2.0.0)
- OpenSSL-Universal (3.3.2000)
- RCT-Folly (2024.01.01.00):
- boost
Expand Down Expand Up @@ -1423,7 +1423,7 @@ PODS:
- Yoga
- react-native-restart (0.0.27):
- React-Core
- react-native-safe-area-context (4.10.9):
- react-native-safe-area-context (5.0.0):
- React-Core
- react-native-skia (1.3.11):
- DoubleConversion
Expand Down Expand Up @@ -1842,7 +1842,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNScreens (3.34.0):
- RNScreens (4.3.0):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -2216,8 +2216,8 @@ SPEC CHECKSUMS:
hermes-engine: 3b6e0717ca847e2fc90a201e59db36caf04dee88
lottie-ios: e047b1d2e6239b787cc5e9755b988869cf190494
lottie-react-native: 31197e5c65aa7cb59e6affcefaf901588bb708c4
MMKV: 36a22a9ec84c9bb960613a089ddf6f48be9312b0
MMKVCore: 158e61c8516401a9fac730288acb29e6fc19bbf9
MMKV: f7d1d5945c8765f97f39c3d121f353d46735d801
MMKVCore: c04b296010fcb1d1638f2c69405096aac12f6390
OpenSSL-Universal: b60a3702c9fea8b3145549d421fdb018e53ab7b4
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
RCTDeprecation: 34cbf122b623037ea9facad2e92e53434c5c7422
Expand Down Expand Up @@ -2259,7 +2259,7 @@ SPEC CHECKSUMS:
react-native-quick-base64: f98f17faf04c9779faf726921a2b389d4775e8b6
react-native-quick-crypto: 12de8e1666ad3dab6339418c14f4a6de71716194
react-native-restart: 7595693413fe3ca15893702f2c8306c62a708162
react-native-safe-area-context: ab8f4a3d8180913bd78ae75dd599c94cce3d5e9a
react-native-safe-area-context: ab7beb734b0f9f79f55ae144a6c946a6422f55d6
react-native-skia: 68be40d53b1957f6c276cec19bcd50d293173868
react-native-tcp-socket: e724380c910c2e704816ec817ed28f1342246ff7
React-nativeconfig: 57781b79e11d5af7573e6f77cbf1143b71802a6d
Expand Down Expand Up @@ -2301,7 +2301,7 @@ SPEC CHECKSUMS:
RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93
RNReactNativeHapticFeedback: ec56a5f81c3941206fd85625fa669ffc7b4545f9
RNReanimated: 74413c59c47123d7144db601d065627c75c746a3
RNScreens: 19719a9c326e925498ac3b2d35c4e50fe87afc06
RNScreens: b03d696c70cc5235ce4587fcc27ae1a93a48f98c
RNShare: 554a91f5cfbe4adac4cfe3654826ee8b299fe365
RNSVG: 43b64ed39c14ce830d840903774154ca0c1f27ec
RNZipArchive: 7bb4c70d6aa2dd235212c0a4a3de0a4e237e2569
Expand Down
106 changes: 53 additions & 53 deletions ios/bitkit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios --simulator='iPhone 15'",
"ios": "react-native run-ios --simulator='iPhone 16'",
"ios:se": "react-native run-ios --simulator='iPhone SE (3rd generation)'",
"test": "jest --forceExit",
"test:coverage": "jest --forceExit --coverage=true",
Expand Down Expand Up @@ -42,8 +42,8 @@
"@react-native-clipboard/clipboard": "1.14.1",
"@react-native-community/blur": "4.4.0",
"@react-native-community/netinfo": "11.3.1",
"@react-navigation/native": "6.1.18",
"@react-navigation/native-stack": "6.10.1",
"@react-navigation/native": "7.0.14",
"@react-navigation/native-stack": "7.2.0",
"@reduxjs/toolkit": "2.2.6",
"@shopify/react-native-skia": "1.3.11",
"@synonymdev/blocktank-lsp-http-client": "2.2.0",
Expand Down Expand Up @@ -104,8 +104,8 @@
"react-native-reanimated": "3.15.0",
"react-native-reanimated-carousel": "3.5.1",
"react-native-restart": "0.0.27",
"react-native-safe-area-context": "4.10.9",
"react-native-screens": "3.34.0",
"react-native-safe-area-context": "5.0.0",
"react-native-screens": "4.3.0",
"react-native-share": "10.2.0",
"react-native-svg": "15.2.0",
"react-native-tcp-socket": "6.0.6",
Expand Down
9 changes: 6 additions & 3 deletions src/components/NavigationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Subtitle, Title } from '../styles/text';
import { BackIcon, XIcon } from '../styles/icons';
import { Keyboard } from '../hooks/keyboard';
import { Pressable } from '../styles/components';
import { RootNavigationProp } from '../navigation/types';

export const HEADER_HEIGHT = 46;

Expand Down Expand Up @@ -71,7 +72,7 @@ const NavigationHeader = ({
onClosePress,
onActionPress,
}: NavigationHeaderProps): ReactElement => {
const navigation = useNavigation<any>();
const navigation = useNavigation<RootNavigationProp>();

const handleBackPress = useCallback(async () => {
onBackPress?.();
Expand All @@ -92,8 +93,10 @@ const NavigationHeader = ({
[size, style],
);

// TODO: this doesn't have the right navigator
const showBack = Boolean(displayBackButton && navigation.canGoBack());
const state = navigation.getState?.();
const parent = navigation.getParent?.();
const canGoBack = state?.routes.length > 1 || parent;
const showBack = displayBackButton && canGoBack;

const numberOfActions = useMemo(() => {
if (actionIcon && onClosePress) {
Expand Down
17 changes: 9 additions & 8 deletions src/navigation/bottom-sheet/BackupNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { ReactElement, memo } from 'react';
import { useAppSelector } from '../../hooks/redux';
import { NavigationIndependentTree } from '@react-navigation/native';
import {
createNativeStackNavigator,
NativeStackNavigationOptions,
NativeStackNavigationProp,
} from '@react-navigation/native-stack';

import { NavigationContainer } from '../../styles/components';
import BottomSheetWrapper from '../../components/BottomSheetWrapper';
import ShowMnemonic from '../../screens/Settings/Backup/ShowMnemonic';
import ShowPassphrase from '../../screens/Settings/Backup/ShowPassphrase';
Expand All @@ -15,8 +16,8 @@ import Success from '../../screens/Settings/Backup/Success';
import Warning from '../../screens/Settings/Backup/Warning';
import MultipleDevices from '../../screens/Settings/Backup/MultipleDevices';
import Metadata from '../../screens/Settings/Backup/Metadata';
import { NavigationContainer } from '../../styles/components';
import { useSnapPoints } from '../../hooks/bottomSheet';
import { useAppSelector } from '../../hooks/redux';
import { viewControllerIsOpenSelector } from '../../store/reselect/ui';
import { __E2E__ } from '../../constants/env';

Expand Down Expand Up @@ -49,9 +50,9 @@ const BackupNavigation = (): ReactElement => {

return (
<BottomSheetWrapper view="backupNavigation" snapPoints={snapPoints}>
<NavigationContainer key={isOpen.toString()}>
<Stack.Navigator screenOptions={navOptions}>
<Stack.Group screenOptions={navOptions}>
<NavigationIndependentTree>
<NavigationContainer key={isOpen.toString()}>
<Stack.Navigator screenOptions={navOptions}>
<Stack.Screen name="ShowMnemonic" component={ShowMnemonic} />
<Stack.Screen name="ShowPassphrase" component={ShowPassphrase} />
<Stack.Screen name="ConfirmMnemonic" component={ConfirmMnemonic} />
Expand All @@ -63,9 +64,9 @@ const BackupNavigation = (): ReactElement => {
<Stack.Screen name="Success" component={Success} />
<Stack.Screen name="MultipleDevices" component={MultipleDevices} />
<Stack.Screen name="Metadata" component={Metadata} />
</Stack.Group>
</Stack.Navigator>
</NavigationContainer>
</Stack.Navigator>
</NavigationContainer>
</NavigationIndependentTree>
</BottomSheetWrapper>
);
};
Expand Down
45 changes: 24 additions & 21 deletions src/navigation/bottom-sheet/LNURLWithdrawNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import React, { ReactElement, memo } from 'react';
import { useAppSelector } from '../../hooks/redux';
import { LNURLWithdrawParams } from 'js-lnurl';
import { NavigationIndependentTree } from '@react-navigation/native';
import {
NativeStackNavigationOptions,
NativeStackNavigationProp,
createNativeStackNavigator,
} from '@react-navigation/native-stack';
import { LNURLWithdrawParams } from 'js-lnurl';

import { NavigationContainer } from '../../styles/components';
import BottomSheetWrapper from '../../components/BottomSheetWrapper';
import { __E2E__ } from '../../constants/env';
import { useSnapPoints } from '../../hooks/bottomSheet';
import Amount from '../../screens/Wallets/LNURLWithdraw/Amount';
import Confirm from '../../screens/Wallets/LNURLWithdraw/Confirm';
import { useSnapPoints } from '../../hooks/bottomSheet';
import { useAppSelector } from '../../hooks/redux';
import { viewControllerSelector } from '../../store/reselect/ui';
import { NavigationContainer } from '../../styles/components';
import { __E2E__ } from '../../constants/env';

export type LNURLWithdrawNavigationProp =
NativeStackNavigationProp<LNURLWithdrawStackParamList>;
Expand Down Expand Up @@ -46,22 +47,24 @@ const LNURLWithdrawNavigation = (): ReactElement => {

return (
<BottomSheetWrapper view="lnurlWithdraw" snapPoints={snapPoints}>
<NavigationContainer key={isOpen.toString()}>
<Stack.Navigator
screenOptions={screenOptions}
initialRouteName={initialRouteName}>
<Stack.Screen
name="Amount"
component={Amount}
initialParams={{ wParams }}
/>
<Stack.Screen
name="Confirm"
component={Confirm}
initialParams={{ wParams, amount: wParams.minWithdrawable }}
/>
</Stack.Navigator>
</NavigationContainer>
<NavigationIndependentTree>
<NavigationContainer key={isOpen.toString()}>
<Stack.Navigator
screenOptions={screenOptions}
initialRouteName={initialRouteName}>
<Stack.Screen
name="Amount"
component={Amount}
initialParams={{ wParams }}
/>
<Stack.Screen
name="Confirm"
component={Confirm}
initialParams={{ wParams, amount: wParams.minWithdrawable }}
/>
</Stack.Navigator>
</NavigationContainer>
</NavigationIndependentTree>
</BottomSheetWrapper>
);
};
Expand Down
45 changes: 24 additions & 21 deletions src/navigation/bottom-sheet/OrangeTicketNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React, {
useState,
} from 'react';
import { ldk } from '@synonymdev/react-native-ldk';
import { NavigationIndependentTree } from '@react-navigation/native';
import {
createNativeStackNavigator,
NativeStackNavigationProp,
Expand Down Expand Up @@ -157,27 +158,29 @@ const OrangeTicket = (): ReactElement => {

return (
<BottomSheetWrapper view="orangeTicket" snapPoints={snapPoints}>
<NavigationContainer key={isOpen.toString()}>
<Stack.Navigator
initialRouteName={initialScreen}
screenOptions={screenOptions}>
<Stack.Screen
name="Prize"
component={Prize}
initialParams={{ ticketId, amount }}
/>
<Stack.Screen
name="UsedCard"
component={UsedCard}
initialParams={{ amount }}
/>
<Stack.Screen
name="Error"
component={Error}
initialParams={{ errorCode }}
/>
</Stack.Navigator>
</NavigationContainer>
<NavigationIndependentTree>
<NavigationContainer key={isOpen.toString()}>
<Stack.Navigator
initialRouteName={initialScreen}
screenOptions={screenOptions}>
<Stack.Screen
name="Prize"
component={Prize}
initialParams={{ ticketId, amount }}
/>
<Stack.Screen
name="UsedCard"
component={UsedCard}
initialParams={{ amount }}
/>
<Stack.Screen
name="Error"
component={Error}
initialParams={{ errorCode }}
/>
</Stack.Navigator>
</NavigationContainer>
</NavigationIndependentTree>
</BottomSheetWrapper>
);
};
Expand Down
22 changes: 14 additions & 8 deletions src/navigation/bottom-sheet/PINNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { ReactElement, memo } from 'react';
import { useAppSelector } from '../../hooks/redux';
import { BiometryType } from 'react-native-biometrics';
import { NavigationIndependentTree } from '@react-navigation/native';
import {
createNativeStackNavigator,
NativeStackNavigationOptions,
Expand Down Expand Up @@ -41,14 +42,19 @@ const PINNavigation = (): ReactElement => {

return (
<BottomSheetWrapper view="PINNavigation" snapPoints={snapPoints}>
<NavigationContainer key={isOpen.toString()}>
<Stack.Navigator screenOptions={screenOptions}>
<Stack.Screen name="PINPrompt" component={PINPrompt} />
<Stack.Screen name="ChoosePIN" component={ChoosePIN} />
<Stack.Screen name="AskForBiometrics" component={AskForBiometrics} />
<Stack.Screen name="Result" component={Result} />
</Stack.Navigator>
</NavigationContainer>
<NavigationIndependentTree>
<NavigationContainer key={isOpen.toString()}>
<Stack.Navigator screenOptions={screenOptions}>
<Stack.Screen name="PINPrompt" component={PINPrompt} />
<Stack.Screen name="ChoosePIN" component={ChoosePIN} />
<Stack.Screen
name="AskForBiometrics"
component={AskForBiometrics}
/>
<Stack.Screen name="Result" component={Result} />
</Stack.Navigator>
</NavigationContainer>
</NavigationIndependentTree>
</BottomSheetWrapper>
);
};
Expand Down
29 changes: 16 additions & 13 deletions src/navigation/bottom-sheet/ProfileLinkNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import React, { ReactElement, memo } from 'react';
import { useAppSelector } from '../../hooks/redux';
import { NavigationIndependentTree } from '@react-navigation/native';
import {
NativeStackNavigationOptions,
NativeStackNavigationProp,
createNativeStackNavigator,
} from '@react-navigation/native-stack';

import { NavigationContainer } from '../../styles/components';
import BottomSheetWrapper from '../../components/BottomSheetWrapper';
import { __E2E__ } from '../../constants/env';
import { useSnapPoints } from '../../hooks/bottomSheet';
import ProfileLink from '../../screens/Profile/ProfileLink';
import ProfileLinkSuggestions from '../../screens/Profile/ProfileLinkSuggestions';
import { useAppSelector } from '../../hooks/redux';
import { useSnapPoints } from '../../hooks/bottomSheet';
import { viewControllerIsOpenSelector } from '../../store/reselect/ui';
import { NavigationContainer } from '../../styles/components';
import { __E2E__ } from '../../constants/env';

export type ProfileLinkNavigationProp =
NativeStackNavigationProp<ProfileLinkStackParamList>;
Expand All @@ -37,15 +38,17 @@ const ProfileLinkNavigation = (): ReactElement => {

return (
<BottomSheetWrapper view="profileAddDataForm" snapPoints={snapPoints}>
<NavigationContainer key={isOpen.toString()}>
<Stack.Navigator screenOptions={screenOptions}>
<Stack.Screen name="ProfileLink" component={ProfileLink} />
<Stack.Screen
name="ProfileLinkSuggestions"
component={ProfileLinkSuggestions}
/>
</Stack.Navigator>
</NavigationContainer>
<NavigationIndependentTree>
<NavigationContainer key={isOpen.toString()}>
<Stack.Navigator screenOptions={screenOptions}>
<Stack.Screen name="ProfileLink" component={ProfileLink} />
<Stack.Screen
name="ProfileLinkSuggestions"
component={ProfileLinkSuggestions}
/>
</Stack.Navigator>
</NavigationContainer>
</NavigationIndependentTree>
</BottomSheetWrapper>
);
};
Expand Down
Loading

0 comments on commit 161ca76

Please sign in to comment.