This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(pagetitle): migrate pagetitle to typescript
- migrate to typescript - add description field to page title - add package installation for @types/react-helmet
- Loading branch information
1 parent
e065c37
commit 41c0f9c
Showing
4 changed files
with
34 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,24 @@ | ||
import Helmet from 'react-helmet' | ||
|
||
const PageTitle = ({ | ||
title, | ||
description, | ||
}: { | ||
title: string | undefined | ||
description: string | undefined | ||
}) => { | ||
const defaultTitle = 'AskGov' | ||
const defaultDescription = 'Answers from the Singapore Government' | ||
|
||
return ( | ||
<Helmet> | ||
<title>{title ? title : defaultTitle}</title> | ||
<meta | ||
name="description" | ||
content={description ? description : defaultDescription} | ||
/> | ||
</Helmet> | ||
) | ||
} | ||
|
||
export default PageTitle |