Skip to content

Commit

Permalink
Merge pull request #26597 from Expensify/hayata-display-all-info-for-…
Browse files Browse the repository at this point in the history
…distance-requests

Display all request info for distance request
  • Loading branch information
mountiny authored Sep 4, 2023
2 parents a7dfd6f + 50130ea commit 4b32a96
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 @@ -164,7 +164,8 @@ function MoneyRequestConfirmationList(props) {
const {translate} = useLocalize();

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

const {unit, rate, currency} = props.mileageRate;
Expand Down Expand Up @@ -437,12 +438,12 @@ function MoneyRequestConfirmationList(props) {
disabled={didConfirm || props.isReadOnly}
numberOfLinesTitle={2}
/>
{!showAllFields && (
{!shouldShowAllFields && (
<View style={[styles.flexRow, styles.justifyContentBetween, styles.mh3, styles.alignItemsCenter, styles.mb2]}>
<View style={[styles.shortTermsHorizontalRule, styles.flex1, styles.mr0]} />
<Button
small
onPress={toggleShowAllFields}
onPress={toggleShouldExpandFields}
text={translate('common.showMore')}
shouldShowRightIcon
iconRight={Expensicons.DownArrow}
Expand All @@ -452,7 +453,7 @@ function MoneyRequestConfirmationList(props) {
<View style={[styles.shortTermsHorizontalRule, styles.flex1, styles.ml0]} />
</View>
)}
{showAllFields && (
{shouldShowAllFields && (
<>
<MenuItemWithTopDescription
shouldShowRightIcon={!props.isReadOnly && isTypeRequest}
Expand Down

0 comments on commit 4b32a96

Please sign in to comment.