fix(org): Set title on patterns page
This commit is contained in:
parent
6ca8a2c51e
commit
018b74aa98
1 changed files with 16 additions and 9 deletions
|
@ -1,13 +1,16 @@
|
|||
// Dependencies
|
||||
import dynamic from 'next/dynamic'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { nsMerge } from 'shared/utils.mjs'
|
||||
// Hooks
|
||||
import { useTranslation } from 'next-i18next'
|
||||
// Components
|
||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||
import { ns as setsNs } from 'shared/components/account/sets.mjs'
|
||||
|
||||
// Translation namespaces used on this page
|
||||
const namespaces = [...new Set([...setsNs, ...authNs, ...pageNs])]
|
||||
const ns = nsMerge(setsNs, authNs, pageNs)
|
||||
|
||||
/*
|
||||
* Some things should never generated as SSR
|
||||
|
@ -29,20 +32,24 @@ const DynamicPatterns = dynamic(
|
|||
* when path and locale come from static props (as here)
|
||||
* or set them manually.
|
||||
*/
|
||||
const AccountSetsPage = ({ page }) => (
|
||||
<PageWrapper {...page}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicPatterns />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
const AccountSetsPage = ({ page }) => {
|
||||
const { t } = useTranslation(ns)
|
||||
|
||||
return (
|
||||
<PageWrapper {...page} title={t('patterns')}>
|
||||
<DynamicAuthWrapper>
|
||||
<DynamicPatterns />
|
||||
</DynamicAuthWrapper>
|
||||
</PageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default AccountSetsPage
|
||||
|
||||
export async function getStaticProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, namespaces)),
|
||||
...(await serverSideTranslations(locale, ns)),
|
||||
page: {
|
||||
locale,
|
||||
path: ['account', 'patterns'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue