Skip to content

Commit

Permalink
Disable changing date and merchant when creating split bills
Browse files Browse the repository at this point in the history
  • Loading branch information
mountiny committed Aug 19, 2023
1 parent e5755b4 commit 8ad0fc4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function MoneyRequestConfirmationList(props) {

// A flag and a toggler for showing the rest of the form fields
const [showAllFields, toggleShowAllFields] = useReducer((state) => !state, false);
const isTypeRequest = props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.REQUEST;

/**
* Returns the participants with amount
Expand Down Expand Up @@ -407,20 +408,20 @@ function MoneyRequestConfirmationList(props) {
{showAllFields && (
<>
<MenuItemWithTopDescription
shouldShowRightIcon={!props.isReadOnly}
shouldShowRightIcon={!props.isReadOnly && isTypeRequest}
title={props.iouCreated || format(new Date(), CONST.DATE.FNS_FORMAT_STRING)}
description={translate('common.date')}
style={[styles.moneyRequestMenuItem, styles.mb2]}
onPress={() => Navigation.navigate(ROUTES.getMoneyRequestCreatedRoute(props.iouType, props.reportID))}
disabled={didConfirm || props.isReadOnly}
disabled={didConfirm || props.isReadOnly || !isTypeRequest}
/>
<MenuItemWithTopDescription
shouldShowRightIcon={!props.isReadOnly}
shouldShowRightIcon={!props.isReadOnly && isTypeRequest}
title={props.iouMerchant}
description={translate('common.merchant')}
style={[styles.moneyRequestMenuItem, styles.mb2]}
onPress={() => Navigation.navigate(ROUTES.getMoneyRequestMerchantRoute(props.iouType, props.reportID))}
disabled={didConfirm || props.isReadOnly}
disabled={didConfirm || props.isReadOnly || !isTypeRequest}
/>
</>
)}
Expand Down

0 comments on commit 8ad0fc4

Please sign in to comment.