diff --git a/src/languages/en.ts b/src/languages/en.ts index e7f71e755dd8..211a631b54bd 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -594,6 +594,8 @@ export default { duplicateWaypointsErrorMessage: 'Please remove duplicate waypoints', emptyWaypointsErrorMessage: 'Please enter at least two waypoints', }, + waitingOnEnabledWallet: ({submitterDisplayName}: WaitingOnBankAccountParams) => `Started settling up, payment is held until ${submitterDisplayName} enables their Wallet`, + enableWallet: 'Enable Wallet', }, notificationPreferencesPage: { header: 'Notification preferences', diff --git a/src/languages/es.ts b/src/languages/es.ts index 6020ded30b92..e62bcac0ac46 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -588,6 +588,8 @@ export default { duplicateWaypointsErrorMessage: 'Por favor elimina los puntos de ruta duplicados', emptyWaypointsErrorMessage: 'Por favor introduce al menos dos puntos de ruta', }, + waitingOnEnabledWallet: ({submitterDisplayName}: WaitingOnBankAccountParams) => `nicio el pago, pero no se procesará hasta que ${submitterDisplayName} active su Billetera`, + enableWallet: 'Habilitar Billetera', }, notificationPreferencesPage: { header: 'Preferencias de avisos', diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index f5ca7080249c..3adcf4fc3683 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -70,6 +70,10 @@ import themeColors from '../../../styles/themes/default'; import ReportActionItemBasicMessage from './ReportActionItemBasicMessage'; import RenderHTML from '../../../components/RenderHTML'; import ReportAttachmentsContext from './ReportAttachmentsContext'; +import ROUTES from '../../../ROUTES'; +import Navigation from '../../../libs/Navigation/Navigation'; +import KYCWall from '../../../components/KYCWall'; +import userWalletPropTypes from '../../EnablePayments/userWalletPropTypes'; const propTypes = { ...windowDimensionsPropTypes, @@ -114,6 +118,9 @@ const propTypes = { /** Flag to show, hide the thread divider line */ shouldHideThreadDividerLine: PropTypes.bool, + + /** The user's wallet account */ + userWallet: userWalletPropTypes, }; const defaultProps = { @@ -125,6 +132,7 @@ const defaultProps = { hasOutstandingIOU: false, iouReport: undefined, shouldHideThreadDividerLine: false, + userWallet: {}, }; function ReportActionItem(props) { @@ -345,20 +353,50 @@ function ReportActionItem(props) { ); } else if (props.action.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTQUEUED) { const submitterDisplayName = PersonalDetailsUtils.getDisplayNameOrDefault(props.personalDetailsList, [props.report.ownerAccountID, 'displayName'], props.report.ownerEmail); - const shouldShowAddCreditBankAccountButton = - ReportUtils.isCurrentUserSubmitter(props.report.reportID) && !store.hasCreditBankAccount() && !ReportUtils.isSettled(props.report.reportID); + const paymentType = lodashGet(props.action, 'originalMessage.paymentType', ''); + + const isSubmitterOfUnsettledReport = ReportUtils.isCurrentUserSubmitter(props.report.reportID) && !ReportUtils.isSettled(props.report.reportID); + const shouldShowAddCreditBankAccountButton = isSubmitterOfUnsettledReport && !store.hasCreditBankAccount() && paymentType !== CONST.IOU.PAYMENT_TYPE.EXPENSIFY; + const shouldShowEnableWalletButton = + isSubmitterOfUnsettledReport && + (_.isEmpty(props.userWallet) || props.userWallet.tierName === CONST.WALLET.TIER_NAME.SILVER) && + paymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY; children = ( - - {shouldShowAddCreditBankAccountButton ? ( -