Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/SubStepForms/ConfirmationStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ import useSafeAreaPaddings from '@hooks/useSafeAreaPaddings';
import type {SubStepProps} from '@hooks/useSubStep/types';
import useThemeStyles from '@hooks/useThemeStyles';
import type {ForwardedFSClassProps} from '@libs/Fullstory/types';
import type {BrickRoad} from '@libs/WorkspacesSettingsUtils';

type SummaryItem = {
description: string;
title: string;
shouldShowRightIcon: boolean;
onPress: () => void;
brickRoadIndicator?: BrickRoad;
errorText?: string;
};

type ConfirmationStepProps = SubStepProps &
Expand Down Expand Up @@ -67,13 +70,15 @@ function ConfirmationStep({
contentContainerStyle={[styles.flexGrow1, shouldApplySafeAreaPaddingBottom && {paddingBottom: safeAreaInsetPaddingBottom + styles.pb5.paddingBottom}]}
>
<Text style={[styles.textHeadlineLineHeightXXL, styles.ph5, styles.mb3]}>{pageTitle}</Text>
{summaryItems.map(({description, title, shouldShowRightIcon, onPress}) => (
{summaryItems.map(({description, title, shouldShowRightIcon, onPress, brickRoadIndicator, errorText}) => (
<MenuItemWithTopDescription
key={`${title}_${description}`}
description={description}
title={title}
shouldShowRightIcon={shouldShowRightIcon}
onPress={onPress}
brickRoadIndicator={brickRoadIndicator}
errorText={errorText}
forwardedFSClass={forwardedFSClass}
/>
))}
Expand Down
10 changes: 9 additions & 1 deletion src/libs/actions/Wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function setKYCWallSource(source?: ValueOf<typeof CONST.KYC_WALL_SOURCE>, chatRe
* Validates a user's provided details against a series of checks
*/
function updatePersonalDetails(personalDetails: UpdatePersonalDetailsForWalletParams) {
const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.FORMS.WALLET_ADDITIONAL_DETAILS>> = [
const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.FORMS.WALLET_ADDITIONAL_DETAILS | typeof ONYXKEYS.WALLET_ADDITIONAL_DETAILS>> = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.FORMS.WALLET_ADDITIONAL_DETAILS,
Expand All @@ -72,6 +72,14 @@ function updatePersonalDetails(personalDetails: UpdatePersonalDetailsForWalletPa
errorFields: null,
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.WALLET_ADDITIONAL_DETAILS,
value: {
errorCode: null,
errors: null,
},
},
];

const finallyData: Array<OnyxUpdate<typeof ONYXKEYS.FORMS.WALLET_ADDITIONAL_DETAILS>> = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function ConfirmationStep({onNext, onMove, isEditing}: SubStepProps) {
const error = getLatestErrorMessage(walletAdditionalDetails ?? {});
const values = useMemo(() => getSubstepValues(PERSONAL_INFO_STEP_KEYS, walletAdditionalDetailsDraft, walletAdditionalDetails), [walletAdditionalDetails, walletAdditionalDetailsDraft]);
const shouldAskForFullSSN = walletAdditionalDetails?.errorCode === CONST.WALLET.ERROR.SSN;
const shouldShowSSNRowError = shouldAskForFullSSN && values[PERSONAL_INFO_STEP_KEYS.SSN_LAST_4].length < CONST.BANK_ACCOUNT.MAX_LENGTH.FULL_SSN;

const summaryItems = [
{
Expand Down Expand Up @@ -60,6 +61,8 @@ function ConfirmationStep({onNext, onMove, isEditing}: SubStepProps) {
description: translate(shouldAskForFullSSN ? 'common.ssnFull9' : 'personalInfoStep.last4SSN'),
title: values[PERSONAL_INFO_STEP_KEYS.SSN_LAST_4],
shouldShowRightIcon: true,
brickRoadIndicator: shouldShowSSNRowError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,
errorText: shouldShowSSNRowError ? error : undefined,
onPress: () => {
onMove(PERSONAL_INFO_STEP_INDEXES.SSN);
},
Expand Down
Loading