Skip to content

Render ChatBubbleCell only if it's needed #65570

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
Changes from 3 commits
Commits
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
15 changes: 10 additions & 5 deletions src/components/TransactionItemRow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ function TransactionItemRow({
],
);
const safeColumnWrapperStyle = columnWrapperStyles ?? [styles.p3, styles.expenseWidgetRadius];
const shouldRenderChatBubbleCell = useMemo(() => {
return columns?.includes(CONST.REPORT.TRANSACTION_LIST.COLUMNS.COMMENTS) ?? false;
}, [columns]);
return (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment
But let's add an empty line before return

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@ZhenjaHorbach ZhenjaHorbach Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn
Now we have TS issues 😅

Copy link
Contributor

@ZhenjaHorbach ZhenjaHorbach Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's not our issues
Let's try to update a branch to the latest version of main

<View
style={[styles.flex1]}
Expand Down Expand Up @@ -473,11 +476,13 @@ function TransactionItemRow({
missingFieldError={missingFieldError}
/>
</View>
<ChatBubbleCell
transaction={transactionItem}
containerStyles={[styles.mt2]}
isInSingleTransactionReport={isInSingleTransactionReport}
/>
{shouldRenderChatBubbleCell && (
<ChatBubbleCell
transaction={transactionItem}
containerStyles={[styles.mt2]}
isInSingleTransactionReport={isInSingleTransactionReport}
/>
)}
</View>
</View>
</Animated.View>
Expand Down
Loading