diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js index 84de26b310f1..7468e2138ca4 100755 --- a/src/components/IOUConfirmationList.js +++ b/src/components/IOUConfirmationList.js @@ -62,8 +62,8 @@ const propTypes = { phoneNumber: PropTypes.string, })).isRequired, - /** Whether this is an IOU split and belongs to a group report */ - isGroupSplit: PropTypes.bool.isRequired, + /** Is this IOU associated with existing report */ + isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired, ...windowDimensionsPropTypes, @@ -225,6 +225,7 @@ class IOUConfirmationList extends Component { data: [formattedMyPersonalDetails], shouldShow: true, indexOffset: 0, + isDisabled: true, }, { title: this.props.translate('iOUConfirmationList.whoWasThere'), data: formattedSelectedParticipants, @@ -350,6 +351,7 @@ class IOUConfirmationList extends Component { const shouldDisableButton = selectedParticipants.length === 0 || this.props.network.isOffline; const isLoading = this.props.iou.loading && !this.props.network.isOffline; const recipient = this.state.participants[0]; + const canModifyParticipants = this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants; return ( <> @@ -362,7 +364,7 @@ class IOUConfirmationList extends Component { canSelectMultipleOptions={this.props.hasMultipleParticipants} selectedOptions={this.getSelectedOptions()} onSelectRow={toggleOption} - isDisabled={!this.props.isGroupSplit} + isDisabled={!canModifyParticipants} optionHoveredStyle={hoverStyle} /> diff --git a/src/components/OptionsList/BaseOptionsList.js b/src/components/OptionsList/BaseOptionsList.js index f6049a886c5a..1b66eec802dd 100644 --- a/src/components/OptionsList/BaseOptionsList.js +++ b/src/components/OptionsList/BaseOptionsList.js @@ -111,7 +111,7 @@ class BaseOptionsList extends Component { showSelectedState={this.props.canSelectMultipleOptions} hideAdditionalOptionStates={this.props.hideAdditionalOptionStates} forceTextUnreadStyle={this.props.forceTextUnreadStyle} - isDisabled={this.props.isDisabled} + isDisabled={this.props.isDisabled || section.isDisabled} /> ); } diff --git a/src/components/OptionsSelector.js b/src/components/OptionsSelector.js index 48c34b1fcb15..81a83cbdf19e 100755 --- a/src/components/OptionsSelector.js +++ b/src/components/OptionsSelector.js @@ -30,6 +30,9 @@ const propTypes = { /** Whether this section should show or not */ shouldShow: PropTypes.bool, + + /** Whether this section items disabled for selection */ + isDisabled: PropTypes.bool, })).isRequired, /** Value in the search input field */ diff --git a/src/pages/iou/IOUModal.js b/src/pages/iou/IOUModal.js index c0d8cf70449f..6bda5b82a745 100755 --- a/src/pages/iou/IOUModal.js +++ b/src/pages/iou/IOUModal.js @@ -434,7 +434,7 @@ class IOUModal extends Component { comment={this.state.comment} onUpdateComment={this.updateComment} iouType={this.props.iouType} - isGroupSplit={this.steps.length === 2} + isIOUAttachedToExistingChatReport={!_.isEmpty(reportID)} /> )} diff --git a/src/pages/iou/steps/IOUConfirmPage.js b/src/pages/iou/steps/IOUConfirmPage.js index 6d59ed01c7ce..5352ccfdcf83 100644 --- a/src/pages/iou/steps/IOUConfirmPage.js +++ b/src/pages/iou/steps/IOUConfirmPage.js @@ -42,8 +42,8 @@ const propTypes = { /** IOU type */ iouType: PropTypes.string, - /** Whether this is an IOU split and belongs to a group report */ - isGroupSplit: PropTypes.bool.isRequired, + /** Is this IOU associated with existing report */ + isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired, }; const defaultProps = { @@ -62,7 +62,7 @@ const IOUConfirmPage = props => ( onConfirm={props.onConfirm} onSendMoney={props.onSendMoney} iouType={props.iouType} - isGroupSplit={props.isGroupSplit} + isIOUAttachedToExistingChatReport={props.isIOUAttachedToExistingChatReport} /> );