Profile wasn't properly localizing
This commit is contained in:
parent
497c309bd1
commit
9e3ab298e8
1 changed files with 21 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
import Head from 'next/head'
|
||||
import { useRouter } from 'next/router'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
import { useCookies } from 'react-cookie'
|
||||
|
||||
import api from '~utils/api'
|
||||
|
|
@ -177,4 +178,23 @@ const ProfileRoute: React.FC = () => {
|
|||
)
|
||||
}
|
||||
|
||||
export default ProfileRoute
|
||||
export async function getStaticPaths() {
|
||||
return {
|
||||
paths: [
|
||||
// Object variant:
|
||||
{ params: { username: 'string' } },
|
||||
],
|
||||
fallback: true,
|
||||
}
|
||||
}
|
||||
|
||||
export async function getStaticProps({ locale }: { locale: string }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ['common'])),
|
||||
// Will be passed to the page component as props
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default ProfileRoute
|
||||
|
|
|
|||
Loading…
Reference in a new issue