diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-28 18:19:24 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-29 19:02:57 +0100 |
| commit | 47b854de26dea24e7838fd0804df103dee99635f (patch) | |
| tree | 28ceab6a0a127bab9024bb7e6997f9db73bd13d6 /src/pages/article | |
| parent | 67ce6cc19cbfdf9692dc785d2fc88ecee4ed500c (diff) | |
chore(i18n): replace i18n provider and helpers
Diffstat (limited to 'src/pages/article')
| -rw-r--r-- | src/pages/article/[slug].tsx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index d38ff63..ce9c22b 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -3,11 +3,14 @@ import CommentsList from '@components/CommentsList/CommentsList'; import { getLayout } from '@components/Layouts/Layout'; import PostFooter from '@components/PostFooter/PostFooter'; import PostHeader from '@components/PostHeader/PostHeader'; +import Sidebar from '@components/Sidebar/Sidebar'; +import { Sharing, ToC } from '@components/Widgets'; import { config } from '@config/website'; import { getAllPostsSlug, getPostBySlug } from '@services/graphql/queries'; +import styles from '@styles/pages/Page.module.scss'; import { NextPageWithLayout } from '@ts/types/app'; import { ArticleMeta, ArticleProps } from '@ts/types/articles'; -import { defaultLocale, loadTranslation } from '@utils/helpers/i18n'; +import { loadTranslation } from '@utils/helpers/i18n'; import { addPrismClasses, translateCopyButton } from '@utils/helpers/prism'; import { GetStaticPaths, GetStaticProps, GetStaticPropsContext } from 'next'; import Head from 'next/head'; @@ -15,9 +18,6 @@ import { useRouter } from 'next/router'; import Prism from 'prismjs'; import { ParsedUrlQuery } from 'querystring'; import { useEffect } from 'react'; -import styles from '@styles/pages/Page.module.scss'; -import { Sharing, ToC } from '@components/Widgets'; -import Sidebar from '@components/Sidebar/Sidebar'; import { Blog, BlogPosting, Graph, WebPage } from 'schema-dts'; const SingleArticle: NextPageWithLayout<ArticleProps> = ({ post }) => { @@ -163,7 +163,7 @@ export const getStaticProps: GetStaticProps = async ( context: GetStaticPropsContext ) => { const { locale } = context; - const translation = await loadTranslation(locale || defaultLocale); + const translation = await loadTranslation(locale); const { slug } = context.params as PostParams; const post = await getPostBySlug(slug); const breadcrumbTitle = post.title; @@ -171,7 +171,6 @@ export const getStaticProps: GetStaticProps = async ( return { props: { breadcrumbTitle, - locale, post, translation, }, |
