Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Oct 13, 2023
1 parent b43282d commit 9d04cf9
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/components/ReportActionItem/MoneyRequestPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function MoneyRequestPreview(props) {
const receiptImages = hasReceipt ? [ReceiptUtils.getThumbnailAndImageURIs(props.transaction.receipt.source, props.transaction.filename || '')] : [];

const getSettledMessage = () => {
if (isExpensifyCardTransaction || isDistanceRequest) {
if (isExpensifyCardTransaction) {
return props.translate('common.done');
}
switch (lodashGet(props.action, 'originalMessage.paymentType', '')) {
Expand Down Expand Up @@ -262,20 +262,7 @@ function MoneyRequestPreview(props) {
) : (
<View style={styles.moneyRequestPreviewBoxText}>
<View style={[styles.flexRow]}>
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.mb1]}>
<Text style={[styles.textLabelSupporting, styles.lh20]}>{getPreviewHeaderText()}</Text>
{isSettled && (
<>
<Icon
src={Expensicons.DotIndicator}
width={4}
height={4}
additionalStyles={[styles.mr1, styles.ml1]}
/>
<Text style={[styles.textLabelSupporting, styles.lh20]}>{getSettledMessage()}</Text>
</>
)}
</View>
<Text style={[styles.textLabelSupporting, styles.lh20, styles.mb1]}>{getPreviewHeaderText() + (isSettled ? ` • ${getSettledMessage()}` : '')}</Text>
{hasFieldErrors && (
<Icon
src={Expensicons.DotIndicator}
Expand Down

0 comments on commit 9d04cf9

Please sign in to comment.