Skip to content

Commit

Permalink
Fix spanish copy, fix welcome title, hide Join button
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisl committed Apr 30, 2024
1 parent 1cbeb47 commit feb523c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/components/ReportWelcomeText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP
return translate('reportActionsView.yourSpace');
}

if (isSystemDM) {
return reportName;
}

return translate('reportActionsView.sayHello');
}, [isChatRoom, isInvoiceRoom, isSelfDM, translate, reportName]);
}, [isChatRoom, isInvoiceRoom, isSelfDM, isSystemDM, translate, reportName]);

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ export default {
beginningOfChatHistoryPolicyExpenseChatPartTwo: ' y ',
beginningOfChatHistoryPolicyExpenseChatPartThree: ' empieza aquí! 🎉 Este es el lugar donde chatear y presentar o pagar gastos.',
beginningOfChatHistorySelfDM: 'Este es tu espacio personal. Úsalo para notas, tareas, borradores y recordatorios.',
beginningOfChatHistorySystemDM: "Welcome! Let's get you set up.",
beginningOfChatHistorySystemDM: '¡Bienvenido! Vamos a configurar tu cuenta.',
chatWithAccountManager: 'Chatea con tu gestor de cuenta aquí',
sayHello: '¡Saluda!',
yourSpace: 'Tu espacio',
Expand Down
3 changes: 2 additions & 1 deletion src/pages/home/HeaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function HeaderView({
const theme = useTheme();
const styles = useThemeStyles();
const isSelfDM = ReportUtils.isSelfDM(report);
const isSystemDM = ReportUtils.isSystemChat(report);
const isGroupChat = ReportUtils.isGroupChat(report) || ReportUtils.isDeprecatedGroupDM(report);
// Currently, currentUser is not included in participantAccountIDs, so for selfDM, we need to add the currentUser as participants.
const participants = isSelfDM ? [session?.accountID ?? -1] : (report?.participantAccountIDs ?? []).slice(0, 5);
Expand Down Expand Up @@ -157,7 +158,7 @@ function HeaderView({
Report.updateNotificationPreference(reportID, report.notificationPreference, CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS, false, report.parentReportID, report.parentReportActionID),
);

const canJoinOrLeave = !isSelfDM && !isGroupChat && (isChatThread || isUserCreatedPolicyRoom || canLeaveRoom || canLeavePolicyExpenseChat);
const canJoinOrLeave = !isSelfDM && !isGroupChat && !isSystemDM && (isChatThread || isUserCreatedPolicyRoom || canLeaveRoom || canLeavePolicyExpenseChat);
const canJoin = canJoinOrLeave && !isWhisperAction && report.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN;
const canLeave = canJoinOrLeave && ((isChatThread && !!report.notificationPreference?.length) || isUserCreatedPolicyRoom || canLeaveRoom || canLeavePolicyExpenseChat);
if (canJoin) {
Expand Down

0 comments on commit feb523c

Please sign in to comment.