Skip to content

Commit

Permalink
Merge pull request #23703 from Expensify/vit-createEditIOUTransaction…
Browse files Browse the repository at this point in the history
…Command

Enable editing of money requests
  • Loading branch information
luacmartins authored Aug 14, 2023
2 parents d0b4fc2 + 61d0f2f commit 6a5b1a4
Show file tree
Hide file tree
Showing 19 changed files with 647 additions and 307 deletions.
3 changes: 3 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ const CONST = {
TASKEDITED: 'TASKEDITED',
TASKCANCELLED: 'TASKCANCELLED',
IOU: 'IOU',
MODIFIEDEXPENSE: 'MODIFIEDEXPENSE',
REIMBURSEMENTQUEUED: 'REIMBURSEMENTQUEUED',
RENAMED: 'RENAMED',
CHRONOSOOOLIST: 'CHRONOSOOOLIST',
Expand Down Expand Up @@ -1257,8 +1258,10 @@ const CONST = {
},
EDIT_REQUEST_FIELD: {
AMOUNT: 'amount',
CURRENCY: 'currency',
DATE: 'date',
DESCRIPTION: 'description',
MERCHANT: 'merchant',
},
FOOTER: {
EXPENSE_MANAGEMENT_URL: `${USE_EXPENSIFY_URL}/expense-management`,
Expand Down
2 changes: 2 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ export default {
NEW_TASK_FORM: 'newTaskForm',
EDIT_TASK_FORM: 'editTaskForm',
MONEY_REQUEST_DESCRIPTION_FORM: 'moneyRequestDescriptionForm',
MONEY_REQUEST_AMOUNT_FORM: 'moneyRequestAmountForm',
MONEY_REQUEST_CREATED_FORM: 'moneyRequestCreatedForm',
NEW_CONTACT_METHOD_FORM: 'newContactMethodForm',
PAYPAL_FORM: 'payPalForm',
SETTINGS_STATUS_SET_FORM: 'settingsStatusSetForm',
Expand Down
24 changes: 16 additions & 8 deletions src/components/CurrencySymbolButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
import Text from './Text';
import styles from '../styles/styles';
import Tooltip from './Tooltip';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback';
import CONST from '../CONST';
import useLocalize from '../hooks/useLocalize';

const propTypes = {
/** Currency symbol of selected currency */
Expand All @@ -14,24 +14,32 @@ const propTypes = {
/** Function to call when currency button is pressed */
onCurrencyButtonPress: PropTypes.func.isRequired,

...withLocalizePropTypes,
/** Flag to indicate if the button should be disabled */
disabled: PropTypes.bool,
};

function CurrencySymbolButton(props) {
const defaultProps = {
disabled: false,
};

function CurrencySymbolButton({onCurrencyButtonPress, currencySymbol, disabled}) {
const {translate} = useLocalize();
return (
<Tooltip text={props.translate('iOUCurrencySelection.selectCurrency')}>
<Tooltip text={translate('iOUCurrencySelection.selectCurrency')}>
<PressableWithoutFeedback
onPress={props.onCurrencyButtonPress}
accessibilityLabel={props.translate('iOUCurrencySelection.selectCurrency')}
onPress={onCurrencyButtonPress}
accessibilityLabel={translate('iOUCurrencySelection.selectCurrency')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
disabled={disabled}
>
<Text style={styles.iouAmountText}>{props.currencySymbol}</Text>
<Text style={styles.iouAmountText}>{currencySymbol}</Text>
</PressableWithoutFeedback>
</Tooltip>
);
}

CurrencySymbolButton.propTypes = propTypes;
CurrencySymbolButton.displayName = 'CurrencySymbolButton';
CurrencySymbolButton.defaultProps = defaultProps;

export default withLocalize(CurrencySymbolButton);
export default CurrencySymbolButton;
231 changes: 0 additions & 231 deletions src/components/MoneyRequestDetails.js

This file was deleted.

Loading

0 comments on commit 6a5b1a4

Please sign in to comment.