Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Replace react-i18next imports with next-i18next #1844

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ module.exports = {
endOfLine: 'auto',
},
],
'no-restricted-imports': ["error", {
"name": "react-i18next",
"message": "Please use next-i18next"
}]
},
}
2 changes: 1 addition & 1 deletion src/common/hooks/affiliates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions src/components/client/auth/profile/AffiliateProgramTab.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
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 {
useCancelGuaranteedDonationMutation,
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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/components/client/notifications/SubscriptionPage.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/CookieConsentPopup.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
Loading