Skip to content

Commit

Permalink
Merge pull request #933 from CruGlobal/i18n-import-path
Browse files Browse the repository at this point in the history
[no-Jira] Import i18n from `src/lib/i18n`
  • Loading branch information
canac authored Apr 30, 2024
2 parents 6370c51 + d247f3f commit aad2df0
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pages/login.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Head from 'next/head';
import React, { ReactElement, useEffect } from 'react';
import SubjectIcon from '@mui/icons-material/Subject';
import { Button } from '@mui/material';
import i18n from 'i18next';
import { getSession, signIn } from 'next-auth/react';
import BaseLayout from 'src/components/Layouts/Basic';
import Loading from 'src/components/Loading';
import Welcome from 'src/components/Welcome';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import { extractCookie } from 'src/lib/extractCookie';
import i18n from 'src/lib/i18n';

export interface LoginProps {
signInButtonText: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { Box, IconButton, Typography } from '@mui/material';
import { styled } from '@mui/material/styles';
import i18n from 'i18next';
import { useTranslation } from 'react-i18next';
import { PreferredContactMethodEnum } from 'src/graphql/types.generated';
import i18n from 'src/lib/i18n';
import { EditIcon } from '../StyledComponents';
import { ContactOtherFragment } from './ContactOther.generated';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TFunction } from 'i18next';
import { TFunction } from 'react-i18next';

export const validateAvatar = ({
file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import {
Typography,
} from '@mui/material';
import { styled } from '@mui/material/styles';
import { TFunction } from 'i18next';
import { useSnackbar } from 'notistack';
import { useTranslation } from 'react-i18next';
import { TFunction, useTranslation } from 'react-i18next';
import {
CancelButton,
SubmitButton,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tool/Appeal/AddAppealForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import {
} from '@mui/material';
import { styled } from '@mui/material/styles';
import { Field, Form, Formik } from 'formik';
import i18n from 'i18next';
import { useSnackbar } from 'notistack';
import { useTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
import * as yup from 'yup';
import { useContactFiltersQuery } from 'pages/accountLists/[accountListId]/contacts/Contacts.generated';
import { MultiselectFilter } from 'src/graphql/types.generated';
import i18n from 'src/lib/i18n';
import { useAccountListId } from '../../../hooks/useAccountListId';
import theme from '../../../theme';
import AnimatedCard from '../../AnimatedCard';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { mdiDelete, mdiSquareEditOutline } from '@mdi/js';
import Icon from '@mdi/react';
import { Box, IconButton } from '@mui/material';
import { DataGrid, GridSelectionModel } from '@mui/x-data-grid';
import i18n from 'i18next';
import { makeStyles } from 'tss-react/mui';
import { TestAppeal } from 'pages/accountLists/[accountListId]/tools/appeals/testAppeal';
import i18n from 'src/lib/i18n';
import theme from '../../../../theme';
import { useAppealContext } from '../AppealContextProvider/AppealContextProvider';
import AppealDetailsNoData from './AppealDetailsNoData';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { mdiDelete, mdiSquareEditOutline } from '@mdi/js';
import Icon from '@mdi/react';
import { Box, IconButton } from '@mui/material';
import { DataGrid, GridSelectionModel } from '@mui/x-data-grid';
import i18n from 'i18next';
import { makeStyles } from 'tss-react/mui';
import { TestAppeal } from 'pages/accountLists/[accountListId]/tools/appeals/testAppeal';
import i18n from 'src/lib/i18n';
import theme from '../../../../theme';
import { useAppealContext } from '../AppealContextProvider/AppealContextProvider';
import AppealDetailsNoData from './AppealDetailsNoData';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { mdiAccountPlus } from '@mdi/js';
import Icon from '@mdi/react';
import { Box, IconButton } from '@mui/material';
import { DataGrid } from '@mui/x-data-grid';
import i18n from 'i18next';
import { makeStyles } from 'tss-react/mui';
import { TestAppeal } from 'pages/accountLists/[accountListId]/tools/appeals/testAppeal';
import i18n from 'src/lib/i18n';
import theme from '../../../../theme';
import AppealDetailsNoData from './AppealDetailsNoData';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { mdiDelete, mdiSquareEditOutline } from '@mdi/js';
import Icon from '@mdi/react';
import { Box, IconButton } from '@mui/material';
import { DataGrid, GridSelectionModel } from '@mui/x-data-grid';
import i18n from 'i18next';
import { makeStyles } from 'tss-react/mui';
import { TestAppeal } from 'pages/accountLists/[accountListId]/tools/appeals/testAppeal';
import i18n from 'src/lib/i18n';
import theme from '../../../../theme';
import { useAppealContext } from '../AppealContextProvider/AppealContextProvider';
import AppealDetailsNoData from './AppealDetailsNoData';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { mdiDelete, mdiSquareEditOutline } from '@mdi/js';
import Icon from '@mdi/react';
import { Box, IconButton } from '@mui/material';
import { DataGrid, GridSelectionModel } from '@mui/x-data-grid';
import i18n from 'i18next';
import { makeStyles } from 'tss-react/mui';
import { TestAppeal } from 'pages/accountLists/[accountListId]/tools/appeals/testAppeal';
import i18n from 'src/lib/i18n';
import theme from '../../../../theme';
import { useAppealContext } from '../AppealContextProvider/AppealContextProvider';
import AppealDetailsNoData from './AppealDetailsNoData';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import i18n from 'i18next';
import i18n from 'src/lib/i18n';

export const frequencies: { [key: string]: string } = {
WEEKLY: i18n.t('Weekly'),
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tool/NoData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@mdi/js';
import Icon from '@mdi/react';
import { Typography } from '@mui/material';
import i18n from 'i18next';
import i18n from 'src/lib/i18n';
import { NullStateBox } from '../Shared/Filters/NullState/NullStateBox';

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useGetTimezones.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import i18n from 'i18next';
import i18n from 'src/lib/i18n';

export const useGetTimezones = (): Array<Record<string, string>> => {
const timezones = [
Expand Down
2 changes: 1 addition & 1 deletion src/utils/contacts/contactPartnershipStatus.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import i18n from 'i18next';
import i18n from 'src/lib/i18n';

export const contactPartnershipStatus = {
NEVER_CONTACTED: i18n.t('Never Contacted'),
Expand Down

0 comments on commit aad2df0

Please sign in to comment.