Skip to content

Commit

Permalink
Merge pull request #8760 from Santhosh-Sellavel/santhosh-issue-8034
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham authored May 18, 2022
2 parents 9a9e5a5 + d897914 commit 24294f2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
8 changes: 5 additions & 3 deletions src/components/IOUConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down Expand Up @@ -225,6 +225,7 @@ class IOUConfirmationList extends Component {
data: [formattedMyPersonalDetails],
shouldShow: true,
indexOffset: 0,
isDisabled: true,
}, {
title: this.props.translate('iOUConfirmationList.whoWasThere'),
data: formattedSelectedParticipants,
Expand Down Expand Up @@ -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 (
<>
<ScrollView style={[styles.flexGrow0, styles.flexShrink1, styles.flexBasisAuto, styles.w100]}>
Expand All @@ -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}
/>
</ScrollView>
Expand Down
2 changes: 1 addition & 1 deletion src/components/OptionsList/BaseOptionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/OptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/pages/iou/IOUModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
/>
</AnimatedStep>
)}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/iou/steps/IOUConfirmPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -62,7 +62,7 @@ const IOUConfirmPage = props => (
onConfirm={props.onConfirm}
onSendMoney={props.onSendMoney}
iouType={props.iouType}
isGroupSplit={props.isGroupSplit}
isIOUAttachedToExistingChatReport={props.isIOUAttachedToExistingChatReport}
/>
);

Expand Down

0 comments on commit 24294f2

Please sign in to comment.