-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CP Staging] feat: Improve KYC error handling #30103
Changes from 8 commits
bf7f200
8419844
1d93ba6
845a672
56bab9e
81fb1a2
89621cc
4d4ca6c
cc298bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ import compose from '../../../../libs/compose'; | |
import * as BankAccounts from '../../../../libs/actions/BankAccounts'; | ||
import Popover from '../../../../components/Popover'; | ||
import MenuItem from '../../../../components/MenuItem'; | ||
import Text from '../../../../components/Text'; | ||
import Icon from '../../../../components/Icon'; | ||
import * as PaymentMethods from '../../../../libs/actions/PaymentMethods'; | ||
import getClickedTargetLocation from '../../../../libs/getClickedTargetLocation'; | ||
import CurrentWalletBalance from '../../../../components/CurrentWalletBalance'; | ||
|
@@ -66,6 +68,8 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen | |
const hasAssignedCard = !_.isEmpty(cardList); | ||
const shouldShowEmptyState = !hasBankAccount && !hasWallet && !hasAssignedCard; | ||
|
||
const {isPendingOnfidoResult} = userWallet; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just confirming, if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handled! |
||
|
||
const updateShouldShowLoadingSpinner = useCallback(() => { | ||
// In order to prevent a loop, only update state of the spinner if there is a change | ||
const showLoadingSpinner = isLoadingPaymentMethods || false; | ||
|
@@ -357,6 +361,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen | |
<CurrentWalletBalance balanceStyles={[styles.walletBalance]} /> | ||
</OfflineWithFeedback> | ||
)} | ||
|
||
<KYCWall | ||
onSuccessfulKYC={(_iouPaymentType, source) => navigateToWalletOrTransferBalancePage(source)} | ||
onSelectPaymentMethod={(selectedPaymentMethod) => { | ||
|
@@ -373,18 +378,38 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen | |
source={hasActivatedWallet ? CONST.KYC_WALL_SOURCE.TRANSFER_BALANCE : CONST.KYC_WALL_SOURCE.ENABLE_WALLET} | ||
shouldIncludeDebitCard={hasActivatedWallet} | ||
> | ||
{(triggerKYCFlow, buttonRef) => | ||
hasActivatedWallet ? ( | ||
<MenuItem | ||
ref={buttonRef} | ||
title={translate('common.transferBalance')} | ||
icon={Expensicons.Transfer} | ||
onPress={triggerKYCFlow} | ||
shouldShowRightIcon | ||
disabled={network.isOffline} | ||
wrapperStyle={styles.transferBalance} | ||
/> | ||
) : ( | ||
{(triggerKYCFlow, buttonRef) => { | ||
if (shouldShowLoadingSpinner) { | ||
return null; | ||
} | ||
|
||
if (hasActivatedWallet) { | ||
return ( | ||
<MenuItem | ||
ref={buttonRef} | ||
title={translate('common.transferBalance')} | ||
icon={Expensicons.Transfer} | ||
onPress={triggerKYCFlow} | ||
shouldShowRightIcon | ||
disabled={network.isOffline} | ||
wrapperStyle={styles.transferBalance} | ||
/> | ||
); | ||
} | ||
|
||
if (isPendingOnfidoResult) { | ||
return ( | ||
<View style={[styles.flexRow, styles.alignItemsCenter, styles.w100, styles.ph5]}> | ||
<Icon | ||
src={Expensicons.Hourglass} | ||
fill={themeColors.icon} | ||
/> | ||
<Text style={[styles.inlineSystemMessage, styles.flexShrink1]}>{translate('walletPage.walletActivationPending')}</Text> | ||
</View> | ||
); | ||
} | ||
|
||
return ( | ||
<Button | ||
ref={buttonRef} | ||
text={translate('walletPage.enableWallet')} | ||
|
@@ -394,8 +419,8 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen | |
success | ||
large | ||
/> | ||
) | ||
} | ||
); | ||
}} | ||
</KYCWall> | ||
</> | ||
</WalletSection> | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -25,8 +25,8 @@ type UserWallet = { | |||||
/** The user's wallet tier */ | ||||||
tier?: number; | ||||||
|
||||||
/** Whether we should show the ActivateStep success view after the user finished the KYC flow */ | ||||||
shouldShowWalletActivationSuccess?: boolean; | ||||||
/** Whether the kyc is pending and is yet to be confirmed */ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handled. |
||||||
isPendingOnfidoResult?: boolean; | ||||||
|
||||||
/** The ID of the linked account */ | ||||||
walletLinkedAccountID: number; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very small change, but I think we should call this
isLoading
to follow our naming patterns for bool propsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handled.