generated from DTS-STN/next-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from DTS-STN/security-page
Creating Security page.
- Loading branch information
Showing
4 changed files
with
77 additions
and
13 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import PropTypes from 'prop-types' | ||
import { Heading } from '@dts-stn/service-canada-design-system' | ||
import en from '../locales/en' | ||
import fr from '../locales/fr' | ||
|
||
export default function Home(props) { | ||
const t = props.locale === 'en' ? en : fr | ||
|
||
return ( | ||
<div id="securityContent" data-testid="securityContent-test"> | ||
<Heading id="my-dashboard-heading" title={t.pageHeading.security} /> | ||
</div> | ||
) | ||
} | ||
|
||
export async function getStaticProps({ locale }) { | ||
/* istanbul ignore next */ | ||
const langToggleLink = locale === 'en' ? '/fr/security' : '/security' | ||
|
||
const t = locale === 'en' ? en : fr | ||
|
||
const breadCrumbItems = [ | ||
{ | ||
link: t.url_dashboard, | ||
text: t.pageHeading.title, | ||
}, | ||
] | ||
|
||
/* Place-holder Meta Data Props */ | ||
const meta = { | ||
data_en: { | ||
title: 'My Service Canada Account - Security', | ||
desc: 'English', | ||
author: 'Service Canada', | ||
keywords: '', | ||
}, | ||
data_fr: { | ||
title: 'Mon dossier Service Canada - Sécurité', | ||
desc: 'Français', | ||
author: 'Service Canada', | ||
keywords: '', | ||
}, | ||
} | ||
|
||
return { | ||
props: { locale, langToggleLink, meta, breadCrumbItems }, | ||
} | ||
} | ||
|
||
Home.propTypes = { | ||
/** | ||
* current locale in the address | ||
*/ | ||
locale: PropTypes.string, | ||
|
||
/* | ||
* Language link toggle text | ||
*/ | ||
langToggleLink: PropTypes.string, | ||
|
||
/* | ||
* Meta Tags | ||
*/ | ||
|
||
meta: PropTypes.object, | ||
|
||
/* | ||
* BreadCrumb Items | ||
*/ | ||
breadCrumbItems: PropTypes.object, | ||
} |