Skip to content

Commit 8984338

Browse files
fix: restore account selector transition
1 parent 967d357 commit 8984338

1 file changed

Lines changed: 28 additions & 10 deletions

File tree

app/components/Nav/App/App.tsx

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React, { useContext, useEffect, useMemo, useRef } from 'react';
22
import { useRoute } from '@react-navigation/native';
3-
import { createStackNavigator } from '@react-navigation/stack';
3+
import {
4+
createStackNavigator,
5+
type StackNavigationOptions,
6+
} from '@react-navigation/stack';
47
import Login from '../../Views/Login';
58
import OAuthRehydration from '../../Views/OAuthRehydration';
69
import QRTabSwitcher from '../../Views/QRTabSwitcher';
@@ -166,6 +169,24 @@ import { AccessRestrictedProvider } from '../../UI/Compliance';
166169

167170
const Stack = createStackNavigator();
168171

172+
const accountSelectorTransitionOptions: StackNavigationOptions = {
173+
animationEnabled: true,
174+
cardStyle: { backgroundColor: importedColors.transparent },
175+
cardStyleInterpolator: ({ current, layouts }) => ({
176+
cardStyle: {
177+
transform: [
178+
{
179+
translateX: current.progress.interpolate({
180+
inputRange: [0, 1],
181+
outputRange: [layouts.screen.width, 0],
182+
}),
183+
},
184+
],
185+
},
186+
}),
187+
detachPreviousScreen: false,
188+
};
189+
169190
// Type helper for screen components that use v5 pattern of requiring route props
170191
// In React Navigation v6, screen components should ideally use useRoute() hook,
171192
// but for migration compatibility, we cast these components to satisfy the type checker.
@@ -464,15 +485,7 @@ const RootModalFlow = (props: RootModalFlowProps) => (
464485
<Stack.Screen
465486
name={Routes.SHEET.ACCOUNT_SELECTOR}
466487
component={AccountSelector}
467-
options={{
468-
cardStyle: { backgroundColor: importedColors.transparent },
469-
cardStyleInterpolator: () => ({
470-
overlayStyle: {
471-
opacity: 0,
472-
},
473-
}),
474-
detachPreviousScreen: false,
475-
}}
488+
options={accountSelectorTransitionOptions}
476489
/>
477490
<Stack.Screen
478491
name={Routes.SHEET.ADD_WALLET}
@@ -1009,6 +1022,11 @@ const AppFlow = () => {
10091022
<Stack.Screen
10101023
name={Routes.MODAL.ROOT_MODAL_FLOW}
10111024
component={RootModalFlow as ScreenComponent}
1025+
options={({ route }) =>
1026+
route.params?.screen === Routes.SHEET.ACCOUNT_SELECTOR
1027+
? accountSelectorTransitionOptions
1028+
: undefined
1029+
}
10121030
/>
10131031
<Stack.Screen
10141032
name={Routes.IMPORT_PRIVATE_KEY_VIEW}

0 commit comments

Comments
 (0)