Skip to content
Snippets Groups Projects

Various smaller changes

Merged Jonas Braathen requested to merge cleanup-frontpage into master
2 files
+ 11
3
Compare changes
  • Side-by-side
  • Inline
Files
2
import React from 'react'
import React from 'react'
import { Helmet } from 'react-helmet'
import { Helmet } from 'react-helmet'
 
import { useTranslation } from 'react-i18next'
import styled from 'styled-components/macro'
import styled from 'styled-components/macro'
@@ -17,15 +18,18 @@ const StyledPageHeader = styled.h2`
@@ -17,15 +18,18 @@ const StyledPageHeader = styled.h2`
interface IPage {
interface IPage {
children: React.ReactNode
children: React.ReactNode
header: string
header?: string
}
}
export default function Page(props: IPage) {
export default function Page(props: IPage) {
const { header, children } = props
const { header, children } = props
 
const { i18n, t } = useTranslation()
 
const appTitle = t('common:header:applicationTitle')
return (
return (
<>
<>
<Helmet>
<Helmet titleTemplate={`%s - ${appTitle}`} defaultTitle={appTitle}>
 
<html lang={i18n.language} />
<title>{header}</title>
<title>{header}</title>
</Helmet>
</Helmet>
<StyledPage>
<StyledPage>
@@ -35,3 +39,7 @@ export default function Page(props: IPage) {
@@ -35,3 +39,7 @@ export default function Page(props: IPage) {
</>
</>
)
)
}
}
 
 
Page.defaultProps = {
 
header: null,
 
}
Loading