diff --git a/src/CONST.js b/src/CONST.js index 7215f3b3972a..113911f61c41 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -898,6 +898,7 @@ const CONST = { SPLIT: 'split', DECLINE: 'decline', CANCEL: 'cancel', + DELETE: 'delete', }, AMOUNT_MAX_LENGTH: 10, }, diff --git a/src/components/ReportTransaction.js b/src/components/ReportTransaction.js index f80c638a0f58..fe728146e4fa 100644 --- a/src/components/ReportTransaction.js +++ b/src/components/ReportTransaction.js @@ -24,37 +24,33 @@ const propTypes = { /** The report action which we are displaying */ action: PropTypes.shape(reportActionPropTypes).isRequired, - /** Can this transaction be rejected? */ - canBeRejected: PropTypes.bool, + /** Can this transaction be deleted? */ + canBeDeleted: PropTypes.bool, - /** Type of the reject transaction button */ - rejectButtonType: PropTypes.oneOf([CONST.IOU.REPORT_ACTION_TYPE.DECLINE, CONST.IOU.REPORT_ACTION_TYPE.CANCEL]).isRequired, - - /** Indicates whether pressing the reject button should hide the details sidebar */ - shouldCloseOnReject: PropTypes.bool, + /** Indicates whether pressing the delete button should hide the details sidebar */ + shouldCloseOnDelete: PropTypes.bool, ...withLocalizePropTypes, }; const defaultProps = { - canBeRejected: false, - shouldCloseOnReject: false, + canBeDeleted: false, + shouldCloseOnDelete: false, }; class ReportTransaction extends Component { constructor(props) { super(props); - this.cancelMoneyRequest = this.cancelMoneyRequest.bind(this); + this.deleteMoneyRequest = this.deleteMoneyRequest.bind(this); } - cancelMoneyRequest() { - IOU.cancelMoneyRequest( + deleteMoneyRequest() { + IOU.deleteMoneyRequest( this.props.chatReportID, this.props.iouReportID, - this.props.rejectButtonType, this.props.action, - this.props.shouldCloseOnReject, + this.props.shouldCloseOnDelete, ); } @@ -84,13 +80,13 @@ class ReportTransaction extends Component { {this.props.action.message[0].text} - {this.props.canBeRejected && ( + {this.props.canBeDeleted && (