Skip to content
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

[CP Staging] Fix: System Footer Visibility #41200

Merged
merged 4 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const chatTypes = {
POLICY_EXPENSE_CHAT: 'policyExpenseChat',
SELF_DM: 'selfDM',
INVOICE: 'invoice',
SYSTEM: 'system',
} as const;

// Explicit type annotation is required
Expand Down
5 changes: 5 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,10 @@ function isGroupChat(report: OnyxEntry<Report> | Partial<Report>): boolean {
return getChatType(report) === CONST.REPORT.CHAT_TYPE.GROUP;
}

function isSystemChat(report: OnyxEntry<Report>): boolean {
return getChatType(report) === CONST.REPORT.CHAT_TYPE.SYSTEM;
}

/**
* Only returns true if this is our main 1:1 DM report with Concierge
*/
Expand Down Expand Up @@ -6536,6 +6540,7 @@ export {
isReportParticipant,
isSelfDM,
isSettled,
isSystemChat,
isTaskReport,
isThread,
isThreadFirstChat,
Expand Down
3 changes: 2 additions & 1 deletion src/pages/home/report/ReportFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function ReportFooter({
const isSmallSizeLayout = windowWidth - (isSmallScreenWidth ? 0 : variables.sideBarWidth) < variables.anonymousReportFooterBreakpoint;
const hideComposer = !ReportUtils.canUserPerformWriteAction(report);
const canWriteInReport = ReportUtils.canWriteInReport(report);
const isSystemChat = ReportUtils.isSystemChat(report);

const allPersonalDetails = usePersonalDetails();

Expand Down Expand Up @@ -141,7 +142,7 @@ function ReportFooter({
/>
)}
{isArchivedRoom && <ArchivedReportFooter report={report} />}
{!canWriteInReport && <SystemChatReportFooterMessage />}
{!isAnonymousUser && !canWriteInReport && isSystemChat && <SystemChatReportFooterMessage />}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the !isAnonymousUser was not necessary here anymore, but good enough for the CP

{!isSmallScreenWidth && <View style={styles.offlineIndicatorRow}>{hideComposer && <OfflineIndicator containerStyles={[styles.chatItemComposeSecondaryRow]} />}</View>}
</View>
)}
Expand Down
Loading