diff --git a/src/languages/en.ts b/src/languages/en.ts index 30b8b36ecbd..3fa7af6d25d 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -594,6 +594,7 @@ export default { genericSmartscanFailureMessage: 'Transaction is missing fields', duplicateWaypointsErrorMessage: 'Please remove duplicate waypoints', emptyWaypointsErrorMessage: 'Please enter at least two waypoints', + splitBillMultipleParticipantsErrorMessage: 'Split bill is only allowed between a single workspace or individual users. Please update your selection.', }, waitingOnEnabledWallet: ({submitterDisplayName}: WaitingOnBankAccountParams) => `Started settling up, payment is held until ${submitterDisplayName} enables their Wallet`, enableWallet: 'Enable Wallet', diff --git a/src/languages/es.ts b/src/languages/es.ts index 0c33b93079d..a4c673e367a 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -588,6 +588,7 @@ export default { genericSmartscanFailureMessage: 'La transacción tiene campos vacíos', duplicateWaypointsErrorMessage: 'Por favor elimina los puntos de ruta duplicados', emptyWaypointsErrorMessage: 'Por favor introduce al menos dos puntos de ruta', + splitBillMultipleParticipantsErrorMessage: 'Solo puedes dividir una cuenta entre un único espacio de trabajo o con usuarios individuales. Por favor actualiza tu selección.', }, waitingOnEnabledWallet: ({submitterDisplayName}: WaitingOnBankAccountParams) => `Inició el pago, pero no se procesará hasta que ${submitterDisplayName} active su Billetera`, enableWallet: 'Habilitar Billetera', diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js index 790793787e5..af616372994 100755 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js +++ b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js @@ -4,6 +4,8 @@ import React, {useCallback, useEffect, useMemo, useState} from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; +import Button from '@components/Button'; +import FormHelpMessage from '@components/FormHelpMessage'; import OptionsSelector from '@components/OptionsSelector'; import refPropTypes from '@components/refPropTypes'; import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; @@ -262,11 +264,38 @@ function MoneyRequestParticipantsSelector({ // Right now you can't split a request with a workspace and other additional participants // This is getting properly fixed in https://github.com/Expensify/App/issues/27508, but as a stop-gap to prevent - // the app from crashing on native when you try to do this, we'll going to hide the button if you have a workspace and other participants + // the app from crashing on native when you try to do this, we'll going to show error message if you have a workspace and other participants const hasPolicyExpenseChatParticipant = _.some(participants, (participant) => participant.isPolicyExpenseChat); - const shouldShowConfirmButton = !(participants.length > 1 && hasPolicyExpenseChatParticipant); + const shouldShowSplitBillErrorMessage = participants.length > 1 && hasPolicyExpenseChatParticipant; const isAllowedToSplit = !isDistanceRequest && iouType !== CONST.IOU.TYPE.SEND; + const handleConfirmSelection = useCallback(() => { + if (shouldShowSplitBillErrorMessage) { + return; + } + + navigateToSplit(); + }, [shouldShowSplitBillErrorMessage, navigateToSplit]); + + const footerContent = ( + + {shouldShowSplitBillErrorMessage && ( + + )} +