From 36c8ef149e14ba385975c88fe77df5edf85618c4 Mon Sep 17 00:00:00 2001 From: Caleb Cox Date: Wed, 6 Dec 2023 16:49:26 -0600 Subject: [PATCH 1/2] Move NextJS subimports to the top --- .eslintrc.js | 2 +- __tests__/util/TestRouter.tsx | 2 +- pages/404.page.tsx | 2 +- pages/500.page.tsx | 2 +- pages/_app.page.tsx | 4 ++-- pages/_document.page.tsx | 4 ++-- pages/accountLists.page.tsx | 2 +- pages/accountLists/[accountListId].page.tsx | 2 +- pages/accountLists/[accountListId]/coaching.page.tsx | 2 +- .../[accountListId]/coaching/[coachingId].page.tsx | 2 +- .../accountLists/[accountListId]/contacts/ContactsContext.tsx | 2 +- pages/accountLists/[accountListId]/contacts/ContactsPage.tsx | 2 +- .../[accountListId]/contacts/flows/setup.page.tsx | 2 +- pages/accountLists/[accountListId]/reports/coaching.page.tsx | 2 +- .../[accountListId]/reports/designationAccounts.page.tsx | 2 +- .../reports/donations/[[...contactId]].page.tsx | 4 ++-- .../[accountListId]/reports/expectedMonthlyTotal.page.tsx | 2 +- .../reports/partnerCurrency/[[...contactId]].page.tsx | 4 ++-- .../reports/partnerGivingAnalysis/[[...contactId]].page.tsx | 4 ++-- .../[accountListId]/reports/responsibilityCenters.page.tsx | 2 +- .../reports/salaryCurrency/[[...contactId]].page.tsx | 4 ++-- .../[accountListId]/settings/integrations/index.page.tsx | 2 +- pages/accountLists/[accountListId]/settings/wrapper.tsx | 2 +- .../[accountListId]/tasks/[[...contactId]].page.tsx | 4 ++-- pages/accountLists/[accountListId]/tools.page.tsx | 2 +- pages/accountLists/[accountListId]/tools/appeals.page.tsx | 2 +- .../[accountListId]/tools/appeals/[appealId].page.tsx | 2 +- .../[accountListId]/tools/fixCommitmentInfo.page.tsx | 2 +- .../[accountListId]/tools/fixEmailAddresses.page.tsx | 2 +- .../[accountListId]/tools/fixMailingAddresses.page.tsx | 2 +- .../[accountListId]/tools/fixPhoneNumbers.page.tsx | 2 +- .../[accountListId]/tools/fixSendNewsletter.page.tsx | 2 +- .../accountLists/[accountListId]/tools/mergeContacts.page.tsx | 2 +- pages/accountLists/[accountListId]/tools/mergePeople.page.tsx | 2 +- pages/login.page.tsx | 2 +- pages/logout.page.tsx | 2 +- src/components/AccountLists/AccountLists.tsx | 2 +- .../Contacts/ContactDetails/ContactDetailContext.tsx | 2 +- .../ContactFlowSetup/Header/ContactFlowSetupHeader.tsx | 2 +- src/components/Contacts/ContactsContainer.tsx | 2 +- .../Contacts/ContactsMainPanel/ContactsMainPanelHeader.tsx | 2 +- src/components/Contacts/ContactsMap/ContactsMapPanel.tsx | 2 +- src/components/Dashboard/Balance/Balance.tsx | 2 +- .../Dashboard/DonationHistories/DonationHistories.tsx | 2 +- .../Dashboard/ThisWeek/LateCommitments/LateCommitments.tsx | 2 +- src/components/Dashboard/ThisWeek/PartnerCare/PartnerCare.tsx | 2 +- src/components/Dashboard/ThisWeek/Referrals/Referrals.tsx | 2 +- .../Dashboard/ThisWeek/TasksDueThisWeek/TasksDueThisWeek.tsx | 2 +- src/components/DataDog/DataDog.tsx | 2 +- src/components/HandoffLink/HandoffLink.test.tsx | 2 +- src/components/Helpscout/HelpscoutBeacon.tsx | 2 +- src/components/Layouts/Primary/NavBar/NavBar.tsx | 4 ++-- src/components/Layouts/Primary/NavBar/NavItem/NavItem.tsx | 2 +- .../NavBar/NavTools/ProfileMenuPanel/ProfileMenuPanel.tsx | 2 +- src/components/Layouts/Primary/Primary.test.tsx | 2 +- .../Items/AddMenu/Items/CreateContact/CreateContact.tsx | 2 +- .../Layouts/Primary/TopBar/Items/NavMenu/NavMenu.tsx | 4 ++-- .../Primary/TopBar/Items/NotificationMenu/Item/Item.tsx | 2 +- .../Layouts/Primary/TopBar/Items/ProfileMenu/ProfileMenu.tsx | 2 +- .../Layouts/Primary/TopBar/Items/SearchMenu/SearchMenu.tsx | 4 ++-- src/components/Layouts/Primary/TopBar/TopBar.test.tsx | 2 +- src/components/Layouts/Primary/TopBar/TopBar.tsx | 2 +- src/components/Loading/Loading.test.tsx | 2 +- src/components/Loading/Loading.tsx | 2 +- src/components/Reports/DonationsReport/DonationsReport.tsx | 2 +- src/components/RouterGuard/RouterGuard.test.tsx | 2 +- src/components/RouterGuard/RouterGuard.tsx | 2 +- .../Settings/integrations/Organization/OrganizationService.ts | 2 +- .../Shared/Filters/SaveFilterModal/SaveFilterModal.tsx | 2 +- .../Shared/Filters/TagsSection/FilterPanelTagsSection.tsx | 2 +- .../Shared/Filters/TagsSection/FilterTagDeleteModal.tsx | 2 +- .../Shared/MultiPageLayout/MultiPageMenu/Item/Item.tsx | 2 +- src/components/Tool/Appeal/Appeal.tsx | 2 +- .../Tool/Appeal/AppealDetails/AppealDetailsHeader.tsx | 2 +- src/components/Tool/FixCommitmentInfo/Contact.tsx | 4 ++-- src/components/Tool/Home/Tool.tsx | 2 +- src/components/Tool/NavToolList/Item/Item.tsx | 2 +- 77 files changed, 88 insertions(+), 88 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index e68da9de5..3dbe1b545 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -32,7 +32,7 @@ module.exports = { 'newlines-between': 'never', pathGroups: [ { - pattern: '{next,react}', + pattern: '{next,next/**,react}', group: 'external', position: 'before', }, diff --git a/__tests__/util/TestRouter.tsx b/__tests__/util/TestRouter.tsx index 362a549a4..1aea92055 100644 --- a/__tests__/util/TestRouter.tsx +++ b/__tests__/util/TestRouter.tsx @@ -1,6 +1,6 @@ -import React, { ReactElement, ReactNode } from 'react'; import { RouterContext } from 'next/dist/shared/lib/router-context'; import Router, { Router as IRouter, NextRouter } from 'next/router'; // eslint-disable-line import/no-named-as-default +import React, { ReactElement, ReactNode } from 'react'; interface Props { children: ReactNode; diff --git a/pages/404.page.tsx b/pages/404.page.tsx index fd024e0e9..63be7981f 100644 --- a/pages/404.page.tsx +++ b/pages/404.page.tsx @@ -1,8 +1,8 @@ +import Head from 'next/head'; import React, { ReactElement } from 'react'; import DisabledByDefaultOutlinedIcon from '@mui/icons-material/DisabledByDefaultOutlined'; import { Box, Button, Typography } from '@mui/material'; import { styled } from '@mui/material/styles'; -import Head from 'next/head'; import { useTranslation } from 'react-i18next'; import useGetAppSettings from '../src/hooks/useGetAppSettings'; diff --git a/pages/500.page.tsx b/pages/500.page.tsx index 8408607a3..307482153 100644 --- a/pages/500.page.tsx +++ b/pages/500.page.tsx @@ -1,8 +1,8 @@ +import Head from 'next/head'; import React, { ReactElement } from 'react'; import DisabledByDefaultOutlinedIcon from '@mui/icons-material/DisabledByDefaultOutlined'; import { Box, Button, Typography } from '@mui/material'; import { styled } from '@mui/material/styles'; -import Head from 'next/head'; import { useTranslation } from 'react-i18next'; import useGetAppSettings from '../src/hooks/useGetAppSettings'; diff --git a/pages/_app.page.tsx b/pages/_app.page.tsx index 22e4427d4..1035c064f 100644 --- a/pages/_app.page.tsx +++ b/pages/_app.page.tsx @@ -1,4 +1,6 @@ import { NextPage } from 'next'; +import type { AppProps } from 'next/app'; +import Head from 'next/head'; import React, { ReactElement } from 'react'; import { ApolloProvider } from '@apollo/client'; import { Box } from '@mui/material'; @@ -12,7 +14,6 @@ import { ErrorBoundary, Provider } from '@rollbar/react'; import { AnimatePresence } from 'framer-motion'; import { Session } from 'next-auth'; import { SessionProvider } from 'next-auth/react'; -import Head from 'next/head'; import { SnackbarProvider } from 'notistack'; import { I18nextProvider, useTranslation } from 'react-i18next'; import Rollbar from 'rollbar'; @@ -32,7 +33,6 @@ import client from '../src/lib/client'; import i18n from '../src/lib/i18n'; import theme from '../src/theme'; import { AdapterLuxon } from './api/utils/AdapterLuxon'; -import type { AppProps } from 'next/app'; import './helpscout.css'; import './print.css'; diff --git a/pages/_document.page.tsx b/pages/_document.page.tsx index 27f349d50..8a60bb93f 100644 --- a/pages/_document.page.tsx +++ b/pages/_document.page.tsx @@ -1,5 +1,3 @@ -import React, { ReactElement } from 'react'; -import { ServerStyleSheets } from '@mui/styles'; import { RenderPageResult } from 'next/dist/shared/lib/utils'; import Document, { DocumentContext, @@ -10,6 +8,8 @@ import Document, { NextScript, } from 'next/document'; import Script from 'next/script'; +import React, { ReactElement } from 'react'; +import { ServerStyleSheets } from '@mui/styles'; import theme from '../src/theme'; class MyDocument extends Document { diff --git a/pages/accountLists.page.tsx b/pages/accountLists.page.tsx index f014e6483..209d0cec4 100644 --- a/pages/accountLists.page.tsx +++ b/pages/accountLists.page.tsx @@ -1,7 +1,7 @@ import { GetServerSideProps, GetServerSidePropsResult } from 'next'; +import Head from 'next/head'; import React, { ReactElement } from 'react'; import { getToken } from 'next-auth/jwt'; -import Head from 'next/head'; import { useTranslation } from 'react-i18next'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; import AccountLists from '../src/components/AccountLists'; diff --git a/pages/accountLists/[accountListId].page.tsx b/pages/accountLists/[accountListId].page.tsx index af1d985ad..86b356f49 100644 --- a/pages/accountLists/[accountListId].page.tsx +++ b/pages/accountLists/[accountListId].page.tsx @@ -1,7 +1,7 @@ import { GetServerSideProps } from 'next'; +import Head from 'next/head'; import React, { ReactElement, useEffect, useState } from 'react'; import { getToken } from 'next-auth/jwt'; -import Head from 'next/head'; import { renderDialog } from 'src/components/Layouts/Primary/TopBar/Items/AddMenu/AddMenu'; import { suggestArticles } from 'src/lib/helpScout'; import Dashboard from '../../src/components/Dashboard'; diff --git a/pages/accountLists/[accountListId]/coaching.page.tsx b/pages/accountLists/[accountListId]/coaching.page.tsx index f3f3ba0ce..41cc3eb07 100644 --- a/pages/accountLists/[accountListId]/coaching.page.tsx +++ b/pages/accountLists/[accountListId]/coaching.page.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import Head from 'next/head'; +import React from 'react'; import { useTranslation } from 'react-i18next'; import { CoachingList } from 'src/components/Coaching/CoachingList'; import Loading from 'src/components/Loading'; diff --git a/pages/accountLists/[accountListId]/coaching/[coachingId].page.tsx b/pages/accountLists/[accountListId]/coaching/[coachingId].page.tsx index ec2c1874c..175494d73 100644 --- a/pages/accountLists/[accountListId]/coaching/[coachingId].page.tsx +++ b/pages/accountLists/[accountListId]/coaching/[coachingId].page.tsx @@ -1,6 +1,6 @@ -import React from 'react'; import Head from 'next/head'; import { useRouter } from 'next/router'; +import React from 'react'; import { useTranslation } from 'react-i18next'; import { AccountListTypeEnum, diff --git a/pages/accountLists/[accountListId]/contacts/ContactsContext.tsx b/pages/accountLists/[accountListId]/contacts/ContactsContext.tsx index 7cef182a6..9c75130d3 100644 --- a/pages/accountLists/[accountListId]/contacts/ContactsContext.tsx +++ b/pages/accountLists/[accountListId]/contacts/ContactsContext.tsx @@ -1,3 +1,4 @@ +import { NextRouter, useRouter } from 'next/router'; import React, { Dispatch, SetStateAction, @@ -8,7 +9,6 @@ import React, { useState, } from 'react'; import _, { debounce } from 'lodash'; -import { NextRouter, useRouter } from 'next/router'; import { useGetIdsForMassSelectionQuery } from 'src/hooks/GetIdsForMassSelection.generated'; import { useLocale } from 'src/hooks/useLocale'; import { sanitizeFilters } from 'src/lib/sanitizeFilters'; diff --git a/pages/accountLists/[accountListId]/contacts/ContactsPage.tsx b/pages/accountLists/[accountListId]/contacts/ContactsPage.tsx index 7bd6a0907..e5fc0df96 100644 --- a/pages/accountLists/[accountListId]/contacts/ContactsPage.tsx +++ b/pages/accountLists/[accountListId]/contacts/ContactsPage.tsx @@ -1,6 +1,6 @@ +import { useRouter } from 'next/router'; import React, { useEffect, useMemo, useState } from 'react'; import _ from 'lodash'; -import { useRouter } from 'next/router'; import { suggestArticles } from 'src/lib/helpScout'; import { sanitizeFilters } from 'src/lib/sanitizeFilters'; import { ContactFilterSetInput } from '../../../../graphql/types.generated'; diff --git a/pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx b/pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx index ace90dd64..d4036d34a 100644 --- a/pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx +++ b/pages/accountLists/[accountListId]/contacts/flows/setup.page.tsx @@ -1,8 +1,8 @@ +import Head from 'next/head'; import React, { useCallback, useEffect, useState } from 'react'; import Box from '@mui/material/Box'; import { styled } from '@mui/material/styles'; import _ from 'lodash'; -import Head from 'next/head'; import { useSnackbar } from 'notistack'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; diff --git a/pages/accountLists/[accountListId]/reports/coaching.page.tsx b/pages/accountLists/[accountListId]/reports/coaching.page.tsx index dc031a2a6..843de3e12 100644 --- a/pages/accountLists/[accountListId]/reports/coaching.page.tsx +++ b/pages/accountLists/[accountListId]/reports/coaching.page.tsx @@ -1,5 +1,5 @@ -import React, { ReactElement, useEffect } from 'react'; import Head from 'next/head'; +import React, { ReactElement, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { AccountListTypeEnum, diff --git a/pages/accountLists/[accountListId]/reports/designationAccounts.page.tsx b/pages/accountLists/[accountListId]/reports/designationAccounts.page.tsx index aea7f6aed..a1be89205 100644 --- a/pages/accountLists/[accountListId]/reports/designationAccounts.page.tsx +++ b/pages/accountLists/[accountListId]/reports/designationAccounts.page.tsx @@ -1,7 +1,7 @@ +import Head from 'next/head'; import React, { useEffect, useState } from 'react'; import Box from '@mui/material/Box'; import { styled } from '@mui/material/styles'; -import Head from 'next/head'; import { useTranslation } from 'react-i18next'; import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout'; import Loading from 'src/components/Loading'; diff --git a/pages/accountLists/[accountListId]/reports/donations/[[...contactId]].page.tsx b/pages/accountLists/[accountListId]/reports/donations/[[...contactId]].page.tsx index 391ddead2..507c6edb8 100644 --- a/pages/accountLists/[accountListId]/reports/donations/[[...contactId]].page.tsx +++ b/pages/accountLists/[accountListId]/reports/donations/[[...contactId]].page.tsx @@ -1,8 +1,8 @@ +import Head from 'next/head'; +import { useRouter } from 'next/router'; import React, { useEffect, useState } from 'react'; import Box from '@mui/material/Box'; import { styled } from '@mui/material/styles'; -import Head from 'next/head'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel'; import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout'; diff --git a/pages/accountLists/[accountListId]/reports/expectedMonthlyTotal.page.tsx b/pages/accountLists/[accountListId]/reports/expectedMonthlyTotal.page.tsx index e4ae55973..9a4dbde20 100644 --- a/pages/accountLists/[accountListId]/reports/expectedMonthlyTotal.page.tsx +++ b/pages/accountLists/[accountListId]/reports/expectedMonthlyTotal.page.tsx @@ -1,7 +1,7 @@ +import Head from 'next/head'; import React, { ReactElement, useEffect, useState } from 'react'; import { Box } from '@mui/material'; import { styled } from '@mui/material/styles'; -import Head from 'next/head'; import { useTranslation } from 'react-i18next'; import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout'; import Loading from 'src/components/Loading'; diff --git a/pages/accountLists/[accountListId]/reports/partnerCurrency/[[...contactId]].page.tsx b/pages/accountLists/[accountListId]/reports/partnerCurrency/[[...contactId]].page.tsx index 5e11e23f9..0e443d40b 100644 --- a/pages/accountLists/[accountListId]/reports/partnerCurrency/[[...contactId]].page.tsx +++ b/pages/accountLists/[accountListId]/reports/partnerCurrency/[[...contactId]].page.tsx @@ -1,8 +1,8 @@ +import Head from 'next/head'; +import { useRouter } from 'next/router'; import React, { useEffect, useState } from 'react'; import Box from '@mui/material/Box'; import { styled } from '@mui/material/styles'; -import Head from 'next/head'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel'; import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout'; diff --git a/pages/accountLists/[accountListId]/reports/partnerGivingAnalysis/[[...contactId]].page.tsx b/pages/accountLists/[accountListId]/reports/partnerGivingAnalysis/[[...contactId]].page.tsx index 9fb436494..565c1f614 100644 --- a/pages/accountLists/[accountListId]/reports/partnerGivingAnalysis/[[...contactId]].page.tsx +++ b/pages/accountLists/[accountListId]/reports/partnerGivingAnalysis/[[...contactId]].page.tsx @@ -1,9 +1,9 @@ +import Head from 'next/head'; +import { useRouter } from 'next/router'; import React, { useEffect, useMemo, useState } from 'react'; import Box from '@mui/material/Box'; import { styled } from '@mui/material/styles'; import { sortBy } from 'lodash'; -import Head from 'next/head'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { ReportContactFilterSetInput } from 'pages/api/graphql-rest.page.generated'; import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel'; diff --git a/pages/accountLists/[accountListId]/reports/responsibilityCenters.page.tsx b/pages/accountLists/[accountListId]/reports/responsibilityCenters.page.tsx index dfd77b7a1..4ee1b9fd6 100644 --- a/pages/accountLists/[accountListId]/reports/responsibilityCenters.page.tsx +++ b/pages/accountLists/[accountListId]/reports/responsibilityCenters.page.tsx @@ -1,7 +1,7 @@ +import Head from 'next/head'; import React, { useEffect, useState } from 'react'; import Box from '@mui/material/Box'; import { styled } from '@mui/material/styles'; -import Head from 'next/head'; import { useTranslation } from 'react-i18next'; import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout'; import Loading from 'src/components/Loading'; diff --git a/pages/accountLists/[accountListId]/reports/salaryCurrency/[[...contactId]].page.tsx b/pages/accountLists/[accountListId]/reports/salaryCurrency/[[...contactId]].page.tsx index af18110f8..e017d85ae 100644 --- a/pages/accountLists/[accountListId]/reports/salaryCurrency/[[...contactId]].page.tsx +++ b/pages/accountLists/[accountListId]/reports/salaryCurrency/[[...contactId]].page.tsx @@ -1,8 +1,8 @@ +import Head from 'next/head'; +import { useRouter } from 'next/router'; import React, { useEffect, useState } from 'react'; import Box from '@mui/material/Box'; import { styled } from '@mui/material/styles'; -import Head from 'next/head'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel'; import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout'; diff --git a/pages/accountLists/[accountListId]/settings/integrations/index.page.tsx b/pages/accountLists/[accountListId]/settings/integrations/index.page.tsx index 2a4aec1e4..3cffa418c 100644 --- a/pages/accountLists/[accountListId]/settings/integrations/index.page.tsx +++ b/pages/accountLists/[accountListId]/settings/integrations/index.page.tsx @@ -1,7 +1,7 @@ import { GetServerSideProps } from 'next'; +import { useRouter } from 'next/router'; import React, { ReactElement, useEffect, useState } from 'react'; import { getToken } from 'next-auth/jwt'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { ChalklineAccordion } from 'src/components/Settings/integrations/Chalkline/ChalklineAccordion'; import { GoogleAccordion } from 'src/components/Settings/integrations/Google/GoogleAccordion'; diff --git a/pages/accountLists/[accountListId]/settings/wrapper.tsx b/pages/accountLists/[accountListId]/settings/wrapper.tsx index dc1772669..c09b86197 100644 --- a/pages/accountLists/[accountListId]/settings/wrapper.tsx +++ b/pages/accountLists/[accountListId]/settings/wrapper.tsx @@ -1,7 +1,7 @@ +import Head from 'next/head'; import React, { useState } from 'react'; import { Box, Container } from '@mui/material'; import { styled } from '@mui/material/styles'; -import Head from 'next/head'; import { SidePanelsLayout } from 'src/components/Layouts/SidePanelsLayout'; import { HeaderTypeEnum, diff --git a/pages/accountLists/[accountListId]/tasks/[[...contactId]].page.tsx b/pages/accountLists/[accountListId]/tasks/[[...contactId]].page.tsx index 00fff8f07..ced1ee9bf 100644 --- a/pages/accountLists/[accountListId]/tasks/[[...contactId]].page.tsx +++ b/pages/accountLists/[accountListId]/tasks/[[...contactId]].page.tsx @@ -1,3 +1,5 @@ +import Head from 'next/head'; +import { useRouter } from 'next/router'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import AddIcon from '@mui/icons-material/Add'; import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; @@ -5,8 +7,6 @@ import { Box, Button, ButtonGroup, Hidden } from '@mui/material'; import { styled } from '@mui/material/styles'; import debounce from 'lodash/debounce'; import { DateTime } from 'luxon'; -import Head from 'next/head'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { ContactsRightPanel } from 'src/components/Contacts/ContactsRightPanel/ContactsRightPanel'; import { navBarHeight } from 'src/components/Layouts/Primary/Primary'; diff --git a/pages/accountLists/[accountListId]/tools.page.tsx b/pages/accountLists/[accountListId]/tools.page.tsx index 93ec763cf..e1e04fd4e 100644 --- a/pages/accountLists/[accountListId]/tools.page.tsx +++ b/pages/accountLists/[accountListId]/tools.page.tsx @@ -1,5 +1,5 @@ -import React, { ReactElement } from 'react'; import Head from 'next/head'; +import React, { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import ToolHome from 'src/components/Tool/Home/Home'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; diff --git a/pages/accountLists/[accountListId]/tools/appeals.page.tsx b/pages/accountLists/[accountListId]/tools/appeals.page.tsx index 7b6859348..d6c0ff495 100644 --- a/pages/accountLists/[accountListId]/tools/appeals.page.tsx +++ b/pages/accountLists/[accountListId]/tools/appeals.page.tsx @@ -1,7 +1,7 @@ +import Head from 'next/head'; import React from 'react'; import { Box, Divider, Grid, Theme, Typography } from '@mui/material'; import { motion } from 'framer-motion'; -import Head from 'next/head'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; diff --git a/pages/accountLists/[accountListId]/tools/appeals/[appealId].page.tsx b/pages/accountLists/[accountListId]/tools/appeals/[appealId].page.tsx index d7f5b5094..2574a975c 100644 --- a/pages/accountLists/[accountListId]/tools/appeals/[appealId].page.tsx +++ b/pages/accountLists/[accountListId]/tools/appeals/[appealId].page.tsx @@ -1,6 +1,6 @@ +import Head from 'next/head'; import React, { ReactElement, useState } from 'react'; import { Box, Container, Theme } from '@mui/material'; -import Head from 'next/head'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; diff --git a/pages/accountLists/[accountListId]/tools/fixCommitmentInfo.page.tsx b/pages/accountLists/[accountListId]/tools/fixCommitmentInfo.page.tsx index 4d7fe99d9..fd74ca5c8 100644 --- a/pages/accountLists/[accountListId]/tools/fixCommitmentInfo.page.tsx +++ b/pages/accountLists/[accountListId]/tools/fixCommitmentInfo.page.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import Head from 'next/head'; +import React from 'react'; import { useTranslation } from 'react-i18next'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; import Loading from '../../../../src/components/Loading'; diff --git a/pages/accountLists/[accountListId]/tools/fixEmailAddresses.page.tsx b/pages/accountLists/[accountListId]/tools/fixEmailAddresses.page.tsx index b2853dcb6..49949debe 100644 --- a/pages/accountLists/[accountListId]/tools/fixEmailAddresses.page.tsx +++ b/pages/accountLists/[accountListId]/tools/fixEmailAddresses.page.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import Head from 'next/head'; +import React from 'react'; import { useTranslation } from 'react-i18next'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; import Loading from '../../../../src/components/Loading'; diff --git a/pages/accountLists/[accountListId]/tools/fixMailingAddresses.page.tsx b/pages/accountLists/[accountListId]/tools/fixMailingAddresses.page.tsx index c5a40fd7a..69aa05d64 100644 --- a/pages/accountLists/[accountListId]/tools/fixMailingAddresses.page.tsx +++ b/pages/accountLists/[accountListId]/tools/fixMailingAddresses.page.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import Head from 'next/head'; +import React from 'react'; import { useTranslation } from 'react-i18next'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; import Loading from '../../../../src/components/Loading'; diff --git a/pages/accountLists/[accountListId]/tools/fixPhoneNumbers.page.tsx b/pages/accountLists/[accountListId]/tools/fixPhoneNumbers.page.tsx index 8f4e3b307..d609e5829 100644 --- a/pages/accountLists/[accountListId]/tools/fixPhoneNumbers.page.tsx +++ b/pages/accountLists/[accountListId]/tools/fixPhoneNumbers.page.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import Head from 'next/head'; +import React from 'react'; import { useTranslation } from 'react-i18next'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; import Loading from '../../../../src/components/Loading'; diff --git a/pages/accountLists/[accountListId]/tools/fixSendNewsletter.page.tsx b/pages/accountLists/[accountListId]/tools/fixSendNewsletter.page.tsx index 11a072a38..a7d4e012d 100644 --- a/pages/accountLists/[accountListId]/tools/fixSendNewsletter.page.tsx +++ b/pages/accountLists/[accountListId]/tools/fixSendNewsletter.page.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import Head from 'next/head'; +import React from 'react'; import { useTranslation } from 'react-i18next'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; import Loading from '../../../../src/components/Loading'; diff --git a/pages/accountLists/[accountListId]/tools/mergeContacts.page.tsx b/pages/accountLists/[accountListId]/tools/mergeContacts.page.tsx index 47df77db1..ad0bc7c77 100644 --- a/pages/accountLists/[accountListId]/tools/mergeContacts.page.tsx +++ b/pages/accountLists/[accountListId]/tools/mergeContacts.page.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import Head from 'next/head'; +import React from 'react'; import { useTranslation } from 'react-i18next'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; import Loading from '../../../../src/components/Loading'; diff --git a/pages/accountLists/[accountListId]/tools/mergePeople.page.tsx b/pages/accountLists/[accountListId]/tools/mergePeople.page.tsx index dc4308dda..8d8ff6884 100644 --- a/pages/accountLists/[accountListId]/tools/mergePeople.page.tsx +++ b/pages/accountLists/[accountListId]/tools/mergePeople.page.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import Head from 'next/head'; +import React from 'react'; import { useTranslation } from 'react-i18next'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; import Loading from '../../../../src/components/Loading'; diff --git a/pages/login.page.tsx b/pages/login.page.tsx index 8abe5fccf..1edcab8e5 100644 --- a/pages/login.page.tsx +++ b/pages/login.page.tsx @@ -1,10 +1,10 @@ import { GetServerSideProps } from 'next'; +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 Head from 'next/head'; import BaseLayout from '../src/components/Layouts/Basic'; import Loading from '../src/components/Loading'; import Welcome from '../src/components/Welcome'; diff --git a/pages/logout.page.tsx b/pages/logout.page.tsx index d74359a45..3cc746dd0 100644 --- a/pages/logout.page.tsx +++ b/pages/logout.page.tsx @@ -1,10 +1,10 @@ import { GetServerSideProps } from 'next'; +import Head from 'next/head'; import React, { ReactElement, useEffect } from 'react'; import ExitToAppRoundedIcon from '@mui/icons-material/ExitToAppRounded'; import { Box, Typography } from '@mui/material'; import { styled } from '@mui/material/styles'; import { signOut } from 'next-auth/react'; -import Head from 'next/head'; import { useTranslation } from 'react-i18next'; import { clearDataDogUser } from 'src/hooks/useDataDog'; import useGetAppSettings from 'src/hooks/useGetAppSettings'; diff --git a/src/components/AccountLists/AccountLists.tsx b/src/components/AccountLists/AccountLists.tsx index 7a3ad16b7..7ee375c92 100644 --- a/src/components/AccountLists/AccountLists.tsx +++ b/src/components/AccountLists/AccountLists.tsx @@ -1,3 +1,4 @@ +import Link from 'next/link'; import React, { ReactElement } from 'react'; import { Box, @@ -9,7 +10,6 @@ import { Typography, } from '@mui/material'; import { motion } from 'framer-motion'; -import Link from 'next/link'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; import { useLocale } from 'src/hooks/useLocale'; diff --git a/src/components/Contacts/ContactDetails/ContactDetailContext.tsx b/src/components/Contacts/ContactDetails/ContactDetailContext.tsx index 6e5a05455..b55546c93 100644 --- a/src/components/Contacts/ContactDetails/ContactDetailContext.tsx +++ b/src/components/Contacts/ContactDetails/ContactDetailContext.tsx @@ -1,5 +1,5 @@ -import React, { useState } from 'react'; import { useRouter } from 'next/router'; +import React, { useState } from 'react'; import { TabKey } from './ContactDetails'; import { DonationTabKey } from './ContactDontationsTab/ContactDonationsTab'; diff --git a/src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx b/src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx index 78a2a9d0c..c50f4f951 100644 --- a/src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx +++ b/src/components/Contacts/ContactFlow/ContactFlowSetup/Header/ContactFlowSetupHeader.tsx @@ -1,10 +1,10 @@ +import NextLink from 'next/link'; import React, { useState } from 'react'; import Add from '@mui/icons-material/Add'; import ChevronLeft from '@mui/icons-material/ChevronLeft'; import LoadingButton from '@mui/lab/LoadingButton'; import { Box, Button } from '@mui/material'; import { styled } from '@mui/material/styles'; -import NextLink from 'next/link'; import { useTranslation } from 'react-i18next'; import { useAccountListId } from '../../../../../hooks/useAccountListId'; diff --git a/src/components/Contacts/ContactsContainer.tsx b/src/components/Contacts/ContactsContainer.tsx index 7b6b62434..889eac6db 100644 --- a/src/components/Contacts/ContactsContainer.tsx +++ b/src/components/Contacts/ContactsContainer.tsx @@ -1,8 +1,8 @@ +import Head from 'next/head'; import React, { useContext } from 'react'; import Box from '@mui/material/Box'; import { styled } from '@mui/material/styles'; import _ from 'lodash'; -import Head from 'next/head'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; import { useTranslation } from 'react-i18next'; diff --git a/src/components/Contacts/ContactsMainPanel/ContactsMainPanelHeader.tsx b/src/components/Contacts/ContactsMainPanel/ContactsMainPanelHeader.tsx index 723063c97..09ed6eac3 100644 --- a/src/components/Contacts/ContactsMainPanel/ContactsMainPanelHeader.tsx +++ b/src/components/Contacts/ContactsMainPanel/ContactsMainPanelHeader.tsx @@ -1,3 +1,4 @@ +import NextLink from 'next/link'; import React from 'react'; import FormatListBulleted from '@mui/icons-material/FormatListBulleted'; import Map from '@mui/icons-material/Map'; @@ -10,7 +11,6 @@ import ToggleButton from '@mui/material/ToggleButton'; import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; import { styled } from '@mui/material/styles'; import _ from 'lodash'; -import NextLink from 'next/link'; import { useTranslation } from 'react-i18next'; import { useContactsQuery } from 'pages/accountLists/[accountListId]/contacts/Contacts.generated'; import { diff --git a/src/components/Contacts/ContactsMap/ContactsMapPanel.tsx b/src/components/Contacts/ContactsMap/ContactsMapPanel.tsx index 8de2bd6cc..7081328fe 100644 --- a/src/components/Contacts/ContactsMap/ContactsMapPanel.tsx +++ b/src/components/Contacts/ContactsMap/ContactsMapPanel.tsx @@ -1,3 +1,4 @@ +import Image from 'next/image'; import React, { Dispatch, SetStateAction, @@ -16,7 +17,6 @@ import { Typography, } from '@mui/material'; import { styled } from '@mui/material/styles'; -import Image from 'next/image'; import { useTranslation } from 'react-i18next'; import { Coordinates } from 'pages/accountLists/[accountListId]/contacts/map/map'; import theme from 'src/theme'; diff --git a/src/components/Dashboard/Balance/Balance.tsx b/src/components/Dashboard/Balance/Balance.tsx index 16b1814b9..d7010a1da 100644 --- a/src/components/Dashboard/Balance/Balance.tsx +++ b/src/components/Dashboard/Balance/Balance.tsx @@ -1,3 +1,4 @@ +import NextLink from 'next/link'; import React, { ReactElement } from 'react'; import { Box, @@ -8,7 +9,6 @@ import { Typography, } from '@mui/material'; import Skeleton from '@mui/material/Skeleton'; -import NextLink from 'next/link'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; import { useAccountListId } from 'src/hooks/useAccountListId'; diff --git a/src/components/Dashboard/DonationHistories/DonationHistories.tsx b/src/components/Dashboard/DonationHistories/DonationHistories.tsx index 2a138dc0a..1d12e90ea 100644 --- a/src/components/Dashboard/DonationHistories/DonationHistories.tsx +++ b/src/components/Dashboard/DonationHistories/DonationHistories.tsx @@ -1,3 +1,4 @@ +import { useRouter } from 'next/router'; import React, { ReactElement } from 'react'; import { Box, @@ -9,7 +10,6 @@ import { } from '@mui/material'; import Skeleton from '@mui/material/Skeleton'; import { DateTime } from 'luxon'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { Bar, diff --git a/src/components/Dashboard/ThisWeek/LateCommitments/LateCommitments.tsx b/src/components/Dashboard/ThisWeek/LateCommitments/LateCommitments.tsx index b47c919df..8880f28f0 100644 --- a/src/components/Dashboard/ThisWeek/LateCommitments/LateCommitments.tsx +++ b/src/components/Dashboard/ThisWeek/LateCommitments/LateCommitments.tsx @@ -1,3 +1,4 @@ +import { useRouter } from 'next/router'; import React, { ReactElement } from 'react'; import { Button, @@ -12,7 +13,6 @@ import Skeleton from '@mui/material/Skeleton'; import { styled } from '@mui/material/styles'; import { motion } from 'framer-motion'; import { DateTime } from 'luxon'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { useAccountListId } from 'src/hooks/useAccountListId'; import { useLocale } from 'src/hooks/useLocale'; diff --git a/src/components/Dashboard/ThisWeek/PartnerCare/PartnerCare.tsx b/src/components/Dashboard/ThisWeek/PartnerCare/PartnerCare.tsx index 7fcc6c674..91f5cdeba 100644 --- a/src/components/Dashboard/ThisWeek/PartnerCare/PartnerCare.tsx +++ b/src/components/Dashboard/ThisWeek/PartnerCare/PartnerCare.tsx @@ -1,3 +1,4 @@ +import Link from 'next/link'; import React, { ReactElement, useState } from 'react'; import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; import Brightness1Outlined from '@mui/icons-material/Brightness1Outlined'; @@ -23,7 +24,6 @@ import { import Skeleton from '@mui/material/Skeleton'; import { styled } from '@mui/material/styles'; import { motion } from 'framer-motion'; -import Link from 'next/link'; import { useTranslation } from 'react-i18next'; import { useLocale } from 'src/hooks/useLocale'; import useTaskModal from 'src/hooks/useTaskModal'; diff --git a/src/components/Dashboard/ThisWeek/Referrals/Referrals.tsx b/src/components/Dashboard/ThisWeek/Referrals/Referrals.tsx index d83602cc3..eda3855ba 100644 --- a/src/components/Dashboard/ThisWeek/Referrals/Referrals.tsx +++ b/src/components/Dashboard/ThisWeek/Referrals/Referrals.tsx @@ -1,3 +1,4 @@ +import { useRouter } from 'next/router'; import React, { ReactElement, useState } from 'react'; import { Button, @@ -16,7 +17,6 @@ import { import Skeleton from '@mui/material/Skeleton'; import { motion } from 'framer-motion'; import { DateTime } from 'luxon'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; import { useAccountListId } from 'src/hooks/useAccountListId'; diff --git a/src/components/Dashboard/ThisWeek/TasksDueThisWeek/TasksDueThisWeek.tsx b/src/components/Dashboard/ThisWeek/TasksDueThisWeek/TasksDueThisWeek.tsx index 09720840a..0c7c2d66f 100644 --- a/src/components/Dashboard/ThisWeek/TasksDueThisWeek/TasksDueThisWeek.tsx +++ b/src/components/Dashboard/ThisWeek/TasksDueThisWeek/TasksDueThisWeek.tsx @@ -1,3 +1,4 @@ +import Link from 'next/link'; import React, { ReactElement } from 'react'; import { Box, @@ -15,7 +16,6 @@ import { import Skeleton from '@mui/material/Skeleton'; import { motion } from 'framer-motion'; import { DateTime } from 'luxon'; -import Link from 'next/link'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; import { useLoadConstantsQuery } from 'src/components/Constants/LoadConstants.generated'; diff --git a/src/components/DataDog/DataDog.tsx b/src/components/DataDog/DataDog.tsx index 5198da718..cfe31b2c9 100644 --- a/src/components/DataDog/DataDog.tsx +++ b/src/components/DataDog/DataDog.tsx @@ -1,6 +1,6 @@ +import { useRouter } from 'next/router'; import React, { useEffect } from 'react'; import { useSession } from 'next-auth/react'; -import { useRouter } from 'next/router'; import { setDataDogUser } from 'src/hooks/useDataDog'; import { useGetUserInfoQuery } from './GetUserInfo.generated'; diff --git a/src/components/HandoffLink/HandoffLink.test.tsx b/src/components/HandoffLink/HandoffLink.test.tsx index 9a9f9a7e0..ccaac6b98 100644 --- a/src/components/HandoffLink/HandoffLink.test.tsx +++ b/src/components/HandoffLink/HandoffLink.test.tsx @@ -1,7 +1,7 @@ +import * as nextRouter from 'next/router'; import React from 'react'; import { render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import * as nextRouter from 'next/router'; import { GqlMockedProvider } from '../../../__tests__/util/graphqlMocking'; import HandoffLink from '.'; diff --git a/src/components/Helpscout/HelpscoutBeacon.tsx b/src/components/Helpscout/HelpscoutBeacon.tsx index fbf859969..c8bc7ea87 100644 --- a/src/components/Helpscout/HelpscoutBeacon.tsx +++ b/src/components/Helpscout/HelpscoutBeacon.tsx @@ -1,5 +1,5 @@ -import { useEffect } from 'react'; import Script from 'next/script'; +import { useEffect } from 'react'; import { callBeacon, identifyUser, initBeacon } from 'src/lib/helpScout'; import { useUser } from '../User/useUser'; diff --git a/src/components/Layouts/Primary/NavBar/NavBar.tsx b/src/components/Layouts/Primary/NavBar/NavBar.tsx index 6c5998e1d..bd2def8b1 100644 --- a/src/components/Layouts/Primary/NavBar/NavBar.tsx +++ b/src/components/Layouts/Primary/NavBar/NavBar.tsx @@ -1,8 +1,8 @@ +import NextLink, { LinkProps } from 'next/link'; +import { useRouter } from 'next/router'; import React, { ReactElement, useEffect } from 'react'; import type { FC } from 'react'; import { Box, Drawer, Hidden, List, Theme } from '@mui/material'; -import NextLink, { LinkProps } from 'next/link'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; import { reportNavItems } from 'src/components/Shared/MultiPageLayout/MultiPageMenu/MultiPageMenuItems'; diff --git a/src/components/Layouts/Primary/NavBar/NavItem/NavItem.tsx b/src/components/Layouts/Primary/NavBar/NavItem/NavItem.tsx index 39c7544a6..7465042c8 100644 --- a/src/components/Layouts/Primary/NavBar/NavItem/NavItem.tsx +++ b/src/components/Layouts/Primary/NavBar/NavItem/NavItem.tsx @@ -1,10 +1,10 @@ +import NextLink, { LinkProps } from 'next/link'; import React, { useState } from 'react'; import type { FC, ReactNode } from 'react'; import ChevronRightIcon from '@mui/icons-material/ChevronRight'; import ExpandLessIcon from '@mui/icons-material/ExpandLess'; import { Button, Collapse, ListItemButton } from '@mui/material'; import { styled, useTheme } from '@mui/material/styles'; -import NextLink, { LinkProps } from 'next/link'; import HandoffLink from 'src/components/HandoffLink'; interface NavItemProps { diff --git a/src/components/Layouts/Primary/NavBar/NavTools/ProfileMenuPanel/ProfileMenuPanel.tsx b/src/components/Layouts/Primary/NavBar/NavTools/ProfileMenuPanel/ProfileMenuPanel.tsx index 61f8a2726..bdf7a0a76 100644 --- a/src/components/Layouts/Primary/NavBar/NavTools/ProfileMenuPanel/ProfileMenuPanel.tsx +++ b/src/components/Layouts/Primary/NavBar/NavTools/ProfileMenuPanel/ProfileMenuPanel.tsx @@ -1,10 +1,10 @@ +import { useRouter } from 'next/router'; import React, { useState } from 'react'; import ArrowBackIcon from '@mui/icons-material/ArrowBack'; import ChevronRight from '@mui/icons-material/ChevronRight'; import { Box, Button, Drawer, Link, List } from '@mui/material'; import { styled } from '@mui/material/styles'; import { signOut } from 'next-auth/react'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { clearDataDogUser } from 'src/hooks/useDataDog'; import { useAccountListId } from '../../../../../../hooks/useAccountListId'; diff --git a/src/components/Layouts/Primary/Primary.test.tsx b/src/components/Layouts/Primary/Primary.test.tsx index 50825af83..343370031 100644 --- a/src/components/Layouts/Primary/Primary.test.tsx +++ b/src/components/Layouts/Primary/Primary.test.tsx @@ -1,7 +1,7 @@ +import * as nextRouter from 'next/router'; import React from 'react'; import { ThemeProvider } from '@mui/material/styles'; import { render } from '@testing-library/react'; -import * as nextRouter from 'next/router'; import TestWrapper from '../../../../__tests__/util/TestWrapper'; import matchMediaMock from '../../../../__tests__/util/matchMediaMock'; import theme from '../../../theme'; diff --git a/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/CreateContact/CreateContact.tsx b/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/CreateContact/CreateContact.tsx index 9c45aa4c5..8c88a56ad 100644 --- a/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/CreateContact/CreateContact.tsx +++ b/src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/CreateContact/CreateContact.tsx @@ -1,3 +1,4 @@ +import { useRouter } from 'next/router'; import React, { ReactElement } from 'react'; import { CircularProgress, @@ -10,7 +11,6 @@ import { } from '@mui/material'; import { styled } from '@mui/material/styles'; import { Formik } from 'formik'; -import { useRouter } from 'next/router'; import { useSnackbar } from 'notistack'; import { useTranslation } from 'react-i18next'; import * as yup from 'yup'; diff --git a/src/components/Layouts/Primary/TopBar/Items/NavMenu/NavMenu.tsx b/src/components/Layouts/Primary/TopBar/Items/NavMenu/NavMenu.tsx index 7c75efbf3..6b80381c7 100644 --- a/src/components/Layouts/Primary/TopBar/Items/NavMenu/NavMenu.tsx +++ b/src/components/Layouts/Primary/TopBar/Items/NavMenu/NavMenu.tsx @@ -1,3 +1,5 @@ +import NextLink from 'next/link'; +import { useRouter } from 'next/router'; import React, { useMemo, useState } from 'react'; import Icon from '@mdi/react'; import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'; @@ -14,8 +16,6 @@ import { Typography, } from '@mui/material'; import clsx from 'clsx'; -import NextLink from 'next/link'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; import HandoffLink from 'src/components/HandoffLink'; diff --git a/src/components/Layouts/Primary/TopBar/Items/NotificationMenu/Item/Item.tsx b/src/components/Layouts/Primary/TopBar/Items/NotificationMenu/Item/Item.tsx index 3978e2c7e..d3c693378 100644 --- a/src/components/Layouts/Primary/TopBar/Items/NotificationMenu/Item/Item.tsx +++ b/src/components/Layouts/Primary/TopBar/Items/NotificationMenu/Item/Item.tsx @@ -1,3 +1,4 @@ +import Link from 'next/link'; import React, { ReactElement } from 'react'; import { Avatar, @@ -12,7 +13,6 @@ import { } from '@mui/material'; import Skeleton from '@mui/material/Skeleton'; import { DateTime } from 'luxon'; -import Link from 'next/link'; import { useTranslation } from 'react-i18next'; import { useLocale } from 'src/hooks/useLocale'; import { NotificationTypeTypeEnum } from '../../../../../../../../graphql/types.generated'; diff --git a/src/components/Layouts/Primary/TopBar/Items/ProfileMenu/ProfileMenu.tsx b/src/components/Layouts/Primary/TopBar/Items/ProfileMenu/ProfileMenu.tsx index 61f3c237d..4803e3fa7 100644 --- a/src/components/Layouts/Primary/TopBar/Items/ProfileMenu/ProfileMenu.tsx +++ b/src/components/Layouts/Primary/TopBar/Items/ProfileMenu/ProfileMenu.tsx @@ -1,3 +1,4 @@ +import { useRouter } from 'next/router'; import React, { ReactElement, useState } from 'react'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { @@ -17,7 +18,6 @@ import { } from '@mui/material'; import { styled } from '@mui/material/styles'; import { signOut, useSession } from 'next-auth/react'; -import { useRouter } from 'next/router'; import { useSnackbar } from 'notistack'; import { useTranslation } from 'react-i18next'; import { clearDataDogUser } from 'src/hooks/useDataDog'; diff --git a/src/components/Layouts/Primary/TopBar/Items/SearchMenu/SearchMenu.tsx b/src/components/Layouts/Primary/TopBar/Items/SearchMenu/SearchMenu.tsx index f422ddd44..dd1db3bd3 100644 --- a/src/components/Layouts/Primary/TopBar/Items/SearchMenu/SearchMenu.tsx +++ b/src/components/Layouts/Primary/TopBar/Items/SearchMenu/SearchMenu.tsx @@ -1,3 +1,5 @@ +import NextLink from 'next/link'; +import { useRouter } from 'next/router'; import React, { ReactElement, useCallback, useState } from 'react'; import AddIcon from '@mui/icons-material/Add'; import CompassIcon from '@mui/icons-material/Explore'; @@ -15,8 +17,6 @@ import { } from '@mui/material'; import { styled } from '@mui/material/styles'; import debounce from 'lodash/debounce'; -import NextLink from 'next/link'; -import { useRouter } from 'next/router'; import { useSnackbar } from 'notistack'; import { useTranslation } from 'react-i18next'; import { diff --git a/src/components/Layouts/Primary/TopBar/TopBar.test.tsx b/src/components/Layouts/Primary/TopBar/TopBar.test.tsx index c9200404b..2250397ff 100644 --- a/src/components/Layouts/Primary/TopBar/TopBar.test.tsx +++ b/src/components/Layouts/Primary/TopBar/TopBar.test.tsx @@ -1,8 +1,8 @@ +import * as nextRouter from 'next/router'; import React from 'react'; import { MockedProvider } from '@apollo/client/testing'; import { ThemeProvider } from '@mui/material/styles'; import { render } from '@testing-library/react'; -import * as nextRouter from 'next/router'; import { SnackbarProvider } from 'notistack'; import TestRouter from '../../../../../__tests__/util/TestRouter'; import theme from '../../../../theme'; diff --git a/src/components/Layouts/Primary/TopBar/TopBar.tsx b/src/components/Layouts/Primary/TopBar/TopBar.tsx index 412369542..243a702d2 100644 --- a/src/components/Layouts/Primary/TopBar/TopBar.tsx +++ b/src/components/Layouts/Primary/TopBar/TopBar.tsx @@ -1,3 +1,4 @@ +import NextLink from 'next/link'; import React, { ReactElement } from 'react'; import MenuIcon from '@mui/icons-material/Menu'; import { @@ -10,7 +11,6 @@ import { useScrollTrigger, } from '@mui/material'; import { styled } from '@mui/material/styles'; -import NextLink from 'next/link'; import AddMenu from './Items/AddMenu/AddMenu'; import NavMenu from './Items/NavMenu/NavMenu'; import NotificationMenu from './Items/NotificationMenu/NotificationMenu'; diff --git a/src/components/Loading/Loading.test.tsx b/src/components/Loading/Loading.test.tsx index 4a6441b37..f6c481a0e 100644 --- a/src/components/Loading/Loading.test.tsx +++ b/src/components/Loading/Loading.test.tsx @@ -1,6 +1,6 @@ +import { NextRouter } from 'next/router'; import React from 'react'; import { render, waitFor } from '@testing-library/react'; -import { NextRouter } from 'next/router'; import TestRouter from '../../../__tests__/util/TestRouter'; import Loading from '.'; diff --git a/src/components/Loading/Loading.tsx b/src/components/Loading/Loading.tsx index 135c95a69..e8630fc40 100644 --- a/src/components/Loading/Loading.tsx +++ b/src/components/Loading/Loading.tsx @@ -1,7 +1,7 @@ +import { useRouter } from 'next/router'; import React, { ReactElement, useEffect, useState } from 'react'; import { CircularProgress, Fab, Theme } from '@mui/material'; import { AnimatePresence, motion } from 'framer-motion'; -import { useRouter } from 'next/router'; import { makeStyles } from 'tss-react/mui'; const useStyles = makeStyles()((theme: Theme) => ({ diff --git a/src/components/Reports/DonationsReport/DonationsReport.tsx b/src/components/Reports/DonationsReport/DonationsReport.tsx index ce26e28d7..037f43bf1 100644 --- a/src/components/Reports/DonationsReport/DonationsReport.tsx +++ b/src/components/Reports/DonationsReport/DonationsReport.tsx @@ -1,7 +1,7 @@ +import { useRouter } from 'next/router'; import React, { useEffect, useState } from 'react'; import { Box, Container } from '@mui/material'; import { DateTime } from 'luxon'; -import { useRouter } from 'next/router'; import DonationHistories from 'src/components/Dashboard/DonationHistories'; import { HeaderTypeEnum, diff --git a/src/components/RouterGuard/RouterGuard.test.tsx b/src/components/RouterGuard/RouterGuard.test.tsx index 1dc8dbbaf..f056043de 100644 --- a/src/components/RouterGuard/RouterGuard.test.tsx +++ b/src/components/RouterGuard/RouterGuard.test.tsx @@ -1,7 +1,7 @@ +import * as nextRouter from 'next/router'; import { ThemeProvider } from '@mui/material/styles'; import { render, waitFor } from '@testing-library/react'; import { getSession } from 'next-auth/react'; -import * as nextRouter from 'next/router'; import { SnackbarProvider } from 'notistack'; import theme from '../../theme'; import { RouterGuard } from './RouterGuard'; diff --git a/src/components/RouterGuard/RouterGuard.tsx b/src/components/RouterGuard/RouterGuard.tsx index f15f3ec8b..59bad5953 100644 --- a/src/components/RouterGuard/RouterGuard.tsx +++ b/src/components/RouterGuard/RouterGuard.tsx @@ -1,8 +1,8 @@ +import { useRouter } from 'next/router'; import React, { useEffect, useState } from 'react'; import { Box, CircularProgress } from '@mui/material'; import { DateTime } from 'luxon'; import { getSession, signIn } from 'next-auth/react'; -import { useRouter } from 'next/router'; interface Props { children?: React.ReactElement; diff --git a/src/components/Settings/integrations/Organization/OrganizationService.ts b/src/components/Settings/integrations/Organization/OrganizationService.ts index 737d7c9b1..6be444e88 100644 --- a/src/components/Settings/integrations/Organization/OrganizationService.ts +++ b/src/components/Settings/integrations/Organization/OrganizationService.ts @@ -1,5 +1,5 @@ -import { getSession } from 'next-auth/react'; import Router from 'next/router'; +import { getSession } from 'next-auth/react'; import { getQueryParam } from 'src/utils/queryParam'; export const getOauthUrl = async ( diff --git a/src/components/Shared/Filters/SaveFilterModal/SaveFilterModal.tsx b/src/components/Shared/Filters/SaveFilterModal/SaveFilterModal.tsx index 87abd0d5c..5e801a3b4 100644 --- a/src/components/Shared/Filters/SaveFilterModal/SaveFilterModal.tsx +++ b/src/components/Shared/Filters/SaveFilterModal/SaveFilterModal.tsx @@ -1,3 +1,4 @@ +import { useRouter } from 'next/router'; import React, { useState } from 'react'; import { CircularProgress, @@ -9,7 +10,6 @@ import { Typography, } from '@mui/material'; import { Field, FieldProps, Form, Formik } from 'formik'; -import { useRouter } from 'next/router'; import { useSnackbar } from 'notistack'; import { useTranslation } from 'react-i18next'; import * as yup from 'yup'; diff --git a/src/components/Shared/Filters/TagsSection/FilterPanelTagsSection.tsx b/src/components/Shared/Filters/TagsSection/FilterPanelTagsSection.tsx index 9d3792c27..12a627e66 100644 --- a/src/components/Shared/Filters/TagsSection/FilterPanelTagsSection.tsx +++ b/src/components/Shared/Filters/TagsSection/FilterPanelTagsSection.tsx @@ -1,3 +1,4 @@ +import { useRouter } from 'next/router'; import React, { useState } from 'react'; import ExpandMore from '@mui/icons-material/ExpandMore'; import LocalOffer from '@mui/icons-material/LocalOffer'; @@ -11,7 +12,6 @@ import { Typography, } from '@mui/material'; import { styled } from '@mui/material/styles'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import theme from 'src/theme'; import { diff --git a/src/components/Shared/Filters/TagsSection/FilterTagDeleteModal.tsx b/src/components/Shared/Filters/TagsSection/FilterTagDeleteModal.tsx index 260b29f97..c5cc52801 100644 --- a/src/components/Shared/Filters/TagsSection/FilterTagDeleteModal.tsx +++ b/src/components/Shared/Filters/TagsSection/FilterTagDeleteModal.tsx @@ -1,6 +1,6 @@ +import { useRouter } from 'next/router'; import * as React from 'react'; import { DialogActions, DialogContent, Typography } from '@mui/material'; -import { useRouter } from 'next/router'; import { useSnackbar } from 'notistack'; import { useTranslation } from 'react-i18next'; import { ContactFiltersDocument } from 'pages/accountLists/[accountListId]/contacts/Contacts.generated'; diff --git a/src/components/Shared/MultiPageLayout/MultiPageMenu/Item/Item.tsx b/src/components/Shared/MultiPageLayout/MultiPageMenu/Item/Item.tsx index f5aa46b97..62bc64fb1 100644 --- a/src/components/Shared/MultiPageLayout/MultiPageMenu/Item/Item.tsx +++ b/src/components/Shared/MultiPageLayout/MultiPageMenu/Item/Item.tsx @@ -1,7 +1,7 @@ +import NextLink from 'next/link'; import React, { useMemo, useState } from 'react'; import { ArrowForwardIos } from '@mui/icons-material'; import { Collapse, ListItem, ListItemText } from '@mui/material'; -import NextLink from 'next/link'; import { useTranslation } from 'react-i18next'; import HandoffLink from 'src/components/HandoffLink'; import { useAccountListId } from 'src/hooks/useAccountListId'; diff --git a/src/components/Tool/Appeal/Appeal.tsx b/src/components/Tool/Appeal/Appeal.tsx index a63eb6b7c..4a85313be 100644 --- a/src/components/Tool/Appeal/Appeal.tsx +++ b/src/components/Tool/Appeal/Appeal.tsx @@ -1,8 +1,8 @@ +import NextLink from 'next/link'; import React, { ReactElement } from 'react'; import StarIcon from '@mui/icons-material/Star'; import StarOutlineIcon from '@mui/icons-material/StarOutline'; import { Box, CardContent, Typography } from '@mui/material'; -import NextLink from 'next/link'; import { makeStyles } from 'tss-react/mui'; import { useAccountListId } from '../../../hooks/useAccountListId'; import theme from '../../../theme'; diff --git a/src/components/Tool/Appeal/AppealDetails/AppealDetailsHeader.tsx b/src/components/Tool/Appeal/AppealDetails/AppealDetailsHeader.tsx index 647603ff8..2b7df28b2 100644 --- a/src/components/Tool/Appeal/AppealDetails/AppealDetailsHeader.tsx +++ b/src/components/Tool/Appeal/AppealDetails/AppealDetailsHeader.tsx @@ -1,11 +1,11 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import NextLink from 'next/link'; import React, { ReactElement } from 'react'; import ArrowBackIos from '@mui/icons-material/ArrowBackIos'; import List from '@mui/icons-material/List'; import TableChart from '@mui/icons-material/TableChart'; import { Box, Button, ButtonGroup, Grid, TextField } from '@mui/material'; import clsx from 'clsx'; -import NextLink from 'next/link'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; import { TestAppeal } from '../../../../../pages/accountLists/[accountListId]/tools/appeals/testAppeal'; diff --git a/src/components/Tool/FixCommitmentInfo/Contact.tsx b/src/components/Tool/FixCommitmentInfo/Contact.tsx index 3647964eb..b445379ee 100644 --- a/src/components/Tool/FixCommitmentInfo/Contact.tsx +++ b/src/components/Tool/FixCommitmentInfo/Contact.tsx @@ -1,3 +1,5 @@ +import NextLink from 'next/link'; +import { useRouter } from 'next/router'; import React, { useState } from 'react'; import SearchIcon from '@mui/icons-material/Search'; import VisibilityOffIcon from '@mui/icons-material/VisibilityOff'; @@ -12,8 +14,6 @@ import { Typography, } from '@mui/material'; import { styled } from '@mui/material/styles'; -import NextLink from 'next/link'; -import { useRouter } from 'next/router'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; import { useAccountListId } from 'src/hooks/useAccountListId'; diff --git a/src/components/Tool/Home/Tool.tsx b/src/components/Tool/Home/Tool.tsx index 261540a24..3ddb329a0 100644 --- a/src/components/Tool/Home/Tool.tsx +++ b/src/components/Tool/Home/Tool.tsx @@ -1,7 +1,7 @@ +import NextLink from 'next/link'; import React, { ReactElement } from 'react'; import Icon from '@mdi/react'; import { Box, CardActionArea, CardContent, Typography } from '@mui/material'; -import NextLink from 'next/link'; import { makeStyles } from 'tss-react/mui'; import AnimatedCard from 'src/components/AnimatedCard'; import { useAccountListId } from '../../../hooks/useAccountListId'; diff --git a/src/components/Tool/NavToolList/Item/Item.tsx b/src/components/Tool/NavToolList/Item/Item.tsx index 57d86e606..b2e69ccee 100644 --- a/src/components/Tool/NavToolList/Item/Item.tsx +++ b/src/components/Tool/NavToolList/Item/Item.tsx @@ -1,8 +1,8 @@ +import NextLink from 'next/link'; import React, { ReactElement } from 'react'; import ArrowForwardIos from '@mui/icons-material/ArrowForwardIos'; import ListItem from '@mui/material/ListItem'; import ListItemText from '@mui/material/ListItemText'; -import NextLink from 'next/link'; import { makeStyles } from 'tss-react/mui'; import { useAccountListId } from 'src/hooks/useAccountListId'; import theme from '../../../../theme'; From fd220c9c79dd9db2d2fa3db53bd1ca91650619f1 Mon Sep 17 00:00:00 2001 From: Caleb Cox Date: Wed, 6 Dec 2023 16:53:05 -0600 Subject: [PATCH 2/2] Remove usesless eslint-disable-line --- __tests__/util/TestRouter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/util/TestRouter.tsx b/__tests__/util/TestRouter.tsx index 1aea92055..5f5675bcc 100644 --- a/__tests__/util/TestRouter.tsx +++ b/__tests__/util/TestRouter.tsx @@ -1,5 +1,5 @@ import { RouterContext } from 'next/dist/shared/lib/router-context'; -import Router, { Router as IRouter, NextRouter } from 'next/router'; // eslint-disable-line import/no-named-as-default +import Router, { Router as IRouter, NextRouter } from 'next/router'; import React, { ReactElement, ReactNode } from 'react'; interface Props {