Profile wasn't properly localizing

This commit is contained in:
Justin Edmund 2022-03-05 13:54:14 -08:00
parent 497c309bd1
commit 9e3ab298e8

View file

@ -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