From 081a06df249129d32507d150c7d5c65577e98e5f Mon Sep 17 00:00:00 2001 From: MarekBodingerBA <104828482+MarekBodingerBA@users.noreply.github.com> Date: Wed, 22 Feb 2023 11:57:54 +0100 Subject: [PATCH] Downgrade next (#215) * Fix link in 404 * Downgrade Next to 13.0.6 https://github.com/vercel/next.js/issues/44293 --------- Co-authored-by: Marek Bodinger --- next/package.json | 2 +- next/pages/404.tsx | 8 +- next/yarn.lock | 182 ++++++++++++++++++++++----------------------- 3 files changed, 97 insertions(+), 95 deletions(-) diff --git a/next/package.json b/next/package.json index f08284d7..bab7919d 100644 --- a/next/package.json +++ b/next/package.json @@ -37,7 +37,7 @@ "many-keys-map": "^2.0.0", "mapbox-gl": "^2.12.0", "meilisearch": "^0.30.0", - "next": "^13.1.1", + "next": "13.0.6", "next-i18next": "^11.0.0", "next-query-params": "^4.1.0", "pretty-bytes": "^6.1.0", diff --git a/next/pages/404.tsx b/next/pages/404.tsx index 9b866eed..343f8827 100644 --- a/next/pages/404.tsx +++ b/next/pages/404.tsx @@ -18,9 +18,9 @@ type Error404PageProps = { } & CLNavikronosPageProps const Custom404 = ({ general }: Error404PageProps) => { - const { t } = useTranslation() + const { t, i18n } = useTranslation() - const { asPath, locale } = useRouter() + const { asPath } = useRouter() return ( @@ -31,7 +31,9 @@ const Custom404 = ({ general }: Error404PageProps) => {

{t('pageNotFoundSorry')}

- {`https://www.mestskakniznica.sk/${locale ?? ''}${asPath}`} + {`https://www.mestskakniznica.sk${ + i18n.language === 'sk' ? '' : `/${i18n.language}` + }${asPath}`}