-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix): Wrap page header in t function (#226)
Co-authored-by: Dennis Kigen <[email protected]>
- Loading branch information
1 parent
46ce473
commit 83a1141
Showing
3 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
packages/esm-home-app/src/dashboard/home-dashboard.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 9 additions & 2 deletions
11
packages/esm-home-app/src/page-header/page-header.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import React from 'react'; | ||
import { PageHeader, HomePictogram } from '@openmrs/esm-framework'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { HomePictogram, PageHeader } from '@openmrs/esm-framework'; | ||
import styles from './page-header.scss'; | ||
|
||
interface PageHeaderProps { | ||
dashboardTitle: string; | ||
} | ||
|
||
const HomePageHeader: React.FC<PageHeaderProps> = ({ dashboardTitle }) => { | ||
return <PageHeader illustration={<HomePictogram />} title={dashboardTitle} className={styles.pageHeader} />; | ||
const { t } = useTranslation(); | ||
|
||
/** | ||
* Translation for the home page header | ||
* // t('home', 'Home') | ||
*/ | ||
return <PageHeader className={styles.pageHeader} illustration={<HomePictogram />} title={t(dashboardTitle)} />; | ||
}; | ||
|
||
export default HomePageHeader; |