Skip to content

Commit

Permalink
🌐(frontend) remove localized message with only a variable within
Browse files Browse the repository at this point in the history
In two components, we use localized message to only display the username and the
 organization name. We can remove the use of localized message for those texts.
  • Loading branch information
jbpenrath committed Apr 21, 2023
1 parent b39ea4f commit 69c9b51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import {
} from 'widgets/Dashboard/utils/dashboardRoutes';

const messages = defineMessages({
header: {
id: 'components.TeacherOrganizationDashboardSidebar.header',
description: 'Title of the organization dashboard sidebar',
defaultMessage: '{organizationName}',
},
subHeader: {
id: 'components.TeacherOrganizationDashboardSidebar.subHeader',
description: 'Sub title of the organization dashboard sidebar',
Expand Down Expand Up @@ -48,7 +43,7 @@ export const TeacherOrganizationDashboardSidebar = () => {
return (
<DashboardSidebar
menuLinks={links}
header={intl.formatMessage(messages.header, { organizationName: 'Dummy Organization' })}
header="Dummy Organization"
subHeader={intl.formatMessage(messages.subHeader)}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ import { useOrganizations } from 'hooks/useOrganizations';
import OrganizationLinks from './components/OrganizationLinks';

const messages = defineMessages({
header: {
id: 'components.TeacherProfileDashboardSidebar.header',
description: 'Title of the dashboard sidebar',
defaultMessage: '{name}',
},
subHeader: {
id: 'components.TeacherProfileDashboardSidebar.subHeader',
description: 'Sub title of the dashboard sidebar',
Expand Down Expand Up @@ -46,7 +41,7 @@ export const TeacherProfileDashboardSidebar = () => {
return (
<DashboardSidebar
menuLinks={links}
header={intl.formatMessage(messages.header, { name: user?.username })}
header={user?.username || ''}
subHeader={intl.formatMessage(messages.subHeader)}
>
{organizations.length > 0 && <OrganizationLinks organizations={organizations} />}
Expand Down

0 comments on commit 69c9b51

Please sign in to comment.