Skip to content

Commit

Permalink
wip bundle several routes
Browse files Browse the repository at this point in the history
  • Loading branch information
cgerrard-pass committed Oct 29, 2024
1 parent 15cf3cb commit a95fe97
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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'
Expand All @@ -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 = () => <TypoDS.Title1>Chargement...</TypoDS.Title1>

// Try to keep those routes in the same order as the user flow
export const subscriptionRoutes: GenericRoute<SubscriptionRootStackParamList>[] = [
// 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,
Expand All @@ -70,7 +109,11 @@ export const subscriptionRoutes: GenericRoute<SubscriptionRootStackParamList>[]
// Stepper
{
name: 'Stepper',
component: Stepper,
component: () => (
<Suspense fallback={<LoadingComponent />}>
<IdentityCheckModule.stepper />

Check failure on line 114 in src/features/navigation/RootNavigator/subscriptionRoutes.tsx

View workflow job for this annotation

GitHub Actions / yarn-linter / yarn_typescript

Property 'stepper' does not exist on type 'LazyExoticComponent<() => Element>'.
</Suspense>
),
path: 'verification-identite',
options: { title: 'Vérification d’identité' },
secure: true,
Expand Down
33 changes: 33 additions & 0 deletions src/features/navigation/RootNavigator/subscriptionRoutesModule.js
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit a95fe97

Please sign in to comment.