From ff854648a835cb67b218be33ad402c39615bf155 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Tue, 11 Oct 2022 21:52:47 +0100 Subject: [PATCH] Refactoring the reject transaction to cancel money request --- src/components/ReportTransaction.js | 24 ++------ src/libs/actions/IOU.js | 90 +++++++++++++++++++++++++++++ src/libs/deprecatedAPI.js | 12 ---- src/pages/iou/IOUTransactions.js | 4 +- 4 files changed, 95 insertions(+), 35 deletions(-) diff --git a/src/components/ReportTransaction.js b/src/components/ReportTransaction.js index c201434d9569..31272f94cc4c 100644 --- a/src/components/ReportTransaction.js +++ b/src/components/ReportTransaction.js @@ -2,9 +2,7 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import lodashGet from 'lodash/get'; import {View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; -import ONYXKEYS from '../ONYXKEYS'; import styles from '../styles/styles'; import * as IOU from '../libs/actions/IOU'; import reportActionPropTypes from '../pages/home/report/reportActionPropTypes'; @@ -27,17 +25,8 @@ const propTypes = { /** Can this transaction be rejected? */ canBeRejected: PropTypes.bool, - /** Text label for the reject transaction button */ - rejectButtonLabelText: PropTypes.string.isRequired, - - /* Onyx Props */ - - /** List of transactionIDs in process of rejection */ - /* eslint-disable-next-line react/no-unused-prop-types, react/require-default-props */ - transactionsBeingRejected: PropTypes.shape({ - /** IOUTransactionID that's being rejected */ - transactionID: PropTypes.bool, - }), + /** Type of the reject transaction button */ + rejectButtonType: PropTypes.oneOf(['decline', 'cancel']).isRequired, }; const defaultProps = { @@ -88,10 +77,9 @@ class ReportTransaction extends Component {