Skip to content

Commit

Permalink
fix(wallet-mobile): error boundary copy action
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed Dec 16, 2024
1 parent 01e4a1c commit 43eb764
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 132 deletions.
187 changes: 92 additions & 95 deletions apps/wallet-mobile/src/AppNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import RNBootSplash from 'react-native-bootsplash'
import SystemNavigationBar from 'react-native-system-navigation-bar'

import StorybookScreen from '../.storybook'
import {ClipboardProvider} from './components/Clipboard/ClipboardProvider'
import {ModalProvider} from './components/Modal/ModalContext'
import {ModalScreen} from './components/Modal/ModalScreen'
import {useAuth} from './features/Auth/AuthProvider'
Expand Down Expand Up @@ -119,116 +118,114 @@ export const AppNavigator = () => {
onReady={onReady}
ref={navRef}
>
<ClipboardProvider>
<ModalProvider>
<Stack.Navigator
screenOptions={{
...navOptions,
headerShown: false /* used only for transition */,
}}
>
{/* Not Authenticated */}

{isLoggedOut && (
<ModalProvider>
<Stack.Navigator
screenOptions={{
...navOptions,
headerShown: false /* used only for transition */,
}}
>
{/* Not Authenticated */}

{isLoggedOut && (
<Stack.Group>
{firstAction === 'first-run' && (
<Stack.Screen name="first-run">
{() => (
<SearchProvider>
<InitializationNavigator />
</SearchProvider>
)}
</Stack.Screen>
)}

{firstAction === 'show-agreement-changed-notice' && (
<Stack.Screen name="agreement-changed-notice">{() => <AgreementChangedNavigator />}</Stack.Screen>
)}

{firstAction === 'auth-with-pin' && (
<Stack.Screen
name="custom-pin-auth"
component={PinLoginScreen}
options={{title: strings.loginPinTitle}}
/>
)}

{firstAction === 'auth-with-os' && (
<Stack.Screen name="bio-auth-initial" component={OsLoginScreen} options={{headerShown: false}} />
)}

{firstAction === 'request-new-pin' && (
<Stack.Screen //
name="enable-login-with-pin"
component={CreatePinScreenWrapper}
options={{title: strings.customPinTitle}}
/>
)}
</Stack.Group>
)}

{/* Authenticated */}

{isLoggedIn && (
<>
<Stack.Group>
{firstAction === 'first-run' && (
<Stack.Screen name="first-run">
{() => (
<SearchProvider>
<InitializationNavigator />
</SearchProvider>
)}
</Stack.Screen>
)}

{firstAction === 'show-agreement-changed-notice' && (
<Stack.Screen name="agreement-changed-notice">{() => <AgreementChangedNavigator />}</Stack.Screen>
)}

{firstAction === 'auth-with-pin' && (
<Stack.Screen
name="custom-pin-auth"
component={PinLoginScreen}
options={{title: strings.loginPinTitle}}
{afterLoginAction === 'choose-biometric-login' && (
<Stack.Screen //
name="choose-biometric-login"
options={{headerShown: false}}
component={ChooseBiometricLoginScreen}
/>
)}

{firstAction === 'auth-with-os' && (
<Stack.Screen name="bio-auth-initial" component={OsLoginScreen} options={{headerShown: false}} />
{afterLoginAction === 'dark-theme-announcement' && (
<Stack.Screen //
name="dark-theme-announcement"
options={{headerShown: false}}
component={DarkThemeAnnouncement}
/>
)}

{firstAction === 'request-new-pin' && (
{afterLoginAction === 'setup-wallet' && (
<Stack.Screen //
name="enable-login-with-pin"
component={CreatePinScreenWrapper}
options={{title: strings.customPinTitle}}
name="setup-wallet"
options={{headerShown: false}}
component={SetupWalletNavigator}
/>
)}

{afterLoginAction === 'manage-wallets' && (
<Stack.Screen name="manage-wallets" getComponent={() => WalletNavigator} />
)}
</Stack.Group>
)}

{/* Authenticated */}

{isLoggedIn && (
<>
<Stack.Group>
{afterLoginAction === 'choose-biometric-login' && (
<Stack.Screen //
name="choose-biometric-login"
options={{headerShown: false}}
component={ChooseBiometricLoginScreen}
/>
)}

{afterLoginAction === 'dark-theme-announcement' && (
<Stack.Screen //
name="dark-theme-announcement"
options={{headerShown: false}}
component={DarkThemeAnnouncement}
/>
)}
<Stack.Group
screenOptions={{
presentation: 'transparentModal',
...(Platform.OS === 'android' && {...TransitionPresets.DefaultTransition}), // overriding general navigation settings
cardStyle: {backgroundColor: 'transparent'}, // this is needed for the modal to be transparent
}}
>
<Stack.Screen name="modal" component={ModalScreen} />
</Stack.Group>
</>
)}

{afterLoginAction === 'setup-wallet' && (
<Stack.Screen //
name="setup-wallet"
options={{headerShown: false}}
component={SetupWalletNavigator}
/>
)}
{/* Development */}

{afterLoginAction === 'manage-wallets' && (
<Stack.Screen name="manage-wallets" getComponent={() => WalletNavigator} />
)}
</Stack.Group>

<Stack.Group
screenOptions={{
presentation: 'transparentModal',
...(Platform.OS === 'android' && {...TransitionPresets.DefaultTransition}), // overriding general navigation settings
cardStyle: {backgroundColor: 'transparent'}, // this is needed for the modal to be transparent
}}
>
<Stack.Screen name="modal" component={ModalScreen} />
</Stack.Group>
</>
)}

{/* Development */}

{__DEV__ && (
<Stack.Group>
<Stack.Screen name="developer" component={DeveloperScreen} options={{headerShown: false}} />
{__DEV__ && (
<Stack.Group>
<Stack.Screen name="developer" component={DeveloperScreen} options={{headerShown: false}} />

<Stack.Screen name="storybook" component={StorybookScreen} />
<Stack.Screen name="storybook" component={StorybookScreen} />

<Stack.Screen name="playground" component={Playground} />
<Stack.Screen name="playground" component={Playground} />

<Stack.Screen name="notifications" component={NotificationsDevScreen} />
</Stack.Group>
)}
</Stack.Navigator>
</ModalProvider>
</ClipboardProvider>
<Stack.Screen name="notifications" component={NotificationsDevScreen} />
</Stack.Group>
)}
</Stack.Navigator>
</ModalProvider>
</NavigationContainer>
)
}
Expand Down
77 changes: 40 additions & 37 deletions apps/wallet-mobile/src/YoroiApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {enableScreens} from 'react-native-screens'
import {QueryClientProvider} from 'react-query'

import {LoadingBoundary} from './components/Boundary/Boundary'
import {ClipboardProvider} from './components/Clipboard/ClipboardProvider'
import {ErrorBoundary} from './components/ErrorBoundary/ErrorBoundary'
import {AuthProvider} from './features/Auth/AuthProvider'
import {BrowserProvider} from './features/Discover/common/BrowserProvider'
Expand Down Expand Up @@ -57,43 +58,45 @@ const Yoroi = () => {
return (
<AsyncStorageProvider storage={rootStorage}>
<ThemeProvider storage={themeStorage}>
<ErrorBoundary>
<MetricsProvider metricsManager={metricsManager}>
<QueryClientProvider client={queryInfo.queryClient}>
<WalletManagerProvider walletManager={walletManager}>
<CurrencyProvider>
<PortfolioTokenActivityProvider>
<LoadingBoundary style={StyleSheet.absoluteFill}>
<LanguageProvider>
<AuthProvider>
<TransferProvider>
<LinksProvider>
<SetupWalletProvider>
<PoolTransitionProvider>
<BrowserProvider>
<AutomaticWalletOpenerProvider>
<CatalystProvider manager={catalystManager}>
<ReviewTxProvider>
<NotificationProvider manager={notificationManager}>
<InitApp />
</NotificationProvider>
</ReviewTxProvider>
</CatalystProvider>
</AutomaticWalletOpenerProvider>
</BrowserProvider>
</PoolTransitionProvider>
</SetupWalletProvider>
</LinksProvider>
</TransferProvider>
</AuthProvider>
</LanguageProvider>
</LoadingBoundary>
</PortfolioTokenActivityProvider>
</CurrencyProvider>
</WalletManagerProvider>
</QueryClientProvider>
</MetricsProvider>
</ErrorBoundary>
<ClipboardProvider>
<ErrorBoundary>
<MetricsProvider metricsManager={metricsManager}>
<QueryClientProvider client={queryInfo.queryClient}>
<WalletManagerProvider walletManager={walletManager}>
<CurrencyProvider>
<PortfolioTokenActivityProvider>
<LoadingBoundary style={StyleSheet.absoluteFill}>
<LanguageProvider>
<AuthProvider>
<TransferProvider>
<LinksProvider>
<SetupWalletProvider>
<PoolTransitionProvider>
<BrowserProvider>
<AutomaticWalletOpenerProvider>
<CatalystProvider manager={catalystManager}>
<ReviewTxProvider>
<NotificationProvider manager={notificationManager}>
<InitApp />
</NotificationProvider>
</ReviewTxProvider>
</CatalystProvider>
</AutomaticWalletOpenerProvider>
</BrowserProvider>
</PoolTransitionProvider>
</SetupWalletProvider>
</LinksProvider>
</TransferProvider>
</AuthProvider>
</LanguageProvider>
</LoadingBoundary>
</PortfolioTokenActivityProvider>
</CurrencyProvider>
</WalletManagerProvider>
</QueryClientProvider>
</MetricsProvider>
</ErrorBoundary>
</ClipboardProvider>
</ThemeProvider>
</AsyncStorageProvider>
)
Expand Down

0 comments on commit 43eb764

Please sign in to comment.