Changes in LinkerStudio/modules/PiiOnboarding/hooks/shippingAddress/useShippingAddress.ts
Import after the last import:
Copy import {CustomerSelectors} from 'LinkerStudio/modules/baas/common/redux/customer/customerSlice' ;
import {navigate} from 'src/navigation/RootNavigation' ;
After the comment /* use useAppSelector for Customer profile data and assign it to this variable */
add the following:
Copy const customer = useAppSelector ( CustomerSelectors .getCustomer);
Replace the first useEffect function by the following:
Copy useEffect (() => {
//Add here the rest of pre-populated values
if (isRouteShippingAddress) {
dispatch ( reset ());
dispatch (
setAddress ({
... customer .address ,
street2 : customer . address .street2 ?? '' ,
}) ,
);
}
} , [customer , dispatch , isRouteShippingAddress]);
Replace this
Copy console .log (
'Add redux action to handle send shipping address info: ' ,
piiAddress .street1 ,
);
by this:
Copy navigate ( 'PhysicalCardRequestProcess' , {shippingAddress : piiAddress});
Changes in LinkerStudio/modules/baas/common/utils/baas/BaasHelpers.ts
Import after the last import:
Copy import {reset as resetPii} from 'LinkerStudio/modules/PiiOnboarding/redux/pii' ;
Add in the function baasResetState
before the closing }
Copy dispatch ( resetPii ());
Changes in LinkerStudio/modules/baas/common/navigation/MainStackNavigator.tsx
Copy import {ONBOARDING_SCREENS} from 'LinkerStudio/modules/PiiOnboarding/constants' ;
Add below the last </Stack.Group>
Copy < Stack.Group >
{ ONBOARDING_SCREENS .map (screen => {
return (
< Stack.Screen
key = { screen .name}
name = { screen .name}
component = { screen .component}
/>
);
})}
</ Stack.Group >
Changes in LinkerStudio/modules/baas/common/navigation/types.ts
Import after the last import
Copy import {OnboardingStackParams} from 'LinkerStudio/modules/PiiOnboarding/navigation/types' ;
Add in MainStackParams
type
Copy & OnboardingStackParams;
Changes in LinkerStudio/modules/baas/common/utils/baas/cards/CardsHelpers.ts
Copy navigation .navigate ( 'ConfirmOnboardingInfoScreen' , {
routeType : 'shippingAddress' , routeType : 'shippingAddress' ,
headerTitle : strings . dashboardItems .headerTitle ,
title : strings . dashboardItems .physicalCardRequestTitle ,
subTitle : strings . dashboardItems .physicalCardRequestSubTitle ,
section : strings . dashboardItems .section ,
});