2023-01-29 16:44:02 +01:00
|
|
|
// Hooks
|
|
|
|
import { useApp } from 'site/hooks/useApp.mjs'
|
2023-01-24 21:17:49 +01:00
|
|
|
import { useTranslation } from 'next-i18next'
|
2023-01-29 16:44:02 +01:00
|
|
|
// Dependencies
|
|
|
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
|
|
|
// Components
|
|
|
|
import { PageWrapper } from 'site/components/wrappers/page.mjs'
|
|
|
|
import { BareLayout } from 'site/components/layouts/bare.mjs'
|
|
|
|
import { AuthWrapper, ns as authNs } from 'site/components/wrappers/auth/index.mjs'
|
|
|
|
import { UsernameSettings, ns as usernameNs } from 'site/components/account/username/index.mjs'
|
2023-01-24 21:17:49 +01:00
|
|
|
|
|
|
|
// Translation namespaces used on this page
|
|
|
|
const namespaces = [...usernameNs, ...authNs]
|
|
|
|
|
|
|
|
const UsernamePage = (props) => {
|
|
|
|
const app = useApp(props)
|
|
|
|
const { t } = useTranslation(namespaces)
|
|
|
|
|
|
|
|
return (
|
2023-01-29 16:44:02 +01:00
|
|
|
<PageWrapper app={app} title={t('title')} layout={BareLayout} footer={false}>
|
2023-01-24 21:17:49 +01:00
|
|
|
<AuthWrapper app={app}>
|
|
|
|
<div className="m-auto max-w-lg text-center lg:mt-12 p-8">
|
|
|
|
<UsernameSettings app={app} title welcome />
|
|
|
|
</div>
|
|
|
|
</AuthWrapper>
|
2023-01-29 16:44:02 +01:00
|
|
|
</PageWrapper>
|
2023-01-24 21:17:49 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default UsernamePage
|
|
|
|
|
|
|
|
export async function getStaticProps({ locale }) {
|
|
|
|
return {
|
|
|
|
props: {
|
2023-01-29 16:44:02 +01:00
|
|
|
...(await serverSideTranslations(locale, namespaces)),
|
2023-01-24 21:17:49 +01:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|