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

HelpScout Tasks Search #1120

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Changes from 1 commit
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
12 changes: 3 additions & 9 deletions src/components/Dashboard/Welcome/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@ const Welcome = ({ firstName }: Props): ReactElement => {
const { appName } = useGetAppSettings();
const currentHour = today.hour;

let greeting = firstName
? t('Good Evening, {{ firstName }}.', { firstName })
: t('Good Evening,');
let greeting = t('Good Evening,') + (firstName ? ` ${firstName}.` : '');

if (currentHour < 12) {
greeting = firstName
? t('Good Morning, {{ firstName }}.', { firstName })
: t('Good Morning,');
greeting = t('Good Morning,') + (firstName ? ` ${firstName}.` : '');
} else if (currentHour < 18) {
greeting = firstName
? t('Good Afternoon, {{ firstName }}.', { firstName })
: t('Good Afternoon,');
greeting = t('Good Afternoon,') + (firstName ? ` ${firstName}.` : '');
Copy link
Contributor

Choose a reason for hiding this comment

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

How about removing the string concatenation and after the last else if doing

if (firstName) {
  greeting += ` ${firstName}.`
}

Also, this seems good for now, but if find any more bugs like this, we should probably look into tweaking i18n's interpolation settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sure there are many more bugs because of the interpolation settings. My work around in the past has been to use a component where I can set interpolation: { escapeValue: false },

}

return (
Expand Down
Loading