diff --git a/pages/[username].tsx b/pages/[username].tsx index 50bec0fe..46b34e34 100644 --- a/pages/[username].tsx +++ b/pages/[username].tsx @@ -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 \ No newline at end of file +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