diff --git a/package.json b/package.json index eec7db73..25e1c5b6 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "markdown": "^0.5.0", "matchmedia-polyfill": "^0.3.2", "negotiator": "^0.6.3", - "next": "^13.4.4", + "next": "^14.2.0", "next-client-cookies": "^1.1.0", "react": "^18.2.0", "react-day-picker": "^8.8.0", diff --git a/src/components/atoms/link/index.tsx b/src/components/atoms/link/index.tsx index fb11a62e..1f36e5c7 100644 --- a/src/components/atoms/link/index.tsx +++ b/src/components/atoms/link/index.tsx @@ -27,7 +27,7 @@ const Link = ({ return ( 0 ? (
{label} - {CurrencyHelpers.formatForCurrency(value, locale)} + {CurrencyHelpers.formatForCurrency(value, locale as string)}
) : ( <> @@ -42,7 +42,7 @@ const Costs = ({
{total.label} - {CurrencyHelpers.formatForCurrency(total.value, locale)} + {CurrencyHelpers.formatForCurrency(value, locale as string)}
); diff --git a/src/hooks/useCustomRouter/index.ts b/src/hooks/useCustomRouter/index.ts index 8c1bf5a3..6b406500 100644 --- a/src/hooks/useCustomRouter/index.ts +++ b/src/hooks/useCustomRouter/index.ts @@ -1,7 +1,6 @@ 'use client'; import { useCallback } from 'react'; -import type { NavigateOptions } from 'next/dist/shared/lib/app-router-context'; import { useRouter, useParams } from 'next/navigation'; import { constructLocalizedUrl } from '@/utils/links'; @@ -11,15 +10,15 @@ const useCustomRouter = () => { const { locale } = useParams(); const push = useCallback( - (href: string, { locale: localeOverride, ...options }: NavigateOptions & { locale?: string } = {}) => { - pushRoute(constructLocalizedUrl(href, localeOverride ?? locale), options); + (href: string, { locale: localeOverride, ...options }: Parameters[1] & { locale?: string } = {}) => { + pushRoute(constructLocalizedUrl(href, localeOverride ?? (locale as string)), options); }, [pushRoute, locale], ); const replace = useCallback( - (href: string, { locale: localeOverride, ...options }: NavigateOptions & { locale?: string } = {}) => { - replaceRoute(constructLocalizedUrl(href, localeOverride ?? locale), options); + (href: string, { locale: localeOverride, ...options }: Parameters[1] & { locale?: string } = {}) => { + replaceRoute(constructLocalizedUrl(href, localeOverride ?? (locale as string)), options); }, [replaceRoute, locale], ); diff --git a/src/lib/tastics/product-list/components/product-list-view-model/index.tsx b/src/lib/tastics/product-list/components/product-list-view-model/index.tsx index 885f1565..a8e08964 100644 --- a/src/lib/tastics/product-list/components/product-list-view-model/index.tsx +++ b/src/lib/tastics/product-list/components/product-list-view-model/index.tsx @@ -60,7 +60,7 @@ const ProductListViewModel = ({ ] : [ { name: translate('common.home'), link: '/' }, - ...slug.split('/').map((chunk, index, arr) => ({ + ...(slug as string[]).map((chunk, index, arr) => ({ name: chunk.replace(/[-_]/g, ' '), link: `/${arr.slice(0, index + 1).join('/')}`, })), diff --git a/src/providers/I18n/hooks/useTranslation/index.ts b/src/providers/I18n/hooks/useTranslation/index.ts index 70137ce0..bb7937cb 100644 --- a/src/providers/I18n/hooks/useTranslation/index.ts +++ b/src/providers/I18n/hooks/useTranslation/index.ts @@ -22,7 +22,7 @@ const useTranslation = () => { const [namespace, key] = [token.substring(0, firstDotIndex), token.substring(firstDotIndex + 1)]; - let message = translations[locale]?.[namespace]?.[key] ?? fallbackMessage; + let message = translations[locale as string]?.[namespace]?.[key] ?? fallbackMessage; for (const placeholder of Object.keys(values)) { message = message.replace(new RegExp(`\{${placeholder}\}`, 'g'), values[placeholder]); diff --git a/src/providers/ship-and-language/index.tsx b/src/providers/ship-and-language/index.tsx index 9a02b9ed..78f31185 100644 --- a/src/providers/ship-and-language/index.tsx +++ b/src/providers/ship-and-language/index.tsx @@ -110,7 +110,7 @@ const ShipAndLanguageProvider = ({ children }: React.PropsWithChildren) => { mutateAllCarts(); }, [locale, mutateAllCarts]); - const [selectedLocationValue, setSelectedLocationValue] = useState(locale.split('-')[1]); + const [selectedLocationValue, setSelectedLocationValue] = useState((locale as string).split('-')[1]); const selectedLocation = locations.find((location) => location.value === selectedLocationValue); const selectedLanguage = selectedLocation?.languages.find((language) => language.value === locale);