From a95fe97b94b3c5387ba765e2a034d104f3833c08 Mon Sep 17 00:00:00 2001 From: Christopher Gerrard Date: Tue, 29 Oct 2024 17:59:34 +0100 Subject: [PATCH] wip bundle several routes --- ...iptionRoutes.ts => subscriptionRoutes.tsx} | 55 +++++++++++++++++-- .../RootNavigator/subscriptionRoutesModule.js | 33 +++++++++++ 2 files changed, 82 insertions(+), 6 deletions(-) rename src/features/navigation/RootNavigator/{subscriptionRoutes.ts => subscriptionRoutes.tsx} (81%) create mode 100644 src/features/navigation/RootNavigator/subscriptionRoutesModule.js diff --git a/src/features/navigation/RootNavigator/subscriptionRoutes.ts b/src/features/navigation/RootNavigator/subscriptionRoutes.tsx similarity index 81% rename from src/features/navigation/RootNavigator/subscriptionRoutes.ts rename to src/features/navigation/RootNavigator/subscriptionRoutes.tsx index 763fc5e8793..3b78b945031 100644 --- a/src/features/navigation/RootNavigator/subscriptionRoutes.ts +++ b/src/features/navigation/RootNavigator/subscriptionRoutes.tsx @@ -1,3 +1,5 @@ +import React, { lazy, Suspense } from 'react' + import { withAsyncErrorBoundary } from 'features/errors/hocs/withAsyncErrorBoundary' import { BeneficiaryAccountCreated } from 'features/identityCheck/pages/confirmation/BeneficiaryAccountCreated' import { BeneficiaryRequestSent } from 'features/identityCheck/pages/confirmation/BeneficiaryRequestSent' @@ -27,7 +29,6 @@ import { SetAddress } from 'features/identityCheck/pages/profile/SetAddress' import { SetCity } from 'features/identityCheck/pages/profile/SetCity' import { SetName } from 'features/identityCheck/pages/profile/SetName' import { SetStatus } from 'features/identityCheck/pages/profile/SetStatus' -import { Stepper } from 'features/identityCheck/pages/Stepper' import { NavigationErrors } from 'features/internal/cheatcodes/pages/NavigationErrors/NavigationErrors' import { NavigationSignUp } from 'features/internal/cheatcodes/pages/NavigationSignUp' import { NavigationIdentityCheck } from 'features/internal/cheatcodes/pages/NavigationSignUp/NavigationIdentityCheck' @@ -36,32 +37,70 @@ import { GenericRoute, SubscriptionRootStackParamList, } from 'features/navigation/RootNavigator/types' +import { TypoDS } from 'ui/theme' + +const IdentityCheckModule = lazy(() => + import('./subscriptionRoutesModule').then((module) => ({ + default: module.BeneficiaryAccountCreated, + stepper: module.Stepper, + beneficiaryRequestSent: module.BeneficiaryRequestSent, + identityCheckHonor: module.IdentityCheckHonor, + dmsIntroduction: module.DMSIntroduction, + identityCheckDMS: module.IdentityCheckDMS, + eduConnectForm: module.EduConnectForm, + eduConnectValidation: module.EduConnectValidation, + withEduConnectErrorBoundary: module.withEduConnectErrorBoundary, + eduConnectErrors: module.EduConnectErrors, + identificationFork: module.IdentificationFork, + identityCheckUnavailable: module.IdentityCheckUnavailable, + comeBackLater: module.ComeBackLater, + expiredOrLostID: module.ExpiredOrLostID, + identityCheckEnd: module.IdentityCheckEnd, + identityCheckPending: module.IdentityCheckPending, + selectIDOrigin: module.SelectIDOrigin, + selectIDStatus: module.SelectIDStatus, + selectPhoneStatus: module.SelectPhoneStatus, + ubbleWebview: module.UbbleWebview, + phoneValidationTooManyAttempts: module.PhoneValidationTooManyAttempts, + phoneValidationTooManySMSSent: module.PhoneValidationTooManySMSSent, + setPhoneNumber: module.SetPhoneNumber, + setPhoneNumberWithoutValidation: module.SetPhoneNumberWithoutValidation, + setPhoneValidationCode: module.SetPhoneValidationCode, + setAddress: module.SetAddress, + setCity: module.SetCity, + setName: module.SetName, + setStatus: module.SetStatus, + navigationErrors: module.NavigationErrors, + navigationSignUp: module.NavigationSignUp, + navigationIdentityCheck: module.NavigationIdentityCheck, + newIdentificationFlow: module.NewIdentificationFlow, + })) +) + +const LoadingComponent = () => Chargement... // Try to keep those routes in the same order as the user flow export const subscriptionRoutes: GenericRoute[] = [ + // Debug routes { - // debug route: in navigation component name: 'NavigationSignUp', component: NavigationSignUp, hoc: withAsyncErrorBoundary, path: 'cheat-navigation-sign-up', }, { - // debug route: in navigation component name: 'NavigationErrors', component: NavigationErrors, hoc: withAsyncErrorBoundary, path: 'cheat-navigation-errors', }, { - // debug route: in navigation component name: 'NavigationIdentityCheck', component: NavigationIdentityCheck, hoc: withAsyncErrorBoundary, path: 'cheat-navigation-identity-check', }, { - // debug route: in navigation component name: 'NewIdentificationFlow', component: NewIdentificationFlow, hoc: withAsyncErrorBoundary, @@ -70,7 +109,11 @@ export const subscriptionRoutes: GenericRoute[] // Stepper { name: 'Stepper', - component: Stepper, + component: () => ( + }> + + + ), path: 'verification-identite', options: { title: 'Vérification d’identité' }, secure: true, diff --git a/src/features/navigation/RootNavigator/subscriptionRoutesModule.js b/src/features/navigation/RootNavigator/subscriptionRoutesModule.js new file mode 100644 index 00000000000..d1a9fa57420 --- /dev/null +++ b/src/features/navigation/RootNavigator/subscriptionRoutesModule.js @@ -0,0 +1,33 @@ +export { BeneficiaryAccountCreated } from 'features/identityCheck/pages/confirmation/BeneficiaryAccountCreated' +export { BeneficiaryRequestSent } from 'features/identityCheck/pages/confirmation/BeneficiaryRequestSent' +export { IdentityCheckHonor } from 'features/identityCheck/pages/confirmation/IdentityCheckHonor' +export { DMSIntroduction } from 'features/identityCheck/pages/identification/dms/DMSIntroduction' +export { IdentityCheckDMS } from 'features/identityCheck/pages/identification/dms/IdentityCheckDMS' +export { EduConnectForm } from 'features/identityCheck/pages/identification/educonnect/EduConnectForm' +export { EduConnectValidation } from 'features/identityCheck/pages/identification/educonnect/EduConnectValidation' +export { withEduConnectErrorBoundary } from 'features/identityCheck/pages/identification/errors/eduConnect/EduConnectErrorBoundary' +export { EduConnectErrors } from 'features/identityCheck/pages/identification/errors/eduConnect/EduConnectErrors' +export { IdentificationFork } from 'features/identityCheck/pages/identification/IdentificationFork' +export { IdentityCheckUnavailable } from 'features/identityCheck/pages/identification/IdentityCheckUnavailable' +export { ComeBackLater } from 'features/identityCheck/pages/identification/ubble/ComeBackLater' +export { ExpiredOrLostID } from 'features/identityCheck/pages/identification/ubble/ExpiredOrLostID' +export { IdentityCheckEnd } from 'features/identityCheck/pages/identification/ubble/IdentityCheckEnd' +export { IdentityCheckPending } from 'features/identityCheck/pages/identification/ubble/IdentityCheckPending' +export { SelectIDOrigin } from 'features/identityCheck/pages/identification/ubble/SelectIDOrigin' +export { SelectIDStatus } from 'features/identityCheck/pages/identification/ubble/SelectIDStatus' +export { SelectPhoneStatus } from 'features/identityCheck/pages/identification/ubble/SelectPhoneStatus.web' +export { UbbleWebview } from 'features/identityCheck/pages/identification/ubble/UbbleWebview' +export { PhoneValidationTooManyAttempts } from 'features/identityCheck/pages/phoneValidation/errors/PhoneValidationTooManyAttempts' +export { PhoneValidationTooManySMSSent } from 'features/identityCheck/pages/phoneValidation/errors/PhoneValidationTooManySMSSent' +export { SetPhoneNumber } from 'features/identityCheck/pages/phoneValidation/SetPhoneNumber' +export { SetPhoneNumberWithoutValidation } from 'features/identityCheck/pages/phoneValidation/SetPhoneNumberWithoutValidation' +export { SetPhoneValidationCode } from 'features/identityCheck/pages/phoneValidation/SetPhoneValidationCode' +export { SetAddress } from 'features/identityCheck/pages/profile/SetAddress' +export { SetCity } from 'features/identityCheck/pages/profile/SetCity' +export { SetName } from 'features/identityCheck/pages/profile/SetName' +export { SetStatus } from 'features/identityCheck/pages/profile/SetStatus' +export { Stepper } from 'features/identityCheck/pages/Stepper' +export { NavigationErrors } from 'features/internal/cheatcodes/pages/NavigationErrors/NavigationErrors' +export { NavigationSignUp } from 'features/internal/cheatcodes/pages/NavigationSignUp' +export { NavigationIdentityCheck } from 'features/internal/cheatcodes/pages/NavigationSignUp/NavigationIdentityCheck' +export { NewIdentificationFlow } from 'features/internal/cheatcodes/pages/NavigationSignUp/NavigationIdentityCheck/NewIdentificationFlow/NewIdentificationFlow'