Skip to content

[Better Expense Report View] Expense Report Preview #58479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
7edff68
Carousel skeleton with wrapper for data retrieval
Guccio163 Mar 12, 2025
3899dc3
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 12, 2025
1fe85e8
commit before draft
Guccio163 Mar 14, 2025
2958145
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 14, 2025
6f7e998
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 17, 2025
251968c
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 17, 2025
c777eae
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 17, 2025
a69fc64
working carousel overflow
Guccio163 Mar 17, 2025
0bc0fca
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 19, 2025
87ec465
styling and mock data cleanup
Guccio163 Mar 21, 2025
c86e5ce
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 21, 2025
6f474e6
styling arrowComponent
Guccio163 Mar 21, 2025
da9fba7
styles cleanup, extracting types.ts
Guccio163 Mar 21, 2025
41f6ad6
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 21, 2025
0f27338
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 21, 2025
33f1550
Replace placeholder in story with TransactionPreview
JakubKorytko Mar 21, 2025
fb96c6f
eslint fixes
Guccio163 Mar 24, 2025
f3e43a9
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 24, 2025
0760812
MoneyRequestReportPreview behind beta flag
Guccio163 Mar 24, 2025
3ef1a8f
canUseAllBetas fix
Guccio163 Mar 24, 2025
ac86266
prettier
Guccio163 Mar 24, 2025
18af44d
ESlint fix
Guccio163 Mar 24, 2025
9383792
eslint fixes 2
Guccio163 Mar 24, 2025
d9ffde3
eslinf fixes 3
Guccio163 Mar 24, 2025
9240625
eslint fixes 4
Guccio163 Mar 24, 2025
9e15fb0
Insert MoneyRequestReportPreview to app
JakubKorytko Mar 24, 2025
dc87b00
Merge branch 'Guccio163/MoneyRequestReportPreview' into korytko/chain…
JakubKorytko Mar 24, 2025
d876cca
beta flag change
Guccio163 Mar 24, 2025
e1114e2
Add wrapperStyles to TransactionPreview
JakubKorytko Mar 24, 2025
5f9ea66
Merge branch 'Guccio163/MoneyRequestReportPreview' of github.com:soft…
Guccio163 Mar 24, 2025
b5ca427
Merge branch 'korytko/chain-transaction-preview-with-carousel' of git…
Guccio163 Mar 24, 2025
7ab89f9
Chaining TransactionPreview
Guccio163 Mar 24, 2025
4f7e459
eslint fix import
Guccio163 Mar 24, 2025
b58941c
prettier
Guccio163 Mar 24, 2025
137b7eb
working arrow buttons
Guccio163 Mar 24, 2025
ecbc500
arrow styles fix
Guccio163 Mar 24, 2025
8117819
Do not update submodule
Guccio163 Mar 24, 2025
fb9f8e6
fix arrows logic
Guccio163 Mar 24, 2025
94292fe
Merge branch 'Guccio163/MoneyRequestReportPreview' into korytko/chain…
JakubKorytko Mar 25, 2025
b619000
Fix styling and story
JakubKorytko Mar 25, 2025
c57ce4d
Fix pagination & icon placement
JakubKorytko Mar 25, 2025
018df3f
Add ReviewRequiredButton
JakubKorytko Mar 25, 2025
7abb156
Merge branch 'main' into korytko/chain-transaction-preview-with-carousel
JakubKorytko Mar 25, 2025
d445076
left arrow bug fix
Guccio163 Mar 25, 2025
7ca7039
prettier run
Guccio163 Mar 25, 2025
555f7df
Add tests to MoneyRequestReportPreview
JakubKorytko Mar 25, 2025
e16909a
Merge branch 'Guccio163/MoneyRequestReportPreview' into korytko/chain…
JakubKorytko Mar 25, 2025
001c314
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 26, 2025
13ac199
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 26, 2025
d06327c
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 26, 2025
a8579df
fix refs and code via ReportPreview
Guccio163 Mar 26, 2025
4b49222
renderItem fix
Guccio163 Mar 26, 2025
ee14f4a
conditional fix
Guccio163 Mar 26, 2025
7e09953
Update src/styles/index.ts
Guccio163 Mar 26, 2025
84a3125
Fix styling (again)
JakubKorytko Mar 26, 2025
beb2c39
github comments addressed
Guccio163 Mar 26, 2025
1cd0b74
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 26, 2025
42577b4
Update MoneyRequestReportPreview tests
JakubKorytko Mar 26, 2025
df47cb9
Minor style fixes
JakubKorytko Mar 26, 2025
3155030
Merge branch 'Guccio163/MoneyRequestReportPreview' into korytko/chain…
JakubKorytko Mar 26, 2025
e6d91df
Update src/components/ReportActionItem/MoneyRequestReportPreview/Mone…
Guccio163 Mar 26, 2025
1a9b344
Update src/components/ReportActionItem/MoneyRequestReportPreview/Mone…
Guccio163 Mar 26, 2025
d88aa4e
Update src/components/ReportActionItem/MoneyRequestReportPreview/Mone…
Guccio163 Mar 26, 2025
14c8e7b
Update src/components/ReportActionItem/MoneyRequestReportPreview/Mone…
Guccio163 Mar 26, 2025
cd1973b
Pass TransactionID to TransactionPreview
JakubKorytko Mar 27, 2025
4e12c20
Fix split-share rendering
JakubKorytko Mar 27, 2025
4efd413
Fix code according to PR comments
JakubKorytko Mar 27, 2025
3166661
Merge branch 'main' into Guccio163/MoneyRequestReportPreview
JakubKorytko Mar 27, 2025
f1f8224
Fix new issues mentioned in PR comments
JakubKorytko Mar 27, 2025
97fd782
Add proper skeleton for TransactionPreview
JakubKorytko Mar 28, 2025
864180a
Position ApproveOrSettled icon correctly
JakubKorytko Mar 28, 2025
901cd73
Merge branch 'main' into Guccio163/MoneyRequestReportPreview
JakubKorytko Mar 28, 2025
a94df03
Fix padding in carousel on mobile devices
JakubKorytko Mar 28, 2025
23be292
snapping with padding included fix
Guccio163 Mar 28, 2025
99c68db
prettier
Guccio163 Mar 28, 2025
2d17026
scaling mobile width styles
Guccio163 Mar 29, 2025
876c3d9
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 29, 2025
17628bf
padding horizontal 16 fix
Guccio163 Mar 31, 2025
19c7144
extract isWaitingForSubmissionFromCurrentUser
Guccio163 Mar 31, 2025
0d29400
Update src/components/ReportActionItem/MoneyRequestReportPreview/Mone…
Guccio163 Mar 31, 2025
2700068
review styles fix
Guccio163 Mar 31, 2025
6803c2f
Merge branch 'main' into Guccio163/MoneyRequestReportPreview
JakubKorytko Mar 31, 2025
e823cdc
Fix icon alignment in MoneyRequestReportPreview Text
JakubKorytko Mar 31, 2025
0c99efd
translate review with amount
Guccio163 Mar 31, 2025
bc41f6f
Merge branch 'Guccio163/MoneyRequestReportPreview' of github.com:soft…
Guccio163 Mar 31, 2025
503c704
Fix test & eslint errors
JakubKorytko Mar 31, 2025
247f0c4
review comments fixes
Guccio163 Mar 31, 2025
1b8015d
Merge branch 'Guccio163/MoneyRequestReportPreview' of github.com:soft…
Guccio163 Mar 31, 2025
4cfdf61
Fix font & margin in Carousel
JakubKorytko Mar 31, 2025
d645518
disabled button when on the end of list
Guccio163 Mar 31, 2025
d9d72ca
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 31, 2025
4bbde94
disabled arrow buttons styles
Guccio163 Mar 31, 2025
dc94f5f
tests fix
Guccio163 Mar 31, 2025
d7befcc
don't change Mobile-Expensify
Guccio163 Mar 31, 2025
46c2ba6
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Mar 31, 2025
b74e7a9
+X visible and last dot reachable
Guccio163 Apr 1, 2025
248692d
Merge branch 'main' of github.com:software-mansion-labs/expensify-app…
Guccio163 Apr 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/MoneyRequestSkeletonView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function MoneyRequestSkeletonView() {
const styles = useThemeStyles();
return (
<SkeletonViewContentLoader
testID={MoneyRequestSkeletonView.displayName}
animate
width={styles.w100.width}
height={variables.moneyRequestSkeletonHeight}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import React from 'react';
import type {ListRenderItem} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import TransactionPreview from '@components/ReportActionItem/TransactionPreview';
import useDelegateUserDetails from '@hooks/useDelegateUserDetails';
import usePolicy from '@hooks/usePolicy';
import useReportWithTransactionsAndViolations from '@hooks/useReportWithTransactionsAndViolations';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import useTransactionViolations from '@hooks/useTransactionViolations';
import {getIOUActionForReportID, isSplitBillAction as isSplitBillActionReportActionsUtils, isTrackExpenseAction as isTrackExpenseActionReportActionsUtils} from '@libs/ReportActionsUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Transaction} from '@src/types/onyx';
import MoneyRequestReportPreviewContent from './MoneyRequestReportPreviewContent';
import type {MoneyRequestReportPreviewProps} from './types';

function MoneyRequestReportPreview({
iouReportID,
policyID,
chatReportID,
action,
containerStyles,
contextMenuAnchor,
isHovered = false,
isWhisper = false,
checkIfContextMenuActive = () => {},
onPaymentOptionsShow,
onPaymentOptionsHide,
}: MoneyRequestReportPreviewProps) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const {shouldUseNarrowLayout} = useResponsiveLayout();
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`);
const [invoiceReceiverPolicy] = useOnyx(
`${ONYXKEYS.COLLECTION.POLICY}${chatReport?.invoiceReceiver && 'policyID' in chatReport.invoiceReceiver ? chatReport.invoiceReceiver.policyID : CONST.DEFAULT_NUMBER_ID}`,
);
const [invoiceReceiverPersonalDetail] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {
selector: (personalDetails) =>
personalDetails?.[chatReport?.invoiceReceiver && 'accountID' in chatReport.invoiceReceiver ? chatReport.invoiceReceiver.accountID : CONST.DEFAULT_NUMBER_ID],
});
const [iouReport, transactions, violations] = useReportWithTransactionsAndViolations(iouReportID);
const policy = usePolicy(policyID);
const lastTransaction = transactions?.at(0);
const lastTransactionViolations = useTransactionViolations(lastTransaction?.transactionID);
const {isDelegateAccessRestricted} = useDelegateUserDetails();
const isTrackExpenseAction = isTrackExpenseActionReportActionsUtils(action);
const isSplitBillAction = isSplitBillActionReportActionsUtils(action);
const style = StyleUtils.getMoneyRequestReportPreviewStyle(transactions.length, shouldUseNarrowLayout);

const renderItem: ListRenderItem<Transaction> = ({item}) => (
<TransactionPreview
chatReportID={chatReportID}
action={getIOUActionForReportID(item.reportID, item.transactionID)}
reportID={item.reportID}
isBillSplit={isSplitBillAction}
isTrackExpense={isTrackExpenseAction}
contextMenuAnchor={contextMenuAnchor}
isWhisper={isWhisper}
isHovered={isHovered}
iouReportID={iouReportID}
onPreviewPressed={() => {}}
wrapperStyles={style.transaction}
containerStyles={[styles.h100, containerStyles]}
/>
);

return (
<MoneyRequestReportPreviewContent
containerStyles={[style.preview, containerStyles]}
contextMenuAnchor={contextMenuAnchor}
isHovered={isHovered}
isWhisper={isWhisper}
checkIfContextMenuActive={checkIfContextMenuActive}
onPaymentOptionsShow={onPaymentOptionsShow}
onPaymentOptionsHide={onPaymentOptionsHide}
action={action}
chatReportID={chatReportID}
iouReportID={iouReportID}
policyID={undefined}
iouReport={iouReport}
transactions={transactions}
violations={violations}
chatReport={chatReport}
policy={policy}
invoiceReceiverPersonalDetail={invoiceReceiverPersonalDetail}
invoiceReceiverPolicy={invoiceReceiverPolicy}
lastTransactionViolations={lastTransactionViolations}
isDelegateAccessRestricted={isDelegateAccessRestricted}
renderItem={renderItem}
/>
);
}

MoneyRequestReportPreview.displayName = 'MoneyRequestReportPreview';

export default MoneyRequestReportPreview;
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import type {ListRenderItem, StyleProp, ViewStyle} from 'react-native';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import type {ContextMenuAnchor} from '@pages/home/report/ContextMenu/ReportActionContextMenu';
import type {PersonalDetails, Policy, Report, ReportAction, Transaction, TransactionViolation, TransactionViolations} from '@src/types/onyx';

type MoneyRequestReportPreviewProps = {
/** The report's policyID, used for Onyx subscription */
policyID: string | undefined;

/** All the data of the action */
action: ReportAction;

/** The associated chatReport */
chatReportID: string | undefined;

/** The active IOUReport, used for Onyx subscription */
iouReportID: string | undefined;

/** Extra styles to pass to View wrapper */
containerStyles?: StyleProp<ViewStyle>;

/** Popover context menu anchor, used for showing context menu */
contextMenuAnchor?: ContextMenuAnchor;

/** Callback for updating context menu active state, used for showing context menu */
checkIfContextMenuActive?: () => void;

/** Callback when the payment options popover is shown */
onPaymentOptionsShow?: () => void;

/** Callback when the payment options popover is closed */
onPaymentOptionsHide?: () => void;

/** Whether a message is a whisper */
isWhisper?: boolean;

/** Whether the corresponding report action item is hovered */
isHovered?: boolean;
};

type MoneyRequestReportPreviewContentOnyxProps = {
chatReport: OnyxEntry<Report>;
invoiceReceiverPolicy: OnyxEntry<Policy>;
iouReport: OnyxEntry<Report>;
transactions: Transaction[];
violations: OnyxCollection<TransactionViolation[]>;
policy: OnyxEntry<Policy>;
invoiceReceiverPersonalDetail: OnyxEntry<PersonalDetails>;
lastTransactionViolations: TransactionViolations;
isDelegateAccessRestricted: boolean;
};

type MoneyRequestReportPreviewContentProps = MoneyRequestReportPreviewContentOnyxProps & MoneyRequestReportPreviewProps & {renderItem: ListRenderItem<Transaction> | null | undefined};

export type {MoneyRequestReportPreviewContentProps, MoneyRequestReportPreviewProps};
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function TransactionPreviewContent({
navigateToReviewFields,
onPreviewPressed,
containerStyles,
wrapperStyles,
isBillSplit,
areThereDuplicates,
sessionAccountID,
Expand Down Expand Up @@ -159,12 +160,12 @@ function TransactionPreviewContent({
() =>
shouldShowSplitShare
? transaction?.comment?.splits?.find((split) => split.accountID === sessionAccountID)?.amount ??
calculateAmount(isReportAPolicyExpenseChat ? 1 : participantAccountIDs.length - 1, requestAmount ?? 0, requestCurrency ?? '', action.actorAccountID === sessionAccountID)
calculateAmount(isReportAPolicyExpenseChat ? 1 : participantAccountIDs.length - 1, requestAmount ?? 0, requestCurrency ?? '', action?.actorAccountID === sessionAccountID)
: 0,
[
shouldShowSplitShare,
isReportAPolicyExpenseChat,
action.actorAccountID,
action?.actorAccountID,
participantAccountIDs.length,
transaction?.comment?.splits,
requestAmount,
Expand All @@ -173,8 +174,12 @@ function TransactionPreviewContent({
],
);

const shouldAddGapToPreviewText = isBillSplit || shouldShowMerchantOrDescription || shouldShowCategoryOrTag;
const shouldAddMbn1ToPreviewText = shouldShowIOUHeader && shouldShowMerchantOrDescription && !isBillSplit && !shouldShowCategoryOrTag;
const shouldWrapDisplayAmount = !(shouldShowMerchantOrDescription || isBillSplit);

const transactionContent = (
<View style={[styles.border, styles.reportContainerBorderRadius]}>
<View style={[styles.border, styles.reportContainerBorderRadius, containerStyles]}>
<OfflineWithFeedback
errors={walletTermsErrors}
onClose={() => offlineWithFeedbackOnClose}
Expand All @@ -187,7 +192,7 @@ function TransactionPreviewContent({
>
<View
style={[
isScanning || isWhisper ? [styles.reportPreviewBoxHoverBorder, styles.reportContainerBorderRadius] : undefined,
(isScanning || isWhisper) && [styles.reportPreviewBoxHoverBorder, styles.reportContainerBorderRadius],
!onPreviewPressed ? [styles.moneyRequestPreviewBox, containerStyles, themeStyles] : {},
]}
>
Expand All @@ -204,23 +209,23 @@ function TransactionPreviewContent({
) : (
<View style={[styles.expenseAndReportPreviewBoxBody, styles.mtn1]}>
<View style={styles.gap3}>
<View style={isBillSplit || shouldShowMerchantOrDescription || shouldShowCategoryOrTag ? styles.gap2 : {}}>
{shouldShowIOUHeader && (
<View style={[styles.flex1, styles.dFlex, styles.alignItemsCenter, styles.gap2, styles.flexRow]}>
<UserInfoCellsWithArrow
shouldDisplayArrowIcon
participantFrom={from}
participantFromDisplayName={from.displayName ?? from.login ?? ''}
participantTo={to}
participantToDisplayName={to.displayName ?? to.login ?? ''}
avatarSize="mid-subscript"
infoCellsTextStyle={{...styles.textMicroBold, lineHeight: 14}}
infoCellsAvatarStyle={styles.pr1}
/>
</View>
)}
{shouldShowIOUHeader && (
<View style={[styles.flex1, styles.dFlex, styles.alignItemsCenter, styles.gap2, styles.flexRow]}>
<UserInfoCellsWithArrow
shouldDisplayArrowIcon
participantFrom={from}
participantFromDisplayName={from.displayName ?? from.login ?? ''}
participantTo={to}
participantToDisplayName={to.displayName ?? to.login ?? ''}
avatarSize="mid-subscript"
infoCellsTextStyle={{...styles.textMicroBold, lineHeight: 14}}
infoCellsAvatarStyle={styles.pr1}
/>
</View>
)}
<View style={shouldAddGapToPreviewText && styles.gap2}>
<View style={[styles.flexRow, styles.alignItemsCenter]}>
<Text style={[styles.textLabelSupporting, styles.flex1, styles.lh16]}>{previewHeaderText}</Text>
<Text style={[styles.textLabelSupporting, styles.flex1, styles.lh16, shouldAddMbn1ToPreviewText && styles.mbn1]}>{previewHeaderText}</Text>
{isBillSplit && (
<View style={styles.moneyRequestPreviewBoxAvatar}>
<MultipleAvatars
Expand All @@ -231,7 +236,7 @@ function TransactionPreviewContent({
/>
</View>
)}
{!isBillSplit && !shouldShowMerchantOrDescription && (
{shouldWrapDisplayAmount && (
<Text
fontSize={variables.fontSizeNormal}
style={[isDeleted && styles.lineThrough, styles.flexShrink0]}
Expand Down Expand Up @@ -260,7 +265,7 @@ function TransactionPreviewContent({
{merchantOrDescription}
</Text>
)}
{(shouldShowMerchant || shouldShowDescription || isBillSplit) && (
{!shouldWrapDisplayAmount && (
<Text
fontSize={variables.fontSizeNormal}
style={[isDeleted && styles.lineThrough, styles.flexShrink0]}
Expand Down Expand Up @@ -364,7 +369,7 @@ function TransactionPreviewContent({
accessibilityHint={convertToDisplayString(requestAmount, requestCurrency)}
style={[
styles.moneyRequestPreviewBox,
containerStyles,
wrapperStyles,
themeStyles,
shouldDisableOnPress && styles.cursorDefault,
(isIOUSettled || isApproved) && isSettlementOrApprovalPartial && styles.offlineFeedback.pending,
Expand Down
14 changes: 10 additions & 4 deletions src/components/ReportActionItem/TransactionPreview/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@ type TransactionPreviewProps = {
onPreviewPressed: (event?: GestureResponderEvent | KeyboardEvent) => void;

/** All the data of the action, used for showing context menu */
action: ReportAction;
action: OnyxEntry<ReportAction>;

/** Popover context menu anchor, used for showing context menu */
contextMenuAnchor?: ContextMenuAnchor;

/** Callback for updating context menu active state, used for showing context menu */
checkIfContextMenuActive?: () => void;

/** Extra styles to pass to View wrapper */
/** Optional custom styles to be applied to container component. */
containerStyles?: StyleProp<ViewStyle>;

/** Optional custom styles to be applied to wrapper component. */
wrapperStyles?: StyleProp<ViewStyle>;

/** True if this IOU has a type of split */
isBillSplit: boolean;

Expand Down Expand Up @@ -69,9 +72,12 @@ type TransactionPreviewContentProps = {
/** Determines if the element is currently hovered over. */
isHovered?: boolean;

/** Optional custom styles to be applied to container components. */
/** Optional custom styles to be applied to container component. */
containerStyles?: StyleProp<ViewStyle>;

/** Optional custom styles to be applied to wrapper component. */
wrapperStyles?: StyleProp<ViewStyle>;

/** Records any errors related to wallet terms. */
walletTermsErrors: Errors | undefined;

Expand All @@ -85,7 +91,7 @@ type TransactionPreviewContentProps = {
transaction: OnyxEntry<Transaction>;

/** Represents the action entry from Onyx */
action: ReportAction;
action: OnyxEntry<ReportAction>;

/** Contains data about potential transaction violations */
violations: TransactionViolations;
Expand Down
6 changes: 3 additions & 3 deletions src/libs/TransactionPreviewUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function getTransactionPreviewTextAndTranslationPaths({
}: {
iouReport: OnyxEntry<OnyxTypes.Report>;
transaction: OnyxEntry<OnyxTypes.Transaction>;
action: OnyxTypes.ReportAction;
action: OnyxEntry<OnyxTypes.ReportAction>;
violations: OnyxTypes.TransactionViolations;
transactionDetails: Partial<TransactionDetails>;
isBillSplit: boolean;
Expand Down Expand Up @@ -256,7 +256,7 @@ function createTransactionPreviewConditionals({
}: {
iouReport: OnyxInputValue<OnyxTypes.Report> | undefined;
transaction: OnyxEntry<OnyxTypes.Transaction> | undefined;
action: OnyxTypes.ReportAction;
action: OnyxEntry<OnyxTypes.ReportAction>;
violations: OnyxTypes.TransactionViolations;
transactionDetails: Partial<TransactionDetails>;
isBillSplit: boolean;
Expand Down Expand Up @@ -284,7 +284,7 @@ function createTransactionPreviewConditionals({
const isFullyApproved = isApproved && !isSettlementOrApprovalPartial;

const shouldDisableOnPress = isBillSplit && isEmptyObject(transaction);
const shouldShowSkeleton = isEmptyObject(transaction) && !isMessageDeleted(action) && action.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
const shouldShowSkeleton = isEmptyObject(transaction) && !isMessageDeleted(action) && action?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
const shouldShowTag = !!tag && isReportAPolicyExpenseChat;
const shouldShowCategory = !!category && isReportAPolicyExpenseChat;

Expand Down
Loading
Loading