diff --git a/.eslintrc.js b/.eslintrc.js index 37b2cbf0c..c82e8eaa6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -45,5 +45,9 @@ module.exports = { endOfLine: 'auto', }, ], + 'no-restricted-imports': ["error", { + "name": "react-i18next", + "message": "Please use next-i18next" + }] }, } diff --git a/src/common/hooks/affiliates.ts b/src/common/hooks/affiliates.ts index 08e380bee..63c168f0f 100644 --- a/src/common/hooks/affiliates.ts +++ b/src/common/hooks/affiliates.ts @@ -3,7 +3,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' import { endpoints } from 'service/apiEndpoints' import { authQueryFnFactory } from 'service/restRequests' import { AlertStore } from 'stores/AlertStore' -import { useTranslation } from 'react-i18next' +import { useTranslation } from 'next-i18next' import { DonationResponse } from 'gql/donations' import { AxiosError, AxiosResponse } from 'axios' import { diff --git a/src/components/client/auth/profile/AffiliateProgramTab.tsx b/src/components/client/auth/profile/AffiliateProgramTab.tsx index cd17e400a..7164ad0aa 100644 --- a/src/components/client/auth/profile/AffiliateProgramTab.tsx +++ b/src/components/client/auth/profile/AffiliateProgramTab.tsx @@ -1,6 +1,5 @@ import { Box, Button, CircularProgress, Link, TableBody, Typography } from '@mui/material' import { styled } from '@mui/material/styles' -import { useTranslation } from 'react-i18next' import ProfileTab from './ProfileTab' import { ProfileTabs } from './tabs' import { @@ -8,7 +7,7 @@ import { useGetAffiliateData, useJoinAffiliateProgramMutation, } from 'common/hooks/affiliates' -import { TFunction } from 'next-i18next' +import { TFunction, useTranslation } from 'next-i18next' import { DataGrid, GridColDef, GridRenderCellParams } from '@mui/x-data-grid' import theme from 'common/theme' import { useMemo } from 'react' diff --git a/src/components/client/notifications/CampaignSubscribeModal.tsx b/src/components/client/notifications/CampaignSubscribeModal.tsx index 97d08efef..22f5a0947 100644 --- a/src/components/client/notifications/CampaignSubscribeModal.tsx +++ b/src/components/client/notifications/CampaignSubscribeModal.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react' import * as yup from 'yup' -import { Trans } from 'react-i18next' +import { Trans } from 'next-i18next' import { useTranslation } from 'next-i18next' import { useMutation } from '@tanstack/react-query' import { useSession } from 'next-auth/react' diff --git a/src/components/client/notifications/GeneralSubscribeModal.tsx b/src/components/client/notifications/GeneralSubscribeModal.tsx index 5f6605ca5..b2f8aa499 100644 --- a/src/components/client/notifications/GeneralSubscribeModal.tsx +++ b/src/components/client/notifications/GeneralSubscribeModal.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react' import * as yup from 'yup' -import { Trans } from 'react-i18next' +import { Trans } from 'next-i18next' import { useTranslation } from 'next-i18next' import { useMutation } from '@tanstack/react-query' import { useSession } from 'next-auth/react' diff --git a/src/components/client/notifications/SubscriptionPage.tsx b/src/components/client/notifications/SubscriptionPage.tsx index f784dbb59..5e76e1fae 100644 --- a/src/components/client/notifications/SubscriptionPage.tsx +++ b/src/components/client/notifications/SubscriptionPage.tsx @@ -1,4 +1,4 @@ -import { useTranslation, Trans } from 'react-i18next' +import { useTranslation, Trans } from 'next-i18next' import Layout from '../layout/Layout' import PodkrepiLogo from 'components/common/brand/PodkrepiLogo' import { useRouter } from 'next/router' diff --git a/src/components/common/CookieConsentPopup.tsx b/src/components/common/CookieConsentPopup.tsx index 30e3b6e94..5973fae2f 100644 --- a/src/components/common/CookieConsentPopup.tsx +++ b/src/components/common/CookieConsentPopup.tsx @@ -1,5 +1,5 @@ import CookieConsent from 'react-cookie-consent' -import { useTranslation } from 'react-i18next' +import { useTranslation } from 'next-i18next' import theme from 'common/theme'