diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index 2bcf146199..27bde56055 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -44,6 +44,7 @@ module.exports = { 'jsx-a11y/anchor-is-valid': 0, 'react/no-danger': 0, '@typescript-eslint/return-await': 0, + '@typescript-eslint/consistent-type-imports': 'error', 'tailwindcss/classnames-order': 'warn', 'tailwindcss/no-contradicting-classname': 'error', 'no-restricted-globals': [ diff --git a/packages/extension/__mocks__/reactMarkdownMock.tsx b/packages/extension/__mocks__/reactMarkdownMock.tsx index 58bcbffe1c..dedbd84a56 100644 --- a/packages/extension/__mocks__/reactMarkdownMock.tsx +++ b/packages/extension/__mocks__/reactMarkdownMock.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; const ReactMarkdown = ({ children, diff --git a/packages/extension/__tests__/setup.ts b/packages/extension/__tests__/setup.ts index ca379fbc4a..12cf7c8fdf 100644 --- a/packages/extension/__tests__/setup.ts +++ b/packages/extension/__tests__/setup.ts @@ -3,7 +3,7 @@ import 'fake-indexeddb/auto'; import { clear } from 'idb-keyval'; import nodeFetch from 'node-fetch'; import { storageWrapper as storage } from '@dailydotdev/shared/src/lib/storageWrapper'; -import { NextRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; import { structuredCloneJsonPolyfill } from '@dailydotdev/shared/src/lib/structuredClone'; process.env.NEXT_PUBLIC_API_URL = 'http://localhost:3000'; diff --git a/packages/extension/src/background/index.ts b/packages/extension/src/background/index.ts index 6779ccc974..f10fe687c7 100644 --- a/packages/extension/src/background/index.ts +++ b/packages/extension/src/background/index.ts @@ -1,4 +1,5 @@ -import browser, { Runtime, Tabs } from 'webextension-polyfill'; +import type { Runtime, Tabs } from 'webextension-polyfill'; +import browser from 'webextension-polyfill'; import { getBootData } from '@dailydotdev/shared/src/lib/boot'; import { graphqlUrl } from '@dailydotdev/shared/src/lib/config'; import { parseOrDefault } from '@dailydotdev/shared/src/lib/func'; diff --git a/packages/extension/src/companion/App.tsx b/packages/extension/src/companion/App.tsx index f2c9413305..fc68967425 100644 --- a/packages/extension/src/companion/App.tsx +++ b/packages/extension/src/companion/App.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import browser from 'webextension-polyfill'; -import { Boot, BootApp } from '@dailydotdev/shared/src/lib/boot'; +import type { Boot } from '@dailydotdev/shared/src/lib/boot'; +import { BootApp } from '@dailydotdev/shared/src/lib/boot'; import { AuthContextProvider } from '@dailydotdev/shared/src/contexts/AuthContext'; import { SettingsContextProvider } from '@dailydotdev/shared/src/contexts/SettingsContext'; import { useRefreshToken } from '@dailydotdev/shared/src/hooks/useRefreshToken'; diff --git a/packages/extension/src/companion/Companion.spec.tsx b/packages/extension/src/companion/Companion.spec.tsx index 6bee3a51f5..75f0ba532f 100644 --- a/packages/extension/src/companion/Companion.spec.tsx +++ b/packages/extension/src/companion/Companion.spec.tsx @@ -1,11 +1,7 @@ import React from 'react'; import '@testing-library/jest-dom'; -import { - fireEvent, - render, - RenderResult, - screen, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen } from '@testing-library/react'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import { UserVote } from '@dailydotdev/shared/src/graphql/posts'; import { diff --git a/packages/extension/src/companion/Companion.tsx b/packages/extension/src/companion/Companion.tsx index 14898502a2..86d164bc3f 100644 --- a/packages/extension/src/companion/Companion.tsx +++ b/packages/extension/src/companion/Companion.tsx @@ -1,19 +1,15 @@ -import React, { - ReactElement, - ReactNode, - useEffect, - useRef, - useState, - LegacyRef, - useCallback, -} from 'react'; +import type { ReactElement, ReactNode, LegacyRef } from 'react'; +import React, { useEffect, useRef, useState, useCallback } from 'react'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import classNames from 'classnames'; import Modal from 'react-modal'; import { isTesting } from '@dailydotdev/shared/src/lib/constants'; import { REQUEST_PROTOCOL_KEY } from '@dailydotdev/shared/src/graphql/common'; import '@dailydotdev/shared/src/styles/globals.css'; -import { AccessToken, PostBootData } from '@dailydotdev/shared/src/lib/boot'; +import type { + AccessToken, + PostBootData, +} from '@dailydotdev/shared/src/lib/boot'; import useLogPageView from '@dailydotdev/shared/src/hooks/log/useLogPageView'; import useDebounceFn from '@dailydotdev/shared/src/hooks/useDebounceFn'; import { usePopupSelector } from '@dailydotdev/shared/src/hooks/usePopupSelector'; diff --git a/packages/extension/src/companion/CompanionContent.tsx b/packages/extension/src/companion/CompanionContent.tsx index ac7c1f2add..ebc19ba113 100644 --- a/packages/extension/src/companion/CompanionContent.tsx +++ b/packages/extension/src/companion/CompanionContent.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useState } from 'react'; import LogoIcon from '@dailydotdev/shared/src/svg/LogoIcon'; import { CopyIcon } from '@dailydotdev/shared/src/components/icons'; import { @@ -7,7 +8,7 @@ import { } from '@dailydotdev/shared/src/components/utilities'; import '@dailydotdev/shared/src/styles/globals.css'; import SimpleTooltip from '@dailydotdev/shared/src/components/tooltips/SimpleTooltip'; -import { PostBootData } from '@dailydotdev/shared/src/lib/boot'; +import type { PostBootData } from '@dailydotdev/shared/src/lib/boot'; import { Button, ButtonColor, diff --git a/packages/extension/src/companion/CompanionContextMenu.tsx b/packages/extension/src/companion/CompanionContextMenu.tsx index 3d6d363763..ab1243bc37 100644 --- a/packages/extension/src/companion/CompanionContextMenu.tsx +++ b/packages/extension/src/companion/CompanionContextMenu.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { DiscussIcon as CommentIcon, FlagIcon, @@ -7,22 +8,19 @@ import { DownvoteIcon, } from '@dailydotdev/shared/src/components/icons'; import { Item, Menu } from '@dailydotdev/react-contexify'; -import { - ReportPostModal, - ReportedCallback, -} from '@dailydotdev/shared/src/components/modals'; -import { PostBootData } from '@dailydotdev/shared/src/lib/boot'; +import type { ReportedCallback } from '@dailydotdev/shared/src/components/modals'; +import { ReportPostModal } from '@dailydotdev/shared/src/components/modals'; +import type { PostBootData } from '@dailydotdev/shared/src/lib/boot'; import { useToastNotification } from '@dailydotdev/shared/src/hooks/useToastNotification'; import { feedback } from '@dailydotdev/shared/src/lib/constants'; -import { - PromptOptions, - usePrompt, -} from '@dailydotdev/shared/src/hooks/usePrompt'; +import type { PromptOptions } from '@dailydotdev/shared/src/hooks/usePrompt'; +import { usePrompt } from '@dailydotdev/shared/src/hooks/usePrompt'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; import classNames from 'classnames'; import { Origin } from '@dailydotdev/shared/src/lib/log'; import { labels } from '@dailydotdev/shared/src/lib'; -import { Post, UserVote } from '@dailydotdev/shared/src/graphql/posts'; +import type { Post } from '@dailydotdev/shared/src/graphql/posts'; +import { UserVote } from '@dailydotdev/shared/src/graphql/posts'; import { getCompanionWrapper } from '@dailydotdev/shared/src/lib/extension'; interface CompanionContextMenuProps { diff --git a/packages/extension/src/companion/CompanionDiscussion.tsx b/packages/extension/src/companion/CompanionDiscussion.tsx index e4bc08fd77..b43c5d5730 100644 --- a/packages/extension/src/companion/CompanionDiscussion.tsx +++ b/packages/extension/src/companion/CompanionDiscussion.tsx @@ -1,6 +1,7 @@ -import React, { CSSProperties, ReactElement } from 'react'; +import type { CSSProperties, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { PostBootData } from '@dailydotdev/shared/src/lib/boot'; +import type { PostBootData } from '@dailydotdev/shared/src/lib/boot'; import { NewComment } from '@dailydotdev/shared/src/components/post/NewComment'; import { PostComments } from '@dailydotdev/shared/src/components/post/PostComments'; import { Origin } from '@dailydotdev/shared/src/lib/log'; diff --git a/packages/extension/src/companion/CompanionEngagements.tsx b/packages/extension/src/companion/CompanionEngagements.tsx index 790d125335..abb6f65e03 100644 --- a/packages/extension/src/companion/CompanionEngagements.tsx +++ b/packages/extension/src/companion/CompanionEngagements.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { PostBootData } from '@dailydotdev/shared/src/lib/boot'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { PostBootData } from '@dailydotdev/shared/src/lib/boot'; import { ClickableText } from '@dailydotdev/shared/src/components/buttons/ClickableText'; import { useQueryClient } from '@tanstack/react-query'; import { useRawBackgroundRequest } from '@dailydotdev/shared/src/hooks/companion'; diff --git a/packages/extension/src/companion/CompanionMenu.tsx b/packages/extension/src/companion/CompanionMenu.tsx index 6c499ac3dd..2b6da5bc48 100644 --- a/packages/extension/src/companion/CompanionMenu.tsx +++ b/packages/extension/src/companion/CompanionMenu.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect } from 'react'; import { Button, ButtonColor, @@ -15,7 +16,7 @@ import SimpleTooltip from '@dailydotdev/shared/src/components/tooltips/SimpleToo import Modal from 'react-modal'; import { useContextMenu } from '@dailydotdev/react-contexify'; import { isTesting } from '@dailydotdev/shared/src/lib/constants'; -import { PostBootData } from '@dailydotdev/shared/src/lib/boot'; +import type { PostBootData } from '@dailydotdev/shared/src/lib/boot'; import { LogEvent, Origin } from '@dailydotdev/shared/src/lib/log'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import usePersistentContext from '@dailydotdev/shared/src/hooks/usePersistentContext'; @@ -27,12 +28,11 @@ import { LazyModal } from '@dailydotdev/shared/src/components/modals/common/type import { useLazyModal } from '@dailydotdev/shared/src/hooks/useLazyModal'; import { UserVote } from '@dailydotdev/shared/src/graphql/posts'; import { useVotePost } from '@dailydotdev/shared/src/hooks'; -import UpvotedPopupModal, { - UpvotedPopupModalProps, -} from '@dailydotdev/shared/src/components/modals/UpvotedPopupModal'; +import type { UpvotedPopupModalProps } from '@dailydotdev/shared/src/components/modals/UpvotedPopupModal'; +import UpvotedPopupModal from '@dailydotdev/shared/src/components/modals/UpvotedPopupModal'; import { getCompanionWrapper } from '@dailydotdev/shared/src/lib/extension'; import ShareModal from '@dailydotdev/shared/src/components/modals/ShareModal'; -import { ShareProps } from '@dailydotdev/shared/src/components/modals/post/common'; +import type { ShareProps } from '@dailydotdev/shared/src/components/modals/post/common'; import CompanionContextMenu from './CompanionContextMenu'; import '@dailydotdev/shared/src/styles/globals.css'; import useCompanionActions from './useCompanionActions'; diff --git a/packages/extension/src/companion/CompanionPermission.spec.tsx b/packages/extension/src/companion/CompanionPermission.spec.tsx index 28e909e711..51afacea44 100644 --- a/packages/extension/src/companion/CompanionPermission.spec.tsx +++ b/packages/extension/src/companion/CompanionPermission.spec.tsx @@ -1,7 +1,8 @@ import React from 'react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import '@testing-library/jest-dom'; -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import { companionExplainerVideo } from '@dailydotdev/shared/src/lib/constants'; import { ExtensionContext } from '@dailydotdev/shared/src/contexts/ExtensionContext'; import { contentScriptKey } from '@dailydotdev/shared/src/hooks'; diff --git a/packages/extension/src/companion/CompanionPermission.tsx b/packages/extension/src/companion/CompanionPermission.tsx index 79a30f7649..55c4a98c4c 100644 --- a/packages/extension/src/companion/CompanionPermission.tsx +++ b/packages/extension/src/companion/CompanionPermission.tsx @@ -5,7 +5,8 @@ import { } from '@dailydotdev/shared/src/components/buttons/Button'; import classed from '@dailydotdev/shared/src/lib/classed'; import { companionExplainerVideo } from '@dailydotdev/shared/src/lib/constants'; -import React, { forwardRef, ReactElement, Ref } from 'react'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; import { PlayIcon } from '@dailydotdev/shared/src/components/icons'; import { ClickableText } from '@dailydotdev/shared/src/components/buttons/ClickableText'; import { useExtensionContext } from '@dailydotdev/shared/src/contexts/ExtensionContext'; diff --git a/packages/extension/src/companion/CompanionPopupButton.tsx b/packages/extension/src/companion/CompanionPopupButton.tsx index 16273db6a0..6bd2e03b86 100644 --- a/packages/extension/src/companion/CompanionPopupButton.tsx +++ b/packages/extension/src/companion/CompanionPopupButton.tsx @@ -1,4 +1,5 @@ -import React, { useState, ReactElement, useContext, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState, useContext, useEffect } from 'react'; import { Button, ButtonVariant, diff --git a/packages/extension/src/companion/CompanionToggle.tsx b/packages/extension/src/companion/CompanionToggle.tsx index ee85f13b74..146926836d 100644 --- a/packages/extension/src/companion/CompanionToggle.tsx +++ b/packages/extension/src/companion/CompanionToggle.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Button, ButtonVariant, @@ -7,7 +8,7 @@ import { ArrowIcon } from '@dailydotdev/shared/src/components/icons'; import { SimpleTooltip } from '@dailydotdev/shared/src/components/tooltips/SimpleTooltip'; import LogoIcon from '@dailydotdev/shared/src/svg/LogoIcon'; import classNames from 'classnames'; -import { BaseTooltipContainerProps } from '@dailydotdev/shared/src/components/tooltips/BaseTooltipContainer'; +import type { BaseTooltipContainerProps } from '@dailydotdev/shared/src/components/tooltips/BaseTooltipContainer'; import AlertPointer, { AlertPlacement, } from '@dailydotdev/shared/src/components/alert/AlertPointer'; diff --git a/packages/extension/src/companion/index.tsx b/packages/extension/src/companion/index.tsx index 150473cd2f..9e1dd2875f 100644 --- a/packages/extension/src/companion/index.tsx +++ b/packages/extension/src/companion/index.tsx @@ -7,7 +7,8 @@ import { } from '@dailydotdev/shared/src/contexts/SettingsContext'; import { setOnError } from '@dailydotdev/shared/src/components/ProfilePicture'; import { getCompanionWrapper } from '@dailydotdev/shared/src/lib/extension'; -import App, { CompanionData } from './App'; +import type { CompanionData } from './App'; +import App from './App'; let root: ReturnType; diff --git a/packages/extension/src/companion/useBackgroundPaginatedRequest.ts b/packages/extension/src/companion/useBackgroundPaginatedRequest.ts index a0a62fd0ac..140c3a307e 100644 --- a/packages/extension/src/companion/useBackgroundPaginatedRequest.ts +++ b/packages/extension/src/companion/useBackgroundPaginatedRequest.ts @@ -1,4 +1,5 @@ -import { QueryKey, useQueryClient, InfiniteData } from '@tanstack/react-query'; +import type { QueryKey, InfiniteData } from '@tanstack/react-query'; +import { useQueryClient } from '@tanstack/react-query'; import { useBackgroundRequest } from '@dailydotdev/shared/src/hooks/companion'; export const useBackgroundPaginatedRequest = >( diff --git a/packages/extension/src/companion/useCompanionActions.ts b/packages/extension/src/companion/useCompanionActions.ts index 512c7437ab..c28630e4f8 100644 --- a/packages/extension/src/companion/useCompanionActions.ts +++ b/packages/extension/src/companion/useCompanionActions.ts @@ -8,7 +8,7 @@ import { import { ADD_FILTERS_TO_FEED_MUTATION } from '@dailydotdev/shared/src/graphql/feedSettings'; import { UPDATE_ALERTS } from '@dailydotdev/shared/src/graphql/alerts'; import { UPDATE_USER_SETTINGS_MUTATION } from '@dailydotdev/shared/src/graphql/settings'; -import { MutateFunc } from '@dailydotdev/shared/src/lib/query'; +import type { MutateFunc } from '@dailydotdev/shared/src/lib/query'; import { ExtensionMessageType } from '@dailydotdev/shared/src/lib/extension'; import { companionRequest } from './companionRequest'; diff --git a/packages/extension/src/contexts/ExtensionContext.tsx b/packages/extension/src/contexts/ExtensionContext.tsx index 00aa510469..01154d6eb2 100644 --- a/packages/extension/src/contexts/ExtensionContext.tsx +++ b/packages/extension/src/contexts/ExtensionContext.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode, useContext, useMemo } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useMemo } from 'react'; import browser from 'webextension-polyfill'; import { useQueryClient } from '@tanstack/react-query'; diff --git a/packages/extension/src/lib/CustomRouter.ts b/packages/extension/src/lib/CustomRouter.ts index 5115a0cfe7..19c1a56b94 100644 --- a/packages/extension/src/lib/CustomRouter.ts +++ b/packages/extension/src/lib/CustomRouter.ts @@ -1,8 +1,8 @@ /* eslint-disable class-methods-use-this */ -import { NextRouter } from 'next/router'; -import { UrlObject } from 'url'; -import { MittEmitter } from 'next/dist/shared/lib/mitt'; -import { RouterEvent } from 'next/dist/client/router'; +import type { NextRouter } from 'next/router'; +import type { UrlObject } from 'url'; +import type { MittEmitter } from 'next/dist/shared/lib/mitt'; +import type { RouterEvent } from 'next/dist/client/router'; declare type Url = UrlObject | string; diff --git a/packages/extension/src/lib/extensionScripts.ts b/packages/extension/src/lib/extensionScripts.ts index 737674c79d..809eccb9bb 100644 --- a/packages/extension/src/lib/extensionScripts.ts +++ b/packages/extension/src/lib/extensionScripts.ts @@ -5,8 +5,8 @@ import { isProduction, } from '@dailydotdev/shared/src/lib/constants'; import { LogEvent as LogEventName } from '@dailydotdev/shared/src/lib/log'; -import { QueryClient } from '@tanstack/react-query'; -import { LogEvent } from '@dailydotdev/shared/src/hooks/log/useLogQueue'; +import type { QueryClient } from '@tanstack/react-query'; +import type { LogEvent } from '@dailydotdev/shared/src/hooks/log/useLogQueue'; export type RequestContentScripts = (data: { origin: string; diff --git a/packages/extension/src/newtab/App.tsx b/packages/extension/src/newtab/App.tsx index 549eeee3c8..5e89c6ba21 100644 --- a/packages/extension/src/newtab/App.tsx +++ b/packages/extension/src/newtab/App.tsx @@ -1,10 +1,5 @@ -import React, { - ReactElement, - useCallback, - useContext, - useEffect, - useState, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useContext, useEffect, useState } from 'react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import dynamic from 'next/dynamic'; import Modal from 'react-modal'; @@ -15,7 +10,7 @@ import AuthContext, { } from '@dailydotdev/shared/src/contexts/AuthContext'; import { SubscriptionContextProvider } from '@dailydotdev/shared/src/contexts/SubscriptionContext'; import browser from 'webextension-polyfill'; -import { BootDataProviderProps } from '@dailydotdev/shared/src/contexts/BootProvider'; +import type { BootDataProviderProps } from '@dailydotdev/shared/src/contexts/BootProvider'; import { RouterContext } from 'next/dist/shared/lib/router-context.shared-runtime'; import useLogPageView from '@dailydotdev/shared/src/hooks/log/useLogPageView'; import useDeviceId from '@dailydotdev/shared/src/hooks/log/useDeviceId'; diff --git a/packages/extension/src/newtab/CardSelection.tsx b/packages/extension/src/newtab/CardSelection.tsx index 72e7d0ad9e..04b52511e5 100644 --- a/packages/extension/src/newtab/CardSelection.tsx +++ b/packages/extension/src/newtab/CardSelection.tsx @@ -1,6 +1,7 @@ import classNames from 'classnames'; import { VIcon } from '@dailydotdev/shared/src/components/icons'; -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; interface CardSelectionProps { title: string; diff --git a/packages/extension/src/newtab/CustomLinks.tsx b/packages/extension/src/newtab/CustomLinks.tsx index 36764986d7..e280bba87d 100644 --- a/packages/extension/src/newtab/CustomLinks.tsx +++ b/packages/extension/src/newtab/CustomLinks.tsx @@ -6,8 +6,9 @@ import { import SimpleTooltip from '@dailydotdev/shared/src/components/tooltips/SimpleTooltip'; import { MenuIcon } from '@dailydotdev/shared/src/components/icons'; import classNames from 'classnames'; -import React, { MouseEventHandler, ReactElement } from 'react'; -import { WithClassNameProps } from '@dailydotdev/shared/src/components/utilities'; +import type { MouseEventHandler, ReactElement } from 'react'; +import React from 'react'; +import type { WithClassNameProps } from '@dailydotdev/shared/src/components/utilities'; import { combinedClicks } from '@dailydotdev/shared/src/lib/click'; import { useFeedLayout } from '@dailydotdev/shared/src/hooks'; import { apiUrl } from '@dailydotdev/shared/src/lib/config'; diff --git a/packages/extension/src/newtab/DndBanner.tsx b/packages/extension/src/newtab/DndBanner.tsx index 38a9570086..12135fc0b1 100644 --- a/packages/extension/src/newtab/DndBanner.tsx +++ b/packages/extension/src/newtab/DndBanner.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Button, ButtonSize, diff --git a/packages/extension/src/newtab/DndModal.tsx b/packages/extension/src/newtab/DndModal.tsx index 4f4aa29465..dbabe79169 100644 --- a/packages/extension/src/newtab/DndModal.tsx +++ b/packages/extension/src/newtab/DndModal.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { format } from 'date-fns'; import { Radio } from '@dailydotdev/shared/src/components/fields/Radio'; import { @@ -7,13 +8,12 @@ import { } from '@dailydotdev/shared/src/components/buttons/Button'; import { Dropdown } from '@dailydotdev/shared/src/components/fields/Dropdown'; import { TextField } from '@dailydotdev/shared/src/components/fields/TextField'; -import { - Modal, - ModalProps, -} from '@dailydotdev/shared/src/components/modals/common/Modal'; +import type { ModalProps } from '@dailydotdev/shared/src/components/modals/common/Modal'; +import { Modal } from '@dailydotdev/shared/src/components/modals/common/Modal'; import { Justify } from '@dailydotdev/shared/src/components/utilities'; import { useDndContext } from '@dailydotdev/shared/src/contexts/DndContext'; -import { getDefaultLink, dndOption, CustomTime, TimeFormat } from './dnd'; +import type { TimeFormat } from './dnd'; +import { getDefaultLink, dndOption, CustomTime } from './dnd'; const timeFormatOptions = Object.entries(dndOption).map(([k, v]) => ({ label: v.label, diff --git a/packages/extension/src/newtab/LinksForm.tsx b/packages/extension/src/newtab/LinksForm.tsx index 74d2288efe..9a5b9768e8 100644 --- a/packages/extension/src/newtab/LinksForm.tsx +++ b/packages/extension/src/newtab/LinksForm.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { TextField } from '@dailydotdev/shared/src/components/fields/TextField'; const limit = 8; diff --git a/packages/extension/src/newtab/MainFeedPage.tsx b/packages/extension/src/newtab/MainFeedPage.tsx index aa013f08f2..9108fe5971 100644 --- a/packages/extension/src/newtab/MainFeedPage.tsx +++ b/packages/extension/src/newtab/MainFeedPage.tsx @@ -1,10 +1,5 @@ -import React, { - ReactElement, - useCallback, - useContext, - useMemo, - useState, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useContext, useMemo, useState } from 'react'; import MainLayout from '@dailydotdev/shared/src/components/MainLayout'; import MainFeedLayout from '@dailydotdev/shared/src/components/MainFeedLayout'; import ScrollToTopButton from '@dailydotdev/shared/src/components/ScrollToTopButton'; diff --git a/packages/extension/src/newtab/MostVisitedSitesModal.tsx b/packages/extension/src/newtab/MostVisitedSitesModal.tsx index 7d9592a8a6..e32463a221 100644 --- a/packages/extension/src/newtab/MostVisitedSitesModal.tsx +++ b/packages/extension/src/newtab/MostVisitedSitesModal.tsx @@ -1,13 +1,12 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { LazyImage } from '@dailydotdev/shared/src/components/LazyImage'; import { Button, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; -import { - Modal, - ModalProps, -} from '@dailydotdev/shared/src/components/modals/common/Modal'; +import type { ModalProps } from '@dailydotdev/shared/src/components/modals/common/Modal'; +import { Modal } from '@dailydotdev/shared/src/components/modals/common/Modal'; import { Justify } from '@dailydotdev/shared/src/components/utilities'; interface MostVisitedSitesModalProps extends ModalProps { diff --git a/packages/extension/src/newtab/ShortcutLinks/ShortcutGetStarted.tsx b/packages/extension/src/newtab/ShortcutLinks/ShortcutGetStarted.tsx index a2e7345dbe..1bd59277b9 100644 --- a/packages/extension/src/newtab/ShortcutLinks/ShortcutGetStarted.tsx +++ b/packages/extension/src/newtab/ShortcutLinks/ShortcutGetStarted.tsx @@ -11,7 +11,8 @@ import { ButtonSize, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; -import React, { PropsWithChildren, ReactElement } from 'react'; +import type { PropsWithChildren, ReactElement } from 'react'; +import React from 'react'; import { useThemedAsset } from '@dailydotdev/shared/src/hooks/utils'; import { useActions } from '@dailydotdev/shared/src/hooks'; diff --git a/packages/extension/src/newtab/ShortcutLinks/ShortcutLinks.spec.tsx b/packages/extension/src/newtab/ShortcutLinks/ShortcutLinks.spec.tsx index 21bdbf9ae1..f5b6011985 100644 --- a/packages/extension/src/newtab/ShortcutLinks/ShortcutLinks.spec.tsx +++ b/packages/extension/src/newtab/ShortcutLinks/ShortcutLinks.spec.tsx @@ -1,11 +1,11 @@ import React from 'react'; import nock from 'nock'; import { BootDataProvider } from '@dailydotdev/shared/src/contexts/BootProvider'; +import type { RenderResult } from '@testing-library/react'; import { act, fireEvent, render, - RenderResult, screen, waitFor, } from '@testing-library/react'; @@ -13,18 +13,13 @@ import { mocked } from 'ts-jest/utils'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; -import { - Boot, - BootApp, - BootCacheData, - getBootData, -} from '@dailydotdev/shared/src/lib/boot'; -import { - RemoteSettings, - UPDATE_USER_SETTINGS_MUTATION, -} from '@dailydotdev/shared/src/graphql/settings'; -import { Alerts } from '@dailydotdev/shared/src/graphql/alerts'; -import browser, { TopSites } from 'webextension-polyfill'; +import type { Boot, BootCacheData } from '@dailydotdev/shared/src/lib/boot'; +import { BootApp, getBootData } from '@dailydotdev/shared/src/lib/boot'; +import type { RemoteSettings } from '@dailydotdev/shared/src/graphql/settings'; +import { UPDATE_USER_SETTINGS_MUTATION } from '@dailydotdev/shared/src/graphql/settings'; +import type { Alerts } from '@dailydotdev/shared/src/graphql/alerts'; +import type { TopSites } from 'webextension-polyfill'; +import browser from 'webextension-polyfill'; import LogContext from '@dailydotdev/shared/src/contexts/LogContext'; import { LogEvent, diff --git a/packages/extension/src/newtab/ShortcutLinks/ShortcutLinks.tsx b/packages/extension/src/newtab/ShortcutLinks/ShortcutLinks.tsx index b86cac5b90..20e59a6a72 100644 --- a/packages/extension/src/newtab/ShortcutLinks/ShortcutLinks.tsx +++ b/packages/extension/src/newtab/ShortcutLinks/ShortcutLinks.tsx @@ -1,11 +1,5 @@ -import React, { - FormEvent, - ReactElement, - useContext, - useEffect, - useRef, - useState, -} from 'react'; +import type { FormEvent, ReactElement } from 'react'; +import React, { useContext, useEffect, useRef, useState } from 'react'; import { useSettingsContext } from '@dailydotdev/shared/src/contexts/SettingsContext'; import LogContext from '@dailydotdev/shared/src/contexts/LogContext'; diff --git a/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksItem.tsx b/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksItem.tsx index 3f070b0aca..49c4053582 100644 --- a/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksItem.tsx +++ b/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksItem.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { PlusIcon } from '@dailydotdev/shared/src/components/icons'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; diff --git a/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksList.tsx b/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksList.tsx index 211701760f..5df4731c0a 100644 --- a/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksList.tsx +++ b/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksList.tsx @@ -1,4 +1,5 @@ -import React, { MouseEventHandler, ReactElement } from 'react'; +import type { MouseEventHandler, ReactElement } from 'react'; +import React from 'react'; import { ClearIcon, MenuIcon } from '@dailydotdev/shared/src/components/icons'; import { Button, diff --git a/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksModal.tsx b/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksModal.tsx index 22e463d0bc..109891015b 100644 --- a/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksModal.tsx +++ b/packages/extension/src/newtab/ShortcutLinks/ShortcutLinksModal.tsx @@ -1,14 +1,13 @@ -import React, { FormEventHandler, MutableRefObject, ReactElement } from 'react'; +import type { FormEventHandler, MutableRefObject, ReactElement } from 'react'; +import React from 'react'; import { Button, ButtonColor, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; import { UserIcon, SitesIcon } from '@dailydotdev/shared/src/components/icons'; -import { - Modal, - ModalProps, -} from '@dailydotdev/shared/src/components/modals/common/Modal'; +import type { ModalProps } from '@dailydotdev/shared/src/components/modals/common/Modal'; +import { Modal } from '@dailydotdev/shared/src/components/modals/common/Modal'; import { Justify } from '@dailydotdev/shared/src/components/utilities'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; import { CardSelection } from '../CardSelection'; diff --git a/packages/extension/src/newtab/ShortcutLinks/ShortcutOptionsMenu.tsx b/packages/extension/src/newtab/ShortcutLinks/ShortcutOptionsMenu.tsx index 04b617fced..54f91d679a 100644 --- a/packages/extension/src/newtab/ShortcutLinks/ShortcutOptionsMenu.tsx +++ b/packages/extension/src/newtab/ShortcutLinks/ShortcutOptionsMenu.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import dynamic from 'next/dynamic'; import { EyeIcon, diff --git a/packages/extension/src/newtab/ShortcutLinks/useShortcutLinks.tsx b/packages/extension/src/newtab/ShortcutLinks/useShortcutLinks.tsx index d981f8a25a..4461fb3f31 100644 --- a/packages/extension/src/newtab/ShortcutLinks/useShortcutLinks.tsx +++ b/packages/extension/src/newtab/ShortcutLinks/useShortcutLinks.tsx @@ -1,13 +1,6 @@ import { useSettingsContext } from '@dailydotdev/shared/src/contexts/SettingsContext'; -import { - Dispatch, - FormEvent, - MutableRefObject, - useContext, - useEffect, - useRef, - useState, -} from 'react'; +import type { Dispatch, FormEvent, MutableRefObject } from 'react'; +import { useContext, useEffect, useRef, useState } from 'react'; import LogContext from '@dailydotdev/shared/src/contexts/LogContext'; import { LogEvent, diff --git a/packages/extension/src/newtab/index.tsx b/packages/extension/src/newtab/index.tsx index 2234f84944..176eb6ed93 100644 --- a/packages/extension/src/newtab/index.tsx +++ b/packages/extension/src/newtab/index.tsx @@ -2,14 +2,14 @@ import React from 'react'; import { createRoot } from 'react-dom/client'; import '@dailydotdev/shared/src/styles/globals.css'; import { getLocalBootData } from '@dailydotdev/shared/src/contexts/BootProvider'; -import { BootCacheData } from '@dailydotdev/shared/src/lib/boot'; +import type { BootCacheData } from '@dailydotdev/shared/src/lib/boot'; import { applyTheme, themeModes, } from '@dailydotdev/shared/src/contexts/SettingsContext'; import { get as getCache } from 'idb-keyval'; import browser from 'webextension-polyfill'; -import { DndSettings } from '@dailydotdev/shared/src/contexts/DndContext'; +import type { DndSettings } from '@dailydotdev/shared/src/contexts/DndContext'; import App from './App'; declare global { diff --git a/packages/extension/src/newtab/useTopSites.tsx b/packages/extension/src/newtab/useTopSites.tsx index 64ad32e3ec..64f7f9d1d1 100644 --- a/packages/extension/src/newtab/useTopSites.tsx +++ b/packages/extension/src/newtab/useTopSites.tsx @@ -1,4 +1,5 @@ -import browser, { TopSites } from 'webextension-polyfill'; +import type { TopSites } from 'webextension-polyfill'; +import browser from 'webextension-polyfill'; import { useEffect, useMemo, useState } from 'react'; type TopSite = TopSites.MostVisitedURL; diff --git a/packages/extension/src/permission/FirefoxPermission.tsx b/packages/extension/src/permission/FirefoxPermission.tsx index bdfac5ae9d..61d8cbc305 100644 --- a/packages/extension/src/permission/FirefoxPermission.tsx +++ b/packages/extension/src/permission/FirefoxPermission.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import DailyDevLogo from '@dailydotdev/shared/src/components/Logo'; import { Typography, diff --git a/packages/extension/src/permission/FirefoxPermissionDeclined.tsx b/packages/extension/src/permission/FirefoxPermissionDeclined.tsx index c4d9210b0b..c9f6675c47 100644 --- a/packages/extension/src/permission/FirefoxPermissionDeclined.tsx +++ b/packages/extension/src/permission/FirefoxPermissionDeclined.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { cloudinaryFeedBgLaptop, cloudinaryGenericErrorDark, diff --git a/packages/extension/src/permission/FirefoxPermissionItem.tsx b/packages/extension/src/permission/FirefoxPermissionItem.tsx index 929d0670f3..8c77d85e31 100644 --- a/packages/extension/src/permission/FirefoxPermissionItem.tsx +++ b/packages/extension/src/permission/FirefoxPermissionItem.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Typography, diff --git a/packages/extension/tailwind.config.ts b/packages/extension/tailwind.config.ts index 98870ec85e..f0c0ff97c5 100644 --- a/packages/extension/tailwind.config.ts +++ b/packages/extension/tailwind.config.ts @@ -1,4 +1,5 @@ -import type { Config } from 'tailwindcss'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { type Config } from 'tailwindcss'; import config from '@dailydotdev/shared/tailwind.config'; module.exports = { diff --git a/packages/extension/tsconfig.json b/packages/extension/tsconfig.json index 5dc3368602..bf5bdee4d2 100644 --- a/packages/extension/tsconfig.json +++ b/packages/extension/tsconfig.json @@ -9,6 +9,7 @@ "allowJs": true, "skipLibCheck": true, "strict": false, + "verbatimModuleSyntax": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, diff --git a/packages/shared/__mocks__/reactMarkdownMock.tsx b/packages/shared/__mocks__/reactMarkdownMock.tsx index 58bcbffe1c..dedbd84a56 100644 --- a/packages/shared/__mocks__/reactMarkdownMock.tsx +++ b/packages/shared/__mocks__/reactMarkdownMock.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; const ReactMarkdown = ({ children, diff --git a/packages/shared/__tests__/fixture/ad.ts b/packages/shared/__tests__/fixture/ad.ts index 8771805560..f9a837bbc9 100644 --- a/packages/shared/__tests__/fixture/ad.ts +++ b/packages/shared/__tests__/fixture/ad.ts @@ -1,4 +1,4 @@ -import { Ad } from '../../src/graphql/posts'; +import type { Ad } from '../../src/graphql/posts'; const ad: Ad = { description: 'I am an ad!', diff --git a/packages/shared/__tests__/fixture/auth.ts b/packages/shared/__tests__/fixture/auth.ts index 23c06cc7ac..a015053a04 100644 --- a/packages/shared/__tests__/fixture/auth.ts +++ b/packages/shared/__tests__/fixture/auth.ts @@ -1,6 +1,6 @@ import nock from 'nock'; import { authUrl, heimdallUrl } from '../../src/lib/constants'; -import { +import type { EmptyObjectLiteral, Identity, InitializationData, diff --git a/packages/shared/__tests__/fixture/comment.ts b/packages/shared/__tests__/fixture/comment.ts index d7aa87f5a7..4f73ee4346 100644 --- a/packages/shared/__tests__/fixture/comment.ts +++ b/packages/shared/__tests__/fixture/comment.ts @@ -1,4 +1,4 @@ -import { Comment } from '../../src/graphql/comments'; +import type { Comment } from '../../src/graphql/comments'; import { author } from './loggedUser'; const comment: Comment = { diff --git a/packages/shared/__tests__/fixture/feed.ts b/packages/shared/__tests__/fixture/feed.ts index ac72b7be06..5f061533ac 100644 --- a/packages/shared/__tests__/fixture/feed.ts +++ b/packages/shared/__tests__/fixture/feed.ts @@ -1,5 +1,6 @@ -import { Connection } from '../../src/graphql/common'; -import { Post, PostType } from '../../src/graphql/posts'; +import type { Connection } from '../../src/graphql/common'; +import type { Post } from '../../src/graphql/posts'; +import { PostType } from '../../src/graphql/posts'; const feed: Connection = { pageInfo: { diff --git a/packages/shared/__tests__/fixture/loggedUser.ts b/packages/shared/__tests__/fixture/loggedUser.ts index 4438a45975..95858cddbe 100644 --- a/packages/shared/__tests__/fixture/loggedUser.ts +++ b/packages/shared/__tests__/fixture/loggedUser.ts @@ -1,5 +1,5 @@ -import { LoggedUser } from '../../src/lib/user'; -import { Author } from '../../src/graphql/comments'; +import type { LoggedUser } from '../../src/lib/user'; +import type { Author } from '../../src/graphql/comments'; const user: LoggedUser = { id: 'u1', diff --git a/packages/shared/__tests__/fixture/post.ts b/packages/shared/__tests__/fixture/post.ts index 0a36fb757f..0aee42c5ab 100644 --- a/packages/shared/__tests__/fixture/post.ts +++ b/packages/shared/__tests__/fixture/post.ts @@ -1,4 +1,5 @@ -import { Post, PostType } from '../../src/graphql/posts'; +import type { Post } from '../../src/graphql/posts'; +import { PostType } from '../../src/graphql/posts'; import { author } from './loggedUser'; const post: Post = { diff --git a/packages/shared/__tests__/fixture/settings.ts b/packages/shared/__tests__/fixture/settings.ts index 7634931832..73b0521be3 100644 --- a/packages/shared/__tests__/fixture/settings.ts +++ b/packages/shared/__tests__/fixture/settings.ts @@ -1,7 +1,5 @@ -import { - SettingsContextData, - ThemeMode, -} from '../../src/contexts/SettingsContext'; +import type { SettingsContextData } from '../../src/contexts/SettingsContext'; +import { ThemeMode } from '../../src/contexts/SettingsContext'; export const createTestSettings = ( props: Partial = {}, diff --git a/packages/shared/__tests__/fixture/squads.ts b/packages/shared/__tests__/fixture/squads.ts index 10a9f762d4..d72d38a248 100644 --- a/packages/shared/__tests__/fixture/squads.ts +++ b/packages/shared/__tests__/fixture/squads.ts @@ -1,13 +1,15 @@ -import { GraphQLResult } from '../helpers/graphql'; -import { Edge } from '../../src/graphql/common'; -import { +import type { GraphQLResult } from '../helpers/graphql'; +import type { Edge } from '../../src/graphql/common'; +import type { BasicSourceMember, SourceMember, +} from '../../src/graphql/sources'; +import { SourceMemberRole, SourcePermissions, SourceType, } from '../../src/graphql/sources'; -import { +import type { BasicSourceMembersData, Squad, SquadData, diff --git a/packages/shared/__tests__/helpers/boot.tsx b/packages/shared/__tests__/helpers/boot.tsx index b0ef740253..679d9cc76e 100644 --- a/packages/shared/__tests__/helpers/boot.tsx +++ b/packages/shared/__tests__/helpers/boot.tsx @@ -1,26 +1,23 @@ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore -import React, { ReactElement, ReactNode } from 'react'; -import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; +import type { QueryClient } from '@tanstack/react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import { GrowthBook, GrowthBookProvider } from '@growthbook/growthbook-react'; -import { WidenPrimitives } from '@growthbook/growthbook'; -import AuthContext, { AuthContextData } from '../../src/contexts/AuthContext'; -import { - NotificationsContextProvider, - NotificationsContextProviderProps, -} from '../../src/contexts/NotificationsContext'; -import SettingsContext, { - SettingsContextData, - ThemeMode, -} from '../../src/contexts/SettingsContext'; -import { - AlertContextProvider, - AlertContextProviderProps, -} from '../../src/contexts/AlertContext'; +import type { WidenPrimitives } from '@growthbook/growthbook'; +import type { AuthContextData } from '../../src/contexts/AuthContext'; +import AuthContext from '../../src/contexts/AuthContext'; +import type { NotificationsContextProviderProps } from '../../src/contexts/NotificationsContext'; +import { NotificationsContextProvider } from '../../src/contexts/NotificationsContext'; +import type { SettingsContextData } from '../../src/contexts/SettingsContext'; +import SettingsContext, { ThemeMode } from '../../src/contexts/SettingsContext'; +import type { AlertContextProviderProps } from '../../src/contexts/AlertContext'; +import { AlertContextProvider } from '../../src/contexts/AlertContext'; import { FeaturesReadyContext } from '../../src/components/GrowthBookProvider'; import { LazyModalElement } from '../../src/components/modals/LazyModalElement'; import LogContext from '../../src/contexts/LogContext'; -import { LogContextData } from '../../src/hooks/log/useLogContextData'; +import type { LogContextData } from '../../src/hooks/log/useLogContextData'; import { ChecklistViewState } from '../../src/lib/checklist'; interface TestBootProviderProps { diff --git a/packages/shared/__tests__/helpers/graphql.ts b/packages/shared/__tests__/helpers/graphql.ts index 866de7631b..c46d3a2e1a 100644 --- a/packages/shared/__tests__/helpers/graphql.ts +++ b/packages/shared/__tests__/helpers/graphql.ts @@ -1,10 +1,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import nock from 'nock'; -import { GraphQLError } from 'graphql-request/dist/types'; -import { - ActionType, - COMPLETE_ACTION_MUTATION, -} from '../../src/graphql/actions'; +import type { GraphQLError } from 'graphql-request/dist/types'; +import type { ActionType } from '../../src/graphql/actions'; +import { COMPLETE_ACTION_MUTATION } from '../../src/graphql/actions'; export interface GraphQLRequest { query: string; diff --git a/packages/shared/__tests__/helpers/tanstack-query.tsx b/packages/shared/__tests__/helpers/tanstack-query.tsx index 751853ac62..23d16e75d7 100644 --- a/packages/shared/__tests__/helpers/tanstack-query.tsx +++ b/packages/shared/__tests__/helpers/tanstack-query.tsx @@ -1,4 +1,4 @@ -import { QueryClientConfig } from '@tanstack/react-query'; +import type { QueryClientConfig } from '@tanstack/react-query'; export const defaultQueryClientTestingConfig: QueryClientConfig = { defaultOptions: { diff --git a/packages/shared/__tests__/setup.ts b/packages/shared/__tests__/setup.ts index e85ccba613..b79ec45a7a 100644 --- a/packages/shared/__tests__/setup.ts +++ b/packages/shared/__tests__/setup.ts @@ -1,7 +1,7 @@ import '@testing-library/jest-dom'; import 'fake-indexeddb/auto'; import nodeFetch from 'node-fetch'; -import { NextRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; import { clear } from 'idb-keyval'; import { storageWrapper as storage } from '../src/lib/storageWrapper'; import { structuredCloneJsonPolyfill } from '../src/lib/structuredClone'; diff --git a/packages/shared/src/components/AlertDot.tsx b/packages/shared/src/components/AlertDot.tsx index 17e6ca4a3a..bd13b00fbf 100644 --- a/packages/shared/src/components/AlertDot.tsx +++ b/packages/shared/src/components/AlertDot.tsx @@ -1,4 +1,5 @@ -import React, { CSSProperties, ReactElement } from 'react'; +import type { CSSProperties, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import classed from '../lib/classed'; diff --git a/packages/shared/src/components/BookmarkEmptyScreen.tsx b/packages/shared/src/components/BookmarkEmptyScreen.tsx index 7d0d8013f9..3d6d5e0c7e 100644 --- a/packages/shared/src/components/BookmarkEmptyScreen.tsx +++ b/packages/shared/src/components/BookmarkEmptyScreen.tsx @@ -1,8 +1,10 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { BookmarkIcon } from './icons'; import { Button, ButtonSize, ButtonVariant } from './buttons/Button'; import Link from './utilities/Link'; -import { IconProps, IconSize } from './Icon'; +import type { IconProps } from './Icon'; +import { IconSize } from './Icon'; interface BookmarkEmptyScreenProps { title?: string; diff --git a/packages/shared/src/components/BookmarkFeedLayout.tsx b/packages/shared/src/components/BookmarkFeedLayout.tsx index 0f36be3d10..1e3126a58a 100644 --- a/packages/shared/src/components/BookmarkFeedLayout.tsx +++ b/packages/shared/src/components/BookmarkFeedLayout.tsx @@ -1,11 +1,5 @@ -import React, { - PropsWithChildren, - ReactElement, - ReactNode, - useContext, - useMemo, - useState, -} from 'react'; +import type { PropsWithChildren, ReactElement, ReactNode } from 'react'; +import React, { useContext, useMemo, useState } from 'react'; import dynamic from 'next/dynamic'; import classNames from 'classnames'; import { @@ -16,9 +10,11 @@ import { import AuthContext from '../contexts/AuthContext'; import { CustomFeedHeader, FeedPageHeader } from './utilities'; import SearchEmptyScreen from './SearchEmptyScreen'; -import Feed, { FeedProps } from './Feed'; +import type { FeedProps } from './Feed'; +import Feed from './Feed'; import BookmarkEmptyScreen from './BookmarkEmptyScreen'; -import { Button, ButtonProps, ButtonVariant } from './buttons/Button'; +import type { ButtonProps } from './buttons/Button'; +import { Button, ButtonVariant } from './buttons/Button'; import { ShareIcon } from './icons'; import { generateQueryKey, OtherFeedPage, RequestKey } from '../lib/query'; import { @@ -33,7 +29,7 @@ import { TypographyTag, TypographyType, } from './typography/Typography'; -import { BookmarkFolder } from '../graphql/bookmarks'; +import type { BookmarkFolder } from '../graphql/bookmarks'; import { BookmarkFolderContextMenu } from './bookmark/BookmarkFolderContextMenu'; export type BookmarkFeedLayoutProps = { diff --git a/packages/shared/src/components/CalendarHeatmap.tsx b/packages/shared/src/components/CalendarHeatmap.tsx index daf4c2de1e..944f661d30 100644 --- a/packages/shared/src/components/CalendarHeatmap.tsx +++ b/packages/shared/src/components/CalendarHeatmap.tsx @@ -1,4 +1,5 @@ -import React, { CSSProperties, ReactElement, ReactNode, useMemo } from 'react'; +import type { CSSProperties, ReactElement, ReactNode } from 'react'; +import React, { useMemo } from 'react'; import { addDays, differenceInDays, endOfWeek } from 'date-fns'; import { SimpleTooltip } from './tooltips/SimpleTooltip'; diff --git a/packages/shared/src/components/CloseButton.tsx b/packages/shared/src/components/CloseButton.tsx index b39fd3251c..c3df27e240 100644 --- a/packages/shared/src/components/CloseButton.tsx +++ b/packages/shared/src/components/CloseButton.tsx @@ -1,10 +1,7 @@ -import React, { forwardRef, ReactElement, Ref } from 'react'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from './buttons/Button'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; +import type { ButtonProps } from './buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from './buttons/Button'; import { MiniCloseIcon as CloseIcon } from './icons'; function CloseButtonComponent( diff --git a/packages/shared/src/components/CommentFeed.tsx b/packages/shared/src/components/CommentFeed.tsx index 436a98c130..568415d6a7 100644 --- a/packages/shared/src/components/CommentFeed.tsx +++ b/packages/shared/src/components/CommentFeed.tsx @@ -1,17 +1,18 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { useInfiniteQuery } from '@tanstack/react-query'; import classNames from 'classnames'; import InfiniteScrolling, { checkFetchMore, } from './containers/InfiniteScrolling'; import MainComment from './comments/MainComment'; -import { Origin } from '../lib/log'; +import type { Origin } from '../lib/log'; import { useShareComment } from '../hooks/useShareComment'; import { useUpvoteQuery } from '../hooks/useUpvoteQuery'; import { useDeleteComment } from '../hooks/comments/useDeleteComment'; import PlaceholderCommentList from './comments/PlaceholderCommentList'; -import { CommentClassName } from './comments/common'; -import { CommentFeedData } from '../graphql/comments'; +import type { CommentClassName } from './comments/common'; +import type { CommentFeedData } from '../graphql/comments'; import { useViewSize, ViewSize } from '../hooks'; import { gqlClient } from '../graphql/common'; import { getNextPageParam } from '../lib/query'; diff --git a/packages/shared/src/components/CreateMyFeedButton.tsx b/packages/shared/src/components/CreateMyFeedButton.tsx index de1f76236d..11ba4656dc 100644 --- a/packages/shared/src/components/CreateMyFeedButton.tsx +++ b/packages/shared/src/components/CreateMyFeedButton.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect } from 'react'; import { PlusIcon } from './icons'; import { Button, @@ -7,7 +8,7 @@ import { ButtonVariant, } from './buttons/Button'; import LogContext from '../contexts/LogContext'; -import { LogEvent } from '../hooks/log/useLogQueue'; +import type { LogEvent } from '../hooks/log/useLogQueue'; interface CreateMyFeedButtonProps { action: () => unknown; diff --git a/packages/shared/src/components/Custom404.tsx b/packages/shared/src/components/Custom404.tsx index cd198272bd..9108f1fb36 100644 --- a/packages/shared/src/components/Custom404.tsx +++ b/packages/shared/src/components/Custom404.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import Link from './utilities/Link'; import { PageContainer } from './utilities'; import { Button, ButtonVariant } from './buttons/Button'; diff --git a/packages/shared/src/components/CustomFeedEmptyScreen.tsx b/packages/shared/src/components/CustomFeedEmptyScreen.tsx index cfa63151ee..02f57a81e4 100644 --- a/packages/shared/src/components/CustomFeedEmptyScreen.tsx +++ b/packages/shared/src/components/CustomFeedEmptyScreen.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import { EmptyScreenButton, diff --git a/packages/shared/src/components/CustomFeedOptionsMenu.tsx b/packages/shared/src/components/CustomFeedOptionsMenu.tsx index a6a3719eac..3996b25761 100644 --- a/packages/shared/src/components/CustomFeedOptionsMenu.tsx +++ b/packages/shared/src/components/CustomFeedOptionsMenu.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ContextMenuIds } from '../hooks/constants'; import type { MenuItemProps } from './fields/ContextMenu'; @@ -7,10 +8,8 @@ import { HashtagIcon, MenuIcon as DotsIcon, ShareIcon } from './icons'; import { MenuIcon } from './MenuIcon'; import useContextMenu from '../hooks/useContextMenu'; import { Button, ButtonSize, ButtonVariant } from './buttons/Button'; -import { - useShareOrCopyLink, - type UseShareOrCopyLinkProps, -} from '../hooks/useShareOrCopyLink'; +import type { UseShareOrCopyLinkProps } from '../hooks/useShareOrCopyLink'; +import { useShareOrCopyLink } from '../hooks/useShareOrCopyLink'; import { useFeeds, usePlusSubscription } from '../hooks'; import { LazyModal } from './modals/common/types'; import { useLazyModal } from '../hooks/useLazyModal'; diff --git a/packages/shared/src/components/DailyCircle.tsx b/packages/shared/src/components/DailyCircle.tsx index acd0880169..ca05fda5a2 100644 --- a/packages/shared/src/components/DailyCircle.tsx +++ b/packages/shared/src/components/DailyCircle.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; type Size = 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'; diff --git a/packages/shared/src/components/DevCardPlaceholder.tsx b/packages/shared/src/components/DevCardPlaceholder.tsx index e5667f0398..da9685ce7f 100644 --- a/packages/shared/src/components/DevCardPlaceholder.tsx +++ b/packages/shared/src/components/DevCardPlaceholder.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; export default function DevCardPlaceholder({ profileImage, diff --git a/packages/shared/src/components/ElementPlaceholder.tsx b/packages/shared/src/components/ElementPlaceholder.tsx index 3b1bcfd1d4..c130ebf83a 100644 --- a/packages/shared/src/components/ElementPlaceholder.tsx +++ b/packages/shared/src/components/ElementPlaceholder.tsx @@ -1,4 +1,5 @@ -import React, { HTMLAttributes, ReactElement } from 'react'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; export const ElementPlaceholder = ({ diff --git a/packages/shared/src/components/EmptyScreen.tsx b/packages/shared/src/components/EmptyScreen.tsx index 0402164994..1cb287d9c7 100644 --- a/packages/shared/src/components/EmptyScreen.tsx +++ b/packages/shared/src/components/EmptyScreen.tsx @@ -1,8 +1,10 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classed from '../lib/classed'; -import { Button, ButtonProps, ButtonVariant } from './buttons/Button'; +import type { ButtonProps } from './buttons/Button'; +import { Button, ButtonVariant } from './buttons/Button'; export const EmptyScreenContainer = classed( 'div', diff --git a/packages/shared/src/components/ErrorBoundary.tsx b/packages/shared/src/components/ErrorBoundary.tsx index 6a29837c5f..7460252f07 100644 --- a/packages/shared/src/components/ErrorBoundary.tsx +++ b/packages/shared/src/components/ErrorBoundary.tsx @@ -1,4 +1,5 @@ -import React, { Component, ErrorInfo, ReactNode } from 'react'; +import type { ErrorInfo, ReactNode } from 'react'; +import React, { Component } from 'react'; import NextError from 'next/error'; import LogContext from '../contexts/LogContext'; diff --git a/packages/shared/src/components/ExtensionOnboarding.tsx b/packages/shared/src/components/ExtensionOnboarding.tsx index a0dd0c5960..311a126f87 100644 --- a/packages/shared/src/components/ExtensionOnboarding.tsx +++ b/packages/shared/src/components/ExtensionOnboarding.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; import Link from './utilities/Link'; import Logo, { LogoPosition } from './Logo'; import { OnboardingTitleGradient } from './onboarding/common'; diff --git a/packages/shared/src/components/ExtensionPermissionsPrompt.tsx b/packages/shared/src/components/ExtensionPermissionsPrompt.tsx index 5031fb3888..f436bee9bb 100644 --- a/packages/shared/src/components/ExtensionPermissionsPrompt.tsx +++ b/packages/shared/src/components/ExtensionPermissionsPrompt.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; import Logo, { LogoPosition } from './Logo'; import { OnboardingTitleGradient } from './onboarding/common'; import { Button, ButtonSize, ButtonVariant } from './buttons/Button'; diff --git a/packages/shared/src/components/Feed.spec.tsx b/packages/shared/src/components/Feed.spec.tsx index ec845c0397..5fa83220d0 100644 --- a/packages/shared/src/components/Feed.spec.tsx +++ b/packages/shared/src/components/Feed.spec.tsx @@ -1,10 +1,10 @@ import nock from 'nock'; import React from 'react'; +import type { RenderResult } from '@testing-library/react'; import { findByText, fireEvent, render, - RenderResult, screen, waitFor, within, @@ -13,22 +13,19 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { mocked } from 'ts-jest/utils'; import { useRouter } from 'next/router'; +import type { FeedData, Post, PostData, PostsEngaged } from '../graphql/posts'; import { ADD_BOOKMARKS_MUTATION, - FeedData, HIDE_POST_MUTATION, - Post, POST_BY_ID_QUERY, - PostData, - PostsEngaged, REPORT_POST_MUTATION, PostType, UserVote, REMOVE_BOOKMARK_MUTATION, } from '../graphql/posts'; +import type { MockedGraphQLResponse } from '../../__tests__/helpers/graphql'; import { completeActionMock, - MockedGraphQLResponse, mockGraphQL, } from '../../__tests__/helpers/graphql'; import { ANONYMOUS_FEED_QUERY } from '../graphql/feed'; @@ -37,23 +34,23 @@ import Feed from './Feed'; import defaultFeedPage from '../../__tests__/fixture/feed'; import defaultUser from '../../__tests__/fixture/loggedUser'; import ad from '../../__tests__/fixture/ad'; -import { LoggedUser } from '../lib/user'; +import type { LoggedUser } from '../lib/user'; import { AcquisitionChannel, USER_ACQUISITION_MUTATION, VOTE_MUTATION, } from '../graphql/users'; -import { SubscriptionCallbacks } from '../hooks/useSubscription'; -import SettingsContext, { - SettingsContextData, - ThemeMode, -} from '../contexts/SettingsContext'; +import type { SubscriptionCallbacks } from '../hooks/useSubscription'; +import type { SettingsContextData } from '../contexts/SettingsContext'; +import SettingsContext, { ThemeMode } from '../contexts/SettingsContext'; import { waitForNock } from '../../__tests__/helpers/utilities'; +import type { + AllTagCategoriesData, + FeedSettings, +} from '../graphql/feedSettings'; import { ADD_FILTERS_TO_FEED_MUTATION, - AllTagCategoriesData, FEED_SETTINGS_QUERY, - FeedSettings, REMOVE_FILTERS_FROM_FEED_MUTATION, } from '../graphql/feedSettings'; import { getFeedSettingsQueryKey } from '../hooks/useFeedSettings'; @@ -63,7 +60,7 @@ import { AuthTriggers } from '../lib/auth'; import { SourceType } from '../graphql/sources'; import { removeQueryParam } from '../lib/links'; import { SharedFeedPage } from './utilities'; -import { AllFeedPages } from '../lib/query'; +import type { AllFeedPages } from '../lib/query'; import { UserVoteEntity } from '../hooks'; import * as hooks from '../hooks/useViewSize'; import { ActionType } from '../graphql/actions'; diff --git a/packages/shared/src/components/Feed.tsx b/packages/shared/src/components/Feed.tsx index ebaa37d7ab..32cb1caa21 100644 --- a/packages/shared/src/components/Feed.tsx +++ b/packages/shared/src/components/Feed.tsx @@ -1,6 +1,5 @@ +import type { ReactElement, ReactNode } from 'react'; import React, { - ReactElement, - ReactNode, useCallback, useContext, useEffect, @@ -9,9 +8,11 @@ import React, { } from 'react'; import dynamic from 'next/dynamic'; import { useRouter } from 'next/router'; -import { QueryKey } from '@tanstack/react-query'; -import useFeed, { PostItem, UseFeedOptionalParams } from '../hooks/useFeed'; -import { Ad, Post, PostType } from '../graphql/posts'; +import type { QueryKey } from '@tanstack/react-query'; +import type { PostItem, UseFeedOptionalParams } from '../hooks/useFeed'; +import useFeed from '../hooks/useFeed'; +import type { Ad, Post } from '../graphql/posts'; +import { PostType } from '../graphql/posts'; import AuthContext from '../contexts/AuthContext'; import FeedContext from '../contexts/FeedContext'; import SettingsContext from '../contexts/SettingsContext'; @@ -31,17 +32,19 @@ import { useSharePost } from '../hooks/useSharePost'; import { Origin } from '../lib/log'; import ShareOptionsMenu from './ShareOptionsMenu'; import { SharedFeedPage } from './utilities'; -import { FeedContainer, FeedContainerProps } from './feeds/FeedContainer'; +import type { FeedContainerProps } from './feeds/FeedContainer'; +import { FeedContainer } from './feeds/FeedContainer'; import { ActiveFeedContext } from '../contexts'; import { useBoot, useFeedLayout, useFeedVotePost } from '../hooks'; -import { AllFeedPages, OtherFeedPage, RequestKey } from '../lib/query'; +import type { AllFeedPages } from '../lib/query'; +import { OtherFeedPage, RequestKey } from '../lib/query'; import { MarketingCtaVariant } from './marketingCta/common'; import { isNullOrUndefined } from '../lib/func'; import { useSearchResultsLayout } from '../hooks/search/useSearchResultsLayout'; import { SearchResultsLayout } from './search/SearchResults/SearchResultsLayout'; import { acquisitionKey } from './cards/AcquisitionForm/common/common'; -import { PostClick } from '../lib/click'; +import type { PostClick } from '../lib/click'; import { useFeedContentPreferenceMutationSubscription } from './feeds/useFeedContentPreferenceMutationSubscription'; import { useFeedBookmarkPost } from '../hooks/bookmark/useFeedBookmarkPost'; diff --git a/packages/shared/src/components/FeedEmptyScreen.tsx b/packages/shared/src/components/FeedEmptyScreen.tsx index c0d9fe038f..75ba79b6c9 100644 --- a/packages/shared/src/components/FeedEmptyScreen.tsx +++ b/packages/shared/src/components/FeedEmptyScreen.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import { EmptyScreenButton, diff --git a/packages/shared/src/components/FeedErrorScreen.tsx b/packages/shared/src/components/FeedErrorScreen.tsx index 5bf9071a79..1716f6d4d5 100644 --- a/packages/shared/src/components/FeedErrorScreen.tsx +++ b/packages/shared/src/components/FeedErrorScreen.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { PageContainer } from './utilities'; import ServerError from './errors/ServerError'; diff --git a/packages/shared/src/components/FeedItemComponent.tsx b/packages/shared/src/components/FeedItemComponent.tsx index 8d0518814d..8904ec5259 100644 --- a/packages/shared/src/components/FeedItemComponent.tsx +++ b/packages/shared/src/components/FeedItemComponent.tsx @@ -1,15 +1,18 @@ -import React, { FunctionComponent, ReactElement } from 'react'; +import type { FunctionComponent, ReactElement } from 'react'; +import React from 'react'; import dynamic from 'next/dynamic'; -import { FeedItem } from '../hooks/useFeed'; +import type { FeedItem } from '../hooks/useFeed'; import { PlaceholderGrid } from './cards/placeholder/PlaceholderGrid'; import { PlaceholderList } from './cards/placeholder/PlaceholderList'; -import { Ad, Post, PostItem, PostType } from '../graphql/posts'; -import { LoggedUser } from '../lib/user'; -import { CommentOnData } from '../graphql/comments'; +import type { Ad, Post, PostItem } from '../graphql/posts'; +import { PostType } from '../graphql/posts'; +import type { LoggedUser } from '../lib/user'; +import type { CommentOnData } from '../graphql/comments'; import useLogImpression from '../hooks/feed/useLogImpression'; -import { FeedPostClick } from '../hooks/feed/useFeedOnPostClick'; +import type { FeedPostClick } from '../hooks/feed/useFeedOnPostClick'; import { Origin } from '../lib/log'; -import { useFeedLayout, UseVotePost } from '../hooks'; +import type { UseVotePost } from '../hooks'; +import { useFeedLayout } from '../hooks'; import { CollectionList } from './cards/collection/CollectionList'; import { MarketingCtaCard } from './marketingCta'; import { MarketingCtaList } from './marketingCta/MarketingCtaList'; @@ -20,13 +23,13 @@ import { AcquisitionFormGrid } from './cards/AcquisitionForm/AcquisitionFormGrid import { AcquisitionFormList } from './cards/AcquisitionForm/AcquisitionFormList'; import { FreeformGrid } from './cards/Freeform/FreeformGrid'; import { FreeformList } from './cards/Freeform/FreeformList'; -import { PostClick } from '../lib/click'; +import type { PostClick } from '../lib/click'; import { ArticleList } from './cards/article/ArticleList'; import { ArticleGrid } from './cards/article/ArticleGrid'; import { ShareGrid } from './cards/share/ShareGrid'; import { ShareList } from './cards/share/ShareList'; import { CollectionGrid } from './cards/collection'; -import { UseBookmarkPost } from '../hooks/useBookmarkPost'; +import type { UseBookmarkPost } from '../hooks/useBookmarkPost'; import { AdActions } from '../lib/ads'; const CommentPopup = dynamic( diff --git a/packages/shared/src/components/FollowingFeedEmptyScreen.tsx b/packages/shared/src/components/FollowingFeedEmptyScreen.tsx index 19866e8fd9..5140995000 100644 --- a/packages/shared/src/components/FollowingFeedEmptyScreen.tsx +++ b/packages/shared/src/components/FollowingFeedEmptyScreen.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { EmptyScreenButton, EmptyScreenContainer, diff --git a/packages/shared/src/components/GoToDevCardButton.tsx b/packages/shared/src/components/GoToDevCardButton.tsx index 4b34907e63..ece8099128 100644 --- a/packages/shared/src/components/GoToDevCardButton.tsx +++ b/packages/shared/src/components/GoToDevCardButton.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { Button, ButtonSize, ButtonVariant } from './buttons/Button'; import { SimpleTooltip } from './tooltips/SimpleTooltip'; diff --git a/packages/shared/src/components/GrowthBookProvider.tsx b/packages/shared/src/components/GrowthBookProvider.tsx index 7dacddefc8..2e5d57bb4f 100644 --- a/packages/shared/src/components/GrowthBookProvider.tsx +++ b/packages/shared/src/components/GrowthBookProvider.tsx @@ -1,6 +1,5 @@ +import type { ReactElement, ReactNode } from 'react'; import React, { - ReactElement, - ReactNode, useContext, useEffect, useRef, @@ -9,22 +8,25 @@ import React, { useCallback, } from 'react'; import { useMutation } from '@tanstack/react-query'; -import { +import type { Context, + GrowthBookContextValue, +} from '@growthbook/growthbook-react'; +import { GrowthBook, GrowthBookContext, GrowthBookProvider as Provider, useFeatureValue, useFeatureIsOn as gbUseFeatureIsOn, - GrowthBookContextValue, } from '@growthbook/growthbook-react'; -import { WidenPrimitives, JSONValue } from '@growthbook/growthbook'; +import type { WidenPrimitives, JSONValue } from '@growthbook/growthbook'; import dynamic from 'next/dynamic'; import { isGBDevMode, isProduction } from '../lib/constants'; -import { BootApp, BootCacheData } from '../lib/boot'; +import type { BootApp, BootCacheData } from '../lib/boot'; import { apiUrl } from '../lib/config'; import { useRequestProtocol } from '../hooks/useRequestProtocol'; -import { feature as localFeature, Feature } from '../lib/featureManagement'; +import type { Feature } from '../lib/featureManagement'; +import { feature as localFeature } from '../lib/featureManagement'; import { useViewSize, ViewSize } from '../hooks/useViewSize'; const ServerError = dynamic( diff --git a/packages/shared/src/components/HorizontalScroll/HorizontalScroll.tsx b/packages/shared/src/components/HorizontalScroll/HorizontalScroll.tsx index 077f9ab9ff..d64a48d3c6 100644 --- a/packages/shared/src/components/HorizontalScroll/HorizontalScroll.tsx +++ b/packages/shared/src/components/HorizontalScroll/HorizontalScroll.tsx @@ -1,15 +1,8 @@ -import React, { - forwardRef, - MutableRefObject, - ReactElement, - ReactNode, - useId, -} from 'react'; +import type { MutableRefObject, ReactElement, ReactNode } from 'react'; +import React, { forwardRef, useId } from 'react'; import classNames from 'classnames'; -import { - UseHorizontalScrollHeaderProps, - useHorizontalScrollHeader, -} from './useHorizontalScrollHeader'; +import type { UseHorizontalScrollHeaderProps } from './useHorizontalScrollHeader'; +import { useHorizontalScrollHeader } from './useHorizontalScrollHeader'; interface ClassName { container?: string; diff --git a/packages/shared/src/components/HorizontalScroll/HorizontalScrollHeader.tsx b/packages/shared/src/components/HorizontalScroll/HorizontalScrollHeader.tsx index 11b493c45b..3bb2dc0c7d 100644 --- a/packages/shared/src/components/HorizontalScroll/HorizontalScrollHeader.tsx +++ b/packages/shared/src/components/HorizontalScroll/HorizontalScrollHeader.tsx @@ -1,4 +1,5 @@ -import React, { MouseEventHandler, ReactElement, ReactNode } from 'react'; +import type { MouseEventHandler, ReactElement, ReactNode } from 'react'; +import React from 'react'; import Link from 'next/link'; import { Button } from '../buttons/Button'; import { ButtonVariant } from '../buttons/common'; diff --git a/packages/shared/src/components/HorizontalScroll/useCalculateVisibleElements.ts b/packages/shared/src/components/HorizontalScroll/useCalculateVisibleElements.ts index 234d1b7ecc..c7db5631a3 100644 --- a/packages/shared/src/components/HorizontalScroll/useCalculateVisibleElements.ts +++ b/packages/shared/src/components/HorizontalScroll/useCalculateVisibleElements.ts @@ -1,4 +1,5 @@ -import { MutableRefObject, useCallback, useEffect, useState } from 'react'; +import type { MutableRefObject } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import { useToggle } from '../../hooks/useToggle'; import { useEventListener } from '../../hooks'; diff --git a/packages/shared/src/components/HorizontalScroll/useHorizontalScrollHeader.spec.tsx b/packages/shared/src/components/HorizontalScroll/useHorizontalScrollHeader.spec.tsx index b8aeec7a1f..9c9f5dd5b4 100644 --- a/packages/shared/src/components/HorizontalScroll/useHorizontalScrollHeader.spec.tsx +++ b/packages/shared/src/components/HorizontalScroll/useHorizontalScrollHeader.spec.tsx @@ -1,9 +1,7 @@ import React from 'react'; import { render, fireEvent, screen } from '@testing-library/react'; -import { - UseHorizontalScrollHeaderProps, - useHorizontalScrollHeader, -} from './useHorizontalScrollHeader'; +import type { UseHorizontalScrollHeaderProps } from './useHorizontalScrollHeader'; +import { useHorizontalScrollHeader } from './useHorizontalScrollHeader'; import { useScrollManagement } from './useScrollManagement'; import { useCalculateVisibleElements } from './useCalculateVisibleElements'; diff --git a/packages/shared/src/components/HorizontalScroll/useHorizontalScrollHeader.tsx b/packages/shared/src/components/HorizontalScroll/useHorizontalScrollHeader.tsx index 785f2beb71..dd7454f55f 100644 --- a/packages/shared/src/components/HorizontalScroll/useHorizontalScrollHeader.tsx +++ b/packages/shared/src/components/HorizontalScroll/useHorizontalScrollHeader.tsx @@ -1,16 +1,9 @@ -import React, { - MouseEventHandler, - ReactNode, - RefObject, - useCallback, - useRef, -} from 'react'; +import type { MouseEventHandler, ReactNode, RefObject } from 'react'; +import React, { useCallback, useRef } from 'react'; import { useScrollManagement } from './useScrollManagement'; import { useCalculateVisibleElements } from './useCalculateVisibleElements'; -import { - HorizontalScrollHeader, - HorizontalScrollTitleProps, -} from './HorizontalScrollHeader'; +import type { HorizontalScrollTitleProps } from './HorizontalScrollHeader'; +import { HorizontalScrollHeader } from './HorizontalScrollHeader'; interface HorizontalScrollHeaderReturn< El extends HTMLElement = HTMLDivElement, diff --git a/packages/shared/src/components/HorizontalScroll/useScrollManagement.tsx b/packages/shared/src/components/HorizontalScroll/useScrollManagement.tsx index 6fdbf31456..f5b31ca84c 100644 --- a/packages/shared/src/components/HorizontalScroll/useScrollManagement.tsx +++ b/packages/shared/src/components/HorizontalScroll/useScrollManagement.tsx @@ -1,4 +1,6 @@ -import React, { RefObject, useCallback, useState } from 'react'; +import type { RefObject } from 'react'; +import type React from 'react'; +import { useCallback, useState } from 'react'; import useDebounceFn from '../../hooks/useDebounceFn'; import { useEventListener } from '../../hooks'; diff --git a/packages/shared/src/components/Icon.tsx b/packages/shared/src/components/Icon.tsx index 63200b0915..90ad6d74b8 100644 --- a/packages/shared/src/components/Icon.tsx +++ b/packages/shared/src/components/Icon.tsx @@ -1,4 +1,5 @@ -import React, { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; export enum IconSize { diff --git a/packages/shared/src/components/InteractionCounter.tsx b/packages/shared/src/components/InteractionCounter.tsx index 6628c1f65e..84831e54f0 100644 --- a/packages/shared/src/components/InteractionCounter.tsx +++ b/packages/shared/src/components/InteractionCounter.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useState } from 'react'; import { requestIdleCallback } from 'next/dist/client/request-idle-callback'; import classNames from 'classnames'; import { largeNumberFormat } from '../lib'; diff --git a/packages/shared/src/components/KeyboardShortcutLabel.tsx b/packages/shared/src/components/KeyboardShortcutLabel.tsx index 4e78e668c7..5cfb161f45 100644 --- a/packages/shared/src/components/KeyboardShortcutLabel.tsx +++ b/packages/shared/src/components/KeyboardShortcutLabel.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { Fragment, ReactElement, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { Fragment, useEffect, useState } from 'react'; export type KeyboadShortcutLabelProps = { className?: string; diff --git a/packages/shared/src/components/LazyImage.tsx b/packages/shared/src/components/LazyImage.tsx index 30cfeef86f..387d489704 100644 --- a/packages/shared/src/components/LazyImage.tsx +++ b/packages/shared/src/components/LazyImage.tsx @@ -1,11 +1,11 @@ -import React, { +import type { ComponentPropsWithoutRef, - forwardRef, ReactElement, ReactNode, Ref, SyntheticEvent, } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; export interface LazyImageProps extends ComponentPropsWithoutRef<'img'> { diff --git a/packages/shared/src/components/Loader.tsx b/packages/shared/src/components/Loader.tsx index f72e0f66e6..fd27567aba 100644 --- a/packages/shared/src/components/Loader.tsx +++ b/packages/shared/src/components/Loader.tsx @@ -1,4 +1,5 @@ -import React, { HTMLAttributes, ReactElement } from 'react'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import styles from './Loader.module.css'; diff --git a/packages/shared/src/components/LoaderOverlay.tsx b/packages/shared/src/components/LoaderOverlay.tsx index 74c0457f4c..76d0eb69bc 100644 --- a/packages/shared/src/components/LoaderOverlay.tsx +++ b/packages/shared/src/components/LoaderOverlay.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { Loader, LoaderProps } from './Loader'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { LoaderProps } from './Loader'; +import { Loader } from './Loader'; export function LoaderOverlay({ ...props }: LoaderProps): ReactElement { return ( diff --git a/packages/shared/src/components/LoginButton.spec.tsx b/packages/shared/src/components/LoginButton.spec.tsx index 8c6ba1f664..f1145bf3f4 100644 --- a/packages/shared/src/components/LoginButton.spec.tsx +++ b/packages/shared/src/components/LoginButton.spec.tsx @@ -1,15 +1,11 @@ /* eslint-disable no-console */ import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; import LoginButton from './LoginButton'; import { TestBootProvider } from '../../__tests__/helpers/boot'; -import { LoggedUser } from '../lib/user'; +import type { LoggedUser } from '../lib/user'; describe('LoginButton', () => { const showLogin = jest.fn(); diff --git a/packages/shared/src/components/LoginButton.tsx b/packages/shared/src/components/LoginButton.tsx index 8378122441..4aaf5df519 100644 --- a/packages/shared/src/components/LoginButton.tsx +++ b/packages/shared/src/components/LoginButton.tsx @@ -1,9 +1,10 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import { Button, ButtonVariant } from './buttons/Button'; import AuthContext from '../contexts/AuthContext'; import LogContext from '../contexts/LogContext'; -import { LogEvent } from '../hooks/log/useLogQueue'; +import type { LogEvent } from '../hooks/log/useLogQueue'; import { AuthTriggers } from '../lib/auth'; import { TargetType } from '../lib/log'; diff --git a/packages/shared/src/components/Logo.tsx b/packages/shared/src/components/Logo.tsx index aa0726a194..f214eeb798 100644 --- a/packages/shared/src/components/Logo.tsx +++ b/packages/shared/src/components/Logo.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import dynamic from 'next/dynamic'; import { LinkWithTooltip } from './tooltips/LinkWithTooltip'; diff --git a/packages/shared/src/components/MainFeedLayout.tsx b/packages/shared/src/components/MainFeedLayout.tsx index 2c8ce1e129..6778375490 100644 --- a/packages/shared/src/components/MainFeedLayout.tsx +++ b/packages/shared/src/components/MainFeedLayout.tsx @@ -1,6 +1,5 @@ +import type { ReactElement, ReactNode } from 'react'; import React, { - ReactElement, - ReactNode, useCallback, useContext, useEffect, @@ -10,9 +9,10 @@ import React, { import dynamic from 'next/dynamic'; import classNames from 'classnames'; import { useRouter } from 'next/router'; -import Feed, { FeedProps } from './Feed'; +import type { FeedProps } from './Feed'; +import Feed from './Feed'; import AuthContext from '../contexts/AuthContext'; -import { LoggedUser } from '../lib/user'; +import type { LoggedUser } from '../lib/user'; import { SharedFeedPage } from './utilities'; import { ANONYMOUS_FEED_QUERY, @@ -45,7 +45,7 @@ import { } from '../hooks'; import { feature } from '../lib/featureManagement'; import { isDevelopment } from '../lib/constants'; -import { FeedContainerProps } from './feeds'; +import type { FeedContainerProps } from './feeds'; import { getFeedName } from '../lib/feed'; import CommentFeed from './CommentFeed'; import { COMMENT_FEED_QUERY } from '../graphql/comments'; diff --git a/packages/shared/src/components/MainLayout.tsx b/packages/shared/src/components/MainLayout.tsx index 7b220faad5..b0fd45b927 100644 --- a/packages/shared/src/components/MainLayout.tsx +++ b/packages/shared/src/components/MainLayout.tsx @@ -1,11 +1,5 @@ -import React, { - HTMLAttributes, - ReactElement, - ReactNode, - useContext, - useEffect, - useState, -} from 'react'; +import type { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; import dynamic from 'next/dynamic'; @@ -16,9 +10,8 @@ import SettingsContext from '../contexts/SettingsContext'; import Toast from './notifications/Toast'; import { useAuthErrors } from '../hooks/useAuthErrors'; import { useAuthVerificationRecovery } from '../hooks/useAuthVerificationRecovery'; -import MainLayoutHeader, { - MainLayoutHeaderProps, -} from './layout/MainLayoutHeader'; +import type { MainLayoutHeaderProps } from './layout/MainLayoutHeader'; +import MainLayoutHeader from './layout/MainLayoutHeader'; import { InAppNotificationElement } from './notifications/InAppNotification'; import { useNotificationContext } from '../contexts/NotificationsContext'; import { LogEvent, NotificationTarget } from '../lib/log'; diff --git a/packages/shared/src/components/Markdown.tsx b/packages/shared/src/components/Markdown.tsx index 4d57c68de5..92e2a6e653 100644 --- a/packages/shared/src/components/Markdown.tsx +++ b/packages/shared/src/components/Markdown.tsx @@ -1,13 +1,9 @@ -import React, { - MouseEventHandler, - ReactElement, - useCallback, - useState, -} from 'react'; +import type { MouseEventHandler, ReactElement } from 'react'; +import React, { useCallback, useState } from 'react'; import classNames from 'classnames'; import styles from './markdown.module.css'; import { ProfileTooltip } from './profile/ProfileTooltip'; -import { CaretOffset } from '../lib/element'; +import type { CaretOffset } from '../lib/element'; import useDebounceFn from '../hooks/useDebounceFn'; import { useDomPurify } from '../hooks/useDomPurify'; diff --git a/packages/shared/src/components/MenuIcon.tsx b/packages/shared/src/components/MenuIcon.tsx index ae291f201c..e69fb86fe4 100644 --- a/packages/shared/src/components/MenuIcon.tsx +++ b/packages/shared/src/components/MenuIcon.tsx @@ -1,6 +1,8 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; -import { IconProps, IconSize } from './Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from './Icon'; +import { IconSize } from './Icon'; interface MenuIconProps extends IconProps { Icon: React.ElementType; diff --git a/packages/shared/src/components/Pill.tsx b/packages/shared/src/components/Pill.tsx index 55e5a236f8..e403adfd4c 100644 --- a/packages/shared/src/components/Pill.tsx +++ b/packages/shared/src/components/Pill.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; export enum PillSize { diff --git a/packages/shared/src/components/Pixels.tsx b/packages/shared/src/components/Pixels.tsx index e08fb78cf7..e3a68d9b8e 100644 --- a/packages/shared/src/components/Pixels.tsx +++ b/packages/shared/src/components/Pixels.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import Script from 'next/script'; import { useRouter } from 'next/router'; import { isProduction } from '../lib/constants'; -import { UserExperienceLevel } from '../lib/user'; +import type { UserExperienceLevel } from '../lib/user'; import { useAuthContext } from '../contexts/AuthContext'; import { fromCDN } from '../lib'; diff --git a/packages/shared/src/components/PlusUserBadge.tsx b/packages/shared/src/components/PlusUserBadge.tsx index 7834caab08..cf9d55be6b 100644 --- a/packages/shared/src/components/PlusUserBadge.tsx +++ b/packages/shared/src/components/PlusUserBadge.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import type { PublicProfile } from '../lib/user'; import { SimpleTooltip } from './tooltips'; import { PlusUser } from './PlusUser'; diff --git a/packages/shared/src/components/PostOptionsMenu.tsx b/packages/shared/src/components/PostOptionsMenu.tsx index 2364549526..f3c1e845bd 100644 --- a/packages/shared/src/components/PostOptionsMenu.tsx +++ b/packages/shared/src/components/PostOptionsMenu.tsx @@ -1,11 +1,13 @@ -import React, { ReactElement, useContext, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; import dynamic from 'next/dynamic'; import { useQueryClient } from '@tanstack/react-query'; import { useRouter } from 'next/router'; import classNames from 'classnames'; import useFeedSettings from '../hooks/useFeedSettings'; import useReportPost from '../hooks/useReportPost'; -import { Post, UserVote, isVideoPost } from '../graphql/posts'; +import type { Post } from '../graphql/posts'; +import { UserVote, isVideoPost } from '../graphql/posts'; import { TrashIcon, HammerIcon, @@ -30,7 +32,7 @@ import { ShieldIcon, ShieldWarningIcon, } from './icons'; -import { ReportedCallback } from './modals'; +import type { ReportedCallback } from './modals'; import useTagAndSource from '../hooks/useTagAndSource'; import LogContext from '../contexts/LogContext'; import { postLogEvent } from '../lib/feed'; @@ -43,7 +45,8 @@ import { useSourceActionsNotify, useToastNotification, } from '../hooks'; -import { AllFeedPages, generateQueryKey } from '../lib/query'; +import type { AllFeedPages } from '../lib/query'; +import { generateQueryKey } from '../lib/query'; import AuthContext from '../contexts/AuthContext'; import { LogEvent, Origin } from '../lib/log'; import { usePostMenuActions } from '../hooks/usePostMenuActions'; @@ -51,7 +54,7 @@ import usePostById, { getPostByIdKey } from '../hooks/usePostById'; import { useLazyModal } from '../hooks/useLazyModal'; import { LazyModal } from './modals/common/types'; import { labels } from '../lib'; -import { MenuItemProps } from './fields/ContextMenu'; +import type { MenuItemProps } from './fields/ContextMenu'; import { ContextMenu as ContextMenuTypes } from '../hooks/constants'; import useContextMenu from '../hooks/useContextMenu'; import { SourceType } from '../graphql/sources'; diff --git a/packages/shared/src/components/PostOptionsReadingHistoryMenu.tsx b/packages/shared/src/components/PostOptionsReadingHistoryMenu.tsx index 6d2b99ff45..6f308ade7a 100644 --- a/packages/shared/src/components/PostOptionsReadingHistoryMenu.tsx +++ b/packages/shared/src/components/PostOptionsReadingHistoryMenu.tsx @@ -1,20 +1,20 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import dynamic from 'next/dynamic'; -import { QueryClient, QueryKey, useQueryClient } from '@tanstack/react-query'; -import { ReadHistoryPost } from '../graphql/posts'; +import type { QueryClient, QueryKey } from '@tanstack/react-query'; +import { useQueryClient } from '@tanstack/react-query'; +import type { ReadHistoryPost } from '../graphql/posts'; import { ShareIcon, BookmarkIcon, MiniCloseIcon as XIcon } from './icons'; -import { - UseBookmarkPostRollback, - useBookmarkPost, -} from '../hooks/useBookmarkPost'; +import type { UseBookmarkPostRollback } from '../hooks/useBookmarkPost'; +import { useBookmarkPost } from '../hooks/useBookmarkPost'; import AuthContext from '../contexts/AuthContext'; -import { +import type { ReadHistoryInfiniteData, ReadHistoryData, } from '../hooks/useInfiniteReadingHistory'; import { MenuIcon } from './MenuIcon'; -import { QueryIndexes } from '../hooks/useReadingHistory'; +import type { QueryIndexes } from '../hooks/useReadingHistory'; import { generateQueryKey, RequestKey, diff --git a/packages/shared/src/components/PostsSearch.tsx b/packages/shared/src/components/PostsSearch.tsx index f0fa6bffde..564a9dc17e 100644 --- a/packages/shared/src/components/PostsSearch.tsx +++ b/packages/shared/src/components/PostsSearch.tsx @@ -1,10 +1,5 @@ -import React, { - HTMLAttributes, - ReactElement, - useEffect, - useRef, - useState, -} from 'react'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import dynamic from 'next/dynamic'; import { useQuery } from '@tanstack/react-query'; import classNames from 'classnames'; diff --git a/packages/shared/src/components/ProfileMenu.tsx b/packages/shared/src/components/ProfileMenu.tsx index 348d7a923c..fd7b7ff0d8 100644 --- a/packages/shared/src/components/ProfileMenu.tsx +++ b/packages/shared/src/components/ProfileMenu.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import classNames from 'classnames'; import { useAuthContext } from '../contexts/AuthContext'; import { @@ -16,13 +17,8 @@ import { import InteractivePopup, { InteractivePopupPosition, } from './tooltips/InteractivePopup'; -import { - AllowedTags, - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from './buttons/Button'; +import type { AllowedTags, ButtonProps } from './buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from './buttons/Button'; import { managePlusUrl, plusUrl, diff --git a/packages/shared/src/components/ProfilePicture.tsx b/packages/shared/src/components/ProfilePicture.tsx index cf325a7ef4..9cda71e643 100644 --- a/packages/shared/src/components/ProfilePicture.tsx +++ b/packages/shared/src/components/ProfilePicture.tsx @@ -1,13 +1,9 @@ -import React, { - forwardRef, - ReactElement, - ReactEventHandler, - Ref, - useMemo, -} from 'react'; +import type { ReactElement, ReactEventHandler, Ref } from 'react'; +import React, { forwardRef, useMemo } from 'react'; import classNames from 'classnames'; -import { LazyImage, LazyImageProps } from './LazyImage'; -import { PublicProfile } from '../lib/user'; +import type { LazyImageProps } from './LazyImage'; +import { LazyImage } from './LazyImage'; +import type { PublicProfile } from '../lib/user'; import { fallbackImages } from '../lib/config'; import { Image, ImageType } from './image/Image'; import { useRequestProtocol } from '../hooks/useRequestProtocol'; diff --git a/packages/shared/src/components/ProfilePictureGroup.tsx b/packages/shared/src/components/ProfilePictureGroup.tsx index 7bc24b53aa..bdef1dc059 100644 --- a/packages/shared/src/components/ProfilePictureGroup.tsx +++ b/packages/shared/src/components/ProfilePictureGroup.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ProfileImageSize, sizeClasses } from './ProfilePicture'; diff --git a/packages/shared/src/components/PromotionalBanner.tsx b/packages/shared/src/components/PromotionalBanner.tsx index 89a439c878..8a798689c7 100644 --- a/packages/shared/src/components/PromotionalBanner.tsx +++ b/packages/shared/src/components/PromotionalBanner.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Button, @@ -7,7 +8,8 @@ import { ButtonVariant, } from './buttons/Button'; import { isTesting } from '../lib/constants'; -import { BannerCustomTheme, BannerTheme } from '../graphql/banner'; +import type { BannerTheme } from '../graphql/banner'; +import { BannerCustomTheme } from '../graphql/banner'; import { Theme } from './utilities'; import { useBanner } from '../hooks/useBanner'; import CloseButton from './CloseButton'; diff --git a/packages/shared/src/components/RadialProgress.spec.tsx b/packages/shared/src/components/RadialProgress.spec.tsx index 3467bdcd28..e7473c8057 100644 --- a/packages/shared/src/components/RadialProgress.spec.tsx +++ b/packages/shared/src/components/RadialProgress.spec.tsx @@ -1,6 +1,8 @@ import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; -import RadialProgress, { RadialProgressProps } from './RadialProgress'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; +import type { RadialProgressProps } from './RadialProgress'; +import RadialProgress from './RadialProgress'; const renderComponent = (props: RadialProgressProps): RenderResult => { return render(); diff --git a/packages/shared/src/components/RadialProgress.tsx b/packages/shared/src/components/RadialProgress.tsx index 4f7da2d4dd..4501049f90 100644 --- a/packages/shared/src/components/RadialProgress.tsx +++ b/packages/shared/src/components/RadialProgress.tsx @@ -1,11 +1,5 @@ -import React, { - CSSProperties, - forwardRef, - LegacyRef, - ReactElement, - useMemo, - useState, -} from 'react'; +import type { CSSProperties, LegacyRef, ReactElement } from 'react'; +import React, { forwardRef, useMemo, useState } from 'react'; import classNames from 'classnames'; import styles from './RadialProgress.module.css'; import classed from '../lib/classed'; diff --git a/packages/shared/src/components/RecommendedMention.tsx b/packages/shared/src/components/RecommendedMention.tsx index b61c7eb567..ea276f04fc 100644 --- a/packages/shared/src/components/RecommendedMention.tsx +++ b/packages/shared/src/components/RecommendedMention.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { UserShortInfo } from './profile/UserShortInfo'; interface RecommendedUser { diff --git a/packages/shared/src/components/RecommendedTags.tsx b/packages/shared/src/components/RecommendedTags.tsx index b4579d175f..5b4412ec2d 100644 --- a/packages/shared/src/components/RecommendedTags.tsx +++ b/packages/shared/src/components/RecommendedTags.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ElementPlaceholder } from './ElementPlaceholder'; import { TagLink } from './TagLinks'; import type { Tag } from '../graphql/feedSettings'; diff --git a/packages/shared/src/components/RelatedSources.tsx b/packages/shared/src/components/RelatedSources.tsx index 30479ce369..0302e8fad4 100644 --- a/packages/shared/src/components/RelatedSources.tsx +++ b/packages/shared/src/components/RelatedSources.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import Link from './utilities/Link'; -import { Source } from '../graphql/sources'; +import type { Source } from '../graphql/sources'; import { ElementPlaceholder } from './ElementPlaceholder'; interface RelatedSourcesProps { diff --git a/packages/shared/src/components/RenderMarkdown.tsx b/packages/shared/src/components/RenderMarkdown.tsx index 2f743a2e7a..2c1d0e221e 100644 --- a/packages/shared/src/components/RenderMarkdown.tsx +++ b/packages/shared/src/components/RenderMarkdown.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useState } from 'react'; import classNames from 'classnames'; import { LightAsync as SyntaxHighlighterAsync } from 'react-syntax-highlighter'; import dynamic from 'next/dynamic'; -import { ReactMarkdownOptions } from 'react-markdown/lib/react-markdown'; +import type { ReactMarkdownOptions } from 'react-markdown/lib/react-markdown'; import styles from './markdown.module.css'; import { Button, diff --git a/packages/shared/src/components/ReputationUserBadge.tsx b/packages/shared/src/components/ReputationUserBadge.tsx index 597588dbb7..eaf3721c87 100644 --- a/packages/shared/src/components/ReputationUserBadge.tsx +++ b/packages/shared/src/components/ReputationUserBadge.tsx @@ -1,8 +1,10 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; -import UserBadge, { UserBadgeProps } from './UserBadge'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { UserBadgeProps } from './UserBadge'; +import UserBadge from './UserBadge'; import { ReputationIcon } from './icons'; -import { LoggedUser } from '../lib/user'; +import type { LoggedUser } from '../lib/user'; import { SimpleTooltip } from './tooltips'; import { largeNumberFormat } from '../lib'; import { IconSize } from './Icon'; diff --git a/packages/shared/src/components/ScrollToTopButton.tsx b/packages/shared/src/components/ScrollToTopButton.tsx index 768486ce07..149a182485 100644 --- a/packages/shared/src/components/ScrollToTopButton.tsx +++ b/packages/shared/src/components/ScrollToTopButton.tsx @@ -1,10 +1,7 @@ -import React, { CSSProperties, ReactElement, useEffect, useState } from 'react'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from './buttons/Button'; +import type { CSSProperties, ReactElement } from 'react'; +import React, { useEffect, useState } from 'react'; +import type { ButtonProps } from './buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from './buttons/Button'; import { ArrowIcon } from './icons'; import { useViewSize, ViewSize } from '../hooks'; diff --git a/packages/shared/src/components/SearchEmptyScreen.tsx b/packages/shared/src/components/SearchEmptyScreen.tsx index 0cc1bb452a..a7c0ae26d9 100644 --- a/packages/shared/src/components/SearchEmptyScreen.tsx +++ b/packages/shared/src/components/SearchEmptyScreen.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { SearchIcon as MagnifyingIcon } from './icons'; import { IconSize } from './Icon'; diff --git a/packages/shared/src/components/Settings.spec.tsx b/packages/shared/src/components/Settings.spec.tsx index 2faa03cb9c..11f651104c 100644 --- a/packages/shared/src/components/Settings.spec.tsx +++ b/packages/shared/src/components/Settings.spec.tsx @@ -1,10 +1,10 @@ import React from 'react'; import nock from 'nock'; +import type { RenderResult } from '@testing-library/react'; import { fireEvent, queryByText, render, - RenderResult, screen, waitFor, } from '@testing-library/react'; @@ -12,16 +12,15 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { mockGraphQL } from '../../__tests__/helpers/graphql'; import { SettingsContextProvider } from '../contexts/SettingsContext'; import Settings from './Settings'; -import { - RemoteSettings, - UPDATE_USER_SETTINGS_MUTATION, -} from '../graphql/settings'; -import { LoggedUser } from '../lib/user'; +import type { RemoteSettings } from '../graphql/settings'; +import { UPDATE_USER_SETTINGS_MUTATION } from '../graphql/settings'; +import type { LoggedUser } from '../lib/user'; import defaultUser from '../../__tests__/fixture/loggedUser'; import AuthContext from '../contexts/AuthContext'; import { BootDataProvider } from '../contexts/BootProvider'; import { apiUrl } from '../lib/config'; -import { BootApp, BootCacheData } from '../lib/boot'; +import type { BootCacheData } from '../lib/boot'; +import { BootApp } from '../lib/boot'; import { BOOT_LOCAL_KEY } from '../contexts/common'; import * as hooks from '../hooks/useViewSize'; diff --git a/packages/shared/src/components/Settings.tsx b/packages/shared/src/components/Settings.tsx index 4b75d8092b..56c7ba6a10 100644 --- a/packages/shared/src/components/Settings.tsx +++ b/packages/shared/src/components/Settings.tsx @@ -1,18 +1,11 @@ -import React, { - HTMLAttributes, - ReactElement, - ReactNode, - useCallback, - useContext, - useEffect, - useState, -} from 'react'; +import type { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import React, { useCallback, useContext, useEffect, useState } from 'react'; import classNames from 'classnames'; import classed from '../lib/classed'; import { Radio } from './fields/Radio'; import { Switch } from './fields/Switch'; +import type { ThemeMode } from '../contexts/SettingsContext'; import SettingsContext, { - ThemeMode, themes as layoutThemes, } from '../contexts/SettingsContext'; import { CardIcon, LineIcon } from './icons'; diff --git a/packages/shared/src/components/ShareBar.spec.tsx b/packages/shared/src/components/ShareBar.spec.tsx index 30b12035f8..e69c13563b 100644 --- a/packages/shared/src/components/ShareBar.spec.tsx +++ b/packages/shared/src/components/ShareBar.spec.tsx @@ -1,10 +1,5 @@ -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React from 'react'; import nock from 'nock'; diff --git a/packages/shared/src/components/ShareBar.tsx b/packages/shared/src/components/ShareBar.tsx index 4ee56d137f..d466fd5458 100644 --- a/packages/shared/src/components/ShareBar.tsx +++ b/packages/shared/src/components/ShareBar.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { CopyIcon, FacebookIcon, TwitterIcon, WhatsappIcon } from './icons'; -import { Post } from '../graphql/posts'; +import type { Post } from '../graphql/posts'; import { useCopyPostLink } from '../hooks/useCopyPostLink'; import { getShareLink, ShareProvider } from '../lib/share'; import LogContext from '../contexts/LogContext'; @@ -9,7 +10,7 @@ import { WidgetContainer } from './widgets/common'; import { LogEvent, Origin } from '../lib/log'; import { LazyModal } from './modals/common/types'; import { useLazyModal } from '../hooks/useLazyModal'; -import { Squad } from '../graphql/sources'; +import type { Squad } from '../graphql/sources'; import { SocialShareButton } from './widgets/SocialShareButton'; import { SquadsToShare } from './squads/SquadsToShare'; import { ButtonSize, ButtonVariant } from './buttons/common'; diff --git a/packages/shared/src/components/ShareMobile.tsx b/packages/shared/src/components/ShareMobile.tsx index ff425f9bb0..b85852522b 100644 --- a/packages/shared/src/components/ShareMobile.tsx +++ b/packages/shared/src/components/ShareMobile.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { LinkIcon, ShareIcon } from './icons'; import { useCopyPostLink } from '../hooks/useCopyPostLink'; import { @@ -9,11 +10,12 @@ import { } from './buttons/Button'; import { WidgetContainer } from './widgets/common'; import { postLogEvent } from '../lib/feed'; -import { LogEvent, Origin } from '../lib/log'; -import { Post } from '../graphql/posts'; +import type { Origin } from '../lib/log'; +import { LogEvent } from '../lib/log'; +import type { Post } from '../graphql/posts'; import { useLogContext } from '../contexts/LogContext'; import { useSharePost } from '../hooks/useSharePost'; -import { UsePostContent } from '../hooks/usePostContent'; +import type { UsePostContent } from '../hooks/usePostContent'; export interface ShareMobileProps { post: Post; diff --git a/packages/shared/src/components/ShareOptionsMenu.tsx b/packages/shared/src/components/ShareOptionsMenu.tsx index fe91ad1d72..cf638fcf06 100644 --- a/packages/shared/src/components/ShareOptionsMenu.tsx +++ b/packages/shared/src/components/ShareOptionsMenu.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import dynamic from 'next/dynamic'; import classNames from 'classnames'; -import { Post } from '../graphql/posts'; +import type { Post } from '../graphql/posts'; import { ShareIcon, LinkIcon } from './icons'; import LogContext from '../contexts/LogContext'; import { postLogEvent } from '../lib/feed'; diff --git a/packages/shared/src/components/SharedByUserBanner.tsx b/packages/shared/src/components/SharedByUserBanner.tsx index fe2a89b66d..0a8aec8589 100644 --- a/packages/shared/src/components/SharedByUserBanner.tsx +++ b/packages/shared/src/components/SharedByUserBanner.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import classNames from 'classnames'; import { useAuthContext } from '../contexts/AuthContext'; @@ -11,7 +12,7 @@ import { import { FollowButton } from './contentPreference/FollowButton'; import { ContentPreferenceType } from '../graphql/contentPreference'; import { Origin } from '../lib/log'; -import { WithClassNameProps } from './utilities'; +import type { WithClassNameProps } from './utilities'; import { useUserShortByIdQuery } from '../hooks/user/useUserShortByIdQuery'; import { useContentPreferenceStatusQuery } from '../hooks/contentPreference/useContentPreferenceStatusQuery'; diff --git a/packages/shared/src/components/TagLinks.tsx b/packages/shared/src/components/TagLinks.tsx index 9132bd308d..08b1d0b32e 100644 --- a/packages/shared/src/components/TagLinks.tsx +++ b/packages/shared/src/components/TagLinks.tsx @@ -1,12 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import Link from './utilities/Link'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from './buttons/Button'; +import type { ButtonProps } from './buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from './buttons/Button'; import { AlertDot, AlertColor } from './AlertDot'; import { getTagPageLink } from '../lib/links'; diff --git a/packages/shared/src/components/TopReaderIn.tsx b/packages/shared/src/components/TopReaderIn.tsx index 58dcbe770e..be4919efd9 100644 --- a/packages/shared/src/components/TopReaderIn.tsx +++ b/packages/shared/src/components/TopReaderIn.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { TruncateText, type WithClassNameProps } from './utilities'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { WithClassNameProps } from './utilities'; +import { TruncateText } from './utilities'; import type { TopReader } from './badges/TopReaderBadge'; import ConditionalWrapper from './ConditionalWrapper'; import { SimpleTooltip } from './tooltips'; diff --git a/packages/shared/src/components/UpgradeToPlus.tsx b/packages/shared/src/components/UpgradeToPlus.tsx index 01444af78a..ce02ab2ee7 100644 --- a/packages/shared/src/components/UpgradeToPlus.tsx +++ b/packages/shared/src/components/UpgradeToPlus.tsx @@ -1,21 +1,18 @@ import React, { useCallback } from 'react'; import type { ReactElement } from 'react'; import classNames from 'classnames'; -import { - Button, - ButtonVariant, - type ButtonSize, - type ButtonColor, -} from './buttons/Button'; +import type { ButtonSize, ButtonColor } from './buttons/Button'; +import { Button, ButtonVariant } from './buttons/Button'; import { DevPlusIcon } from './icons'; import Link from './utilities/Link'; import { plusUrl } from '../lib/constants'; import { useViewSize, ViewSize } from '../hooks'; import { usePlusSubscription } from '../hooks/usePlusSubscription'; -import { LogEvent, TargetId } from '../lib/log'; +import type { TargetId } from '../lib/log'; +import { LogEvent } from '../lib/log'; import { useAuthContext } from '../contexts/AuthContext'; import { AuthTriggers } from '../lib/auth'; -import { WithClassNameProps } from './utilities'; +import type { WithClassNameProps } from './utilities'; type Props = { iconOnly?: boolean; diff --git a/packages/shared/src/components/UserBadge.tsx b/packages/shared/src/components/UserBadge.tsx index 5ea26d5013..b442bec28f 100644 --- a/packages/shared/src/components/UserBadge.tsx +++ b/packages/shared/src/components/UserBadge.tsx @@ -1,6 +1,8 @@ import classNames from 'classnames'; -import React, { FunctionComponent, ReactElement, ReactNode } from 'react'; -import { IconProps, IconSize } from './Icon'; +import type { FunctionComponent, ReactElement, ReactNode } from 'react'; +import React from 'react'; +import type { IconProps } from './Icon'; +import { IconSize } from './Icon'; import { useViewSize, ViewSize } from '../hooks'; export type UserBadgeProps = { diff --git a/packages/shared/src/components/VerifiedCompanyUserBadge.tsx b/packages/shared/src/components/VerifiedCompanyUserBadge.tsx index 48dd806fc9..2c5d0e8e9f 100644 --- a/packages/shared/src/components/VerifiedCompanyUserBadge.tsx +++ b/packages/shared/src/components/VerifiedCompanyUserBadge.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import type { PublicProfile } from '../lib/user'; import { SimpleTooltip } from './tooltips'; import { ProfileImageSize, ProfilePicture } from './ProfilePicture'; diff --git a/packages/shared/src/components/alert/AlertBanner.tsx b/packages/shared/src/components/alert/AlertBanner.tsx index d888f2a24b..cf1594fe89 100644 --- a/packages/shared/src/components/alert/AlertBanner.tsx +++ b/packages/shared/src/components/alert/AlertBanner.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { Alert, AlertBackground } from './common'; interface ClassName { diff --git a/packages/shared/src/components/alert/AlertPointer.tsx b/packages/shared/src/components/alert/AlertPointer.tsx index b21dfedfe7..f0abca5eab 100644 --- a/packages/shared/src/components/alert/AlertPointer.tsx +++ b/packages/shared/src/components/alert/AlertPointer.tsx @@ -1,4 +1,5 @@ -import React, { CSSProperties, ReactElement, ReactNode, useRef } from 'react'; +import type { CSSProperties, ReactElement, ReactNode } from 'react'; +import React, { useRef } from 'react'; import classNames from 'classnames'; import { ButtonSize } from '../buttons/Button'; import { diff --git a/packages/shared/src/components/alert/Pointer.tsx b/packages/shared/src/components/alert/Pointer.tsx index 48340c35b0..61190323f2 100644 --- a/packages/shared/src/components/alert/Pointer.tsx +++ b/packages/shared/src/components/alert/Pointer.tsx @@ -1,9 +1,5 @@ -import React, { - CSSProperties, - forwardRef, - MutableRefObject, - ReactElement, -} from 'react'; +import type { CSSProperties, MutableRefObject, ReactElement } from 'react'; +import React, { forwardRef } from 'react'; import classed from '../../lib/classed'; const PointerContainer = classed('div', 'h-5 z-3 flex flex-col items-center'); diff --git a/packages/shared/src/components/auth/AuthContainer.tsx b/packages/shared/src/components/auth/AuthContainer.tsx index bceb5b39a9..3cf26b0b1e 100644 --- a/packages/shared/src/components/auth/AuthContainer.tsx +++ b/packages/shared/src/components/auth/AuthContainer.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { forwardRef, HTMLAttributes, MutableRefObject } from 'react'; +import type { HTMLAttributes, MutableRefObject } from 'react'; +import React, { forwardRef } from 'react'; import classed from '../../lib/classed'; const Container = classed('div', 'flex flex-col gap-3 self-center mt-6 w-full'); diff --git a/packages/shared/src/components/auth/AuthDefault.tsx b/packages/shared/src/components/auth/AuthDefault.tsx index 9845cf8a02..651f19ed00 100644 --- a/packages/shared/src/components/auth/AuthDefault.tsx +++ b/packages/shared/src/components/auth/AuthDefault.tsx @@ -1,19 +1,16 @@ -import React, { - ReactElement, - ReactNode, - useContext, - useEffect, - useRef, - useState, -} from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useEffect, useRef, useState } from 'react'; import { useMutation } from '@tanstack/react-query'; import dynamic from 'next/dynamic'; import { checkKratosEmail } from '../../lib/kratos'; -import { AuthFormProps, Provider, getFormEmail } from './common'; +import type { AuthFormProps, Provider } from './common'; +import { getFormEmail } from './common'; import EmailSignupForm from './EmailSignupForm'; -import LoginForm, { LoginFormParams } from './LoginForm'; +import type { LoginFormParams } from './LoginForm'; +import LoginForm from './LoginForm'; import LogContext from '../../contexts/LogContext'; -import { AuthEventNames, AuthTriggersType } from '../../lib/auth'; +import type { AuthTriggersType } from '../../lib/auth'; +import { AuthEventNames } from '../../lib/auth'; import AuthContainer from './AuthContainer'; import AuthHeader from './AuthHeader'; import ConditionalWrapper from '../ConditionalWrapper'; diff --git a/packages/shared/src/components/auth/AuthForm.tsx b/packages/shared/src/components/auth/AuthForm.tsx index a62c1029b1..eb7e2d9a67 100644 --- a/packages/shared/src/components/auth/AuthForm.tsx +++ b/packages/shared/src/components/auth/AuthForm.tsx @@ -1,10 +1,6 @@ import classNames from 'classnames'; -import React, { - FormHTMLAttributes, - forwardRef, - MutableRefObject, - ReactElement, -} from 'react'; +import type { FormHTMLAttributes, MutableRefObject, ReactElement } from 'react'; +import React, { forwardRef } from 'react'; function AuthForm( { children, className, ...props }: FormHTMLAttributes, diff --git a/packages/shared/src/components/auth/AuthHeader.tsx b/packages/shared/src/components/auth/AuthHeader.tsx index 88144a9b43..8e8f0ae2e3 100644 --- a/packages/shared/src/components/auth/AuthHeader.tsx +++ b/packages/shared/src/components/auth/AuthHeader.tsx @@ -1,10 +1,11 @@ -import React, { +import type { FormEvent, MouseEvent, KeyboardEvent, ReactElement, ComponentProps, } from 'react'; +import React from 'react'; import { Button, ButtonVariant } from '../buttons/Button'; import { ArrowIcon } from '../icons'; import { Modal } from '../modals/common/Modal'; diff --git a/packages/shared/src/components/auth/AuthModal.tsx b/packages/shared/src/components/auth/AuthModal.tsx index e0899bbcc1..57c7d28ac1 100644 --- a/packages/shared/src/components/auth/AuthModal.tsx +++ b/packages/shared/src/components/auth/AuthModal.tsx @@ -1,12 +1,16 @@ -import React, { ReactElement, useContext, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useState } from 'react'; import classNames from 'classnames'; import AuthOptions, { AuthDisplay as Display } from './AuthOptions'; import useAuthForms from '../../hooks/useAuthForms'; import AuthContext from '../../contexts/AuthContext'; -import { AuthEventNames, AuthTriggersType } from '../../lib/auth'; +import type { AuthTriggersType } from '../../lib/auth'; +import { AuthEventNames } from '../../lib/auth'; import LogContext from '../../contexts/LogContext'; -import { Modal, ModalProps } from '../modals/common/Modal'; -import { AnonymousUser, LoggedUser, LogoutReason } from '../../lib/user'; +import type { ModalProps } from '../modals/common/Modal'; +import { Modal } from '../modals/common/Modal'; +import type { AnonymousUser, LoggedUser } from '../../lib/user'; +import { LogoutReason } from '../../lib/user'; import { logPixelSignUp } from '../Pixels'; export interface AuthModalProps extends ModalProps { diff --git a/packages/shared/src/components/auth/AuthModalFooter.tsx b/packages/shared/src/components/auth/AuthModalFooter.tsx index 03bb3e5a2c..bf4e373fe9 100644 --- a/packages/shared/src/components/auth/AuthModalFooter.tsx +++ b/packages/shared/src/components/auth/AuthModalFooter.tsx @@ -1,4 +1,5 @@ -import React, { MouseEventHandler, ReactElement } from 'react'; +import type { MouseEventHandler, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ClickableText } from '../buttons/ClickableText'; import { Modal } from '../modals/common/Modal'; diff --git a/packages/shared/src/components/auth/AuthModalHeading.tsx b/packages/shared/src/components/auth/AuthModalHeading.tsx index 62ea7859a4..5c5851462b 100644 --- a/packages/shared/src/components/auth/AuthModalHeading.tsx +++ b/packages/shared/src/components/auth/AuthModalHeading.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; interface AuthModalHeadingProps { diff --git a/packages/shared/src/components/auth/AuthOptions.tsx b/packages/shared/src/components/auth/AuthOptions.tsx index aa4936508f..ec870a601a 100644 --- a/packages/shared/src/components/auth/AuthOptions.tsx +++ b/packages/shared/src/components/auth/AuthOptions.tsx @@ -1,22 +1,13 @@ -import React, { - MutableRefObject, - ReactElement, - useEffect, - useRef, - useState, -} from 'react'; +import type { MutableRefObject, ReactElement } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; import dynamic from 'next/dynamic'; import { useAuthContext } from '../../contexts/AuthContext'; import { Tab, TabContainer } from '../tabs/TabContainer'; -import { RegistrationFormValues } from './RegistrationForm'; -import { - AuthEventNames, - AuthTriggersType, - getNodeValue, - RegistrationError, -} from '../../lib/auth'; +import type { RegistrationFormValues } from './RegistrationForm'; +import type { AuthTriggersType, RegistrationError } from '../../lib/auth'; +import { AuthEventNames, getNodeValue } from '../../lib/auth'; import useRegistration from '../../hooks/useRegistration'; import { AuthEvent, @@ -29,19 +20,16 @@ import { storageWrapper as storage } from '../../lib/storageWrapper'; import { providers } from './common'; import useLogin from '../../hooks/useLogin'; import useProfileForm from '../../hooks/useProfileForm'; -import { CloseAuthModalFunc } from '../../hooks/useAuthForms'; +import type { CloseAuthModalFunc } from '../../hooks/useAuthForms'; import { useLogContext } from '../../contexts/LogContext'; import { useSettingsContext } from '../../contexts/SettingsContext'; import { useToastNotification, useEventListener } from '../../hooks'; import { isTesting } from '../../lib/constants'; -import { - SignBackProvider, - SIGNIN_METHOD_KEY, - useSignBack, -} from '../../hooks/auth/useSignBack'; -import { AnonymousUser, LoggedUser } from '../../lib/user'; +import type { SignBackProvider } from '../../hooks/auth/useSignBack'; +import { SIGNIN_METHOD_KEY, useSignBack } from '../../hooks/auth/useSignBack'; +import type { AnonymousUser, LoggedUser } from '../../lib/user'; import { labels } from '../../lib'; -import { ButtonProps } from '../buttons/Button'; +import type { ButtonProps } from '../buttons/Button'; import usePersistentState from '../../hooks/usePersistentState'; const AuthDefault = dynamic( diff --git a/packages/shared/src/components/auth/AuthSignBack.tsx b/packages/shared/src/components/auth/AuthSignBack.tsx index e1812371cf..efb6494da7 100644 --- a/packages/shared/src/components/auth/AuthSignBack.tsx +++ b/packages/shared/src/components/auth/AuthSignBack.tsx @@ -1,17 +1,15 @@ -import React, { - MouseEventHandler, - ReactElement, - ReactNode, - useEffect, -} from 'react'; +import type { MouseEventHandler, ReactElement, ReactNode } from 'react'; +import React, { useEffect } from 'react'; import AuthHeader from './AuthHeader'; -import { AuthFormProps, providerMap } from './common'; +import type { AuthFormProps } from './common'; +import { providerMap } from './common'; import AuthModalFooter from './AuthModalFooter'; import AuthContainer from './AuthContainer'; import { useSignBack } from '../../hooks/auth/useSignBack'; import { ProfileImageSize, ProfilePicture } from '../ProfilePicture'; import { SignBackButton } from './SignBackButton'; -import LoginForm, { LoginFormProps } from './LoginForm'; +import type { LoginFormProps } from './LoginForm'; +import LoginForm from './LoginForm'; import ConditionalWrapper from '../ConditionalWrapper'; interface AuthSignBackProps extends AuthFormProps { diff --git a/packages/shared/src/components/auth/AuthenticationBanner.tsx b/packages/shared/src/components/auth/AuthenticationBanner.tsx index 47d710579d..d8b856814f 100644 --- a/packages/shared/src/components/auth/AuthenticationBanner.tsx +++ b/packages/shared/src/components/auth/AuthenticationBanner.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, type PropsWithChildren } from 'react'; +import type { ReactElement, PropsWithChildren } from 'react'; +import React from 'react'; import classNames from 'classnames'; import classed from '../../lib/classed'; import { OnboardingHeadline } from './OnboardingHeadline'; diff --git a/packages/shared/src/components/auth/ChangePasswordForm.tsx b/packages/shared/src/components/auth/ChangePasswordForm.tsx index 95776d5db5..7a973b107c 100644 --- a/packages/shared/src/components/auth/ChangePasswordForm.tsx +++ b/packages/shared/src/components/auth/ChangePasswordForm.tsx @@ -1,20 +1,21 @@ -import React, { FormEvent, ReactElement, useState } from 'react'; +import type { FormEvent, ReactElement } from 'react'; +import React, { useState } from 'react'; import { useMutation, useQuery } from '@tanstack/react-query'; import { formToJson } from '../../lib/form'; import { Button, ButtonVariant } from '../buttons/Button'; import AuthHeader from './AuthHeader'; -import { AuthFormProps, AuthModalText } from './common'; +import type { AuthFormProps } from './common'; +import { AuthModalText } from './common'; import { AuthFlow, initializeKratosFlow, submitKratosFlow, } from '../../lib/kratos'; -import { - errorsToJson, - getNodeValue, +import type { RegistrationParameters, ValidateRegistrationParams, } from '../../lib/auth'; +import { errorsToJson, getNodeValue } from '../../lib/auth'; import AuthForm from './AuthForm'; import { PasswordField } from '../fields/PasswordField'; import { useToastNotification } from '../../hooks/useToastNotification'; diff --git a/packages/shared/src/components/auth/CodeVerificationForm.tsx b/packages/shared/src/components/auth/CodeVerificationForm.tsx index 3e48be6191..e919a63cab 100644 --- a/packages/shared/src/components/auth/CodeVerificationForm.tsx +++ b/packages/shared/src/components/auth/CodeVerificationForm.tsx @@ -1,10 +1,12 @@ -import React, { ReactElement, useContext, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useState } from 'react'; import { formToJson } from '../../lib/form'; import { Button, ButtonVariant } from '../buttons/Button'; import { TextField } from '../fields/TextField'; -import { CloseModalFunc } from '../modals/common'; +import type { CloseModalFunc } from '../modals/common'; import AuthHeader from './AuthHeader'; -import { AuthFormProps, AuthModalText } from './common'; +import type { AuthFormProps } from './common'; +import { AuthModalText } from './common'; import { AuthFlow } from '../../lib/kratos'; import useAccountEmailFlow from '../../hooks/useAccountEmailFlow'; import { AuthEventNames } from '../../lib/auth'; diff --git a/packages/shared/src/components/auth/CustomAuthBanner.tsx b/packages/shared/src/components/auth/CustomAuthBanner.tsx index 943b086b1d..4c86f8b6b9 100644 --- a/packages/shared/src/components/auth/CustomAuthBanner.tsx +++ b/packages/shared/src/components/auth/CustomAuthBanner.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { useOnboarding } from '../../hooks/auth'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/components/auth/EmailCodeVerification.tsx b/packages/shared/src/components/auth/EmailCodeVerification.tsx index 51e89428e7..b784bae32c 100644 --- a/packages/shared/src/components/auth/EmailCodeVerification.tsx +++ b/packages/shared/src/components/auth/EmailCodeVerification.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement, useContext, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import classNames from 'classnames'; import { Button } from '../buttons/Button'; import { TextField } from '../fields/TextField'; -import { AuthFormProps } from './common'; +import type { AuthFormProps } from './common'; import { AuthFlow } from '../../lib/kratos'; import useAccountEmailFlow from '../../hooks/useAccountEmailFlow'; import AuthForm from './AuthForm'; diff --git a/packages/shared/src/components/auth/EmailSignupForm.tsx b/packages/shared/src/components/auth/EmailSignupForm.tsx index 91ad448a6e..74ce83ef8f 100644 --- a/packages/shared/src/components/auth/EmailSignupForm.tsx +++ b/packages/shared/src/components/auth/EmailSignupForm.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useId, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useId, useState } from 'react'; import SignupDisclaimer from './SignupDisclaimer'; import AuthForm from './AuthForm'; import { TextField } from '../fields/TextField'; diff --git a/packages/shared/src/components/auth/ForgotPasswordForm.spec.tsx b/packages/shared/src/components/auth/ForgotPasswordForm.spec.tsx index 674d84b823..ca90e03b65 100644 --- a/packages/shared/src/components/auth/ForgotPasswordForm.spec.tsx +++ b/packages/shared/src/components/auth/ForgotPasswordForm.spec.tsx @@ -1,11 +1,6 @@ import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import nock from 'nock'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { waitForNock } from '../../../__tests__/helpers/utilities'; @@ -13,7 +8,7 @@ import { emailSentRecoveryMockData, passwordRecoveryFlowMockData, } from '../../../__tests__/fixture/auth'; -import { AccountRecoveryParameters } from '../../lib/auth'; +import type { AccountRecoveryParameters } from '../../lib/auth'; import { AuthContextProvider } from '../../contexts/AuthContext'; import { formToJson } from '../../lib/form'; import ForgotPasswordForm from './ForgotPasswordForm'; diff --git a/packages/shared/src/components/auth/ForgotPasswordForm.tsx b/packages/shared/src/components/auth/ForgotPasswordForm.tsx index 5dd8043671..005a7d3957 100644 --- a/packages/shared/src/components/auth/ForgotPasswordForm.tsx +++ b/packages/shared/src/components/auth/ForgotPasswordForm.tsx @@ -1,12 +1,14 @@ -import React, { FormEvent, ReactElement, useContext, useState } from 'react'; +import type { FormEvent, ReactElement } from 'react'; +import React, { useContext, useState } from 'react'; import dynamic from 'next/dynamic'; import { formToJson } from '../../lib/form'; import { Button, ButtonVariant } from '../buttons/Button'; import { TextField } from '../fields/TextField'; import { MailIcon } from '../icons'; -import { CloseModalFunc } from '../modals/common'; +import type { CloseModalFunc } from '../modals/common'; import AuthHeader from './AuthHeader'; -import { AuthFormProps, AuthModalText } from './common'; +import type { AuthFormProps } from './common'; +import { AuthModalText } from './common'; import TokenInput from './TokenField'; import { AuthFlow } from '../../lib/kratos'; import useAccountEmailFlow from '../../hooks/useAccountEmailFlow'; diff --git a/packages/shared/src/components/auth/LoginForm.spec.tsx b/packages/shared/src/components/auth/LoginForm.spec.tsx index 53490336db..3cc3502d31 100644 --- a/packages/shared/src/components/auth/LoginForm.spec.tsx +++ b/packages/shared/src/components/auth/LoginForm.spec.tsx @@ -1,11 +1,6 @@ import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import nock from 'nock'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { waitForNock } from '../../../__tests__/helpers/utilities'; @@ -17,14 +12,12 @@ import { passwordLoginFlowMockData, successfulRegistrationMockData, } from '../../../__tests__/fixture/auth'; -import { - AuthTriggers, - getNodeByKey, - LoginPasswordParameters, -} from '../../lib/auth'; +import type { LoginPasswordParameters } from '../../lib/auth'; +import { AuthTriggers, getNodeByKey } from '../../lib/auth'; import { AuthContextProvider } from '../../contexts/AuthContext'; import { formToJson } from '../../lib/form'; -import AuthOptions, { AuthOptionsProps } from './AuthOptions'; +import type { AuthOptionsProps } from './AuthOptions'; +import AuthOptions from './AuthOptions'; import SettingsContext from '../../contexts/SettingsContext'; let user = null; diff --git a/packages/shared/src/components/auth/LoginForm.tsx b/packages/shared/src/components/auth/LoginForm.tsx index 43ef384e1a..5a069e2c98 100644 --- a/packages/shared/src/components/auth/LoginForm.tsx +++ b/packages/shared/src/components/auth/LoginForm.tsx @@ -1,6 +1,7 @@ import classNames from 'classnames'; -import React, { FormEvent, ReactElement, useState } from 'react'; -import { LoginPasswordParameters } from '../../lib/auth'; +import type { FormEvent, ReactElement } from 'react'; +import React, { useState } from 'react'; +import type { LoginPasswordParameters } from '../../lib/auth'; import { formToJson } from '../../lib/form'; import { Button, ButtonVariant } from '../buttons/Button'; import { ClickableText } from '../buttons/ClickableText'; diff --git a/packages/shared/src/components/auth/OnboardingHeadline.tsx b/packages/shared/src/components/auth/OnboardingHeadline.tsx index bf834176c9..62d69cf2a8 100644 --- a/packages/shared/src/components/auth/OnboardingHeadline.tsx +++ b/packages/shared/src/components/auth/OnboardingHeadline.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { OnboardingGradientClasses } from '../onboarding/common'; import { Typography } from '../typography/Typography'; diff --git a/packages/shared/src/components/auth/OnboardingRegistrationForm.tsx b/packages/shared/src/components/auth/OnboardingRegistrationForm.tsx index 9bb7c8efb8..aab77fa35e 100644 --- a/packages/shared/src/components/auth/OnboardingRegistrationForm.tsx +++ b/packages/shared/src/components/auth/OnboardingRegistrationForm.tsx @@ -1,17 +1,16 @@ -import React, { ReactElement, useContext, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { useMutation } from '@tanstack/react-query'; import classNames from 'classnames'; import { checkKratosEmail } from '../../lib/kratos'; -import { AuthFormProps, getFormEmail, providerMap } from './common'; +import type { AuthFormProps } from './common'; +import { getFormEmail, providerMap } from './common'; import OrDivider from './OrDivider'; import LogContext from '../../contexts/LogContext'; -import { AuthEventNames, AuthTriggersType } from '../../lib/auth'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from '../buttons/Button'; +import type { AuthTriggersType } from '../../lib/auth'; +import { AuthEventNames } from '../../lib/auth'; +import type { ButtonProps } from '../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import AuthForm from './AuthForm'; import { TextField } from '../fields/TextField'; import { MailIcon } from '../icons'; diff --git a/packages/shared/src/components/auth/OrDivider.tsx b/packages/shared/src/components/auth/OrDivider.tsx index b3c2db8d88..cf88702b7c 100644 --- a/packages/shared/src/components/auth/OrDivider.tsx +++ b/packages/shared/src/components/auth/OrDivider.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; interface ClassName { diff --git a/packages/shared/src/components/auth/PostAuthBanner.tsx b/packages/shared/src/components/auth/PostAuthBanner.tsx index 632af9c48c..bde665146e 100644 --- a/packages/shared/src/components/auth/PostAuthBanner.tsx +++ b/packages/shared/src/components/auth/PostAuthBanner.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useSearchParams } from 'next/navigation'; import dynamic from 'next/dynamic'; import { AuthenticationBanner } from './AuthenticationBanner'; diff --git a/packages/shared/src/components/auth/RegistrationForm.spec.tsx b/packages/shared/src/components/auth/RegistrationForm.spec.tsx index 85889e731c..7753b7c1be 100644 --- a/packages/shared/src/components/auth/RegistrationForm.spec.tsx +++ b/packages/shared/src/components/auth/RegistrationForm.spec.tsx @@ -1,11 +1,6 @@ import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import nock from 'nock'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { waitForNock } from '../../../__tests__/helpers/utilities'; @@ -15,7 +10,8 @@ import { mockRegistrationFlow, } from '../../../__tests__/fixture/auth'; import { AuthContextProvider } from '../../contexts/AuthContext'; -import AuthOptions, { AuthOptionsProps } from './AuthOptions'; +import type { AuthOptionsProps } from './AuthOptions'; +import AuthOptions from './AuthOptions'; import SettingsContext from '../../contexts/SettingsContext'; import { mockGraphQL } from '../../../__tests__/helpers/graphql'; import { GET_USERNAME_SUGGESTION } from '../../graphql/users'; diff --git a/packages/shared/src/components/auth/RegistrationForm.tsx b/packages/shared/src/components/auth/RegistrationForm.tsx index 4f07f16134..599a1f68e6 100644 --- a/packages/shared/src/components/auth/RegistrationForm.tsx +++ b/packages/shared/src/components/auth/RegistrationForm.tsx @@ -1,32 +1,25 @@ import classNames from 'classnames'; -import React, { - MutableRefObject, - ReactElement, - useContext, - useEffect, - useId, - useState, -} from 'react'; -import { - AuthEventNames, - AuthTriggers, +import type { MutableRefObject, ReactElement } from 'react'; +import React, { useContext, useEffect, useId, useState } from 'react'; +import type { AuthTriggersType, RegistrationError, RegistrationParameters, } from '../../lib/auth'; +import { AuthEventNames, AuthTriggers } from '../../lib/auth'; import { formToJson } from '../../lib/form'; import { Button, ButtonVariant } from '../buttons/Button'; import { PasswordField } from '../fields/PasswordField'; import { TextField } from '../fields/TextField'; import { MailIcon, UserIcon, VIcon, AtIcon, TwitterIcon } from '../icons'; -import { CloseModalFunc } from '../modals/common'; +import type { CloseModalFunc } from '../modals/common'; import AuthHeader from './AuthHeader'; import TokenInput from './TokenField'; import AuthForm from './AuthForm'; import { Checkbox } from '../fields/Checkbox'; import LogContext from '../../contexts/LogContext'; import { useGenerateUsername } from '../../hooks'; -import { AuthFormProps } from './common'; +import type { AuthFormProps } from './common'; import ConditionalWrapper from '../ConditionalWrapper'; import AuthContainer from './AuthContainer'; import { onValidateHandles } from '../../hooks/useProfileForm'; diff --git a/packages/shared/src/components/auth/SignBackButton.tsx b/packages/shared/src/components/auth/SignBackButton.tsx index 7366d49bd1..02332bfb65 100644 --- a/packages/shared/src/components/auth/SignBackButton.tsx +++ b/packages/shared/src/components/auth/SignBackButton.tsx @@ -1,6 +1,10 @@ -import React, { MouseEventHandler, ReactElement } from 'react'; +import type { MouseEventHandler, ReactElement } from 'react'; +import React from 'react'; import { ProfileImageSize, ProfilePicture } from '../ProfilePicture'; -import { SignBackProvider, SignedInUser } from '../../hooks/auth/useSignBack'; +import type { + SignBackProvider, + SignedInUser, +} from '../../hooks/auth/useSignBack'; import { providerMap } from './common'; interface SignBackButtonProps { diff --git a/packages/shared/src/components/auth/SignupDisclaimer.tsx b/packages/shared/src/components/auth/SignupDisclaimer.tsx index 0a96f46572..8935f548b7 100644 --- a/packages/shared/src/components/auth/SignupDisclaimer.tsx +++ b/packages/shared/src/components/auth/SignupDisclaimer.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { privacyPolicy, termsOfService } from '../../lib/constants'; diff --git a/packages/shared/src/components/auth/SocialRegistrationForm.tsx b/packages/shared/src/components/auth/SocialRegistrationForm.tsx index a5d4512f67..c0b348e202 100644 --- a/packages/shared/src/components/auth/SocialRegistrationForm.tsx +++ b/packages/shared/src/components/auth/SocialRegistrationForm.tsx @@ -1,26 +1,21 @@ import classNames from 'classnames'; -import React, { - MutableRefObject, - ReactElement, - useContext, - useEffect, - useState, -} from 'react'; -import { - AuthEventNames, - AuthTriggers, +import type { MutableRefObject, ReactElement } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; +import type { AuthTriggersType, SocialRegistrationParameters, } from '../../lib/auth'; +import { AuthEventNames, AuthTriggers } from '../../lib/auth'; import { formToJson } from '../../lib/form'; import { Button, ButtonVariant } from '../buttons/Button'; import ImageInput from '../fields/ImageInput'; import { TextField } from '../fields/TextField'; import { MailIcon, UserIcon, LockIcon, AtIcon, TwitterIcon } from '../icons'; import AuthHeader from './AuthHeader'; -import { AuthFormProps, providerMap } from './common'; +import type { AuthFormProps } from './common'; +import { providerMap } from './common'; import AuthContext from '../../contexts/AuthContext'; -import { ProfileFormHint } from '../../hooks/useProfileForm'; +import type { ProfileFormHint } from '../../hooks/useProfileForm'; import { Checkbox } from '../fields/Checkbox'; import LogContext from '../../contexts/LogContext'; import AuthForm from './AuthForm'; @@ -29,7 +24,8 @@ import { IconSize } from '../Icon'; import { useGenerateUsername } from '../../hooks'; import AuthContainer from './AuthContainer'; import ConditionalWrapper from '../ConditionalWrapper'; -import { SignBackProvider, useSignBack } from '../../hooks/auth/useSignBack'; +import type { SignBackProvider } from '../../hooks/auth/useSignBack'; +import { useSignBack } from '../../hooks/auth/useSignBack'; import ExperienceLevelDropdown from '../profile/ExperienceLevelDropdown'; import { LanguageDropdown } from '../profile/LanguageDropdown'; diff --git a/packages/shared/src/components/auth/TokenField.tsx b/packages/shared/src/components/auth/TokenField.tsx index 1cc2b9d256..85f3449c7e 100644 --- a/packages/shared/src/components/auth/TokenField.tsx +++ b/packages/shared/src/components/auth/TokenField.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; interface TokenInputProps { token: string; diff --git a/packages/shared/src/components/auth/VerifySessionModal.tsx b/packages/shared/src/components/auth/VerifySessionModal.tsx index fee09575dc..855b06f237 100644 --- a/packages/shared/src/components/auth/VerifySessionModal.tsx +++ b/packages/shared/src/components/auth/VerifySessionModal.tsx @@ -1,11 +1,13 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { useQueryClient } from '@tanstack/react-query'; import { providers } from './common'; import AuthDefault from './AuthDefault'; import { AuthTriggers } from '../../lib/auth'; -import { Modal, ModalProps } from '../modals/common/Modal'; +import type { ModalProps } from '../modals/common/Modal'; +import { Modal } from '../modals/common/Modal'; import useLogin from '../../hooks/useLogin'; -import { AuthSession } from '../../lib/kratos'; +import type { AuthSession } from '../../lib/kratos'; import { generateQueryKey, RequestKey } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/components/auth/common.tsx b/packages/shared/src/components/auth/common.tsx index b4f24cee02..49235b1b21 100644 --- a/packages/shared/src/components/auth/common.tsx +++ b/packages/shared/src/components/auth/common.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { FacebookIcon, GoogleIcon, GitHubIcon, AppleIcon } from '../icons'; import classed from '../../lib/classed'; -import { IconType } from '../buttons/Button'; +import type { IconType } from '../buttons/Button'; export interface Provider { icon: IconType; diff --git a/packages/shared/src/components/badges/BadgeIcon.tsx b/packages/shared/src/components/badges/BadgeIcon.tsx index ff8aec9371..c7bb9f4044 100644 --- a/packages/shared/src/components/badges/BadgeIcon.tsx +++ b/packages/shared/src/components/badges/BadgeIcon.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import type { WithClassNameProps } from '../utilities'; import colors from '../../styles/colors'; diff --git a/packages/shared/src/components/badges/TopReaderBadge.tsx b/packages/shared/src/components/badges/TopReaderBadge.tsx index 1f8ed1f967..67515742b9 100644 --- a/packages/shared/src/components/badges/TopReaderBadge.tsx +++ b/packages/shared/src/components/badges/TopReaderBadge.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { DevCardTheme, themeToLinearGradient } from '../profile/devcard'; import LogoIcon from '../../svg/LogoIcon'; import LogoText from '../../svg/LogoText'; diff --git a/packages/shared/src/components/banners/personalized/GeoPersonalizedBanner.tsx b/packages/shared/src/components/banners/personalized/GeoPersonalizedBanner.tsx index 72895ffd41..490837bfe5 100644 --- a/packages/shared/src/components/banners/personalized/GeoPersonalizedBanner.tsx +++ b/packages/shared/src/components/banners/personalized/GeoPersonalizedBanner.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { geoToCountry, geoToEmoji } from '../../../lib/geo'; import { AuthenticationBanner, OnboardingHeadline } from '../../auth'; diff --git a/packages/shared/src/components/banners/personalized/SocialPersonalizedBanner.tsx b/packages/shared/src/components/banners/personalized/SocialPersonalizedBanner.tsx index 3fd537efa8..d6edee74fc 100644 --- a/packages/shared/src/components/banners/personalized/SocialPersonalizedBanner.tsx +++ b/packages/shared/src/components/banners/personalized/SocialPersonalizedBanner.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { AuthenticationBanner, OnboardingHeadline } from '../../auth'; import { diff --git a/packages/shared/src/components/banners/personalized/UserPersonalizedBanner.tsx b/packages/shared/src/components/banners/personalized/UserPersonalizedBanner.tsx index 1b3eb77fdd..6b6b0a2b1a 100644 --- a/packages/shared/src/components/banners/personalized/UserPersonalizedBanner.tsx +++ b/packages/shared/src/components/banners/personalized/UserPersonalizedBanner.tsx @@ -1,5 +1,6 @@ import { useQuery } from '@tanstack/react-query'; -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { getBasicUserInfo } from '../../../graphql/users'; import { AuthenticationBanner, OnboardingHeadline } from '../../auth'; diff --git a/packages/shared/src/components/bookmark/BookmarkFolderContextMenu.tsx b/packages/shared/src/components/bookmark/BookmarkFolderContextMenu.tsx index 0b16a6f7f8..66a28eec26 100644 --- a/packages/shared/src/components/bookmark/BookmarkFolderContextMenu.tsx +++ b/packages/shared/src/components/bookmark/BookmarkFolderContextMenu.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement, useId } from 'react'; -import { BookmarkFolder } from '../../graphql/bookmarks'; +import type { ReactElement } from 'react'; +import React, { useId } from 'react'; +import type { BookmarkFolder } from '../../graphql/bookmarks'; import useContextMenu from '../../hooks/useContextMenu'; import { usePrompt } from '../../hooks/usePrompt'; import OptionsButton from '../buttons/OptionsButton'; diff --git a/packages/shared/src/components/buttons/BookmarkButton.tsx b/packages/shared/src/components/buttons/BookmarkButton.tsx index b1bd878484..dc5c286565 100644 --- a/packages/shared/src/components/buttons/BookmarkButton.tsx +++ b/packages/shared/src/components/buttons/BookmarkButton.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement, MouseEvent, ReactNode } from 'react'; -import { Post } from '../../graphql/posts'; +import type { ReactElement, MouseEvent, ReactNode } from 'react'; +import React from 'react'; +import type { Post } from '../../graphql/posts'; import ContextMenu from '../fields/ContextMenu'; -import { QuaternaryButton, QuaternaryButtonProps } from './QuaternaryButton'; +import type { QuaternaryButtonProps } from './QuaternaryButton'; +import { QuaternaryButton } from './QuaternaryButton'; import { BookmarkIcon } from '../icons'; import { SimpleTooltip } from '../tooltips'; import { BookmarkReminderIcon } from '../icons/Bookmark/Reminder'; diff --git a/packages/shared/src/components/buttons/Button.spec.tsx b/packages/shared/src/components/buttons/Button.spec.tsx index b08ee4c7ff..171fbe7443 100644 --- a/packages/shared/src/components/buttons/Button.spec.tsx +++ b/packages/shared/src/components/buttons/Button.spec.tsx @@ -1,12 +1,12 @@ -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import React from 'react'; +import type { ButtonProps, AllowedTags } from './Button'; import { Button, - ButtonProps, ButtonColor, ButtonVariant, ButtonIconPosition, - AllowedTags, } from './Button'; import { UpvoteIcon } from '../icons'; diff --git a/packages/shared/src/components/buttons/Button.tsx b/packages/shared/src/components/buttons/Button.tsx index dbcea917dc..64ba2fb126 100644 --- a/packages/shared/src/components/buttons/Button.tsx +++ b/packages/shared/src/components/buttons/Button.tsx @@ -1,13 +1,7 @@ -import React, { - forwardRef, - HTMLAttributes, - ReactElement, - ReactNode, - Ref, - useState, -} from 'react'; +import type { HTMLAttributes, ReactElement, ReactNode, Ref } from 'react'; +import React, { forwardRef, useState } from 'react'; import classNames from 'classnames'; -import { IconProps } from '../Icon'; +import type { IconProps } from '../Icon'; import { Loader } from '../Loader'; import { combinedClicks } from '../../lib/click'; diff --git a/packages/shared/src/components/buttons/ClickableText.spec.tsx b/packages/shared/src/components/buttons/ClickableText.spec.tsx index 1419993ad7..7ab0747951 100644 --- a/packages/shared/src/components/buttons/ClickableText.spec.tsx +++ b/packages/shared/src/components/buttons/ClickableText.spec.tsx @@ -1,6 +1,9 @@ -import { render, RenderResult, screen } from '@testing-library/react'; -import React, { HTMLAttributes, ReactNode } from 'react'; -import { ClickableText, BaseClickableTextProps } from './ClickableText'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; +import type { HTMLAttributes, ReactNode } from 'react'; +import React from 'react'; +import type { BaseClickableTextProps } from './ClickableText'; +import { ClickableText } from './ClickableText'; const renderComponent = < C extends HTMLElement = HTMLButtonElement, diff --git a/packages/shared/src/components/buttons/ClickableText.tsx b/packages/shared/src/components/buttons/ClickableText.tsx index ecba8ef405..4d2d31b300 100644 --- a/packages/shared/src/components/buttons/ClickableText.tsx +++ b/packages/shared/src/components/buttons/ClickableText.tsx @@ -1,4 +1,5 @@ -import React, { forwardRef, ReactElement, Ref } from 'react'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; type AvailableTags = keyof Pick; diff --git a/packages/shared/src/components/buttons/DeleteCustomFeed.tsx b/packages/shared/src/components/buttons/DeleteCustomFeed.tsx index ec81dc5e6d..3bb081d594 100644 --- a/packages/shared/src/components/buttons/DeleteCustomFeed.tsx +++ b/packages/shared/src/components/buttons/DeleteCustomFeed.tsx @@ -1,9 +1,11 @@ -import React, { type ReactElement } from 'react'; -import { ButtonSize, ButtonVariant, type ButtonProps, Button } from './Button'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ButtonProps } from './Button'; +import { ButtonSize, ButtonVariant, Button } from './Button'; import { SimpleTooltip } from '../tooltips'; import { useFeedSettingsEdit } from '../feeds/FeedSettings/useFeedSettingsEdit'; import { TrashIcon } from '../icons'; -import { WithClassNameProps } from '../utilities'; +import type { WithClassNameProps } from '../utilities'; type DeleteCustomFeedProps = { feedId: string; diff --git a/packages/shared/src/components/buttons/GetExtensionButton.tsx b/packages/shared/src/components/buttons/GetExtensionButton.tsx index a9b8d208db..4706c33e9c 100644 --- a/packages/shared/src/components/buttons/GetExtensionButton.tsx +++ b/packages/shared/src/components/buttons/GetExtensionButton.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { BrowserGroupIcon } from '../icons/Browsers'; import { IconSize } from '../Icon'; diff --git a/packages/shared/src/components/buttons/OptionsButton.tsx b/packages/shared/src/components/buttons/OptionsButton.tsx index a6958cf2ef..22e144db08 100644 --- a/packages/shared/src/components/buttons/OptionsButton.tsx +++ b/packages/shared/src/components/buttons/OptionsButton.tsx @@ -1,15 +1,11 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { - AllowedTags, - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from './Button'; +import type { AllowedTags, ButtonProps } from './Button'; +import { Button, ButtonSize, ButtonVariant } from './Button'; import { MenuIcon } from '../icons'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; -import { TooltipPosition } from '../tooltips/BaseTooltipContainer'; +import type { TooltipPosition } from '../tooltips/BaseTooltipContainer'; type OptionsButtonProps = ButtonProps & { tooltipPlacement?: TooltipPosition; diff --git a/packages/shared/src/components/buttons/QuaternaryButton.tsx b/packages/shared/src/components/buttons/QuaternaryButton.tsx index 2c8765ab9f..f4ee1c67c9 100644 --- a/packages/shared/src/components/buttons/QuaternaryButton.tsx +++ b/packages/shared/src/components/buttons/QuaternaryButton.tsx @@ -1,13 +1,13 @@ +import type { ReactElement, Ref } from 'react'; import React, { forwardRef, - ReactElement, - Ref, useImperativeHandle, useRef, useState, } from 'react'; import classNames from 'classnames'; -import { AllowedTags, Button, ButtonElementType, ButtonProps } from './Button'; +import type { AllowedTags, ButtonElementType, ButtonProps } from './Button'; +import { Button } from './Button'; export type QuaternaryButtonProps = ButtonProps & { diff --git a/packages/shared/src/components/buttons/ToggleClickbaitShield.tsx b/packages/shared/src/components/buttons/ToggleClickbaitShield.tsx index b0730ac326..2c032f5e71 100644 --- a/packages/shared/src/components/buttons/ToggleClickbaitShield.tsx +++ b/packages/shared/src/components/buttons/ToggleClickbaitShield.tsx @@ -1,13 +1,16 @@ -import React, { useState, type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { useQueryClient } from '@tanstack/react-query'; import { useRouter } from 'next/router'; -import { Button, ButtonSize, ButtonVariant, type ButtonProps } from './Button'; +import type { ButtonProps } from './Button'; +import { Button, ButtonSize, ButtonVariant } from './Button'; import { ShieldCheckIcon, ShieldIcon, ShieldPlusIcon } from '../icons'; import { useSettingsContext } from '../../contexts/SettingsContext'; import { usePlusSubscription } from '../../hooks'; import { SidebarSettingsFlags } from '../../graphql/settings'; import { useLogContext } from '../../contexts/LogContext'; -import { LogEvent, Origin, TargetId } from '../../lib/log'; +import type { Origin } from '../../lib/log'; +import { LogEvent, TargetId } from '../../lib/log'; import { SimpleTooltip } from '../tooltips'; import { useActiveFeedContext } from '../../contexts/ActiveFeedContext'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/components/buttons/common.ts b/packages/shared/src/components/buttons/common.ts index 20491b371a..d1214e1bff 100644 --- a/packages/shared/src/components/buttons/common.ts +++ b/packages/shared/src/components/buttons/common.ts @@ -2,7 +2,8 @@ import React from 'react'; import classNames from 'classnames'; import { ColorName as ButtonColor } from '../../styles/colors'; -import { IconProps, IconSize } from '../Icon'; +import type { IconProps } from '../Icon'; +import { IconSize } from '../Icon'; export enum ButtonSize { XLarge = 'xlarge', // only used for iconOnly buttons diff --git a/packages/shared/src/components/cards/AcquisitionForm/AcquisitionFormGrid.tsx b/packages/shared/src/components/cards/AcquisitionForm/AcquisitionFormGrid.tsx index d108c77250..f4d5ca869d 100644 --- a/packages/shared/src/components/cards/AcquisitionForm/AcquisitionFormGrid.tsx +++ b/packages/shared/src/components/cards/AcquisitionForm/AcquisitionFormGrid.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Card } from '../common/Card'; import { AcquisitionFormInner } from './common/AcquisitionFormInner'; diff --git a/packages/shared/src/components/cards/AcquisitionForm/AcquisitionFormList.tsx b/packages/shared/src/components/cards/AcquisitionForm/AcquisitionFormList.tsx index 7e7e888759..153dc918f6 100644 --- a/packages/shared/src/components/cards/AcquisitionForm/AcquisitionFormList.tsx +++ b/packages/shared/src/components/cards/AcquisitionForm/AcquisitionFormList.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ListCard } from '../common/list/ListCard'; import { AcquisitionFormInner } from './common/AcquisitionFormInner'; diff --git a/packages/shared/src/components/cards/AcquisitionForm/common/AcquisitionFormInner.tsx b/packages/shared/src/components/cards/AcquisitionForm/common/AcquisitionFormInner.tsx index 3116526d66..3a5379e115 100644 --- a/packages/shared/src/components/cards/AcquisitionForm/common/AcquisitionFormInner.tsx +++ b/packages/shared/src/components/cards/AcquisitionForm/common/AcquisitionFormInner.tsx @@ -1,15 +1,14 @@ import classNames from 'classnames'; -import React, { ReactElement, useContext, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { useRouter } from 'next/router'; import { useMutation } from '@tanstack/react-query'; import { OnboardingTitleGradient } from '../../../onboarding/common'; import { Button, ButtonSize, ButtonVariant } from '../../../buttons/Button'; import { MiniCloseIcon } from '../../../icons'; import { Radio } from '../../../fields/Radio'; -import { - AcquisitionChannel, - updateUserAcquisition, -} from '../../../../graphql/users'; +import type { AcquisitionChannel } from '../../../../graphql/users'; +import { updateUserAcquisition } from '../../../../graphql/users'; import LogContext from '../../../../contexts/LogContext'; import { removeQueryParam } from '../../../../lib'; import { LogEvent, UserAcquisitionEvent } from '../../../../lib/log'; diff --git a/packages/shared/src/components/cards/ActionsButtons/ActionButtons.tsx b/packages/shared/src/components/cards/ActionsButtons/ActionButtons.tsx index bf541441dd..72e8d43f2b 100644 --- a/packages/shared/src/components/cards/ActionsButtons/ActionButtons.tsx +++ b/packages/shared/src/components/cards/ActionsButtons/ActionButtons.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Post, UserVote } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; +import { UserVote } from '../../../graphql/posts'; import InteractionCounter from '../../InteractionCounter'; import { QuaternaryButton } from '../../buttons/QuaternaryButton'; import { diff --git a/packages/shared/src/components/cards/ActionsButtons/UpvoteButtonIcon.tsx b/packages/shared/src/components/cards/ActionsButtons/UpvoteButtonIcon.tsx index b5b3505254..841cb2669f 100644 --- a/packages/shared/src/components/cards/ActionsButtons/UpvoteButtonIcon.tsx +++ b/packages/shared/src/components/cards/ActionsButtons/UpvoteButtonIcon.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { UpvoteIcon } from '../../icons'; -import { IconProps } from '../../Icon'; +import type { IconProps } from '../../Icon'; export const UpvoteButtonIcon = React.memo(function UpvoteButtonIconComp( props: IconProps, diff --git a/packages/shared/src/components/cards/ActionsButtons/index.ts b/packages/shared/src/components/cards/ActionsButtons/index.ts index 4e90a0b100..c21ebd61bf 100644 --- a/packages/shared/src/components/cards/ActionsButtons/index.ts +++ b/packages/shared/src/components/cards/ActionsButtons/index.ts @@ -1,4 +1,5 @@ -import ActionButtons, { ActionButtonsProps } from './ActionButtons'; +import type { ActionButtonsProps } from './ActionButtons'; +import ActionButtons from './ActionButtons'; export type { ActionButtonsProps }; export default ActionButtons; diff --git a/packages/shared/src/components/cards/Freeform/FreeformGrid.tsx b/packages/shared/src/components/cards/Freeform/FreeformGrid.tsx index 458356121d..bc51b25ca8 100644 --- a/packages/shared/src/components/cards/Freeform/FreeformGrid.tsx +++ b/packages/shared/src/components/cards/Freeform/FreeformGrid.tsx @@ -1,6 +1,8 @@ -import React, { forwardRef, ReactElement, Ref, useRef } from 'react'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef, useRef } from 'react'; import classNames from 'classnames'; -import { Container, generateTitleClamp, PostCardProps } from '../common/common'; +import type { PostCardProps } from '../common/common'; +import { Container, generateTitleClamp } from '../common/common'; import { usePostImage } from '../../../hooks/post/usePostImage'; import FeedItemContainer from '../common/FeedItemContainer'; import { diff --git a/packages/shared/src/components/cards/Freeform/FreeformList.tsx b/packages/shared/src/components/cards/Freeform/FreeformList.tsx index 2f539552d9..99ad4fc042 100644 --- a/packages/shared/src/components/cards/Freeform/FreeformList.tsx +++ b/packages/shared/src/components/cards/Freeform/FreeformList.tsx @@ -1,8 +1,10 @@ -import React, { forwardRef, ReactElement, Ref, useMemo, useRef } from 'react'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef, useMemo, useRef } from 'react'; import classNames from 'classnames'; import { sanitize } from 'dompurify'; -import { Container, generateTitleClamp, PostCardProps } from '../common/common'; +import type { PostCardProps } from '../common/common'; +import { Container, generateTitleClamp } from '../common/common'; import { useFeedPreviewMode, useTruncatedSummary } from '../../../hooks'; import { usePostImage } from '../../../hooks/post/usePostImage'; import SquadHeaderPicture from '../common/SquadHeaderPicture'; diff --git a/packages/shared/src/components/cards/Leaderboard/CompanyTopList.tsx b/packages/shared/src/components/cards/Leaderboard/CompanyTopList.tsx index 1b549d43c1..83c3646d1c 100644 --- a/packages/shared/src/components/cards/Leaderboard/CompanyTopList.tsx +++ b/packages/shared/src/components/cards/Leaderboard/CompanyTopList.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { CommonLeaderboardProps, LeaderboardList } from './LeaderboardList'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { CommonLeaderboardProps } from './LeaderboardList'; +import { LeaderboardList } from './LeaderboardList'; import { LeaderboardListItem } from './LeaderboardListItem'; import type { Company } from '../../../lib/userCompany'; import { ProfileImageSize, ProfilePicture } from '../../ProfilePicture'; diff --git a/packages/shared/src/components/cards/Leaderboard/LeaderboardList.tsx b/packages/shared/src/components/cards/Leaderboard/LeaderboardList.tsx index 61b97058fa..1e428744ad 100644 --- a/packages/shared/src/components/cards/Leaderboard/LeaderboardList.tsx +++ b/packages/shared/src/components/cards/Leaderboard/LeaderboardList.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { LeaderboardListContainer } from './LeaderboardListContainer'; -import { LeaderboardListContainerProps } from './common'; +import type { LeaderboardListContainerProps } from './common'; import classed from '../../../lib/classed'; import { ElementPlaceholder } from '../../ElementPlaceholder'; diff --git a/packages/shared/src/components/cards/Leaderboard/LeaderboardListContainer.tsx b/packages/shared/src/components/cards/Leaderboard/LeaderboardListContainer.tsx index ceb1f36073..a7439bc77a 100644 --- a/packages/shared/src/components/cards/Leaderboard/LeaderboardListContainer.tsx +++ b/packages/shared/src/components/cards/Leaderboard/LeaderboardListContainer.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { LeaderboardCard, LeaderboardListContainerProps } from './common'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { LeaderboardListContainerProps } from './common'; +import { LeaderboardCard } from './common'; export function LeaderboardListContainer({ children, diff --git a/packages/shared/src/components/cards/Leaderboard/LeaderboardListItem.tsx b/packages/shared/src/components/cards/Leaderboard/LeaderboardListItem.tsx index 13d7e6ede9..9058da07dd 100644 --- a/packages/shared/src/components/cards/Leaderboard/LeaderboardListItem.tsx +++ b/packages/shared/src/components/cards/Leaderboard/LeaderboardListItem.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { largeNumberFormat } from '../../../lib'; import ConditionalWrapper from '../../ConditionalWrapper'; import Link from '../../utilities/Link'; diff --git a/packages/shared/src/components/cards/Leaderboard/SourceTopList.tsx b/packages/shared/src/components/cards/Leaderboard/SourceTopList.tsx index 9e30eeb11c..932ec2b37c 100644 --- a/packages/shared/src/components/cards/Leaderboard/SourceTopList.tsx +++ b/packages/shared/src/components/cards/Leaderboard/SourceTopList.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; -import { Source } from '../../../graphql/sources'; -import { CommonLeaderboardProps, LeaderboardList } from './LeaderboardList'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Source } from '../../../graphql/sources'; +import type { CommonLeaderboardProps } from './LeaderboardList'; +import { LeaderboardList } from './LeaderboardList'; import { LeaderboardListItem } from './LeaderboardListItem'; import { UserHighlight, UserType } from '../../widgets/PostUsersHighlights'; diff --git a/packages/shared/src/components/cards/Leaderboard/TagTopList.tsx b/packages/shared/src/components/cards/Leaderboard/TagTopList.tsx index 25aa90326c..f8e9180aae 100644 --- a/packages/shared/src/components/cards/Leaderboard/TagTopList.tsx +++ b/packages/shared/src/components/cards/Leaderboard/TagTopList.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; -import { Keyword, Tag } from '../../../graphql/keywords'; -import { CommonLeaderboardProps, LeaderboardList } from './LeaderboardList'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Keyword, Tag } from '../../../graphql/keywords'; +import type { CommonLeaderboardProps } from './LeaderboardList'; +import { LeaderboardList } from './LeaderboardList'; import { LeaderboardListItem } from './LeaderboardListItem'; import { getTagPageLink } from '../../../lib'; diff --git a/packages/shared/src/components/cards/Leaderboard/UserTopList.tsx b/packages/shared/src/components/cards/Leaderboard/UserTopList.tsx index 20331a9f55..6557169bcb 100644 --- a/packages/shared/src/components/cards/Leaderboard/UserTopList.tsx +++ b/packages/shared/src/components/cards/Leaderboard/UserTopList.tsx @@ -1,8 +1,10 @@ -import React, { ReactElement } from 'react'; -import { CommonLeaderboardProps, LeaderboardList } from './LeaderboardList'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { CommonLeaderboardProps } from './LeaderboardList'; +import { LeaderboardList } from './LeaderboardList'; import { LeaderboardListItem } from './LeaderboardListItem'; import { UserHighlight } from '../../widgets/PostUsersHighlights'; -import { LoggedUser } from '../../../lib/user'; +import type { LoggedUser } from '../../../lib/user'; export interface UserLeaderboard { score: number; diff --git a/packages/shared/src/components/cards/Leaderboard/common.ts b/packages/shared/src/components/cards/Leaderboard/common.ts index 4cd741b56c..7a9d1ed533 100644 --- a/packages/shared/src/components/cards/Leaderboard/common.ts +++ b/packages/shared/src/components/cards/Leaderboard/common.ts @@ -1,4 +1,4 @@ -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import classed from '../../../lib/classed'; export interface LeaderboardListContainerProps { diff --git a/packages/shared/src/components/cards/SimilarPosts/PostEngagementCounts.tsx b/packages/shared/src/components/cards/SimilarPosts/PostEngagementCounts.tsx index f077f91ffd..98ab6ed50e 100644 --- a/packages/shared/src/components/cards/SimilarPosts/PostEngagementCounts.tsx +++ b/packages/shared/src/components/cards/SimilarPosts/PostEngagementCounts.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { separatorCharacter } from '../common/common'; import { largeNumberFormat } from '../../../lib'; diff --git a/packages/shared/src/components/cards/ad/AdCard.spec.tsx b/packages/shared/src/components/cards/ad/AdCard.spec.tsx index 328b39ffae..9ee088fad2 100644 --- a/packages/shared/src/components/cards/ad/AdCard.spec.tsx +++ b/packages/shared/src/components/cards/ad/AdCard.spec.tsx @@ -1,15 +1,10 @@ import React from 'react'; -import { - render, - RenderResult, - screen, - waitFor, - within, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor, within } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; import ad from '../../../../__tests__/fixture/ad'; import { AdGrid } from './AdGrid'; -import { AdCardProps } from './common/common'; +import type { AdCardProps } from './common/common'; import { TestBootProvider } from '../../../../__tests__/helpers/boot'; import { ActiveFeedContext } from '../../../contexts'; diff --git a/packages/shared/src/components/cards/ad/AdGrid.tsx b/packages/shared/src/components/cards/ad/AdGrid.tsx index e1fff72913..fc74623a1c 100644 --- a/packages/shared/src/components/cards/ad/AdGrid.tsx +++ b/packages/shared/src/components/cards/ad/AdGrid.tsx @@ -1,4 +1,5 @@ -import React, { forwardRef, ReactElement, useCallback } from 'react'; +import type { ReactElement } from 'react'; +import React, { forwardRef, useCallback } from 'react'; import { Card, CardImage, CardTextContainer, CardTitle } from '../common/Card'; import AdLink from './common/AdLink'; @@ -8,10 +9,8 @@ import { AdPixel } from './common/AdPixel'; import type { AdCardProps } from './common/common'; import { RemoveAd } from './common/RemoveAd'; import { usePlusSubscription } from '../../../hooks/usePlusSubscription'; -import { - useAutoRotatingAds, - type InViewRef, -} from '../../../hooks/feed/useAutoRotatingAds'; +import type { InViewRef } from '../../../hooks/feed/useAutoRotatingAds'; +import { useAutoRotatingAds } from '../../../hooks/feed/useAutoRotatingAds'; import { AdRefresh } from './common/AdRefresh'; import { ButtonSize } from '../../buttons/common'; diff --git a/packages/shared/src/components/cards/ad/AdList.tsx b/packages/shared/src/components/cards/ad/AdList.tsx index 41d9d44be6..9ad18e3103 100644 --- a/packages/shared/src/components/cards/ad/AdList.tsx +++ b/packages/shared/src/components/cards/ad/AdList.tsx @@ -1,24 +1,18 @@ -import React, { - AnchorHTMLAttributes, - forwardRef, - ReactElement, - useCallback, -} from 'react'; +import type { AnchorHTMLAttributes, ReactElement } from 'react'; +import React, { forwardRef, useCallback } from 'react'; import classNames from 'classnames'; import { CardContent, CardImage, CardTitle } from '../common/list/ListCard'; import FeedItemContainer from '../common/list/FeedItemContainer'; import type { AdCardProps } from './common/common'; import { AdImage } from './common/AdImage'; import { AdPixel } from './common/AdPixel'; -import { Ad } from '../../../graphql/posts'; +import type { Ad } from '../../../graphql/posts'; import { combinedClicks } from '../../../lib/click'; import { RemoveAd } from './common/RemoveAd'; import { usePlusSubscription } from '../../../hooks/usePlusSubscription'; -import { - useAutoRotatingAds, - type InViewRef, -} from '../../../hooks/feed/useAutoRotatingAds'; +import type { InViewRef } from '../../../hooks/feed/useAutoRotatingAds'; +import { useAutoRotatingAds } from '../../../hooks/feed/useAutoRotatingAds'; import { AdRefresh } from './common/AdRefresh'; import AdAttribution from './common/AdAttribution'; diff --git a/packages/shared/src/components/cards/ad/common/AdAttribution.tsx b/packages/shared/src/components/cards/ad/common/AdAttribution.tsx index 87425bde6c..cfcb042fa4 100644 --- a/packages/shared/src/components/cards/ad/common/AdAttribution.tsx +++ b/packages/shared/src/components/cards/ad/common/AdAttribution.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Ad } from '../../../../graphql/posts'; +import type { Ad } from '../../../../graphql/posts'; interface AdClassName { main?: string; diff --git a/packages/shared/src/components/cards/ad/common/AdImage.tsx b/packages/shared/src/components/cards/ad/common/AdImage.tsx index e8f583e582..879476f130 100644 --- a/packages/shared/src/components/cards/ad/common/AdImage.tsx +++ b/packages/shared/src/components/cards/ad/common/AdImage.tsx @@ -1,7 +1,8 @@ -import React, { ComponentType, ReactElement } from 'react'; +import type { ComponentType, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Ad } from '../../../../graphql/posts'; -import { ImageProps } from '../../../image/Image'; +import type { Ad } from '../../../../graphql/posts'; +import type { ImageProps } from '../../../image/Image'; import { cloudinaryPostImageCoverPlaceholder } from '../../../../lib/image'; export const AdImage = ({ diff --git a/packages/shared/src/components/cards/ad/common/AdLink.tsx b/packages/shared/src/components/cards/ad/common/AdLink.tsx index 78ce9a9e85..45fe9142b2 100644 --- a/packages/shared/src/components/cards/ad/common/AdLink.tsx +++ b/packages/shared/src/components/cards/ad/common/AdLink.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { Ad } from '../../../../graphql/posts'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Ad } from '../../../../graphql/posts'; import { CardLink } from '../../common/Card'; import { combinedClicks } from '../../../../lib/click'; diff --git a/packages/shared/src/components/cards/ad/common/AdPixel.tsx b/packages/shared/src/components/cards/ad/common/AdPixel.tsx index 6fd132f452..c1f69dc817 100644 --- a/packages/shared/src/components/cards/ad/common/AdPixel.tsx +++ b/packages/shared/src/components/cards/ad/common/AdPixel.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import type { Ad } from '../../../../graphql/posts'; export const AdPixel = ({ pixel }: Pick): ReactElement => { diff --git a/packages/shared/src/components/cards/ad/common/AdRefresh.tsx b/packages/shared/src/components/cards/ad/common/AdRefresh.tsx index a36773540f..f02a737cb6 100644 --- a/packages/shared/src/components/cards/ad/common/AdRefresh.tsx +++ b/packages/shared/src/components/cards/ad/common/AdRefresh.tsx @@ -1,10 +1,8 @@ -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ButtonSize, ButtonVariant } from '../../../buttons/common'; -import { - Button, - type AllowedTags, - type ButtonProps, -} from '../../../buttons/Button'; +import type { AllowedTags, ButtonProps } from '../../../buttons/Button'; +import { Button } from '../../../buttons/Button'; import { RefreshIcon } from '../../../icons'; export const AdRefresh = ({ diff --git a/packages/shared/src/components/cards/ad/common/RemoveAd.tsx b/packages/shared/src/components/cards/ad/common/RemoveAd.tsx index 15ef092f23..a6b8aad01a 100644 --- a/packages/shared/src/components/cards/ad/common/RemoveAd.tsx +++ b/packages/shared/src/components/cards/ad/common/RemoveAd.tsx @@ -1,13 +1,12 @@ import React from 'react'; import classNames from 'classnames'; import type { ReactElement } from 'react'; +import type { AllowedTags, ButtonProps } from '../../../buttons/Button'; import { Button, ButtonColor, ButtonSize, ButtonVariant, - type AllowedTags, - type ButtonProps, } from '../../../buttons/Button'; import { plusUrl } from '../../../../lib/constants'; import Link from '../../../utilities/Link'; diff --git a/packages/shared/src/components/cards/ad/common/common.tsx b/packages/shared/src/components/cards/ad/common/common.tsx index 4436d2c0d5..59b350e986 100644 --- a/packages/shared/src/components/cards/ad/common/common.tsx +++ b/packages/shared/src/components/cards/ad/common/common.tsx @@ -1,5 +1,5 @@ -import { HTMLAttributes } from 'react'; -import { Ad } from '../../../../graphql/posts'; +import type { HTMLAttributes } from 'react'; +import type { Ad } from '../../../../graphql/posts'; type Callback = (ad: Ad) => unknown; export interface AdCardProps { diff --git a/packages/shared/src/components/cards/article/ArticleGrid.spec.tsx b/packages/shared/src/components/cards/article/ArticleGrid.spec.tsx index 7a079a6534..391b6285ad 100644 --- a/packages/shared/src/components/cards/article/ArticleGrid.spec.tsx +++ b/packages/shared/src/components/cards/article/ArticleGrid.spec.tsx @@ -1,14 +1,10 @@ import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; import post from '../../../../__tests__/fixture/post'; -import { PostCardProps, visibleOnGroupHover } from '../common/common'; +import type { PostCardProps } from '../common/common'; +import { visibleOnGroupHover } from '../common/common'; import { PostType } from '../../../graphql/posts'; import { TestBootProvider } from '../../../../__tests__/helpers/boot'; import { ArticleGrid } from './ArticleGrid'; diff --git a/packages/shared/src/components/cards/article/ArticleGrid.tsx b/packages/shared/src/components/cards/article/ArticleGrid.tsx index 5115fb456d..392177b2fe 100644 --- a/packages/shared/src/components/cards/article/ArticleGrid.tsx +++ b/packages/shared/src/components/cards/article/ArticleGrid.tsx @@ -1,6 +1,8 @@ -import React, { forwardRef, ReactElement, Ref } from 'react'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; -import { Container, PostCardProps } from '../common/common'; +import type { PostCardProps } from '../common/common'; +import { Container } from '../common/common'; import { useBlockPostPanel } from '../../../hooks/post/useBlockPostPanel'; import { usePostFeedback } from '../../../hooks'; import { isVideoPost } from '../../../graphql/posts'; diff --git a/packages/shared/src/components/cards/article/ArticleList.tsx b/packages/shared/src/components/cards/article/ArticleList.tsx index 6b4a65f4af..16825e65d8 100644 --- a/packages/shared/src/components/cards/article/ArticleList.tsx +++ b/packages/shared/src/components/cards/article/ArticleList.tsx @@ -1,6 +1,8 @@ -import React, { forwardRef, ReactElement, Ref } from 'react'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; -import { Container, PostCardProps } from '../common/common'; +import type { PostCardProps } from '../common/common'; +import { Container } from '../common/common'; import { isVideoPost } from '../../../graphql/posts'; import { useFeedPreviewMode, diff --git a/packages/shared/src/components/cards/article/feedback/FeedbackGrid.tsx b/packages/shared/src/components/cards/article/feedback/FeedbackGrid.tsx index d101208e7d..6c41a36632 100644 --- a/packages/shared/src/components/cards/article/feedback/FeedbackGrid.tsx +++ b/packages/shared/src/components/cards/article/feedback/FeedbackGrid.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { usePostFeedback } from '../../../../hooks'; import CloseButton from '../../../CloseButton'; import { ButtonSize } from '../../../buttons/common'; -import { FeedbackProps } from './common/common'; +import type { FeedbackProps } from './common/common'; import { FeedbackButtons } from './common/FeedbackButtons'; export const FeedbackGrid = ({ diff --git a/packages/shared/src/components/cards/article/feedback/FeedbackList.tsx b/packages/shared/src/components/cards/article/feedback/FeedbackList.tsx index 35f0952636..01713bfa87 100644 --- a/packages/shared/src/components/cards/article/feedback/FeedbackList.tsx +++ b/packages/shared/src/components/cards/article/feedback/FeedbackList.tsx @@ -1,10 +1,11 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { usePostFeedback } from '../../../../hooks'; import CloseButton from '../../../CloseButton'; import { ButtonSize } from '../../../buttons/common'; import { CardContent } from '../../common/list/ListCard'; import { CardCoverList } from '../../common/list/CardCover'; -import { FeedbackProps } from './common/common'; +import type { FeedbackProps } from './common/common'; import { FeedbackButtons } from './common/FeedbackButtons'; export const FeedbackList = ({ diff --git a/packages/shared/src/components/cards/article/feedback/common/FeedbackButtons.tsx b/packages/shared/src/components/cards/article/feedback/common/FeedbackButtons.tsx index 4392d6f1b4..c433fe59b4 100644 --- a/packages/shared/src/components/cards/article/feedback/common/FeedbackButtons.tsx +++ b/packages/shared/src/components/cards/article/feedback/common/FeedbackButtons.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Button, ButtonColor, ButtonVariant } from '../../../../buttons/Button'; import { UserVote } from '../../../../../graphql/posts'; import { DownvoteIcon, UpvoteIcon } from '../../../../icons'; -import { FeedbackProps } from './common'; +import type { FeedbackProps } from './common'; export const FeedbackButtons = ({ post, diff --git a/packages/shared/src/components/cards/article/feedback/common/common.tsx b/packages/shared/src/components/cards/article/feedback/common/common.tsx index 1739f4a263..0287a611b6 100644 --- a/packages/shared/src/components/cards/article/feedback/common/common.tsx +++ b/packages/shared/src/components/cards/article/feedback/common/common.tsx @@ -1,5 +1,5 @@ -import { MouseEventHandler } from 'react'; -import { Post } from '../../../../../graphql/posts'; +import type { MouseEventHandler } from 'react'; +import type { Post } from '../../../../../graphql/posts'; export interface FeedbackProps { post: Post; diff --git a/packages/shared/src/components/cards/collection/CollectionCardHeader.tsx b/packages/shared/src/components/cards/collection/CollectionCardHeader.tsx index 40a990719f..3ea5988a9e 100644 --- a/packages/shared/src/components/cards/collection/CollectionCardHeader.tsx +++ b/packages/shared/src/components/cards/collection/CollectionCardHeader.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { SourceAvatarProps } from '../../profile/source'; +import type { SourceAvatarProps } from '../../profile/source'; import { CollectionPillSources } from '../../post/collection'; import OptionsButton from '../../buttons/OptionsButton'; import { diff --git a/packages/shared/src/components/cards/collection/CollectionGrid.spec.tsx b/packages/shared/src/components/cards/collection/CollectionGrid.spec.tsx index e4410171c6..54f4c3189c 100644 --- a/packages/shared/src/components/cards/collection/CollectionGrid.spec.tsx +++ b/packages/shared/src/components/cards/collection/CollectionGrid.spec.tsx @@ -1,9 +1,10 @@ import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; import { CollectionGrid } from './CollectionGrid'; import { sharePost as collectionPost } from '../../../../__tests__/fixture/post'; -import { PostCardProps } from '../common/common'; +import type { PostCardProps } from '../common/common'; import { TestBootProvider } from '../../../../__tests__/helpers/boot'; const post = collectionPost; diff --git a/packages/shared/src/components/cards/collection/CollectionGrid.tsx b/packages/shared/src/components/cards/collection/CollectionGrid.tsx index 38c5f74b7f..c3fb079ee0 100644 --- a/packages/shared/src/components/cards/collection/CollectionGrid.tsx +++ b/packages/shared/src/components/cards/collection/CollectionGrid.tsx @@ -1,6 +1,8 @@ -import React, { forwardRef, Ref } from 'react'; +import type { Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; -import { Container, generateTitleClamp, PostCardProps } from '../common/common'; +import type { PostCardProps } from '../common/common'; +import { Container, generateTitleClamp } from '../common/common'; import FeedItemContainer from '../common/FeedItemContainer'; import { CollectionCardHeader } from './CollectionCardHeader'; import { diff --git a/packages/shared/src/components/cards/collection/CollectionList.tsx b/packages/shared/src/components/cards/collection/CollectionList.tsx index 67d725c1bc..e281b96807 100644 --- a/packages/shared/src/components/cards/collection/CollectionList.tsx +++ b/packages/shared/src/components/cards/collection/CollectionList.tsx @@ -1,6 +1,8 @@ -import React, { forwardRef, Ref } from 'react'; +import type { Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; -import { Container, generateTitleClamp, PostCardProps } from '../common/common'; +import type { PostCardProps } from '../common/common'; +import { Container, generateTitleClamp } from '../common/common'; import FeedItemContainer from '../common/list/FeedItemContainer'; import { CardTitle, diff --git a/packages/shared/src/components/cards/common/BookmarkProviderHeader.tsx b/packages/shared/src/components/cards/common/BookmarkProviderHeader.tsx index b1f67b7d04..1f9e6f2f61 100644 --- a/packages/shared/src/components/cards/common/BookmarkProviderHeader.tsx +++ b/packages/shared/src/components/cards/common/BookmarkProviderHeader.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { CardHeader } from './Card'; import { BookmarkIcon } from '../../icons'; diff --git a/packages/shared/src/components/cards/common/Card.tsx b/packages/shared/src/components/cards/common/Card.tsx index 0c3d96d713..40420ea52e 100644 --- a/packages/shared/src/components/cards/common/Card.tsx +++ b/packages/shared/src/components/cards/common/Card.tsx @@ -1,9 +1,10 @@ -import React, { HTMLAttributes, ReactNode } from 'react'; +import type { HTMLAttributes, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { ReactElement } from 'react-markdown/lib/react-markdown'; +import type { ReactElement } from 'react-markdown/lib/react-markdown'; import styles from './Card.module.css'; import classed from '../../../lib/classed'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { Image } from '../../image/Image'; type TitleProps = HTMLAttributes & { diff --git a/packages/shared/src/components/cards/common/CardCover.tsx b/packages/shared/src/components/cards/common/CardCover.tsx index 0b7fe2d560..56196045d5 100644 --- a/packages/shared/src/components/cards/common/CardCover.tsx +++ b/packages/shared/src/components/cards/common/CardCover.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { ReusedCardCoverProps, SharedCardCover } from './SharedCardCover'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ReusedCardCoverProps } from './SharedCardCover'; +import { SharedCardCover } from './SharedCardCover'; import { CardImage } from './Card'; export function CardCover(props: ReusedCardCoverProps): ReactElement { diff --git a/packages/shared/src/components/cards/common/CardCoverContainer.tsx b/packages/shared/src/components/cards/common/CardCoverContainer.tsx index 0c75a2cc59..983893aa81 100644 --- a/packages/shared/src/components/cards/common/CardCoverContainer.tsx +++ b/packages/shared/src/components/cards/common/CardCoverContainer.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; interface CardCoverContainerProps { diff --git a/packages/shared/src/components/cards/common/CardCoverShare.tsx b/packages/shared/src/components/cards/common/CardCoverShare.tsx index a28ada111a..9fe6b75c6c 100644 --- a/packages/shared/src/components/cards/common/CardCoverShare.tsx +++ b/packages/shared/src/components/cards/common/CardCoverShare.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Button, ButtonVariant } from '../../buttons/Button'; import { ShareIcon } from '../../icons'; import { useLoggedCopyPostLink } from '../../../hooks/post'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { ShareProvider } from '../../../lib/share'; import { CardCoverContainer } from './CardCoverContainer'; import { wrapStopPropagation } from '../../../lib/func'; diff --git a/packages/shared/src/components/cards/common/CardOverlay.tsx b/packages/shared/src/components/cards/common/CardOverlay.tsx index 48c71597fc..05137815b7 100644 --- a/packages/shared/src/components/cards/common/CardOverlay.tsx +++ b/packages/shared/src/components/cards/common/CardOverlay.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { CardLink } from './Card'; import { useFeedPreviewMode } from '../../../hooks'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { webappUrl } from '../../../lib/constants'; import { anchorDefaultRel } from '../../../lib/strings'; diff --git a/packages/shared/src/components/cards/common/ClickbaitShield.tsx b/packages/shared/src/components/cards/common/ClickbaitShield.tsx index a11e06dbfc..92dc67023f 100644 --- a/packages/shared/src/components/cards/common/ClickbaitShield.tsx +++ b/packages/shared/src/components/cards/common/ClickbaitShield.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import { Button, ButtonSize } from '../../buttons/Button'; import { ShieldCheckIcon, ShieldIcon, ShieldWarningIcon } from '../../icons'; diff --git a/packages/shared/src/components/cards/common/CommentPopup.tsx b/packages/shared/src/components/cards/common/CommentPopup.tsx index 017365c4a5..084eaea85e 100644 --- a/packages/shared/src/components/cards/common/CommentPopup.tsx +++ b/packages/shared/src/components/cards/common/CommentPopup.tsx @@ -1,4 +1,5 @@ -import React, { KeyboardEvent, ReactElement, useState } from 'react'; +import type { KeyboardEvent, ReactElement } from 'react'; +import React, { useState } from 'react'; import { requestIdleCallback } from 'next/dist/client/request-idle-callback'; import classNames from 'classnames'; import commentPopupText from '../../../commentPopupText'; diff --git a/packages/shared/src/components/cards/common/FeedItemContainer.tsx b/packages/shared/src/components/cards/common/FeedItemContainer.tsx index 0aafe48938..a9606d40ed 100644 --- a/packages/shared/src/components/cards/common/FeedItemContainer.tsx +++ b/packages/shared/src/components/cards/common/FeedItemContainer.tsx @@ -1,12 +1,7 @@ -import React, { - forwardRef, - HTMLAttributes, - ReactElement, - ReactNode, - Ref, -} from 'react'; +import type { HTMLAttributes, ReactElement, ReactNode, Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { Card } from './Card'; import { RaisedLabel, diff --git a/packages/shared/src/components/cards/common/PostCardFooter.tsx b/packages/shared/src/components/cards/common/PostCardFooter.tsx index 6107eabcbd..0455301bab 100644 --- a/packages/shared/src/components/cards/common/PostCardFooter.tsx +++ b/packages/shared/src/components/cards/common/PostCardFooter.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { isVideoPost, Post } from '../../../graphql/posts'; -import { CommonCardCoverProps } from './common'; +import type { Post } from '../../../graphql/posts'; +import { isVideoPost } from '../../../graphql/posts'; +import type { CommonCardCoverProps } from './common'; import { CardCover } from './CardCover'; import { HIGH_PRIORITY_IMAGE_PROPS } from '../../image/Image'; diff --git a/packages/shared/src/components/cards/common/PostCardHeader.tsx b/packages/shared/src/components/cards/common/PostCardHeader.tsx index 4ee5ae5d4f..0328d7c982 100644 --- a/packages/shared/src/components/cards/common/PostCardHeader.tsx +++ b/packages/shared/src/components/cards/common/PostCardHeader.tsx @@ -1,20 +1,21 @@ -import React, { ReactElement, ReactNode, useMemo } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useMemo } from 'react'; import classNames from 'classnames'; import OptionsButton from '../../buttons/OptionsButton'; import { CardHeader } from './Card'; import SourceButton from './SourceButton'; -import { Source } from '../../../graphql/sources'; +import type { Source } from '../../../graphql/sources'; import { ReadArticleButton } from './ReadArticleButton'; import { getGroupedHoverContainer } from './common'; import { useBookmarkProvider, useFeedPreviewMode } from '../../../hooks'; +import type { Post } from '../../../graphql/posts'; import { getReadPostButtonText, isInternalReadType, isSharedPostSquadPost, - Post, } from '../../../graphql/posts'; import { ButtonVariant } from '../../buttons/Button'; -import { FlagProps } from './FeedItemContainer'; +import type { FlagProps } from './FeedItemContainer'; import { BookmakProviderHeader, headerHiddenClassName, diff --git a/packages/shared/src/components/cards/common/PostMetadata.tsx b/packages/shared/src/components/cards/common/PostMetadata.tsx index 9efc5b7128..22a1e991dc 100644 --- a/packages/shared/src/components/cards/common/PostMetadata.tsx +++ b/packages/shared/src/components/cards/common/PostMetadata.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { TimeFormatType } from '../../../lib/dateFormat'; import { Separator } from './common'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { formatReadTime, TruncateText, DateFormat } from '../../utilities'; import { largeNumberFormat } from '../../../lib'; diff --git a/packages/shared/src/components/cards/common/PostSummary.tsx b/packages/shared/src/components/cards/common/PostSummary.tsx index 2314a87d99..7962ef1783 100644 --- a/packages/shared/src/components/cards/common/PostSummary.tsx +++ b/packages/shared/src/components/cards/common/PostSummary.tsx @@ -1,9 +1,5 @@ -import React, { - forwardRef, - HTMLAttributes, - ReactElement, - RefObject, -} from 'react'; +import type { HTMLAttributes, ReactElement, RefObject } from 'react'; +import React, { forwardRef } from 'react'; import { SummaryContainer, TLDRText } from '../../utilities'; import ShowMoreContent from './ShowMoreContent'; diff --git a/packages/shared/src/components/cards/common/PostTags.tsx b/packages/shared/src/components/cards/common/PostTags.tsx index 19d8df3b80..b49c640f97 100644 --- a/packages/shared/src/components/cards/common/PostTags.tsx +++ b/packages/shared/src/components/cards/common/PostTags.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useRef } from 'react'; import classNames from 'classnames'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import Classed from '../../../lib/classed'; import { useFeedTags } from '../../../hooks/feed/useFeedTags'; import { useFeedLayout } from '../../../hooks'; diff --git a/packages/shared/src/components/cards/common/RaisedLabel.tsx b/packages/shared/src/components/cards/common/RaisedLabel.tsx index fa50e82ef9..2b94841b7d 100644 --- a/packages/shared/src/components/cards/common/RaisedLabel.tsx +++ b/packages/shared/src/components/cards/common/RaisedLabel.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { SimpleTooltip } from '../../tooltips/SimpleTooltip'; import classed from '../../../lib/classed'; diff --git a/packages/shared/src/components/cards/common/ReadArticleButton.tsx b/packages/shared/src/components/cards/common/ReadArticleButton.tsx index 7bf9e41b3c..6ffd7bfb46 100644 --- a/packages/shared/src/components/cards/common/ReadArticleButton.tsx +++ b/packages/shared/src/components/cards/common/ReadArticleButton.tsx @@ -1,10 +1,7 @@ -import React, { ReactElement } from 'react'; -import { - Button, - ButtonIconPosition, - ButtonProps, - ButtonSize, -} from '../../buttons/Button'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ButtonProps } from '../../buttons/Button'; +import { Button, ButtonIconPosition, ButtonSize } from '../../buttons/Button'; import { OpenLinkIcon } from '../../icons'; type ReadArticleButtonProps = ButtonProps<'a'> & { diff --git a/packages/shared/src/components/cards/common/SharedCardCover.tsx b/packages/shared/src/components/cards/common/SharedCardCover.tsx index 0d1417284f..d93ab342bd 100644 --- a/packages/shared/src/components/cards/common/SharedCardCover.tsx +++ b/packages/shared/src/components/cards/common/SharedCardCover.tsx @@ -1,8 +1,11 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { CommonCardCoverProps } from './common'; -import { ImageProps, ImageType } from '../../image/Image'; -import VideoImage, { VideoImageProps } from '../../image/VideoImage'; +import type { CommonCardCoverProps } from './common'; +import type { ImageProps } from '../../image/Image'; +import { ImageType } from '../../image/Image'; +import type { VideoImageProps } from '../../image/VideoImage'; +import VideoImage from '../../image/VideoImage'; import { useCardCover } from '../../../hooks/feed/useCardCover'; import { CardImage } from './Card'; diff --git a/packages/shared/src/components/cards/common/ShowMoreContent.tsx b/packages/shared/src/components/cards/common/ShowMoreContent.tsx index 19ee76713f..d10a2c46b9 100644 --- a/packages/shared/src/components/cards/common/ShowMoreContent.tsx +++ b/packages/shared/src/components/cards/common/ShowMoreContent.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode, useState } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useState } from 'react'; import { ClickableText } from '../../buttons/ClickableText'; interface ShowMoreContentProps { diff --git a/packages/shared/src/components/cards/common/SourceButton.tsx b/packages/shared/src/components/cards/common/SourceButton.tsx index cef51df48a..1d11cad7b6 100644 --- a/packages/shared/src/components/cards/common/SourceButton.tsx +++ b/packages/shared/src/components/cards/common/SourceButton.tsx @@ -1,9 +1,10 @@ -import React, { CSSProperties, ReactElement } from 'react'; -import { TooltipPosition } from '../../tooltips/BaseTooltipContainer'; +import type { CSSProperties, ReactElement } from 'react'; +import React from 'react'; +import type { TooltipPosition } from '../../tooltips/BaseTooltipContainer'; import { LinkWithTooltip } from '../../tooltips/LinkWithTooltip'; import { ProfileImageLink } from '../../profile/ProfileImageLink'; import { ProfileImageSize, ProfilePicture } from '../../ProfilePicture'; -import { Source } from '../../../graphql/sources'; +import type { Source } from '../../../graphql/sources'; import { useFeedPreviewMode } from '../../../hooks'; interface SourceButtonProps { diff --git a/packages/shared/src/components/cards/common/SquadHeaderPicture.tsx b/packages/shared/src/components/cards/common/SquadHeaderPicture.tsx index af8509a4ab..828e35e8e3 100644 --- a/packages/shared/src/components/cards/common/SquadHeaderPicture.tsx +++ b/packages/shared/src/components/cards/common/SquadHeaderPicture.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ProfileImageSize } from '../../ProfilePicture'; import SourceButton from './SourceButton'; -import { Source } from '../../../graphql/sources'; +import type { Source } from '../../../graphql/sources'; interface SquadHeaderPictureProps { source: Source; diff --git a/packages/shared/src/components/cards/common/SquadPostCardHeader.tsx b/packages/shared/src/components/cards/common/SquadPostCardHeader.tsx index d2d4e4513f..8e934eaeff 100644 --- a/packages/shared/src/components/cards/common/SquadPostCardHeader.tsx +++ b/packages/shared/src/components/cards/common/SquadPostCardHeader.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { ProfileImageSize } from '../../ProfilePicture'; import SourceButton from './SourceButton'; import { diff --git a/packages/shared/src/components/cards/common/WelcomePostCardFooter.tsx b/packages/shared/src/components/cards/common/WelcomePostCardFooter.tsx index c71e2a8272..0c45be2661 100644 --- a/packages/shared/src/components/cards/common/WelcomePostCardFooter.tsx +++ b/packages/shared/src/components/cards/common/WelcomePostCardFooter.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import { sanitize } from 'dompurify'; import { CardSpace } from './Card'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { CardCover } from './CardCover'; import { useCardCover } from '../../../hooks/feed/useCardCover'; diff --git a/packages/shared/src/components/cards/common/common.tsx b/packages/shared/src/components/cards/common/common.tsx index 8394b89685..2c1a4331e0 100644 --- a/packages/shared/src/components/cards/common/common.tsx +++ b/packages/shared/src/components/cards/common/common.tsx @@ -1,12 +1,9 @@ -import React, { - HTMLAttributes, - ReactElement, - ReactHTML, - ReactNode, -} from 'react'; -import { Post } from '../../../graphql/posts'; -import classed, { ClassedHTML } from '../../../lib/classed'; -import { Origin } from '../../../lib/log'; +import type { HTMLAttributes, ReactElement, ReactHTML, ReactNode } from 'react'; +import React from 'react'; +import type { Post } from '../../../graphql/posts'; +import type { ClassedHTML } from '../../../lib/classed'; +import classed from '../../../lib/classed'; +import type { Origin } from '../../../lib/log'; export interface CommonCardCoverProps { post?: Post; diff --git a/packages/shared/src/components/cards/common/list/ActionButtons.tsx b/packages/shared/src/components/cards/common/list/ActionButtons.tsx index 8db4436559..78c2dd2740 100644 --- a/packages/shared/src/components/cards/common/list/ActionButtons.tsx +++ b/packages/shared/src/components/cards/common/list/ActionButtons.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Post, UserVote } from '../../../../graphql/posts'; +import type { Post } from '../../../../graphql/posts'; +import { UserVote } from '../../../../graphql/posts'; import InteractionCounter from '../../../InteractionCounter'; import { BookmarkIcon, @@ -17,7 +19,7 @@ import ConditionalWrapper from '../../../ConditionalWrapper'; import { PostTagsPanel } from '../../../post/block/PostTagsPanel'; import { IconSize } from '../../../Icon'; import { LinkWithTooltip } from '../../../tooltips/LinkWithTooltip'; -import { ActionButtonsProps } from '../../ActionsButtons'; +import type { ActionButtonsProps } from '../../ActionsButtons'; import { UpvoteButtonIcon } from '../../ActionsButtons/UpvoteButtonIcon'; import { BookmarkButton } from '../../../buttons'; import { useFeature } from '../../../GrowthBookProvider'; diff --git a/packages/shared/src/components/cards/common/list/BookmarkProviderHeader.tsx b/packages/shared/src/components/cards/common/list/BookmarkProviderHeader.tsx index 29bc924aa4..fd6daf45c7 100644 --- a/packages/shared/src/components/cards/common/list/BookmarkProviderHeader.tsx +++ b/packages/shared/src/components/cards/common/list/BookmarkProviderHeader.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { CardHeader } from './ListCard'; import { bookmarkProviderIcon, diff --git a/packages/shared/src/components/cards/common/list/CardCover.tsx b/packages/shared/src/components/cards/common/list/CardCover.tsx index af40233ae9..d4daeae885 100644 --- a/packages/shared/src/components/cards/common/list/CardCover.tsx +++ b/packages/shared/src/components/cards/common/list/CardCover.tsx @@ -1,10 +1,12 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import classNames from 'classnames'; import ConditionalWrapper from '../../../ConditionalWrapper'; -import { ReusedCardCoverProps, SharedCardCover } from '../SharedCardCover'; +import type { ReusedCardCoverProps } from '../SharedCardCover'; +import { SharedCardCover } from '../SharedCardCover'; import { CardImage } from './ListCard'; import { useViewSize, ViewSize } from '../../../../hooks'; -import { ImageProps } from '../../../image/Image'; +import type { ImageProps } from '../../../image/Image'; interface CardCoverProps extends ReusedCardCoverProps { className?: string; diff --git a/packages/shared/src/components/cards/common/list/FeedItemContainer.tsx b/packages/shared/src/components/cards/common/list/FeedItemContainer.tsx index a3ee05c6a4..f55484f625 100644 --- a/packages/shared/src/components/cards/common/list/FeedItemContainer.tsx +++ b/packages/shared/src/components/cards/common/list/FeedItemContainer.tsx @@ -1,15 +1,14 @@ -import React, { +import type { AnchorHTMLAttributes, - forwardRef, HTMLAttributes, ReactElement, ReactNode, Ref, - useState, } from 'react'; +import React, { forwardRef, useState } from 'react'; import classNames from 'classnames'; import Link from '../../../utilities/Link'; -import { Post } from '../../../../graphql/posts'; +import type { Post } from '../../../../graphql/posts'; import { ListCard, CardLink } from './ListCard'; import { RaisedLabel, RaisedLabelType } from './RaisedLabel'; import { useFeedPreviewMode, useBookmarkProvider } from '../../../../hooks'; diff --git a/packages/shared/src/components/cards/common/list/ListCard.tsx b/packages/shared/src/components/cards/common/list/ListCard.tsx index 7393203c7e..c95db84911 100644 --- a/packages/shared/src/components/cards/common/list/ListCard.tsx +++ b/packages/shared/src/components/cards/common/list/ListCard.tsx @@ -1,6 +1,7 @@ -import React, { HTMLAttributes, ReactNode } from 'react'; +import type { HTMLAttributes, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { ReactElement } from 'react-markdown/lib/react-markdown'; +import type { ReactElement } from 'react-markdown/lib/react-markdown'; import classed from '../../../../lib/classed'; import { Image } from '../../../image/Image'; diff --git a/packages/shared/src/components/cards/common/list/PostCardHeader.tsx b/packages/shared/src/components/cards/common/list/PostCardHeader.tsx index 1f84e8cd82..8f67cb535d 100644 --- a/packages/shared/src/components/cards/common/list/PostCardHeader.tsx +++ b/packages/shared/src/components/cards/common/list/PostCardHeader.tsx @@ -1,13 +1,16 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import OptionsButton from '../../../buttons/OptionsButton'; import { CardHeader } from './ListCard'; import { ReadArticleButton } from '../ReadArticleButton'; import { getGroupedHoverContainer } from '../common'; import { useBookmarkProvider, useFeedPreviewMode } from '../../../../hooks'; -import { Post, PostType } from '../../../../graphql/posts'; +import type { Post } from '../../../../graphql/posts'; +import { PostType } from '../../../../graphql/posts'; import { ButtonVariant } from '../../../buttons/common'; -import PostMetadata, { PostMetadataProps } from './PostMetadata'; +import type { PostMetadataProps } from './PostMetadata'; +import PostMetadata from './PostMetadata'; import { MenuIcon, OpenLinkIcon } from '../../../icons'; import { useReadPostButtonText } from './hooks'; import { BookmakProviderHeader } from './BookmarkProviderHeader'; diff --git a/packages/shared/src/components/cards/common/list/PostMetadata.tsx b/packages/shared/src/components/cards/common/list/PostMetadata.tsx index 92b8ac9c49..2019738f83 100644 --- a/packages/shared/src/components/cards/common/list/PostMetadata.tsx +++ b/packages/shared/src/components/cards/common/list/PostMetadata.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Separator } from '../common'; import { DateFormat } from '../../../utilities'; diff --git a/packages/shared/src/components/cards/common/list/PostReadTime.tsx b/packages/shared/src/components/cards/common/list/PostReadTime.tsx index 90d6fcf226..adc67299bd 100644 --- a/packages/shared/src/components/cards/common/list/PostReadTime.tsx +++ b/packages/shared/src/components/cards/common/list/PostReadTime.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { Post } from '../../../../graphql/posts'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Post } from '../../../../graphql/posts'; import { formatReadTime } from '../../../utilities'; interface PostReadTimeProps extends Pick { diff --git a/packages/shared/src/components/cards/common/list/RaisedLabel.tsx b/packages/shared/src/components/cards/common/list/RaisedLabel.tsx index c7ba4e00ba..905d214d2f 100644 --- a/packages/shared/src/components/cards/common/list/RaisedLabel.tsx +++ b/packages/shared/src/components/cards/common/list/RaisedLabel.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { SimpleTooltip } from '../../../tooltips/SimpleTooltip'; diff --git a/packages/shared/src/components/cards/common/list/SharedPostCardFooter.tsx b/packages/shared/src/components/cards/common/list/SharedPostCardFooter.tsx index a2d5272c5d..18aa734a5d 100644 --- a/packages/shared/src/components/cards/common/list/SharedPostCardFooter.tsx +++ b/packages/shared/src/components/cards/common/list/SharedPostCardFooter.tsx @@ -1,8 +1,9 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; -import { Post } from '../../../../graphql/posts'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Post } from '../../../../graphql/posts'; import { IconSize } from '../../../Icon'; -import { CommonCardCoverProps } from '../common'; +import type { CommonCardCoverProps } from '../common'; import { CardCoverList } from './CardCover'; interface SharedPostCardFooterProps diff --git a/packages/shared/src/components/cards/common/list/TypeLabel.tsx b/packages/shared/src/components/cards/common/list/TypeLabel.tsx index eb26848173..bc91abd21b 100644 --- a/packages/shared/src/components/cards/common/list/TypeLabel.tsx +++ b/packages/shared/src/components/cards/common/list/TypeLabel.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { PostType } from '../../../../graphql/posts'; diff --git a/packages/shared/src/components/cards/common/list/hooks.ts b/packages/shared/src/components/cards/common/list/hooks.ts index 839e66957f..7e52cc0285 100644 --- a/packages/shared/src/components/cards/common/list/hooks.ts +++ b/packages/shared/src/components/cards/common/list/hooks.ts @@ -1,4 +1,5 @@ -import { Post, getReadPostButtonText } from '../../../../graphql/posts'; +import type { Post } from '../../../../graphql/posts'; +import { getReadPostButtonText } from '../../../../graphql/posts'; import { useMedia } from '../../../../hooks'; import { mobileL, mobileXL } from '../../../../styles/media'; diff --git a/packages/shared/src/components/cards/placeholder/PlaceholderGrid.tsx b/packages/shared/src/components/cards/placeholder/PlaceholderGrid.tsx index a9a4d68999..f6417a4b40 100644 --- a/packages/shared/src/components/cards/placeholder/PlaceholderGrid.tsx +++ b/packages/shared/src/components/cards/placeholder/PlaceholderGrid.tsx @@ -1,9 +1,10 @@ -import React, { forwardRef, ReactElement, Ref } from 'react'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; import { CardSpace, CardTextContainer } from '../common/Card'; import { ElementPlaceholder } from '../../ElementPlaceholder'; import classed from '../../../lib/classed'; -import { PlaceholderProps } from './common/common'; +import type { PlaceholderProps } from './common/common'; const Text = classed(ElementPlaceholder, 'h-3 rounded-12 my-2'); diff --git a/packages/shared/src/components/cards/placeholder/PlaceholderList.tsx b/packages/shared/src/components/cards/placeholder/PlaceholderList.tsx index 73e4030aab..920b77369f 100644 --- a/packages/shared/src/components/cards/placeholder/PlaceholderList.tsx +++ b/packages/shared/src/components/cards/placeholder/PlaceholderList.tsx @@ -1,4 +1,5 @@ -import React, { forwardRef, ReactElement, Ref } from 'react'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; import { ListCard, @@ -7,7 +8,7 @@ import { } from '../common/list/ListCard'; import { ElementPlaceholder } from '../../ElementPlaceholder'; import classed from '../../../lib/classed'; -import { PlaceholderProps } from './common/common'; +import type { PlaceholderProps } from './common/common'; const Text = classed(ElementPlaceholder, 'rounded-12'); diff --git a/packages/shared/src/components/cards/placeholder/common/common.tsx b/packages/shared/src/components/cards/placeholder/common/common.tsx index 7279022d70..18b2cfea9a 100644 --- a/packages/shared/src/components/cards/placeholder/common/common.tsx +++ b/packages/shared/src/components/cards/placeholder/common/common.tsx @@ -1,3 +1,3 @@ -import { HTMLAttributes } from 'react'; +import type { HTMLAttributes } from 'react'; export type PlaceholderProps = HTMLAttributes; diff --git a/packages/shared/src/components/cards/share/ShareGrid.spec.tsx b/packages/shared/src/components/cards/share/ShareGrid.spec.tsx index da9e847364..72b311e6f6 100644 --- a/packages/shared/src/components/cards/share/ShareGrid.spec.tsx +++ b/packages/shared/src/components/cards/share/ShareGrid.spec.tsx @@ -1,8 +1,9 @@ import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; import { sharePost } from '../../../../__tests__/fixture/post'; -import { PostCardProps } from '../common/common'; +import type { PostCardProps } from '../common/common'; import { PostType } from '../../../graphql/posts'; import { TestBootProvider } from '../../../../__tests__/helpers/boot'; import { ShareGrid } from './ShareGrid'; diff --git a/packages/shared/src/components/cards/share/ShareGrid.tsx b/packages/shared/src/components/cards/share/ShareGrid.tsx index ca4366a579..87fade86f4 100644 --- a/packages/shared/src/components/cards/share/ShareGrid.tsx +++ b/packages/shared/src/components/cards/share/ShareGrid.tsx @@ -1,5 +1,7 @@ -import React, { forwardRef, ReactElement, Ref, useRef } from 'react'; -import { Container, PostCardProps } from '../common/common'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef, useRef } from 'react'; +import type { PostCardProps } from '../common/common'; +import { Container } from '../common/common'; import { isVideoPost } from '../../../graphql/posts'; import FeedItemContainer from '../common/FeedItemContainer'; import { diff --git a/packages/shared/src/components/cards/share/ShareList.tsx b/packages/shared/src/components/cards/share/ShareList.tsx index 38f6dcf583..a088a3461f 100644 --- a/packages/shared/src/components/cards/share/ShareList.tsx +++ b/packages/shared/src/components/cards/share/ShareList.tsx @@ -1,6 +1,8 @@ -import React, { forwardRef, ReactElement, Ref, useRef } from 'react'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef, useRef } from 'react'; import classNames from 'classnames'; -import { Container, PostCardProps } from '../common/common'; +import type { PostCardProps } from '../common/common'; +import { Container } from '../common/common'; import { useFeedPreviewMode, useTruncatedSummary } from '../../../hooks'; import { isVideoPost } from '../../../graphql/posts'; import FeedItemContainer from '../common/list/FeedItemContainer'; diff --git a/packages/shared/src/components/cards/squad/PlaceholderSquadGrid.tsx b/packages/shared/src/components/cards/squad/PlaceholderSquadGrid.tsx index f24ce11fd3..016f05d5b5 100644 --- a/packages/shared/src/components/cards/squad/PlaceholderSquadGrid.tsx +++ b/packages/shared/src/components/cards/squad/PlaceholderSquadGrid.tsx @@ -1,4 +1,5 @@ -import React, { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { CardTextContainer } from '../common/Card'; import { ElementPlaceholder } from '../../ElementPlaceholder'; diff --git a/packages/shared/src/components/cards/squad/PlaceholderSquadList.tsx b/packages/shared/src/components/cards/squad/PlaceholderSquadList.tsx index 7ecec0a4f5..1d01f8cfea 100644 --- a/packages/shared/src/components/cards/squad/PlaceholderSquadList.tsx +++ b/packages/shared/src/components/cards/squad/PlaceholderSquadList.tsx @@ -1,4 +1,5 @@ -import React, { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ElementPlaceholder } from '../../ElementPlaceholder'; diff --git a/packages/shared/src/components/cards/squad/SquadGrid.spec.tsx b/packages/shared/src/components/cards/squad/SquadGrid.spec.tsx index d01f9ea433..e5735f80d8 100644 --- a/packages/shared/src/components/cards/squad/SquadGrid.spec.tsx +++ b/packages/shared/src/components/cards/squad/SquadGrid.spec.tsx @@ -1,8 +1,10 @@ -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React from 'react'; import nock from 'nock'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import { mocked } from 'ts-jest/utils'; import { AuthContextProvider } from '../../../contexts/AuthContext'; import loggedUser from '../../../../__tests__/fixture/loggedUser'; @@ -14,14 +16,12 @@ import { } from '../../../../__tests__/fixture/squads'; import { SquadGrid } from './SquadGrid'; import { LazyModalElement } from '../../modals/LazyModalElement'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '../../../../__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '../../../../__tests__/helpers/graphql'; +import { mockGraphQL } from '../../../../__tests__/helpers/graphql'; +import type { SquadEdgesData } from '../../../graphql/squads'; import { SQUAD_JOIN_MUTATION, SQUAD_MEMBERS_QUERY, - SquadEdgesData, } from '../../../graphql/squads'; import { waitForNock } from '../../../../__tests__/helpers/utilities'; import { cloudinarySquadsDirectoryCardBannerDefault } from '../../../lib/image'; diff --git a/packages/shared/src/components/cards/squad/SquadGrid.tsx b/packages/shared/src/components/cards/squad/SquadGrid.tsx index 880ed4091e..ac39234bc7 100644 --- a/packages/shared/src/components/cards/squad/SquadGrid.tsx +++ b/packages/shared/src/components/cards/squad/SquadGrid.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; import Link from 'next/link'; @@ -6,7 +7,7 @@ import SquadMemberShortList from '../../squads/SquadMemberShortList'; import { Card, CardLink } from '../common/Card'; import { Image, ImageType } from '../../image/Image'; import { cloudinarySquadsDirectoryCardBannerDefault } from '../../../lib/image'; -import { UnFeaturedSquadCardProps } from './common/types'; +import type { UnFeaturedSquadCardProps } from './common/types'; import { SquadActionButton } from '../../squads/SquadActionButton'; import { Origin } from '../../../lib/log'; import { ButtonVariant } from '../../buttons/common'; diff --git a/packages/shared/src/components/cards/squad/SquadList.spec.tsx b/packages/shared/src/components/cards/squad/SquadList.spec.tsx index 7ae5f2603f..324a31beb4 100644 --- a/packages/shared/src/components/cards/squad/SquadList.spec.tsx +++ b/packages/shared/src/components/cards/squad/SquadList.spec.tsx @@ -1,8 +1,10 @@ -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React from 'react'; import nock from 'nock'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import { mocked } from 'ts-jest/utils'; import { AuthContextProvider } from '../../../contexts/AuthContext'; import loggedUser from '../../../../__tests__/fixture/loggedUser'; @@ -17,7 +19,7 @@ import { SQUAD_JOIN_MUTATION } from '../../../graphql/squads'; import { waitForNock } from '../../../../__tests__/helpers/utilities'; import { ActionType, COMPLETE_ACTION_MUTATION } from '../../../graphql/actions'; import { SquadList } from './SquadList'; -import { Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; const routerReplace = jest.fn(); const squadsList = [generateTestSquad()]; diff --git a/packages/shared/src/components/cards/squad/SquadList.tsx b/packages/shared/src/components/cards/squad/SquadList.tsx index 27560bc120..ee49c101c4 100644 --- a/packages/shared/src/components/cards/squad/SquadList.tsx +++ b/packages/shared/src/components/cards/squad/SquadList.tsx @@ -1,7 +1,8 @@ -import React, { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import Link from 'next/link'; -import { Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; import { Typography, TypographyColor, diff --git a/packages/shared/src/components/cards/squad/SquadsDirectoryFeed.tsx b/packages/shared/src/components/cards/squad/SquadsDirectoryFeed.tsx index de0fdafbbf..e9ced6e205 100644 --- a/packages/shared/src/components/cards/squad/SquadsDirectoryFeed.tsx +++ b/packages/shared/src/components/cards/squad/SquadsDirectoryFeed.tsx @@ -1,10 +1,9 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { useInView } from 'react-intersection-observer'; -import { Squad } from '../../../graphql/sources'; -import { - SourcesQueryProps, - useSources, -} from '../../../hooks/source/useSources'; +import type { Squad } from '../../../graphql/sources'; +import type { SourcesQueryProps } from '../../../hooks/source/useSources'; +import { useSources } from '../../../hooks/source/useSources'; import HorizontalScroll from '../../HorizontalScroll/HorizontalScroll'; import { UnfeaturedSquadGrid } from './UnfeaturedSquadGrid'; import { SquadGrid } from './SquadGrid'; @@ -14,10 +13,8 @@ import { Button, ButtonVariant } from '../../buttons/Button'; import { PlaceholderSquadGridList } from './PlaceholderSquadGrid'; import { PlaceholderSquadListList } from './PlaceholderSquadList'; import Link from '../../utilities/Link'; -import { - HorizontalScrollTitle, - HorizontalScrollTitleProps, -} from '../../HorizontalScroll/HorizontalScrollHeader'; +import type { HorizontalScrollTitleProps } from '../../HorizontalScroll/HorizontalScrollHeader'; +import { HorizontalScrollTitle } from '../../HorizontalScroll/HorizontalScrollHeader'; interface SquadHorizontalListProps { title: HorizontalScrollTitleProps; diff --git a/packages/shared/src/components/cards/squad/UnfeaturedSquadGrid.spec.tsx b/packages/shared/src/components/cards/squad/UnfeaturedSquadGrid.spec.tsx index 26581e55c9..2934a75d56 100644 --- a/packages/shared/src/components/cards/squad/UnfeaturedSquadGrid.spec.tsx +++ b/packages/shared/src/components/cards/squad/UnfeaturedSquadGrid.spec.tsx @@ -1,8 +1,10 @@ -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React from 'react'; import nock from 'nock'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import { mocked } from 'ts-jest/utils'; import { AuthContextProvider } from '../../../contexts/AuthContext'; import loggedUser from '../../../../__tests__/fixture/loggedUser'; diff --git a/packages/shared/src/components/cards/squad/UnfeaturedSquadGrid.tsx b/packages/shared/src/components/cards/squad/UnfeaturedSquadGrid.tsx index 9d867a2382..5b47b90b90 100644 --- a/packages/shared/src/components/cards/squad/UnfeaturedSquadGrid.tsx +++ b/packages/shared/src/components/cards/squad/UnfeaturedSquadGrid.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import classNames from 'classnames'; import { Card, CardLink } from '../common/Card'; @@ -10,7 +11,7 @@ import { } from '../../typography/Typography'; import { largeNumberFormat } from '../../../lib'; import { Separator } from '../common/common'; -import { UnFeaturedSquadCardProps } from './common/types'; +import type { UnFeaturedSquadCardProps } from './common/types'; import { Origin } from '../../../lib/log'; import { SquadActionButton } from '../../squads/SquadActionButton'; import { ButtonVariant } from '../../buttons/common'; diff --git a/packages/shared/src/components/cards/squad/common/SquadImage.tsx b/packages/shared/src/components/cards/squad/common/SquadImage.tsx index a673e4962f..4687b04ea1 100644 --- a/packages/shared/src/components/cards/squad/common/SquadImage.tsx +++ b/packages/shared/src/components/cards/squad/common/SquadImage.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; type SourceImageSize = 'size-24' | 'size-16' | 'size-14'; diff --git a/packages/shared/src/components/cards/squad/common/types.ts b/packages/shared/src/components/cards/squad/common/types.ts index a3402388b1..4910e61e5e 100644 --- a/packages/shared/src/components/cards/squad/common/types.ts +++ b/packages/shared/src/components/cards/squad/common/types.ts @@ -1,4 +1,4 @@ -import { Squad } from '../../../../graphql/sources'; +import type { Squad } from '../../../../graphql/sources'; type SquadCardActionType = 'link' | 'action'; export interface SquadCardAction { diff --git a/packages/shared/src/components/checklist/AboutPublicSquadStep.tsx b/packages/shared/src/components/checklist/AboutPublicSquadStep.tsx index ffe0e9c440..0f95cbbcd7 100644 --- a/packages/shared/src/components/checklist/AboutPublicSquadStep.tsx +++ b/packages/shared/src/components/checklist/AboutPublicSquadStep.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { ChecklistStepProps } from '../../lib/checklist'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ChecklistStepProps } from '../../lib/checklist'; import { ChecklistStep } from './ChecklistStep'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { ActionType } from '../../graphql/actions'; diff --git a/packages/shared/src/components/checklist/ChecklistBar.tsx b/packages/shared/src/components/checklist/ChecklistBar.tsx index 4d20c494b1..de7183a18d 100644 --- a/packages/shared/src/components/checklist/ChecklistBar.tsx +++ b/packages/shared/src/components/checklist/ChecklistBar.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { ChecklistBarProps } from '../../lib/checklist'; +import type { ChecklistBarProps } from '../../lib/checklist'; import { useChecklist } from '../../hooks/useChecklist'; import { ChecklistConfetti } from './ChecklistConfetti'; diff --git a/packages/shared/src/components/checklist/ChecklistCard.spec.tsx b/packages/shared/src/components/checklist/ChecklistCard.spec.tsx index c810077b52..1ec8645e70 100644 --- a/packages/shared/src/components/checklist/ChecklistCard.spec.tsx +++ b/packages/shared/src/components/checklist/ChecklistCard.spec.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { ChecklistCardProps } from '../../lib/checklist'; +import type { ChecklistCardProps } from '../../lib/checklist'; import { ChecklistCard } from './ChecklistCard'; import { defaultSteps, updateStep } from '../../hooks/useChecklist.spec'; diff --git a/packages/shared/src/components/checklist/ChecklistCard.tsx b/packages/shared/src/components/checklist/ChecklistCard.tsx index 26449349d2..0a423a7561 100644 --- a/packages/shared/src/components/checklist/ChecklistCard.tsx +++ b/packages/shared/src/components/checklist/ChecklistCard.tsx @@ -1,12 +1,13 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ChecklistCardComponent } from '../cards/common/Card'; import { ChecklistStep } from './ChecklistStep'; -import { +import type { ChecklistCardProps, - ChecklistCardVariant, ChecklistVariantClassNameMap, } from '../../lib/checklist'; +import { ChecklistCardVariant } from '../../lib/checklist'; import { useChecklist } from '../../hooks/useChecklist'; import { ChecklistConfetti } from './ChecklistConfetti'; diff --git a/packages/shared/src/components/checklist/ChecklistConfetti.tsx b/packages/shared/src/components/checklist/ChecklistConfetti.tsx index 8ec41eae49..99a5808d0b 100644 --- a/packages/shared/src/components/checklist/ChecklistConfetti.tsx +++ b/packages/shared/src/components/checklist/ChecklistConfetti.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { cloudinaryConfettiChecklist, diff --git a/packages/shared/src/components/checklist/ChecklistStep.spec.tsx b/packages/shared/src/components/checklist/ChecklistStep.spec.tsx index d7ecb58750..90809d1f9e 100644 --- a/packages/shared/src/components/checklist/ChecklistStep.spec.tsx +++ b/packages/shared/src/components/checklist/ChecklistStep.spec.tsx @@ -1,12 +1,8 @@ import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen } from '@testing-library/react'; import { ChecklistStep } from './ChecklistStep'; -import { ChecklistStepProps } from '../../lib/checklist'; +import type { ChecklistStepProps } from '../../lib/checklist'; import { ActionType } from '../../graphql/actions'; const step = { diff --git a/packages/shared/src/components/checklist/ChecklistStep.tsx b/packages/shared/src/components/checklist/ChecklistStep.tsx index c944c5b900..8b41cc365f 100644 --- a/packages/shared/src/components/checklist/ChecklistStep.tsx +++ b/packages/shared/src/components/checklist/ChecklistStep.tsx @@ -1,12 +1,13 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { IconSize } from '../Icon'; import { ArrowIcon, ChecklistAIcon } from '../icons'; -import { - ChecklistCardVariant, +import type { ChecklistStepProps, ChecklistVariantClassNameMap, } from '../../lib/checklist'; +import { ChecklistCardVariant } from '../../lib/checklist'; const iconToClassNameMap: ChecklistVariantClassNameMap = { [ChecklistCardVariant.Default]: 'size-10', diff --git a/packages/shared/src/components/checklist/EditSquadStep.tsx b/packages/shared/src/components/checklist/EditSquadStep.tsx index 923f879078..1dd428b70e 100644 --- a/packages/shared/src/components/checklist/EditSquadStep.tsx +++ b/packages/shared/src/components/checklist/EditSquadStep.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { ChecklistStepPropsWithSquad } from '../../lib/checklist'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ChecklistStepPropsWithSquad } from '../../lib/checklist'; import { Button, ButtonVariant } from '../buttons/Button'; import { ChecklistStep } from './ChecklistStep'; import { EditIcon } from '../icons'; diff --git a/packages/shared/src/components/checklist/InstallExtensionChecklistStep.tsx b/packages/shared/src/components/checklist/InstallExtensionChecklistStep.tsx index 2132014e9d..2c84932777 100644 --- a/packages/shared/src/components/checklist/InstallExtensionChecklistStep.tsx +++ b/packages/shared/src/components/checklist/InstallExtensionChecklistStep.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { ChecklistStepProps } from '../../lib/checklist'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ChecklistStepProps } from '../../lib/checklist'; import { ChecklistStep } from './ChecklistStep'; import { Button, ButtonVariant } from '../buttons/Button'; import BrowsersIcon from '../../../icons/browsers.svg'; diff --git a/packages/shared/src/components/checklist/InviteMemberChecklistStep.tsx b/packages/shared/src/components/checklist/InviteMemberChecklistStep.tsx index 8ec9f8caed..c936d23747 100644 --- a/packages/shared/src/components/checklist/InviteMemberChecklistStep.tsx +++ b/packages/shared/src/components/checklist/InviteMemberChecklistStep.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { ChecklistStepPropsWithSquad } from '../../lib/checklist'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ChecklistStepPropsWithSquad } from '../../lib/checklist'; import { ChecklistStep } from './ChecklistStep'; import { Button, ButtonVariant } from '../buttons/Button'; import { LinkIcon } from '../icons'; diff --git a/packages/shared/src/components/checklist/NotificationChecklistStep.tsx b/packages/shared/src/components/checklist/NotificationChecklistStep.tsx index b6d8878226..90c3da39dd 100644 --- a/packages/shared/src/components/checklist/NotificationChecklistStep.tsx +++ b/packages/shared/src/components/checklist/NotificationChecklistStep.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { ChecklistStepProps } from '../../lib/checklist'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ChecklistStepProps } from '../../lib/checklist'; import { Button, ButtonVariant } from '../buttons/Button'; import { ChecklistStep } from './ChecklistStep'; import { BellIcon } from '../icons'; diff --git a/packages/shared/src/components/checklist/OnboardingChecklistBar.tsx b/packages/shared/src/components/checklist/OnboardingChecklistBar.tsx index f16c131bfc..64a9be47a0 100644 --- a/packages/shared/src/components/checklist/OnboardingChecklistBar.tsx +++ b/packages/shared/src/components/checklist/OnboardingChecklistBar.tsx @@ -1,9 +1,11 @@ -import React, { ReactElement, useContext, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useState } from 'react'; import dynamic from 'next/dynamic'; import LogContext from '../../contexts/LogContext'; import { LogEvent, TargetId } from '../../lib/log'; import { useConditionalFeature, useOnboardingChecklist } from '../../hooks'; -import { ChecklistBarProps, ChecklistViewState } from '../../lib/checklist'; +import type { ChecklistBarProps } from '../../lib/checklist'; +import { ChecklistViewState } from '../../lib/checklist'; import { ChecklistBar } from './ChecklistBar'; import InteractivePopup, { InteractivePopupPosition, diff --git a/packages/shared/src/components/checklist/OnboardingChecklistCard.tsx b/packages/shared/src/components/checklist/OnboardingChecklistCard.tsx index f865592ef9..3d254fa2fa 100644 --- a/packages/shared/src/components/checklist/OnboardingChecklistCard.tsx +++ b/packages/shared/src/components/checklist/OnboardingChecklistCard.tsx @@ -1,14 +1,15 @@ -import React, { ReactElement, useContext, useEffect, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useRef } from 'react'; import classNames from 'classnames'; import { ChecklistCard } from './ChecklistCard'; import LogContext from '../../contexts/LogContext'; import { LogEvent, TargetId, TargetType } from '../../lib/log'; import { useActions, useOnboardingChecklist } from '../../hooks'; -import { +import type { ChecklistCardProps, - ChecklistCardVariant, ChecklistVariantClassNameMap, } from '../../lib/checklist'; +import { ChecklistCardVariant } from '../../lib/checklist'; import { ActionType } from '../../graphql/actions'; import { isExtension } from '../../lib/func'; diff --git a/packages/shared/src/components/checklist/OnboardingChecklistDismissButton.tsx b/packages/shared/src/components/checklist/OnboardingChecklistDismissButton.tsx index 17afce6297..81f2f02e5d 100644 --- a/packages/shared/src/components/checklist/OnboardingChecklistDismissButton.tsx +++ b/packages/shared/src/components/checklist/OnboardingChecklistDismissButton.tsx @@ -1,11 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from '../buttons/Button'; +import type { ButtonProps } from '../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { ChecklistViewState } from '../../lib/checklist'; import { useOnboardingChecklist } from '../../hooks'; diff --git a/packages/shared/src/components/checklist/OnboardingChecklistOptions.tsx b/packages/shared/src/components/checklist/OnboardingChecklistOptions.tsx index 9c05a624f1..a072a56e3e 100644 --- a/packages/shared/src/components/checklist/OnboardingChecklistOptions.tsx +++ b/packages/shared/src/components/checklist/OnboardingChecklistOptions.tsx @@ -1,4 +1,5 @@ -import React, { MouseEvent, ReactElement } from 'react'; +import type { MouseEvent, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ChecklistViewState } from '../../lib/checklist'; import { Button } from '../buttons/Button'; diff --git a/packages/shared/src/components/checklist/SharePostChecklistStep.tsx b/packages/shared/src/components/checklist/SharePostChecklistStep.tsx index 5877dcc679..60d5b2c7f6 100644 --- a/packages/shared/src/components/checklist/SharePostChecklistStep.tsx +++ b/packages/shared/src/components/checklist/SharePostChecklistStep.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { ChecklistStepPropsWithSquad } from '../../lib/checklist'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ChecklistStepPropsWithSquad } from '../../lib/checklist'; import { Button, ButtonVariant } from '../buttons/Button'; import { ChecklistStep } from './ChecklistStep'; import { FlexRow } from '../utilities'; diff --git a/packages/shared/src/components/checklist/SidebarOnboardingChecklistCard.tsx b/packages/shared/src/components/checklist/SidebarOnboardingChecklistCard.tsx index bb3410cbe4..cca7b8d9bc 100644 --- a/packages/shared/src/components/checklist/SidebarOnboardingChecklistCard.tsx +++ b/packages/shared/src/components/checklist/SidebarOnboardingChecklistCard.tsx @@ -1,5 +1,6 @@ import dynamic from 'next/dynamic'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ChecklistCardVariant, ChecklistViewState } from '../../lib/checklist'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; diff --git a/packages/shared/src/components/checklist/SquadChecklistCard.tsx b/packages/shared/src/components/checklist/SquadChecklistCard.tsx index 768f900c52..79f78b2c21 100644 --- a/packages/shared/src/components/checklist/SquadChecklistCard.tsx +++ b/packages/shared/src/components/checklist/SquadChecklistCard.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement, useContext, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect } from 'react'; import { ChecklistCard } from './ChecklistCard'; import { useSquadChecklist } from '../../hooks/useSquadChecklist'; -import { Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; import InteractivePopup, { InteractivePopupPosition, } from '../tooltips/InteractivePopup'; diff --git a/packages/shared/src/components/checklist/SquadEditWelcomePostChecklistStep.tsx b/packages/shared/src/components/checklist/SquadEditWelcomePostChecklistStep.tsx index c82ac2cf70..b0acf8e6ef 100644 --- a/packages/shared/src/components/checklist/SquadEditWelcomePostChecklistStep.tsx +++ b/packages/shared/src/components/checklist/SquadEditWelcomePostChecklistStep.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { ChecklistStepPropsWithSquad } from '../../lib/checklist'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ChecklistStepPropsWithSquad } from '../../lib/checklist'; import { Button, ButtonVariant } from '../buttons/Button'; import { ChecklistStep } from './ChecklistStep'; import { EditIcon } from '../icons'; diff --git a/packages/shared/src/components/checklist/SquadFirstCommentChecklistStep.tsx b/packages/shared/src/components/checklist/SquadFirstCommentChecklistStep.tsx index 59037e83c6..cdccedfd1f 100644 --- a/packages/shared/src/components/checklist/SquadFirstCommentChecklistStep.tsx +++ b/packages/shared/src/components/checklist/SquadFirstCommentChecklistStep.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; -import { ChecklistStepPropsWithSquad } from '../../lib/checklist'; +import type { ChecklistStepPropsWithSquad } from '../../lib/checklist'; import { Button, ButtonVariant } from '../buttons/Button'; import { ChecklistStep } from './ChecklistStep'; import { useFindSquadWelcomePost } from '../../hooks/useFindSquadWelcomePost'; diff --git a/packages/shared/src/components/checklist/actionUtils.ts b/packages/shared/src/components/checklist/actionUtils.ts index 2f9685d51d..b4f97f55c2 100644 --- a/packages/shared/src/components/checklist/actionUtils.ts +++ b/packages/shared/src/components/checklist/actionUtils.ts @@ -1,5 +1,6 @@ -import { Squad } from '../../graphql/sources'; -import { Action, ActionType } from '../../graphql/actions'; +import type { Squad } from '../../graphql/sources'; +import type { Action } from '../../graphql/actions'; +import { ActionType } from '../../graphql/actions'; import { cloudinarySquadsImageFallback } from '../../lib/image'; export const getEditActions = (squad: Squad): Action[] => { diff --git a/packages/shared/src/components/comments/AdAsComment.tsx b/packages/shared/src/components/comments/AdAsComment.tsx index 65c7d5b2e4..7a3fe77dab 100644 --- a/packages/shared/src/components/comments/AdAsComment.tsx +++ b/packages/shared/src/components/comments/AdAsComment.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useCallback, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useEffect } from 'react'; import { useQuery } from '@tanstack/react-query'; import { TruncateText } from '../utilities'; import AdLink from '../cards/ad/common/AdLink'; diff --git a/packages/shared/src/components/comments/CommentActionButtons.spec.tsx b/packages/shared/src/components/comments/CommentActionButtons.spec.tsx index 4681a09aae..3707902c68 100644 --- a/packages/shared/src/components/comments/CommentActionButtons.spec.tsx +++ b/packages/shared/src/components/comments/CommentActionButtons.spec.tsx @@ -1,13 +1,16 @@ import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import AuthContext from '../../contexts/AuthContext'; -import { LoggedUser, Roles } from '../../lib/user'; -import CommentActionButtons, { Props } from './CommentActionButtons'; -import { Comment } from '../../graphql/comments'; +import type { LoggedUser } from '../../lib/user'; +import { Roles } from '../../lib/user'; +import type { Props } from './CommentActionButtons'; +import CommentActionButtons from './CommentActionButtons'; +import type { Comment } from '../../graphql/comments'; +import type { MockedGraphQLResponse } from '../../../__tests__/helpers/graphql'; import { completeActionMock, - MockedGraphQLResponse, mockGraphQL, } from '../../../__tests__/helpers/graphql'; import loggedUser from '../../../__tests__/fixture/loggedUser'; diff --git a/packages/shared/src/components/comments/CommentActionButtons.tsx b/packages/shared/src/components/comments/CommentActionButtons.tsx index d1e6c69fca..eac33da609 100644 --- a/packages/shared/src/components/comments/CommentActionButtons.tsx +++ b/packages/shared/src/components/comments/CommentActionButtons.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import classNames from 'classnames'; import { useQueryClient } from '@tanstack/react-query'; import AuthContext, { useAuthContext } from '../../contexts/AuthContext'; @@ -12,7 +13,7 @@ import { DownvoteIcon, AddUserIcon, } from '../icons'; -import { Comment } from '../../graphql/comments'; +import type { Comment } from '../../graphql/comments'; import { Roles } from '../../lib/user'; import { Button, @@ -23,9 +24,11 @@ import { import { ClickableText } from '../buttons/ClickableText'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; import { Origin } from '../../lib/log'; -import { Post, UserVote } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; +import { UserVote } from '../../graphql/posts'; import { AuthTriggers } from '../../lib/auth'; -import ContextMenu, { MenuItemProps } from '../fields/ContextMenu'; +import type { MenuItemProps } from '../fields/ContextMenu'; +import ContextMenu from '../fields/ContextMenu'; import useContextMenu from '../../hooks/useContextMenu'; import OptionsButton from '../buttons/OptionsButton'; import { SourcePermissions } from '../../graphql/sources'; @@ -33,11 +36,8 @@ import { LazyModal } from '../modals/common/types'; import { useLazyModal } from '../../hooks/useLazyModal'; import { labels, largeNumberFormat } from '../../lib'; import { useToastNotification } from '../../hooks/useToastNotification'; -import { - VoteEntityPayload, - useVoteComment, - voteMutationHandlers, -} from '../../hooks'; +import type { VoteEntityPayload } from '../../hooks'; +import { useVoteComment, voteMutationHandlers } from '../../hooks'; import { RequestKey } from '../../lib/query'; import { useRequestProtocol } from '../../hooks/useRequestProtocol'; import { getCompanionWrapper } from '../../lib/extension'; diff --git a/packages/shared/src/components/comments/CommentAuthor.tsx b/packages/shared/src/components/comments/CommentAuthor.tsx index cd510bf1c9..11a18f10a4 100644 --- a/packages/shared/src/components/comments/CommentAuthor.tsx +++ b/packages/shared/src/components/comments/CommentAuthor.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Author } from '../../graphql/comments'; +import type { Author } from '../../graphql/comments'; import { ProfileLink } from '../profile/ProfileLink'; import { ProfileTooltip } from '../profile/ProfileTooltip'; import { TruncateText } from '../utilities'; diff --git a/packages/shared/src/components/comments/CommentBox.tsx b/packages/shared/src/components/comments/CommentBox.tsx index dfbd7de9a1..f4430a185a 100644 --- a/packages/shared/src/components/comments/CommentBox.tsx +++ b/packages/shared/src/components/comments/CommentBox.tsx @@ -1,9 +1,10 @@ -import React, { ReactElement } from 'react'; -import { Origin } from '../../lib/log'; -import CommentActionButtons, { - CommentActionProps, -} from './CommentActionButtons'; -import CommentContainer, { CommentContainerProps } from './CommentContainer'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Origin } from '../../lib/log'; +import type { CommentActionProps } from './CommentActionButtons'; +import CommentActionButtons from './CommentActionButtons'; +import type { CommentContainerProps } from './CommentContainer'; +import CommentContainer from './CommentContainer'; export interface CommentBoxProps extends Omit, diff --git a/packages/shared/src/components/comments/CommentContainer.tsx b/packages/shared/src/components/comments/CommentContainer.tsx index 73de65c98d..b4c1b60811 100644 --- a/packages/shared/src/components/comments/CommentContainer.tsx +++ b/packages/shared/src/components/comments/CommentContainer.tsx @@ -1,8 +1,10 @@ import classNames from 'classnames'; -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import Link from '../utilities/Link'; -import { Comment, getCommentHash } from '../../graphql/comments'; -import { Post } from '../../graphql/posts'; +import type { Comment } from '../../graphql/comments'; +import { getCommentHash } from '../../graphql/comments'; +import type { Post } from '../../graphql/posts'; import { FeatherIcon, ScoutIcon } from '../icons'; import Markdown from '../Markdown'; import { ProfileImageLink } from '../profile/ProfileImageLink'; @@ -14,7 +16,7 @@ import { FlexRow, TruncateText } from '../utilities'; import CommentAuthor from './CommentAuthor'; import { CommentPublishDate } from './CommentPublishDate'; import { useMemberRoleForSource } from '../../hooks/useMemberRoleForSource'; -import { CommentClassName } from '../fields/MarkdownInput/CommentMarkdownInput'; +import type { CommentClassName } from '../fields/MarkdownInput/CommentMarkdownInput'; import { CardLink } from '../cards/common/Card'; import { ReputationUserBadge } from '../ReputationUserBadge'; import { VerifiedCompanyUserBadge } from '../VerifiedCompanyUserBadge'; diff --git a/packages/shared/src/components/comments/CommentInputOrModal.tsx b/packages/shared/src/components/comments/CommentInputOrModal.tsx index 8a8abdfaa0..d681890db2 100644 --- a/packages/shared/src/components/comments/CommentInputOrModal.tsx +++ b/packages/shared/src/components/comments/CommentInputOrModal.tsx @@ -1,10 +1,9 @@ -import React, { ReactElement } from 'react'; -import { - CommentMarkdownInput, - CommentMarkdownInputProps, -} from '../fields/MarkdownInput/CommentMarkdownInput'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { CommentMarkdownInputProps } from '../fields/MarkdownInput/CommentMarkdownInput'; +import { CommentMarkdownInput } from '../fields/MarkdownInput/CommentMarkdownInput'; import { ViewSize, useViewSize } from '../../hooks'; -import { LazyModalCommonProps } from '../modals/common/Modal'; +import type { LazyModalCommonProps } from '../modals/common/Modal'; import CommentModal from '../modals/post/CommentModal'; import { WriteCommentContext } from '../../contexts/WriteCommentContext'; import { useMutateComment } from '../../hooks/post/useMutateComment'; diff --git a/packages/shared/src/components/comments/CommentPublishDate.tsx b/packages/shared/src/components/comments/CommentPublishDate.tsx index 18f8a6b933..6fdb81e243 100644 --- a/packages/shared/src/components/comments/CommentPublishDate.tsx +++ b/packages/shared/src/components/comments/CommentPublishDate.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Comment } from '../../graphql/comments'; +import type { Comment } from '../../graphql/comments'; import { TimeFormatType } from '../../lib/dateFormat'; import { DateFormat } from '../utilities'; diff --git a/packages/shared/src/components/comments/MainComment.spec.tsx b/packages/shared/src/components/comments/MainComment.spec.tsx index 33726b266f..1ba46d3e63 100644 --- a/packages/shared/src/components/comments/MainComment.spec.tsx +++ b/packages/shared/src/components/comments/MainComment.spec.tsx @@ -1,9 +1,11 @@ import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import AuthContext from '../../contexts/AuthContext'; -import { LoggedUser } from '../../lib/user'; -import MainComment, { MainCommentProps } from './MainComment'; +import type { LoggedUser } from '../../lib/user'; +import type { MainCommentProps } from './MainComment'; +import MainComment from './MainComment'; import loggedUser from '../../../__tests__/fixture/loggedUser'; import comment from '../../../__tests__/fixture/comment'; import post from '../../../__tests__/fixture/post'; diff --git a/packages/shared/src/components/comments/MainComment.tsx b/packages/shared/src/components/comments/MainComment.tsx index 60b34cbd32..878575a60e 100644 --- a/packages/shared/src/components/comments/MainComment.tsx +++ b/packages/shared/src/components/comments/MainComment.tsx @@ -1,23 +1,19 @@ -import React, { - ReactElement, - useContext, - useEffect, - useMemo, - useRef, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useMemo, useRef } from 'react'; import classNames from 'classnames'; import { useInView } from 'react-intersection-observer'; import dynamic from 'next/dynamic'; import EnableNotification from '../notifications/EnableNotification'; -import CommentBox, { CommentBoxProps } from './CommentBox'; +import type { CommentBoxProps } from './CommentBox'; +import CommentBox from './CommentBox'; import SubComment from './SubComment'; import AuthContext from '../../contexts/AuthContext'; import { LogEvent, NotificationPromptSource, TargetType } from '../../lib/log'; -import { CommentMarkdownInputProps } from '../fields/MarkdownInput/CommentMarkdownInput'; +import type { CommentMarkdownInputProps } from '../fields/MarkdownInput/CommentMarkdownInput'; import { useComments } from '../../hooks/post'; import { SquadCommentJoinBanner } from '../squads/SquadCommentJoinBanner'; -import { Squad } from '../../graphql/sources'; -import { Comment } from '../../graphql/comments'; +import type { Squad } from '../../graphql/sources'; +import type { Comment } from '../../graphql/comments'; import usePersistentContext from '../../hooks/usePersistentContext'; import { SQUAD_COMMENT_JOIN_BANNER_KEY } from '../../graphql/squads'; import { useEditCommentProps } from '../../hooks/post/useEditCommentProps'; diff --git a/packages/shared/src/components/comments/PlaceholderComment.tsx b/packages/shared/src/components/comments/PlaceholderComment.tsx index a6c10de2d9..dd0a088044 100644 --- a/packages/shared/src/components/comments/PlaceholderComment.tsx +++ b/packages/shared/src/components/comments/PlaceholderComment.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ElementPlaceholder } from '../ElementPlaceholder'; diff --git a/packages/shared/src/components/comments/PlaceholderCommentList.tsx b/packages/shared/src/components/comments/PlaceholderCommentList.tsx index 7cd328b548..47c462cc0b 100644 --- a/packages/shared/src/components/comments/PlaceholderCommentList.tsx +++ b/packages/shared/src/components/comments/PlaceholderCommentList.tsx @@ -1,7 +1,7 @@ -import React, { ReactElement } from 'react'; -import PlaceholderComment, { - PlaceholderCommentProps, -} from './PlaceholderComment'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { PlaceholderCommentProps } from './PlaceholderComment'; +import PlaceholderComment from './PlaceholderComment'; export interface PlaceholderCommentListProps extends PlaceholderCommentProps { placeholderAmount?: number; diff --git a/packages/shared/src/components/comments/SubComment.spec.tsx b/packages/shared/src/components/comments/SubComment.spec.tsx index 41ed2bee75..85c96bc9d7 100644 --- a/packages/shared/src/components/comments/SubComment.spec.tsx +++ b/packages/shared/src/components/comments/SubComment.spec.tsx @@ -1,9 +1,11 @@ import React from 'react'; -import { screen, render, RenderResult } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { screen, render } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import AuthContext from '../../contexts/AuthContext'; -import { LoggedUser } from '../../lib/user'; -import SubComment, { SubCommentProps } from './SubComment'; +import type { LoggedUser } from '../../lib/user'; +import type { SubCommentProps } from './SubComment'; +import SubComment from './SubComment'; import loggedUser from '../../../__tests__/fixture/loggedUser'; import comment from '../../../__tests__/fixture/comment'; import { Origin } from '../../lib/log'; diff --git a/packages/shared/src/components/comments/SubComment.tsx b/packages/shared/src/components/comments/SubComment.tsx index cc90f2ec35..356b433b4e 100644 --- a/packages/shared/src/components/comments/SubComment.tsx +++ b/packages/shared/src/components/comments/SubComment.tsx @@ -1,8 +1,10 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import dynamic from 'next/dynamic'; -import { Comment } from '../../graphql/comments'; -import CommentBox, { CommentBoxProps } from './CommentBox'; -import { CommentMarkdownInputProps } from '../fields/MarkdownInput/CommentMarkdownInput'; +import type { Comment } from '../../graphql/comments'; +import type { CommentBoxProps } from './CommentBox'; +import CommentBox from './CommentBox'; +import type { CommentMarkdownInputProps } from '../fields/MarkdownInput/CommentMarkdownInput'; import { useComments } from '../../hooks/post'; import { useEditCommentProps } from '../../hooks/post/useEditCommentProps'; diff --git a/packages/shared/src/components/containers/Carousel.tsx b/packages/shared/src/components/containers/Carousel.tsx index b1ea06ba1a..0214bc086a 100644 --- a/packages/shared/src/components/containers/Carousel.tsx +++ b/packages/shared/src/components/containers/Carousel.tsx @@ -1,6 +1,8 @@ import classNames from 'classnames'; -import React, { ReactElement, ReactNode, useState } from 'react'; -import { useSwipeable, SwipeCallback } from 'react-swipeable'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useState } from 'react'; +import type { SwipeCallback } from 'react-swipeable'; +import { useSwipeable } from 'react-swipeable'; import { isNullOrUndefined } from '../../lib/func'; import CarouselIndicator from './CarouselIndicator'; diff --git a/packages/shared/src/components/containers/CarouselIndicator.tsx b/packages/shared/src/components/containers/CarouselIndicator.tsx index 89b4b9573e..e1f8007ccf 100644 --- a/packages/shared/src/components/containers/CarouselIndicator.tsx +++ b/packages/shared/src/components/containers/CarouselIndicator.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; interface ClassName { container?: string; diff --git a/packages/shared/src/components/containers/FeedTopicCard.tsx b/packages/shared/src/components/containers/FeedTopicCard.tsx index 704b74dc73..405ce62a12 100644 --- a/packages/shared/src/components/containers/FeedTopicCard.tsx +++ b/packages/shared/src/components/containers/FeedTopicCard.tsx @@ -1,6 +1,7 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; -import { TagCategory } from '../../graphql/feedSettings'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { TagCategory } from '../../graphql/feedSettings'; import classed from '../../lib/classed'; import { VIcon } from '../icons'; diff --git a/packages/shared/src/components/containers/InfiniteScrolling.tsx b/packages/shared/src/components/containers/InfiniteScrolling.tsx index be88be49cd..44b2cdb1f5 100644 --- a/packages/shared/src/components/containers/InfiniteScrolling.tsx +++ b/packages/shared/src/components/containers/InfiniteScrolling.tsx @@ -1,6 +1,10 @@ import classNames from 'classnames'; -import React, { HTMLAttributes, ReactElement, ReactNode } from 'react'; -import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query'; +import type { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import React from 'react'; +import type { + InfiniteData, + UseInfiniteQueryResult, +} from '@tanstack/react-query'; import useFeedInfiniteScroll from '../../hooks/feed/useFeedInfiniteScroll'; export interface InfiniteScrollingProps diff --git a/packages/shared/src/components/contentPreference/FollowButton.tsx b/packages/shared/src/components/contentPreference/FollowButton.tsx index 230155097f..ba47a27b00 100644 --- a/packages/shared/src/components/contentPreference/FollowButton.tsx +++ b/packages/shared/src/components/contentPreference/FollowButton.tsx @@ -1,17 +1,15 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { useMutation } from '@tanstack/react-query'; -import { - ContentPreferenceStatus, - ContentPreferenceType, -} from '../../graphql/contentPreference'; +import type { ContentPreferenceType } from '../../graphql/contentPreference'; +import { ContentPreferenceStatus } from '../../graphql/contentPreference'; import { ButtonVariant } from '../buttons/Button'; import { useContentPreference } from '../../hooks/contentPreference/useContentPreference'; import SourceActionsNotify from '../sources/SourceActions/SourceActionsNotify'; -import SourceActionsFollow, { - CopyType, -} from '../sources/SourceActions/SourceActionsFollow'; -import { Origin } from '../../lib/log'; +import type { CopyType } from '../sources/SourceActions/SourceActionsFollow'; +import SourceActionsFollow from '../sources/SourceActions/SourceActionsFollow'; +import type { Origin } from '../../lib/log'; import { useIsSpecialUser } from '../../hooks/auth/useIsSpecialUser'; export type FollowButtonProps = { diff --git a/packages/shared/src/components/drawers/ContextMenuDrawer.tsx b/packages/shared/src/components/drawers/ContextMenuDrawer.tsx index 10e7d2a81f..c4c33f06fb 100644 --- a/packages/shared/src/components/drawers/ContextMenuDrawer.tsx +++ b/packages/shared/src/components/drawers/ContextMenuDrawer.tsx @@ -1,7 +1,9 @@ -import React, { ComponentType, ReactElement, ReactNode } from 'react'; +import type { ComponentType, ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Drawer, DrawerRef, DrawerWrapperProps } from './Drawer'; -import { SelectParams } from './common'; +import type { DrawerRef, DrawerWrapperProps } from './Drawer'; +import { Drawer } from './Drawer'; +import type { SelectParams } from './common'; import ConditionalWrapper from '../ConditionalWrapper'; export interface ContextMenuDrawerItem { diff --git a/packages/shared/src/components/drawers/Drawer.tsx b/packages/shared/src/components/drawers/Drawer.tsx index cbbf9020ca..05028c9e16 100644 --- a/packages/shared/src/components/drawers/Drawer.tsx +++ b/packages/shared/src/components/drawers/Drawer.tsx @@ -1,13 +1,10 @@ -import React, { +import type { HTMLAttributes, MutableRefObject, ReactElement, ReactNode, - useEffect, - useImperativeHandle, - useRef, - useState, } from 'react'; +import React, { useEffect, useImperativeHandle, useRef, useState } from 'react'; import classNames from 'classnames'; import useDebounceFn from '../../hooks/useDebounceFn'; import ConditionalWrapper from '../ConditionalWrapper'; diff --git a/packages/shared/src/components/drawers/ListDrawer.tsx b/packages/shared/src/components/drawers/ListDrawer.tsx index c9e46c1ce0..f8b5226b97 100644 --- a/packages/shared/src/components/drawers/ListDrawer.tsx +++ b/packages/shared/src/components/drawers/ListDrawer.tsx @@ -1,7 +1,10 @@ -import React, { ReactElement } from 'react'; -import { Drawer, DrawerRef, DrawerWrapperProps } from './Drawer'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { DrawerRef, DrawerWrapperProps } from './Drawer'; +import { Drawer } from './Drawer'; import type { SelectParams } from './common'; -import { ListDrawerItem, ListDrawerItemProps } from './ListDrawerItem'; +import type { ListDrawerItemProps } from './ListDrawerItem'; +import { ListDrawerItem } from './ListDrawerItem'; interface ListDrawerProps extends Pick { drawerProps: Omit; diff --git a/packages/shared/src/components/drawers/ListDrawerItem.tsx b/packages/shared/src/components/drawers/ListDrawerItem.tsx index 9479657493..d1ddd3d8cd 100644 --- a/packages/shared/src/components/drawers/ListDrawerItem.tsx +++ b/packages/shared/src/components/drawers/ListDrawerItem.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { VIcon } from '../icons'; import { IconSize } from '../Icon'; diff --git a/packages/shared/src/components/drawers/NavDrawer.tsx b/packages/shared/src/components/drawers/NavDrawer.tsx index e126b7d2f4..84d44ac09a 100644 --- a/packages/shared/src/components/drawers/NavDrawer.tsx +++ b/packages/shared/src/components/drawers/NavDrawer.tsx @@ -1,11 +1,9 @@ -import React, { ReactElement } from 'react'; -import { - Drawer, - DrawerPosition, - DrawerRef, - DrawerWrapperProps, -} from './Drawer'; -import { NavDrawerItem, NavItemProps } from './NavDrawerItem'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { DrawerRef, DrawerWrapperProps } from './Drawer'; +import { Drawer, DrawerPosition } from './Drawer'; +import type { NavItemProps } from './NavDrawerItem'; +import { NavDrawerItem } from './NavDrawerItem'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { ArrowIcon } from '../icons'; import classed from '../../lib/classed'; diff --git a/packages/shared/src/components/drawers/NavDrawerItem.tsx b/packages/shared/src/components/drawers/NavDrawerItem.tsx index dfe00b4fe7..da4e80c683 100644 --- a/packages/shared/src/components/drawers/NavDrawerItem.tsx +++ b/packages/shared/src/components/drawers/NavDrawerItem.tsx @@ -1,8 +1,10 @@ -import React, { MutableRefObject, ReactElement } from 'react'; +import type { MutableRefObject, ReactElement } from 'react'; +import React from 'react'; import Link from '../utilities/Link'; -import { Button, ButtonProps, ButtonVariant } from '../buttons/Button'; +import type { ButtonProps } from '../buttons/Button'; +import { Button, ButtonVariant } from '../buttons/Button'; import ConditionalWrapper from '../ConditionalWrapper'; -import { DrawerRef } from './Drawer'; +import type { DrawerRef } from './Drawer'; export type NavItemProps = ButtonProps<'a'> & { label: string; diff --git a/packages/shared/src/components/drawers/common.ts b/packages/shared/src/components/drawers/common.ts index 773a08ae75..0cd5805485 100644 --- a/packages/shared/src/components/drawers/common.ts +++ b/packages/shared/src/components/drawers/common.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; export interface SelectParams { value: string; diff --git a/packages/shared/src/components/errors/ServerError.tsx b/packages/shared/src/components/errors/ServerError.tsx index 31fb604915..1ce3f4126b 100644 --- a/packages/shared/src/components/errors/ServerError.tsx +++ b/packages/shared/src/components/errors/ServerError.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Typography, TypographyColor, diff --git a/packages/shared/src/components/errors/SquadLoading.tsx b/packages/shared/src/components/errors/SquadLoading.tsx index ef9d259379..8f55857302 100644 --- a/packages/shared/src/components/errors/SquadLoading.tsx +++ b/packages/shared/src/components/errors/SquadLoading.tsx @@ -1,8 +1,9 @@ -import React, { HTMLAttributes, ReactElement } from 'react'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import classed from '../../lib/classed'; import { FlexCol, FlexRow } from '../utilities'; -import { Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; const PlaceholderElement = classed('div', 'bg-accent-pepper-subtlest'); const RectangleElement = classed(PlaceholderElement, 'rounded-12'); diff --git a/packages/shared/src/components/errors/Unauthorized.tsx b/packages/shared/src/components/errors/Unauthorized.tsx index 2c49862c5a..619933f469 100644 --- a/packages/shared/src/components/errors/Unauthorized.tsx +++ b/packages/shared/src/components/errors/Unauthorized.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { LockIcon } from '../icons'; import { PageContainerCentered } from '../utilities'; diff --git a/packages/shared/src/components/feeds/FeedContainer.tsx b/packages/shared/src/components/feeds/FeedContainer.tsx index a098facb70..8343f65c1f 100644 --- a/packages/shared/src/components/feeds/FeedContainer.tsx +++ b/packages/shared/src/components/feeds/FeedContainer.tsx @@ -1,21 +1,16 @@ -import React, { - CSSProperties, - ReactElement, - ReactNode, - useContext, - useMemo, -} from 'react'; +import type { CSSProperties, ReactElement, ReactNode } from 'react'; +import React, { useContext, useMemo } from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; -import { Spaciness } from '../../graphql/settings'; +import type { Spaciness } from '../../graphql/settings'; import SettingsContext from '../../contexts/SettingsContext'; import FeedContext from '../../contexts/FeedContext'; import styles from '../Feed.module.css'; +import type { FeedPagesWithMobileLayoutType } from '../../hooks'; import { useFeedLayout, ToastSubject, useToastNotification, - FeedPagesWithMobileLayoutType, useViewSize, ViewSize, useFeeds, @@ -24,7 +19,7 @@ import ConditionalWrapper from '../ConditionalWrapper'; import { useActiveFeedNameContext } from '../../contexts'; import { SharedFeedPage } from '../utilities'; import { useFeedName } from '../../hooks/feed/useFeedName'; -import { OtherFeedPage } from '../../lib/query'; +import type { OtherFeedPage } from '../../lib/query'; import { isExtension } from '../../lib/func'; export interface FeedContainerProps { diff --git a/packages/shared/src/components/feeds/FeedCustomActions.tsx b/packages/shared/src/components/feeds/FeedCustomActions.tsx index 0efbcc921f..41e8bb4c2f 100644 --- a/packages/shared/src/components/feeds/FeedCustomActions.tsx +++ b/packages/shared/src/components/feeds/FeedCustomActions.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { Button } from '../buttons/Button'; import { ButtonSize, ButtonVariant } from '../buttons/common'; import { TrashIcon } from '../icons'; diff --git a/packages/shared/src/components/feeds/FeedCustomPreview.tsx b/packages/shared/src/components/feeds/FeedCustomPreview.tsx index 1d92465efa..6e85852d48 100644 --- a/packages/shared/src/components/feeds/FeedCustomPreview.tsx +++ b/packages/shared/src/components/feeds/FeedCustomPreview.tsx @@ -1,5 +1,6 @@ import { keepPreviousData } from '@tanstack/react-query'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useAuthContext } from '../../contexts/AuthContext'; import { PREVIEW_FEED_QUERY } from '../../graphql/feed'; import useFeedSettings from '../../hooks/useFeedSettings'; diff --git a/packages/shared/src/components/feeds/FeedNav.tsx b/packages/shared/src/components/feeds/FeedNav.tsx index 1109394308..ffb7f71563 100644 --- a/packages/shared/src/components/feeds/FeedNav.tsx +++ b/packages/shared/src/components/feeds/FeedNav.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import { useRouter } from 'next/router'; import dynamic from 'next/dynamic'; import { Tab, TabContainer } from '../tabs/TabContainer'; diff --git a/packages/shared/src/components/feeds/FeedPreviewControls.tsx b/packages/shared/src/components/feeds/FeedPreviewControls.tsx index 77401afb7f..767a7c0488 100644 --- a/packages/shared/src/components/feeds/FeedPreviewControls.tsx +++ b/packages/shared/src/components/feeds/FeedPreviewControls.tsx @@ -1,10 +1,11 @@ import classNames from 'classnames'; import React from 'react'; -import { ReactElement } from 'react-markdown/lib/react-markdown'; +import type { ReactElement } from 'react-markdown/lib/react-markdown'; import { Button } from '../buttons/Button'; import { ButtonVariant, ButtonIconPosition } from '../buttons/common'; import { ArrowIcon } from '../icons'; -import { LogEvent, Origin } from '../../lib/log'; +import type { Origin } from '../../lib/log'; +import { LogEvent } from '../../lib/log'; import { useLogContext } from '../../contexts/LogContext'; export type FeedPreviewControlsControlsProps = { diff --git a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsCreate.tsx b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsCreate.tsx index 961b62e4ea..e7a50c2438 100644 --- a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsCreate.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsCreate.tsx @@ -1,12 +1,13 @@ -import React, { ReactElement, useEffect, useRef, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { useRouter } from 'next/router'; import classNames from 'classnames'; import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { ClientError } from 'graphql-request'; +import type { ClientError } from 'graphql-request'; import { Modal } from '../../modals/common/Modal'; +import type { CreateFeedProps } from '../../../hooks'; import { - CreateFeedProps, useActions, useFeeds, usePlusSubscription, diff --git a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEdit.tsx b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEdit.tsx index 34dd3ebd22..2b40874c3c 100644 --- a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEdit.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEdit.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useMemo } from 'react'; import { useRouter } from 'next/router'; import dynamic from 'next/dynamic'; import { useFeedSettingsEdit } from './useFeedSettingsEdit'; @@ -13,7 +14,8 @@ import { HashtagIcon, MagicIcon, } from '../../icons'; -import { FeedSettingsMenu, feedSettingsMenuTitle } from './types'; +import type { FeedSettingsMenu } from './types'; +import { feedSettingsMenuTitle } from './types'; import { IconSize } from '../../Icon'; import { FeedSettingsEditContext } from './FeedSettingsEditContext'; import { FeedSettingsEditHeader } from './FeedSettingsEditHeader'; diff --git a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditBody.tsx b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditBody.tsx index 7e9a7f6520..21de36cf5c 100644 --- a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditBody.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditBody.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Modal } from '../../modals/common/Modal'; -import { ModalBodyProps } from '../../modals/common/ModalBody'; +import type { ModalBodyProps } from '../../modals/common/ModalBody'; import { Typography, TypographyType } from '../../typography/Typography'; export type FeedSettingsEditBodyProps = ModalBodyProps; diff --git a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditContext.tsx b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditContext.tsx index 3e8d7bdfc5..8f7ba21175 100644 --- a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditContext.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditContext.tsx @@ -1,5 +1,5 @@ import { createContext, useContext } from 'react'; -import { FeedSettingsEditContextValue } from './types'; +import type { FeedSettingsEditContextValue } from './types'; export const FeedSettingsEditContext = createContext(undefined); diff --git a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditHeader.tsx b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditHeader.tsx index 478b0425bb..7104b5dfbc 100644 --- a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditHeader.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsEditHeader.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { FeedSettingsEditContext } from './FeedSettingsEditContext'; import { useViewSizeClient, ViewSize } from '../../../hooks/useViewSize'; import { Button } from '../../buttons/Button'; diff --git a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsTitle.tsx b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsTitle.tsx index 72ded53f1e..8a867aea00 100644 --- a/packages/shared/src/components/feeds/FeedSettings/FeedSettingsTitle.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/FeedSettingsTitle.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import { IconSize } from '../../Icon'; import { HashtagIcon } from '../../icons'; diff --git a/packages/shared/src/components/feeds/FeedSettings/TagElement.tsx b/packages/shared/src/components/feeds/FeedSettings/TagElement.tsx index c37bc25b34..ec33a6b26b 100644 --- a/packages/shared/src/components/feeds/FeedSettings/TagElement.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/TagElement.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { AlertDot, AlertColor } from '../../AlertDot'; import { Button } from '../../buttons/Button'; import { @@ -7,8 +8,8 @@ import { ButtonSize, ButtonVariant, } from '../../buttons/common'; -import { Tag } from '../../../graphql/feedSettings'; -import { OnSelectTagProps } from '../../tags/common'; +import type { Tag } from '../../../graphql/feedSettings'; +import type { OnSelectTagProps } from '../../tags/common'; import { MiniCloseIcon, PlusIcon } from '../../icons'; export type OnboardingTagProps = { diff --git a/packages/shared/src/components/feeds/FeedSettings/components/BlockedSourceList.tsx b/packages/shared/src/components/feeds/FeedSettings/components/BlockedSourceList.tsx index 95293b5100..1240f9ad12 100644 --- a/packages/shared/src/components/feeds/FeedSettings/components/BlockedSourceList.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/components/BlockedSourceList.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement, useContext, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; import { FeedSettingsEditContext } from '../FeedSettingsEditContext'; import { ContentPreferenceType } from '../../../../graphql/contentPreference'; import { checkFetchMore } from '../../../containers/InfiniteScrolling'; diff --git a/packages/shared/src/components/feeds/FeedSettings/components/BlockedTagList.tsx b/packages/shared/src/components/feeds/FeedSettings/components/BlockedTagList.tsx index 9ff9054af0..15faf8f3f1 100644 --- a/packages/shared/src/components/feeds/FeedSettings/components/BlockedTagList.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/components/BlockedTagList.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement, useContext, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; import { FeedSettingsEditContext } from '../FeedSettingsEditContext'; import { ContentPreferenceType } from '../../../../graphql/contentPreference'; import { checkFetchMore } from '../../../containers/InfiniteScrolling'; diff --git a/packages/shared/src/components/feeds/FeedSettings/components/BlockedUserList.tsx b/packages/shared/src/components/feeds/FeedSettings/components/BlockedUserList.tsx index 058c8e9df5..d60ce7ed72 100644 --- a/packages/shared/src/components/feeds/FeedSettings/components/BlockedUserList.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/components/BlockedUserList.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import { useFeedSettingsEditContext } from '../FeedSettingsEditContext'; import { ContentPreferenceType } from '../../../../graphql/contentPreference'; import UserList from '../../../profile/UserList'; diff --git a/packages/shared/src/components/feeds/FeedSettings/components/FollowingSourceList.tsx b/packages/shared/src/components/feeds/FeedSettings/components/FollowingSourceList.tsx index 49b2d19eed..50b4210d1e 100644 --- a/packages/shared/src/components/feeds/FeedSettings/components/FollowingSourceList.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/components/FollowingSourceList.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement, useContext, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; import { FeedSettingsEditContext } from '../FeedSettingsEditContext'; import { useAuthContext } from '../../../../contexts/AuthContext'; import { useFollowingQuery } from '../../../../hooks/contentPreference/useFollowingQuery'; diff --git a/packages/shared/src/components/feeds/FeedSettings/components/FollowingUserList.tsx b/packages/shared/src/components/feeds/FeedSettings/components/FollowingUserList.tsx index 8e4131f189..f90244688c 100644 --- a/packages/shared/src/components/feeds/FeedSettings/components/FollowingUserList.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/components/FollowingUserList.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import { useFeedSettingsEditContext } from '../FeedSettingsEditContext'; import { useAuthContext } from '../../../../contexts/AuthContext'; import { useFollowingQuery } from '../../../../hooks/contentPreference/useFollowingQuery'; diff --git a/packages/shared/src/components/feeds/FeedSettings/components/SuspenseLoader.tsx b/packages/shared/src/components/feeds/FeedSettings/components/SuspenseLoader.tsx index 3d34e1988d..993ddc36db 100644 --- a/packages/shared/src/components/feeds/FeedSettings/components/SuspenseLoader.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/components/SuspenseLoader.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Loader } from '../../../Loader'; export const SuspenseLoader = (): ReactElement => { diff --git a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsAISection.tsx b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsAISection.tsx index b1e69c58cd..e325c2bcd0 100644 --- a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsAISection.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsAISection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { usePlusSubscription, useToastNotification } from '../../../../hooks'; import { useAuthContext } from '../../../../contexts/AuthContext'; import { useLogContext } from '../../../../contexts/LogContext'; diff --git a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsBlockingSection.tsx b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsBlockingSection.tsx index c37ec4e0e4..98d1966635 100644 --- a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsBlockingSection.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsBlockingSection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { ModalKind, ModalPropsContext, diff --git a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsContentPreferencesSection.tsx b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsContentPreferencesSection.tsx index 0073277760..39453f08db 100644 --- a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsContentPreferencesSection.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsContentPreferencesSection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; import { FeedSettingsEditContext } from '../FeedSettingsEditContext'; import useFeedSettings from '../../../../hooks/useFeedSettings'; import { useAdvancedSettings } from '../../../../hooks/feed/useAdvancedSettings'; diff --git a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsContentSourcesSection.tsx b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsContentSourcesSection.tsx index 9eacc54486..e4ec3f687e 100644 --- a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsContentSourcesSection.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsContentSourcesSection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useMemo, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo, useState } from 'react'; import { useQueryClient } from '@tanstack/react-query'; import { SearchField } from '../../../fields/SearchField'; import { ModalTabs } from '../../../modals/common/ModalTabs'; @@ -12,10 +13,8 @@ import { FollowingSourceList } from '../components/FollowingSourceList'; import { SourceType } from '../../../../graphql/sources'; import { SearchPanelSourceSuggestions } from '../../../search/SearchPanel/SearchPanelSourceSuggestions'; import { SearchPanelUserSuggestions } from '../../../search/SearchPanel/SearchPanelUserSuggestions'; -import { - SearchPanelContext, - SearchPanelContextValue, -} from '../../../search/SearchPanel/SearchPanelContext'; +import type { SearchPanelContextValue } from '../../../search/SearchPanel/SearchPanelContext'; +import { SearchPanelContext } from '../../../search/SearchPanel/SearchPanelContext'; import { defaultSearchProvider, providerToLabelTextMap } from '../../../search'; import { generateQueryKey, RequestKey } from '../../../../lib/query'; import { useAuthContext } from '../../../../contexts/AuthContext'; diff --git a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsFiltersSection.tsx b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsFiltersSection.tsx index 3b34ce92f0..9473a3a72e 100644 --- a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsFiltersSection.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsFiltersSection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { FeedSettingsEditContext } from '../FeedSettingsEditContext'; import { Typography, diff --git a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsGeneralSection.tsx b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsGeneralSection.tsx index 4996bb2ba9..2d09528b71 100644 --- a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsGeneralSection.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsGeneralSection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import Link from 'next/link'; import { FeedSettingsEditContext } from '../FeedSettingsEditContext'; diff --git a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsTagsSection.tsx b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsTagsSection.tsx index f597d3c92b..adc92f6789 100644 --- a/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsTagsSection.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/sections/FeedSettingsTagsSection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext, useMemo, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo, useState } from 'react'; import classNames from 'classnames'; import { FeedSettingsEditContext } from '../FeedSettingsEditContext'; import { TagSelection } from '../../../tags/TagSelection'; @@ -13,7 +14,7 @@ import { ModalTabs } from '../../../modals/common/ModalTabs'; import useDebounceFn from '../../../../hooks/useDebounceFn'; import { useTagSearch } from '../../../../hooks/useTagSearch'; import { SearchField } from '../../../fields/SearchField'; -import { TagsData } from '../../../../graphql/feedSettings'; +import type { TagsData } from '../../../../graphql/feedSettings'; import { Typography, TypographyColor, diff --git a/packages/shared/src/components/feeds/FeedSettings/types.ts b/packages/shared/src/components/feeds/FeedSettings/types.ts index d073900797..b5eb8ddbb7 100644 --- a/packages/shared/src/components/feeds/FeedSettings/types.ts +++ b/packages/shared/src/components/feeds/FeedSettings/types.ts @@ -1,5 +1,5 @@ -import { Feed } from '../../../graphql/feed'; -import { OnSelectTagProps } from '../../tags/common'; +import type { Feed } from '../../../graphql/feed'; +import type { OnSelectTagProps } from '../../tags/common'; export type FeedSettingsFormData = { name: string; diff --git a/packages/shared/src/components/feeds/FeedSettings/useFeedSettingsEdit.tsx b/packages/shared/src/components/feeds/FeedSettings/useFeedSettingsEdit.tsx index cc8160ef26..163009512c 100644 --- a/packages/shared/src/components/feeds/FeedSettings/useFeedSettingsEdit.tsx +++ b/packages/shared/src/components/feeds/FeedSettings/useFeedSettingsEdit.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useQueryClient, useMutation } from '@tanstack/react-query'; -import { ClientError } from 'graphql-request'; +import type { ClientError } from 'graphql-request'; import { useRouter } from 'next/router'; import useFeedSettings, { getFeedSettingsQueryKey, @@ -16,13 +16,18 @@ import { } from '../../../graphql/feedSettings'; import { useFeeds, useToastNotification } from '../../../hooks'; import { useExitConfirmation } from '../../../hooks/useExitConfirmation'; -import { PromptOptions, usePrompt } from '../../../hooks/usePrompt'; +import type { PromptOptions } from '../../../hooks/usePrompt'; +import { usePrompt } from '../../../hooks/usePrompt'; import { labels } from '../../../lib'; import { generateQueryKey } from '../../../lib/query'; import { ButtonColor } from '../../buttons/Button'; import { SharedFeedPage } from '../../utilities'; -import { FeedSettingsEditContextValue, FeedSettingsFormData } from './types'; -import { Feed, FeedType } from '../../../graphql/feed'; +import type { + FeedSettingsEditContextValue, + FeedSettingsFormData, +} from './types'; +import type { Feed } from '../../../graphql/feed'; +import { FeedType } from '../../../graphql/feed'; import useCustomDefaultFeed from '../../../hooks/feed/useCustomDefaultFeed'; const discardPrompt: PromptOptions = { diff --git a/packages/shared/src/components/feeds/FeedSettingsButton.tsx b/packages/shared/src/components/feeds/FeedSettingsButton.tsx index 56a1a954ee..24cd80e714 100644 --- a/packages/shared/src/components/feeds/FeedSettingsButton.tsx +++ b/packages/shared/src/components/feeds/FeedSettingsButton.tsx @@ -1,10 +1,7 @@ -import React, { ReactElement } from 'react'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from '../buttons/Button'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ButtonProps } from '../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { useLogContext } from '../../contexts/LogContext'; import { LogEvent } from '../../lib/log'; import { FilterIcon } from '../icons'; diff --git a/packages/shared/src/components/feeds/HorizontalFeed.tsx b/packages/shared/src/components/feeds/HorizontalFeed.tsx index 4002b06e90..f288af2f5e 100644 --- a/packages/shared/src/components/feeds/HorizontalFeed.tsx +++ b/packages/shared/src/components/feeds/HorizontalFeed.tsx @@ -1,11 +1,12 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classnames from 'classnames'; import Feed from '../Feed'; -import { OtherFeedPage } from '../../lib/query'; +import type { OtherFeedPage } from '../../lib/query'; import { useHorizontalScrollHeader } from '../HorizontalScroll/useHorizontalScrollHeader'; import { useFeedLayout } from '../../hooks'; import { TypographyType } from '../typography/Typography'; -import { HorizontalScrollTitleProps } from '../HorizontalScroll/HorizontalScrollHeader'; +import type { HorizontalScrollTitleProps } from '../HorizontalScroll/HorizontalScrollHeader'; interface HorizontalFeedProps { feedName: OtherFeedPage; diff --git a/packages/shared/src/components/feeds/MobileFeedActions.tsx b/packages/shared/src/components/feeds/MobileFeedActions.tsx index ddce7a1859..5bfd28ee6b 100644 --- a/packages/shared/src/components/feeds/MobileFeedActions.tsx +++ b/packages/shared/src/components/feeds/MobileFeedActions.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import Link from '../utilities/Link'; import { ReadingStreakButton } from '../streak/ReadingStreakButton'; diff --git a/packages/shared/src/components/feeds/PreparingYourFeed.tsx b/packages/shared/src/components/feeds/PreparingYourFeed.tsx index c26e0707de..36f187dfcc 100644 --- a/packages/shared/src/components/feeds/PreparingYourFeed.tsx +++ b/packages/shared/src/components/feeds/PreparingYourFeed.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import classed from '../../lib/classed'; diff --git a/packages/shared/src/components/feeds/SimilarEmptyScreen.tsx b/packages/shared/src/components/feeds/SimilarEmptyScreen.tsx index 525d7c24f9..21442b1b97 100644 --- a/packages/shared/src/components/feeds/SimilarEmptyScreen.tsx +++ b/packages/shared/src/components/feeds/SimilarEmptyScreen.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { FlexCentered } from '../utilities'; import { MagicIcon } from '../icons'; import { IconSize } from '../Icon'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import { ButtonSize } from '../buttons/Button'; import { TagLinks } from '../TagLinks'; diff --git a/packages/shared/src/components/feeds/useFeedContentPreferenceMutationSubscription.ts b/packages/shared/src/components/feeds/useFeedContentPreferenceMutationSubscription.ts index f5202be98d..dec1cfc6f3 100644 --- a/packages/shared/src/components/feeds/useFeedContentPreferenceMutationSubscription.ts +++ b/packages/shared/src/components/feeds/useFeedContentPreferenceMutationSubscription.ts @@ -1,13 +1,14 @@ -import { InfiniteData, QueryKey } from '@tanstack/react-query'; -import { FeedData } from '../../graphql/posts'; +import type { InfiniteData, QueryKey } from '@tanstack/react-query'; +import type { FeedData } from '../../graphql/posts'; +import type { ContentPreferenceMutation } from '../../hooks/contentPreference/types'; import { - ContentPreferenceMutation, contentPreferenceMutationMatcher, mutationKeyToContentPreferenceStatusMap, } from '../../hooks/contentPreference/types'; import { useMutationSubscription } from '../../hooks/mutationSubscription/useMutationSubscription'; -import { RequestKey, updatePostContentPreference } from '../../lib/query'; -import { PropsParameters } from '../../types'; +import type { RequestKey } from '../../lib/query'; +import { updatePostContentPreference } from '../../lib/query'; +import type { PropsParameters } from '../../types'; type UseFeedContentPreferenceMutationSubscriptionProps = { feedQueryKey: QueryKey; diff --git a/packages/shared/src/components/fields/AutoCompleteMenu.tsx b/packages/shared/src/components/fields/AutoCompleteMenu.tsx index 60507f54ef..88a122b79c 100644 --- a/packages/shared/src/components/fields/AutoCompleteMenu.tsx +++ b/packages/shared/src/components/fields/AutoCompleteMenu.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import { createPortal } from 'react-dom'; import classNames from 'classnames'; import { SearchIcon as MagnifyingIcon } from '../icons'; diff --git a/packages/shared/src/components/fields/BaseFieldContainer.tsx b/packages/shared/src/components/fields/BaseFieldContainer.tsx index 79f642f61a..51f291fe84 100644 --- a/packages/shared/src/components/fields/BaseFieldContainer.tsx +++ b/packages/shared/src/components/fields/BaseFieldContainer.tsx @@ -1,12 +1,9 @@ import classNames from 'classnames'; -import React, { - ReactElement, - ReactNode, - forwardRef, - MutableRefObject, -} from 'react'; -import { BaseField, FieldType, TextInputProps } from './common'; -import { IconProps } from '../Icon'; +import type { ReactElement, ReactNode, MutableRefObject } from 'react'; +import React, { forwardRef } from 'react'; +import type { FieldType, TextInputProps } from './common'; +import { BaseField } from './common'; +import type { IconProps } from '../Icon'; interface FieldStateProps { readOnly?: boolean; diff --git a/packages/shared/src/components/fields/CardCheckbox.tsx b/packages/shared/src/components/fields/CardCheckbox.tsx index c64340d148..5654addc5c 100644 --- a/packages/shared/src/components/fields/CardCheckbox.tsx +++ b/packages/shared/src/components/fields/CardCheckbox.tsx @@ -1,4 +1,5 @@ -import React, { InputHTMLAttributes, ReactElement } from 'react'; +import type { InputHTMLAttributes, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Typography, diff --git a/packages/shared/src/components/fields/Checkbox.spec.tsx b/packages/shared/src/components/fields/Checkbox.spec.tsx index 7713a24480..0dce1a08d1 100644 --- a/packages/shared/src/components/fields/Checkbox.spec.tsx +++ b/packages/shared/src/components/fields/Checkbox.spec.tsx @@ -1,12 +1,8 @@ -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import React from 'react'; -import { Checkbox, CheckboxProps } from './Checkbox'; +import type { CheckboxProps } from './Checkbox'; +import { Checkbox } from './Checkbox'; const renderComponent = (props: Partial = {}): RenderResult => { return render(); diff --git a/packages/shared/src/components/fields/Checkbox.tsx b/packages/shared/src/components/fields/Checkbox.tsx index 01a7b9041d..600aced4b3 100644 --- a/packages/shared/src/components/fields/Checkbox.tsx +++ b/packages/shared/src/components/fields/Checkbox.tsx @@ -1,14 +1,11 @@ -import React, { +import type { ChangeEvent, - forwardRef, LegacyRef, ReactElement, ReactNode, - useEffect, - useState, InputHTMLAttributes, - useId, } from 'react'; +import React, { forwardRef, useEffect, useState, useId } from 'react'; import classNames from 'classnames'; import { VIcon } from '../icons'; import styles from './Checkbox.module.css'; diff --git a/packages/shared/src/components/fields/ContextMenu.tsx b/packages/shared/src/components/fields/ContextMenu.tsx index c9d92b947a..cd0a783c5c 100644 --- a/packages/shared/src/components/fields/ContextMenu.tsx +++ b/packages/shared/src/components/fields/ContextMenu.tsx @@ -1,19 +1,18 @@ -import React, { +import type { AnchorHTMLAttributes, ComponentType, ReactElement, ReactNode, - useCallback, } from 'react'; -import { Item, Menu, MenuProps } from '@dailydotdev/react-contexify'; +import React, { useCallback } from 'react'; +import type { MenuProps } from '@dailydotdev/react-contexify'; +import { Item, Menu } from '@dailydotdev/react-contexify'; import { RootPortal } from '../tooltips/Portal'; import ConditionalWrapper from '../ConditionalWrapper'; import useContextMenu from '../../hooks/useContextMenu'; import { useViewSize, ViewSize } from '../../hooks'; -import { - ContextMenuDrawer, - ContextMenuDrawerItem, -} from '../drawers/ContextMenuDrawer'; +import type { ContextMenuDrawerItem } from '../drawers/ContextMenuDrawer'; +import { ContextMenuDrawer } from '../drawers/ContextMenuDrawer'; function PortalMenu({ id, diff --git a/packages/shared/src/components/fields/CustomSwitch.tsx b/packages/shared/src/components/fields/CustomSwitch.tsx index 40732742b8..53239557f7 100644 --- a/packages/shared/src/components/fields/CustomSwitch.tsx +++ b/packages/shared/src/components/fields/CustomSwitch.tsx @@ -1,10 +1,5 @@ -import React, { - ReactElement, - ReactNode, - useEffect, - useRef, - useState, -} from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; import styles from './CustomSwitch.module.css'; import classed from '../../lib/classed'; diff --git a/packages/shared/src/components/fields/Dropdown.tsx b/packages/shared/src/components/fields/Dropdown.tsx index 564abe1d44..cc58f69cd4 100644 --- a/packages/shared/src/components/fields/Dropdown.tsx +++ b/packages/shared/src/components/fields/Dropdown.tsx @@ -1,7 +1,5 @@ +import type { CSSProperties, ReactElement, ReactNode } from 'react'; import React, { - CSSProperties, - ReactElement, - ReactNode, useEffect, useId, useLayoutEffect, @@ -9,21 +7,17 @@ import React, { useState, } from 'react'; import classNames from 'classnames'; -import { - Item, - Menu, - TriggerEvent, - useContextMenu, -} from '@dailydotdev/react-contexify'; +import type { TriggerEvent } from '@dailydotdev/react-contexify'; +import { Item, Menu, useContextMenu } from '@dailydotdev/react-contexify'; import { ArrowIcon, VIcon } from '../icons'; import styles from './Dropdown.module.css'; import { usePrevious, useViewSize, ViewSize } from '../../hooks'; import { ListDrawer } from '../drawers/ListDrawer'; -import { SelectParams } from '../drawers/common'; +import type { SelectParams } from '../drawers/common'; import { RootPortal } from '../tooltips/Portal'; -import { DrawerProps } from '../drawers'; +import type { DrawerProps } from '../drawers'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; -import { IconProps } from '../Icon'; +import type { IconProps } from '../Icon'; export interface DropdownClassName { container?: string; diff --git a/packages/shared/src/components/fields/FilterCheckbox.tsx b/packages/shared/src/components/fields/FilterCheckbox.tsx index 858d55313c..e541adef2a 100644 --- a/packages/shared/src/components/fields/FilterCheckbox.tsx +++ b/packages/shared/src/components/fields/FilterCheckbox.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Checkbox, CheckboxProps } from './Checkbox'; +import type { CheckboxProps } from './Checkbox'; +import { Checkbox } from './Checkbox'; interface FilterCheckboxProps extends CheckboxProps { description?: string; diff --git a/packages/shared/src/components/fields/HourDropdown.tsx b/packages/shared/src/components/fields/HourDropdown.tsx index 466e8e78cf..0bc58de621 100644 --- a/packages/shared/src/components/fields/HourDropdown.tsx +++ b/packages/shared/src/components/fields/HourDropdown.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { Dropdown, DropdownClassName } from './Dropdown'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { DropdownClassName } from './Dropdown'; +import { Dropdown } from './Dropdown'; export const Hours = [ { value: 0, label: '00:00' }, diff --git a/packages/shared/src/components/fields/ImageInput.tsx b/packages/shared/src/components/fields/ImageInput.tsx index 85138909b4..eefbee4701 100644 --- a/packages/shared/src/components/fields/ImageInput.tsx +++ b/packages/shared/src/components/fields/ImageInput.tsx @@ -1,12 +1,6 @@ import classNames from 'classnames'; -import React, { - ChangeEvent, - DragEvent, - ReactElement, - ReactNode, - useRef, - useState, -} from 'react'; +import type { ChangeEvent, DragEvent, ReactElement, ReactNode } from 'react'; +import React, { useRef, useState } from 'react'; import { blobToBase64 } from '../../lib/blob'; import { fallbackImages } from '../../lib/config'; import { EditIcon } from '../icons'; diff --git a/packages/shared/src/components/fields/MarkdownInput/CommentMarkdownInput.tsx b/packages/shared/src/components/fields/MarkdownInput/CommentMarkdownInput.tsx index 1ef7dc6f52..98cc26693a 100644 --- a/packages/shared/src/components/fields/MarkdownInput/CommentMarkdownInput.tsx +++ b/packages/shared/src/components/fields/MarkdownInput/CommentMarkdownInput.tsx @@ -1,19 +1,18 @@ -import React, { +import type { CSSProperties, FormEventHandler, FormHTMLAttributes, MutableRefObject, ReactElement, - forwardRef, - useEffect, - useRef, } from 'react'; +import React, { forwardRef, useEffect, useRef } from 'react'; import classNames from 'classnames'; import { defaultMarkdownCommands } from '../../../hooks/input'; -import MarkdownInput, { MarkdownRef } from './index'; -import { Comment } from '../../../graphql/comments'; +import type { MarkdownRef } from './index'; +import MarkdownInput from './index'; +import type { Comment } from '../../../graphql/comments'; import { formToJson } from '../../../lib/form'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { useWriteCommentContext } from '../../../contexts/WriteCommentContext'; export interface CommentClassName { diff --git a/packages/shared/src/components/fields/MarkdownInput/MarkdownUploadLabel.tsx b/packages/shared/src/components/fields/MarkdownInput/MarkdownUploadLabel.tsx index 8411be6837..293a2037af 100644 --- a/packages/shared/src/components/fields/MarkdownInput/MarkdownUploadLabel.tsx +++ b/packages/shared/src/components/fields/MarkdownInput/MarkdownUploadLabel.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; interface MarkdownInputFooterProps { uploadingCount: number; diff --git a/packages/shared/src/components/fields/MarkdownInput/SavingLabel.tsx b/packages/shared/src/components/fields/MarkdownInput/SavingLabel.tsx index f1e3d9c3a0..d13d4ac3b0 100644 --- a/packages/shared/src/components/fields/MarkdownInput/SavingLabel.tsx +++ b/packages/shared/src/components/fields/MarkdownInput/SavingLabel.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Loader } from '../../Loader'; import { VIcon } from '../../icons'; diff --git a/packages/shared/src/components/fields/MarkdownInput/index.tsx b/packages/shared/src/components/fields/MarkdownInput/index.tsx index 2da6b58901..c5a3eac19f 100644 --- a/packages/shared/src/components/fields/MarkdownInput/index.tsx +++ b/packages/shared/src/components/fields/MarkdownInput/index.tsx @@ -1,11 +1,13 @@ -import React, { +import type { ChangeEventHandler, - forwardRef, MouseEventHandler, MutableRefObject, ReactElement, ReactNode, TextareaHTMLAttributes, +} from 'react'; +import React, { + forwardRef, useEffect, useImperativeHandle, useRef, @@ -20,11 +22,11 @@ import { ButtonVariant, } from '../../buttons/Button'; import { RecommendedMentionTooltip } from '../../tooltips/RecommendedMentionTooltip'; -import { +import type { UseMarkdownInput, - useMarkdownInput, UseMarkdownInputProps, } from '../../../hooks/input'; +import { useMarkdownInput } from '../../../hooks/input'; import { ACCEPTED_TYPES } from '../ImageInput'; import { MarkdownUploadLabel } from './MarkdownUploadLabel'; import { markdownGuide } from '../../../lib/constants'; diff --git a/packages/shared/src/components/fields/MarkdownPreview.tsx b/packages/shared/src/components/fields/MarkdownPreview.tsx index 9b2e0e3749..bbacf0f285 100644 --- a/packages/shared/src/components/fields/MarkdownPreview.tsx +++ b/packages/shared/src/components/fields/MarkdownPreview.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useQuery } from '@tanstack/react-query'; import { useRequestProtocol } from '../../hooks/useRequestProtocol'; import { PREVIEW_COMMENT_MUTATION } from '../../graphql/comments'; diff --git a/packages/shared/src/components/fields/PasswordField.spec.tsx b/packages/shared/src/components/fields/PasswordField.spec.tsx index 4035be99b0..2c183da408 100644 --- a/packages/shared/src/components/fields/PasswordField.spec.tsx +++ b/packages/shared/src/components/fields/PasswordField.spec.tsx @@ -1,13 +1,8 @@ import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { PasswordField } from './PasswordField'; -import { TextFieldProps } from './TextField'; +import type { TextFieldProps } from './TextField'; const renderComponent = (props: Partial = {}): RenderResult => { const defaultProps: TextFieldProps = { diff --git a/packages/shared/src/components/fields/PasswordField.tsx b/packages/shared/src/components/fields/PasswordField.tsx index f9f464a068..3a6911c8f1 100644 --- a/packages/shared/src/components/fields/PasswordField.tsx +++ b/packages/shared/src/components/fields/PasswordField.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { passwordStrength } from 'check-password-strength'; -import { TextField, TextFieldProps } from './TextField'; +import type { TextFieldProps } from './TextField'; +import { TextField } from './TextField'; import { EyeIcon, EyeCancelIcon, LockIcon } from '../icons'; import { IconSize } from '../Icon'; diff --git a/packages/shared/src/components/fields/ProgressBar.tsx b/packages/shared/src/components/fields/ProgressBar.tsx index e45200d5b3..bd2dd5cafc 100644 --- a/packages/shared/src/components/fields/ProgressBar.tsx +++ b/packages/shared/src/components/fields/ProgressBar.tsx @@ -1,4 +1,5 @@ -import React, { MeterHTMLAttributes, ReactElement } from 'react'; +import type { MeterHTMLAttributes, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import ConditionalWrapper from '../ConditionalWrapper'; diff --git a/packages/shared/src/components/fields/Radio.tsx b/packages/shared/src/components/fields/Radio.tsx index 9e614e142b..b8c738a575 100644 --- a/packages/shared/src/components/fields/Radio.tsx +++ b/packages/shared/src/components/fields/Radio.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { RadioItem, RadioItemProps } from './RadioItem'; -import { TooltipPosition } from '../tooltips/BaseTooltipContainer'; +import type { RadioItemProps } from './RadioItem'; +import { RadioItem } from './RadioItem'; +import type { TooltipPosition } from '../tooltips/BaseTooltipContainer'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; export interface ClassName { diff --git a/packages/shared/src/components/fields/RadioItem.tsx b/packages/shared/src/components/fields/RadioItem.tsx index cae8570f9b..19a93bfe7a 100644 --- a/packages/shared/src/components/fields/RadioItem.tsx +++ b/packages/shared/src/components/fields/RadioItem.tsx @@ -1,4 +1,5 @@ -import React, { InputHTMLAttributes, ReactElement, ReactNode } from 'react'; +import type { InputHTMLAttributes, ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import styles from './RadioItem.module.css'; import ConditionalWrapper from '../ConditionalWrapper'; diff --git a/packages/shared/src/components/fields/SearchField.spec.tsx b/packages/shared/src/components/fields/SearchField.spec.tsx index 29e9246460..080e78a972 100644 --- a/packages/shared/src/components/fields/SearchField.spec.tsx +++ b/packages/shared/src/components/fields/SearchField.spec.tsx @@ -1,12 +1,8 @@ import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; -import { SearchField, SearchFieldProps } from './SearchField'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; +import type { SearchFieldProps } from './SearchField'; +import { SearchField } from './SearchField'; const renderComponent = ( props: Partial = {}, diff --git a/packages/shared/src/components/fields/SearchField.tsx b/packages/shared/src/components/fields/SearchField.tsx index ccd5eada46..947d88eb14 100644 --- a/packages/shared/src/components/fields/SearchField.tsx +++ b/packages/shared/src/components/fields/SearchField.tsx @@ -1,22 +1,18 @@ -import React, { +import type { ForwardedRef, - forwardRef, InputHTMLAttributes, MouseEvent, ReactElement, } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; import { useInputField } from '../../hooks/useInputField'; import { BaseField, FieldInput } from './common'; import { SearchIcon, MiniCloseIcon as CloseIcon, ArrowIcon } from '../icons'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from '../buttons/Button'; +import type { ButtonProps } from '../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { getFieldFontColor } from './BaseFieldContainer'; -import { IconProps } from '../Icon'; +import type { IconProps } from '../Icon'; export interface SearchFieldProps extends Pick< diff --git a/packages/shared/src/components/fields/Switch.tsx b/packages/shared/src/components/fields/Switch.tsx index c25c807eda..8b69023848 100644 --- a/packages/shared/src/components/fields/Switch.tsx +++ b/packages/shared/src/components/fields/Switch.tsx @@ -1,9 +1,10 @@ -import React, { +import type { InputHTMLAttributes, MutableRefObject, ReactElement, ReactNode, } from 'react'; +import React from 'react'; import classNames from 'classnames'; import styles from './Switch.module.css'; diff --git a/packages/shared/src/components/fields/TextField.spec.tsx b/packages/shared/src/components/fields/TextField.spec.tsx index cb65d0f8c7..1cdc5cee8b 100644 --- a/packages/shared/src/components/fields/TextField.spec.tsx +++ b/packages/shared/src/components/fields/TextField.spec.tsx @@ -1,13 +1,9 @@ import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { TextField, TextFieldProps } from './TextField'; +import type { TextFieldProps } from './TextField'; +import { TextField } from './TextField'; const renderComponent = (props: Partial = {}): RenderResult => { const defaultProps: TextFieldProps = { diff --git a/packages/shared/src/components/fields/TextField.tsx b/packages/shared/src/components/fields/TextField.tsx index 368963c15c..f8707ca25f 100644 --- a/packages/shared/src/components/fields/TextField.tsx +++ b/packages/shared/src/components/fields/TextField.tsx @@ -1,22 +1,21 @@ -import React, { - forwardRef, +import type { MutableRefObject, ReactElement, ReactNode, SyntheticEvent, - useId, } from 'react'; +import React, { forwardRef, useId } from 'react'; import classNames from 'classnames'; import { FieldInput } from './common'; import styles from './TextField.module.css'; -import { IconProps } from '../Icon'; +import type { IconProps } from '../Icon'; +import type { BaseFieldProps } from './BaseFieldContainer'; import BaseFieldContainer, { - BaseFieldProps, getFieldFontColor, getFieldLabelColor, getFieldPlaceholder, } from './BaseFieldContainer'; -import { ButtonProps } from '../buttons/Button'; +import type { ButtonProps } from '../buttons/Button'; import useInputFieldFunctions from '../../hooks/useInputFieldFunctions'; export interface TextFieldProps extends BaseFieldProps { diff --git a/packages/shared/src/components/fields/Textarea.tsx b/packages/shared/src/components/fields/Textarea.tsx index df3b983897..7c3fcc9ecc 100644 --- a/packages/shared/src/components/fields/Textarea.tsx +++ b/packages/shared/src/components/fields/Textarea.tsx @@ -1,10 +1,10 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import styles from './TextField.module.css'; import useInputFieldFunctions from '../../hooks/useInputFieldFunctions'; +import type { BaseFieldProps, FieldClassName } from './BaseFieldContainer'; import BaseFieldContainer, { - BaseFieldProps, - FieldClassName, getFieldFontColor, getFieldPlaceholder, InnerLabel, diff --git a/packages/shared/src/components/fields/common.tsx b/packages/shared/src/components/fields/common.tsx index 5ee1914ebd..455efbf933 100644 --- a/packages/shared/src/components/fields/common.tsx +++ b/packages/shared/src/components/fields/common.tsx @@ -1,5 +1,5 @@ -import { InputHTMLAttributes, TextareaHTMLAttributes } from 'react'; -import { InputFieldFunctionsProps } from '../../hooks/useInputFieldFunctions'; +import type { InputHTMLAttributes, TextareaHTMLAttributes } from 'react'; +import type { InputFieldFunctionsProps } from '../../hooks/useInputFieldFunctions'; import classed from '../../lib/classed'; import styles from './fields.module.css'; diff --git a/packages/shared/src/components/fields/form/FormWrapper.tsx b/packages/shared/src/components/fields/form/FormWrapper.tsx index d66d751894..fe42ecaaf4 100644 --- a/packages/shared/src/components/fields/form/FormWrapper.tsx +++ b/packages/shared/src/components/fields/form/FormWrapper.tsx @@ -1,6 +1,8 @@ -import React, { MutableRefObject, ReactElement, ReactNode } from 'react'; +import type { MutableRefObject, ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Button, ButtonProps, ButtonVariant } from '../../buttons/Button'; +import type { ButtonProps } from '../../buttons/Button'; +import { Button, ButtonVariant } from '../../buttons/Button'; import { PageHeader, PageHeaderTitle } from '../../layout/common'; interface Copy { diff --git a/packages/shared/src/components/filters/AdvancedSettings.spec.tsx b/packages/shared/src/components/filters/AdvancedSettings.spec.tsx index 4d11858016..19f980527e 100644 --- a/packages/shared/src/components/filters/AdvancedSettings.spec.tsx +++ b/packages/shared/src/components/filters/AdvancedSettings.spec.tsx @@ -1,35 +1,28 @@ import nock from 'nock'; import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import defaultUser from '../../../__tests__/fixture/loggedUser'; import AuthContext from '../../contexts/AuthContext'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '../../../__tests__/helpers/graphql'; -import { LoggedUser } from '../../lib/user'; -import { +import type { MockedGraphQLResponse } from '../../../__tests__/helpers/graphql'; +import { mockGraphQL } from '../../../__tests__/helpers/graphql'; +import type { LoggedUser } from '../../lib/user'; +import type { AdvancedSettings, - AdvancedSettingsGroup, AllTagCategoriesData, - FEED_SETTINGS_QUERY, FeedSettings, +} from '../../graphql/feedSettings'; +import { + AdvancedSettingsGroup, + FEED_SETTINGS_QUERY, UPDATE_ADVANCED_SETTINGS_FILTERS_MUTATION, } from '../../graphql/feedSettings'; import AdvancedSettingsPage from './AdvancedSettings'; import { getFeedSettingsQueryKey } from '../../hooks/useFeedSettings'; import { waitForNock } from '../../../__tests__/helpers/utilities'; -import AlertContext, { - ALERT_DEFAULTS, - AlertContextData, -} from '../../contexts/AlertContext'; +import type { AlertContextData } from '../../contexts/AlertContext'; +import AlertContext, { ALERT_DEFAULTS } from '../../contexts/AlertContext'; const showLogin = jest.fn(); let loggedUser: LoggedUser; diff --git a/packages/shared/src/components/filters/AdvancedSettings.tsx b/packages/shared/src/components/filters/AdvancedSettings.tsx index 0e40488a9c..a0571cd99a 100644 --- a/packages/shared/src/components/filters/AdvancedSettings.tsx +++ b/packages/shared/src/components/filters/AdvancedSettings.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import useFeedSettings from '../../hooks/useFeedSettings'; import { FilterSwitch } from './FilterSwitch'; import { useAdvancedSettings } from '../../hooks/feed'; diff --git a/packages/shared/src/components/filters/BlockedFilter.spec.tsx b/packages/shared/src/components/filters/BlockedFilter.spec.tsx index 04ddf0cb45..12b61a9c7e 100644 --- a/packages/shared/src/components/filters/BlockedFilter.spec.tsx +++ b/packages/shared/src/components/filters/BlockedFilter.spec.tsx @@ -1,19 +1,18 @@ import nock from 'nock'; import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import defaultUser from '../../../__tests__/fixture/loggedUser'; import AuthContext from '../../contexts/AuthContext'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '../../../__tests__/helpers/graphql'; -import { LoggedUser } from '../../lib/user'; -import { - FEED_SETTINGS_QUERY, +import type { MockedGraphQLResponse } from '../../../__tests__/helpers/graphql'; +import { mockGraphQL } from '../../../__tests__/helpers/graphql'; +import type { LoggedUser } from '../../lib/user'; +import type { FeedSettings, AllTagCategoriesData, } from '../../graphql/feedSettings'; +import { FEED_SETTINGS_QUERY } from '../../graphql/feedSettings'; import BlockedFilter from './BlockedFilter'; const showLogin = jest.fn(); diff --git a/packages/shared/src/components/filters/BlockedFilter.tsx b/packages/shared/src/components/filters/BlockedFilter.tsx index f24ac4e041..d3be3964f4 100644 --- a/packages/shared/src/components/filters/BlockedFilter.tsx +++ b/packages/shared/src/components/filters/BlockedFilter.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import dynamic from 'next/dynamic'; -import { FilterMenuProps } from './common'; +import type { FilterMenuProps } from './common'; import SourceItemList from './SourceItemList'; import TagItemList from './TagItemList'; import useFeedSettings from '../../hooks/useFeedSettings'; diff --git a/packages/shared/src/components/filters/BlockedWords.tsx b/packages/shared/src/components/filters/BlockedWords.tsx index 0de40aaebe..b8da56a4c7 100644 --- a/packages/shared/src/components/filters/BlockedWords.tsx +++ b/packages/shared/src/components/filters/BlockedWords.tsx @@ -1,10 +1,5 @@ -import React, { - KeyboardEvent, - ReactElement, - useCallback, - useContext, - useState, -} from 'react'; +import type { KeyboardEvent, ReactElement } from 'react'; +import React, { useCallback, useContext, useState } from 'react'; import { useQueryClient } from '@tanstack/react-query'; import { Typography, diff --git a/packages/shared/src/components/filters/CategoryButton.tsx b/packages/shared/src/components/filters/CategoryButton.tsx index 31c81aa66d..eae4507428 100644 --- a/packages/shared/src/components/filters/CategoryButton.tsx +++ b/packages/shared/src/components/filters/CategoryButton.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; -import { TagCategory } from '../../graphql/feedSettings'; -import { TagActionArguments } from '../../hooks/useTagAndSource'; +import type { TagCategory } from '../../graphql/feedSettings'; +import type { TagActionArguments } from '../../hooks/useTagAndSource'; const ClearCategoryButton = ({ matches, diff --git a/packages/shared/src/components/filters/ContentTypesFilter.tsx b/packages/shared/src/components/filters/ContentTypesFilter.tsx index 8b94b9bd24..599448bfe0 100644 --- a/packages/shared/src/components/filters/ContentTypesFilter.tsx +++ b/packages/shared/src/components/filters/ContentTypesFilter.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { useQueryClient } from '@tanstack/react-query'; import { FilterCheckbox } from '../fields/FilterCheckbox'; import { useAdvancedSettings } from '../../hooks/feed'; diff --git a/packages/shared/src/components/filters/FilterSwitch.tsx b/packages/shared/src/components/filters/FilterSwitch.tsx index 49b3a3bed1..4880e0aba8 100644 --- a/packages/shared/src/components/filters/FilterSwitch.tsx +++ b/packages/shared/src/components/filters/FilterSwitch.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement, ReactNode } from 'react'; -import { Switch, SwitchProps } from '../fields/Switch'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; +import type { SwitchProps } from '../fields/Switch'; +import { Switch } from '../fields/Switch'; interface FilterSwitchProps extends SwitchProps { label: ReactNode; diff --git a/packages/shared/src/components/filters/FollowingFilter.tsx b/packages/shared/src/components/filters/FollowingFilter.tsx index a29c125346..978d02fcce 100644 --- a/packages/shared/src/components/filters/FollowingFilter.tsx +++ b/packages/shared/src/components/filters/FollowingFilter.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import Link from 'next/link'; import { useAuthContext } from '../../contexts/AuthContext'; import UserList from '../profile/UserList'; diff --git a/packages/shared/src/components/filters/MyFeedHeading.tsx b/packages/shared/src/components/filters/MyFeedHeading.tsx index 8e5515d6b8..78d5a21be4 100644 --- a/packages/shared/src/components/filters/MyFeedHeading.tsx +++ b/packages/shared/src/components/filters/MyFeedHeading.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { FilterIcon, PlusIcon } from '../icons'; import { Button, diff --git a/packages/shared/src/components/filters/SourceItemList.tsx b/packages/shared/src/components/filters/SourceItemList.tsx index 6a1aff1796..a6b59f6cb8 100644 --- a/packages/shared/src/components/filters/SourceItemList.tsx +++ b/packages/shared/src/components/filters/SourceItemList.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { FiltersList } from './common'; -import { Source } from '../../graphql/sources'; +import type { Source } from '../../graphql/sources'; import SourceItemRow from './SourceItemRow'; export default function SourceItemList({ diff --git a/packages/shared/src/components/filters/SourceItemRow.tsx b/packages/shared/src/components/filters/SourceItemRow.tsx index 40c7028d4f..f6e4c1f344 100644 --- a/packages/shared/src/components/filters/SourceItemRow.tsx +++ b/packages/shared/src/components/filters/SourceItemRow.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { FilterItem } from './common'; -import { Source } from '../../graphql/sources'; +import type { Source } from '../../graphql/sources'; import { LazyImage } from '../LazyImage'; import { Button, ButtonVariant } from '../buttons/Button'; import { BlockIcon } from '../icons'; diff --git a/packages/shared/src/components/filters/TagButton.tsx b/packages/shared/src/components/filters/TagButton.tsx index 2d413a4442..3901b003f3 100644 --- a/packages/shared/src/components/filters/TagButton.tsx +++ b/packages/shared/src/components/filters/TagButton.tsx @@ -1,15 +1,15 @@ -import React, { HTMLAttributes, ReactElement } from 'react'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { PlusIcon, BlockIcon } from '../icons'; +import type { AllowedTags, ButtonProps } from '../buttons/Button'; import { - AllowedTags, Button, ButtonIconPosition, - ButtonProps, ButtonSize, ButtonVariant, } from '../buttons/Button'; -import { TagActionArguments } from '../../hooks/useTagAndSource'; +import type { TagActionArguments } from '../../hooks/useTagAndSource'; interface GenericTagButtonProps extends Omit, 'color'> { diff --git a/packages/shared/src/components/filters/TagCategoryDropdown.tsx b/packages/shared/src/components/filters/TagCategoryDropdown.tsx index b442ffc1c8..43164ad650 100644 --- a/packages/shared/src/components/filters/TagCategoryDropdown.tsx +++ b/packages/shared/src/components/filters/TagCategoryDropdown.tsx @@ -1,11 +1,12 @@ -import React, { +import type { ClassAttributes, DetailsHTMLAttributes, ForwardRefExoticComponent, ReactElement, } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { TagCategory } from '../../graphql/feedSettings'; +import type { TagCategory } from '../../graphql/feedSettings'; import { ArrowIcon } from '../icons'; import CategoryButton from './CategoryButton'; import TagButton from './TagButton'; @@ -16,8 +17,8 @@ import { BaseTagCategorySummary, TagCategorySummary, } from './common'; -import { TagActionArguments } from '../../hooks/useTagAndSource'; -import { HTMLElementComponent } from '../utilities'; +import type { TagActionArguments } from '../../hooks/useTagAndSource'; +import type { HTMLElementComponent } from '../utilities'; export enum TagCategoryLayout { Default = 'default', diff --git a/packages/shared/src/components/filters/TagItemList.tsx b/packages/shared/src/components/filters/TagItemList.tsx index 340e699381..1311973e92 100644 --- a/packages/shared/src/components/filters/TagItemList.tsx +++ b/packages/shared/src/components/filters/TagItemList.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; -import { Tag } from '../../graphql/feedSettings'; -import { TagActionArguments } from '../../hooks/useTagAndSource'; -import { HTMLElementComponent } from '../utilities'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Tag } from '../../graphql/feedSettings'; +import type { TagActionArguments } from '../../hooks/useTagAndSource'; +import type { HTMLElementComponent } from '../utilities'; import { FiltersList, FiltersGrid } from './common'; import { TagCategoryLayout } from './TagCategoryDropdown'; import TagItemRow from './TagItemRow'; diff --git a/packages/shared/src/components/filters/TagItemRow.tsx b/packages/shared/src/components/filters/TagItemRow.tsx index 3e56972f0e..7a609f77a2 100644 --- a/packages/shared/src/components/filters/TagItemRow.tsx +++ b/packages/shared/src/components/filters/TagItemRow.tsx @@ -1,8 +1,9 @@ -import React, { HTMLAttributes, ReactElement } from 'react'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React from 'react'; import { FilterItem } from './common'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import TagButton from './TagButton'; -import { TagActionArguments } from '../../hooks/useTagAndSource'; +import type { TagActionArguments } from '../../hooks/useTagAndSource'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; type TagItemRowProps = { diff --git a/packages/shared/src/components/filters/TagOptionsMenu.tsx b/packages/shared/src/components/filters/TagOptionsMenu.tsx index 4db8060779..893055755d 100644 --- a/packages/shared/src/components/filters/TagOptionsMenu.tsx +++ b/packages/shared/src/components/filters/TagOptionsMenu.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import dynamic from 'next/dynamic'; -import { Tag } from '../../graphql/feedSettings'; +import type { Tag } from '../../graphql/feedSettings'; import { getTagPageLink } from '../../lib/links'; -import { MenuItemProps } from '../fields/ContextMenu'; +import type { MenuItemProps } from '../fields/ContextMenu'; import useContextMenu from '../../hooks/useContextMenu'; import { ContextMenu as ContextMenuIds } from '../../hooks/constants'; diff --git a/packages/shared/src/components/filters/TagsFilter.spec.tsx b/packages/shared/src/components/filters/TagsFilter.spec.tsx index a7eda254ec..01966ee142 100644 --- a/packages/shared/src/components/filters/TagsFilter.spec.tsx +++ b/packages/shared/src/components/filters/TagsFilter.spec.tsx @@ -1,8 +1,8 @@ import nock from 'nock'; import React from 'react'; +import type { RenderResult } from '@testing-library/react'; import { render, - RenderResult, waitFor, findAllByRole, screen, @@ -11,22 +11,23 @@ import { import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import defaultUser from '../../../__tests__/fixture/loggedUser'; import AuthContext from '../../contexts/AuthContext'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '../../../__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '../../../__tests__/helpers/graphql'; +import { mockGraphQL } from '../../../__tests__/helpers/graphql'; import TagsFilter from './TagsFilter'; +import type { + AllTagCategoriesData, + FeedSettings, + TagCategory, +} from '../../graphql/feedSettings'; import { ADD_FILTERS_TO_FEED_MUTATION, - AllTagCategoriesData, FEED_SETTINGS_QUERY, - FeedSettings, REMOVE_FILTERS_FROM_FEED_MUTATION, - TagCategory, } from '../../graphql/feedSettings'; import { getFeedSettingsQueryKey } from '../../hooks/useFeedSettings'; import { AlertContextProvider } from '../../contexts/AlertContext'; -import { Alerts, UPDATE_ALERTS } from '../../graphql/alerts'; +import type { Alerts } from '../../graphql/alerts'; +import { UPDATE_ALERTS } from '../../graphql/alerts'; const showLogin = jest.fn(); const updateAlerts = jest.fn(); diff --git a/packages/shared/src/components/filters/TagsFilter.tsx b/packages/shared/src/components/filters/TagsFilter.tsx index 7413aefb33..c6347c2031 100644 --- a/packages/shared/src/components/filters/TagsFilter.tsx +++ b/packages/shared/src/components/filters/TagsFilter.tsx @@ -1,10 +1,5 @@ -import React, { - ReactElement, - useContext, - useMemo, - useRef, - useState, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo, useRef, useState } from 'react'; import classNames from 'classnames'; import { SearchField } from '../fields/SearchField'; import TagCategoryDropdown, { TagCategoryLayout } from './TagCategoryDropdown'; @@ -12,14 +7,13 @@ import useFeedSettings from '../../hooks/useFeedSettings'; import TagItemList from './TagItemList'; import TagOptionsMenu from './TagOptionsMenu'; import useTagContext from '../../hooks/useTagContext'; -import useTagAndSource, { - TagActionArguments, -} from '../../hooks/useTagAndSource'; -import { FilterMenuProps } from './common'; +import type { TagActionArguments } from '../../hooks/useTagAndSource'; +import useTagAndSource from '../../hooks/useTagAndSource'; +import type { FilterMenuProps } from './common'; import { MenuIcon } from '../icons'; import AuthContext from '../../contexts/AuthContext'; import classed from '../../lib/classed'; -import { HTMLElementComponent } from '../utilities'; +import type { HTMLElementComponent } from '../utilities'; import { Origin } from '../../lib/log'; import useDebounceFn from '../../hooks/useDebounceFn'; import { useTagSearch } from '../../hooks'; diff --git a/packages/shared/src/components/filters/Test.tsx b/packages/shared/src/components/filters/Test.tsx index 29d0459f73..7cb6400167 100644 --- a/packages/shared/src/components/filters/Test.tsx +++ b/packages/shared/src/components/filters/Test.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; export default function Test(): ReactElement { return
Testing inside sidebar component
; diff --git a/packages/shared/src/components/filters/UnblockCopy.tsx b/packages/shared/src/components/filters/UnblockCopy.tsx index 7b77459d39..ff5e9f7466 100644 --- a/packages/shared/src/components/filters/UnblockCopy.tsx +++ b/packages/shared/src/components/filters/UnblockCopy.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { Tag } from '../../graphql/feedSettings'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Tag } from '../../graphql/feedSettings'; export type CopyProps = { name: string | Tag; diff --git a/packages/shared/src/components/filters/common.tsx b/packages/shared/src/components/filters/common.tsx index f4d4ed0f0b..32fcc8bf48 100644 --- a/packages/shared/src/components/filters/common.tsx +++ b/packages/shared/src/components/filters/common.tsx @@ -1,5 +1,5 @@ -import { ReactNode } from 'react'; -import { Source } from '../../graphql/sources'; +import type { ReactNode } from 'react'; +import type { Source } from '../../graphql/sources'; import classed from '../../lib/classed'; export type BooleanPromise = Promise<{ successful: boolean }>; diff --git a/packages/shared/src/components/filters/helpers.ts b/packages/shared/src/components/filters/helpers.ts index d82ed1d35b..df7d0162c2 100644 --- a/packages/shared/src/components/filters/helpers.ts +++ b/packages/shared/src/components/filters/helpers.ts @@ -1,7 +1,5 @@ -import { - AdvancedSettings, - AdvancedSettingsGroup, -} from '../../graphql/feedSettings'; +import type { AdvancedSettings } from '../../graphql/feedSettings'; +import { AdvancedSettingsGroup } from '../../graphql/feedSettings'; export enum FilterMenuTitle { MyFeed = 'My feed', diff --git a/packages/shared/src/components/footer/FooterLinks.tsx b/packages/shared/src/components/footer/FooterLinks.tsx index 8993a1b9ab..088ff2301a 100644 --- a/packages/shared/src/components/footer/FooterLinks.tsx +++ b/packages/shared/src/components/footer/FooterLinks.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { contentGuidelines, webappUrl } from '../../lib/constants'; import { anchorDefaultRel } from '../../lib/strings'; diff --git a/packages/shared/src/components/header/BreadCrumbs.tsx b/packages/shared/src/components/header/BreadCrumbs.tsx index 0e433abee9..9a563ca218 100644 --- a/packages/shared/src/components/header/BreadCrumbs.tsx +++ b/packages/shared/src/components/header/BreadCrumbs.tsx @@ -1,8 +1,9 @@ -import React, { PropsWithChildren, ReactElement } from 'react'; +import type { PropsWithChildren, ReactElement } from 'react'; +import React from 'react'; import classed from '../../lib/classed'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { HomeIcon } from '../icons'; -import { WithClassNameProps } from '../utilities'; +import type { WithClassNameProps } from '../utilities'; const BreadCrumbsWrapper = classed( 'nav', diff --git a/packages/shared/src/components/header/FeedExploreDropdown.tsx b/packages/shared/src/components/header/FeedExploreDropdown.tsx index bef1b7bba6..2fe48bf41f 100644 --- a/packages/shared/src/components/header/FeedExploreDropdown.tsx +++ b/packages/shared/src/components/header/FeedExploreDropdown.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; import { useRouter } from 'next/router'; import { Dropdown } from '../fields/Dropdown'; import { ExploreTabs, tabToUrl, urlToTab } from './FeedExploreHeader'; diff --git a/packages/shared/src/components/header/FeedExploreHeader.tsx b/packages/shared/src/components/header/FeedExploreHeader.tsx index a44bfe3420..bc86391739 100644 --- a/packages/shared/src/components/header/FeedExploreHeader.tsx +++ b/packages/shared/src/components/header/FeedExploreHeader.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import classNames from 'classnames'; import { BreadCrumbs } from './BreadCrumbs'; diff --git a/packages/shared/src/components/header/MobileExploreHeader.tsx b/packages/shared/src/components/header/MobileExploreHeader.tsx index dad290f749..cd27bcadc2 100644 --- a/packages/shared/src/components/header/MobileExploreHeader.tsx +++ b/packages/shared/src/components/header/MobileExploreHeader.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { OtherFeedPage } from '../../lib/query'; import { QueryStateKeys, useQueryState } from '../../hooks/utils/useQueryState'; import { Dropdown } from '../fields/Dropdown'; diff --git a/packages/shared/src/components/history/ReadingHistory.spec.tsx b/packages/shared/src/components/history/ReadingHistory.spec.tsx index 088590fce1..f9115f52f3 100644 --- a/packages/shared/src/components/history/ReadingHistory.spec.tsx +++ b/packages/shared/src/components/history/ReadingHistory.spec.tsx @@ -1,16 +1,14 @@ import React from 'react'; import { subDays } from 'date-fns'; -import { - fireEvent, - render, - RenderResult, - screen, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen } from '@testing-library/react'; import nock from 'nock'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import PostItemCard, { PostItemCardProps } from '../post/PostItemCard'; -import ReadHistoryList, { ReadHistoryListProps } from './ReadingHistoryList'; -import { ReadHistoryInfiniteData } from '../../hooks/useInfiniteReadingHistory'; +import type { PostItemCardProps } from '../post/PostItemCard'; +import PostItemCard from '../post/PostItemCard'; +import type { ReadHistoryListProps } from './ReadingHistoryList'; +import ReadHistoryList from './ReadingHistoryList'; +import type { ReadHistoryInfiniteData } from '../../hooks/useInfiniteReadingHistory'; import AuthContext from '../../contexts/AuthContext'; import user from '../../../__tests__/fixture/loggedUser'; import { getLabel } from '../../lib/dateFormat.spec'; diff --git a/packages/shared/src/components/history/ReadingHistoryEmptyScreen.tsx b/packages/shared/src/components/history/ReadingHistoryEmptyScreen.tsx index ef9d2a7fa9..37817911c4 100644 --- a/packages/shared/src/components/history/ReadingHistoryEmptyScreen.tsx +++ b/packages/shared/src/components/history/ReadingHistoryEmptyScreen.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import Link from '../utilities/Link'; import { EmptyScreenButton, diff --git a/packages/shared/src/components/history/ReadingHistoryList.tsx b/packages/shared/src/components/history/ReadingHistoryList.tsx index 970b5eb663..fc9c42a5db 100644 --- a/packages/shared/src/components/history/ReadingHistoryList.tsx +++ b/packages/shared/src/components/history/ReadingHistoryList.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement, useCallback } from 'react'; -import { HideReadHistory } from '../../hooks/useReadingHistory'; +import type { ReactElement } from 'react'; +import React, { useCallback } from 'react'; +import type { HideReadHistory } from '../../hooks/useReadingHistory'; import { isDateOnlyEqual, TimeFormatType } from '../../lib/dateFormat'; import PostItemCard from '../post/PostItemCard'; import { InfiniteScrollScreenOffset } from '../../hooks/feed/useFeedInfiniteScroll'; @@ -8,7 +9,7 @@ import useReadingHistoryContextMenu from '../../hooks/useReadingHistoryContextMe import { useSharePost } from '../../hooks/useSharePost'; import { Origin } from '../../lib/log'; import { DateFormat } from '../utilities'; -import { ReadHistoryInfiniteData } from '../../hooks/useInfiniteReadingHistory'; +import type { ReadHistoryInfiniteData } from '../../hooks/useInfiniteReadingHistory'; export interface ReadHistoryListProps { data: ReadHistoryInfiniteData; diff --git a/packages/shared/src/components/history/ReadingHistoryPlaceholder.tsx b/packages/shared/src/components/history/ReadingHistoryPlaceholder.tsx index 9b9d4755ad..3b6a5cacce 100644 --- a/packages/shared/src/components/history/ReadingHistoryPlaceholder.tsx +++ b/packages/shared/src/components/history/ReadingHistoryPlaceholder.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ElementPlaceholder } from '../ElementPlaceholder'; import classed from '../../lib/classed'; diff --git a/packages/shared/src/components/icons/AddUser/index.tsx b/packages/shared/src/components/icons/AddUser/index.tsx index ac8339eb33..f48a40ebe9 100644 --- a/packages/shared/src/components/icons/AddUser/index.tsx +++ b/packages/shared/src/components/icons/AddUser/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import FilledIcon from './filled.svg'; import OutlinedIcon from './outlined.svg'; diff --git a/packages/shared/src/components/icons/Ai/index.tsx b/packages/shared/src/components/icons/Ai/index.tsx index aa228b26af..b2e7bcf8ee 100644 --- a/packages/shared/src/components/icons/Ai/index.tsx +++ b/packages/shared/src/components/icons/Ai/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Alert/index.tsx b/packages/shared/src/components/icons/Alert/index.tsx index d7fdbb4bed..56cad19401 100644 --- a/packages/shared/src/components/icons/Alert/index.tsx +++ b/packages/shared/src/components/icons/Alert/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; export const AlertIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Amazon/index.tsx b/packages/shared/src/components/icons/Amazon/index.tsx index c1f05aef0c..9dcfb6e71d 100644 --- a/packages/shared/src/components/icons/Amazon/index.tsx +++ b/packages/shared/src/components/icons/Amazon/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; export const AmazonIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/App/index.tsx b/packages/shared/src/components/icons/App/index.tsx index 29f8ab8d02..20abc39f81 100644 --- a/packages/shared/src/components/icons/App/index.tsx +++ b/packages/shared/src/components/icons/App/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Apple/index.tsx b/packages/shared/src/components/icons/Apple/index.tsx index 100797a7fc..6c057d810b 100644 --- a/packages/shared/src/components/icons/Apple/index.tsx +++ b/packages/shared/src/components/icons/Apple/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; export const AppleIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Arrow/Long/index.tsx b/packages/shared/src/components/icons/Arrow/Long/index.tsx index d37ad2530b..cc29d79920 100644 --- a/packages/shared/src/components/icons/Arrow/Long/index.tsx +++ b/packages/shared/src/components/icons/Arrow/Long/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import FilledIcon from './filled.svg'; export const LongArrowIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Arrow/Straight/index.tsx b/packages/shared/src/components/icons/Arrow/Straight/index.tsx index aafe0f0707..6aa3e56acb 100644 --- a/packages/shared/src/components/icons/Arrow/Straight/index.tsx +++ b/packages/shared/src/components/icons/Arrow/Straight/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import FilledIcon from './filled.svg'; export const StraightArrowIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Arrow/Triangle/index.tsx b/packages/shared/src/components/icons/Arrow/Triangle/index.tsx index ae218fc975..000baf720e 100644 --- a/packages/shared/src/components/icons/Arrow/Triangle/index.tsx +++ b/packages/shared/src/components/icons/Arrow/Triangle/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Arrow/index.tsx b/packages/shared/src/components/icons/Arrow/index.tsx index 4e45f9c67b..5fe582d43e 100644 --- a/packages/shared/src/components/icons/Arrow/index.tsx +++ b/packages/shared/src/components/icons/Arrow/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/At/index.tsx b/packages/shared/src/components/icons/At/index.tsx index 776b382aa8..80b0dc022b 100644 --- a/packages/shared/src/components/icons/At/index.tsx +++ b/packages/shared/src/components/icons/At/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Bell/Add/index.tsx b/packages/shared/src/components/icons/Bell/Add/index.tsx index 37d8e19fb2..77d885b79d 100644 --- a/packages/shared/src/components/icons/Bell/Add/index.tsx +++ b/packages/shared/src/components/icons/Bell/Add/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Bell/Disabled/index.tsx b/packages/shared/src/components/icons/Bell/Disabled/index.tsx index 847ce67579..f73e57f2e0 100644 --- a/packages/shared/src/components/icons/Bell/Disabled/index.tsx +++ b/packages/shared/src/components/icons/Bell/Disabled/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Bell/Notify/index.tsx b/packages/shared/src/components/icons/Bell/Notify/index.tsx index 11dcfece5b..2882ccb6da 100644 --- a/packages/shared/src/components/icons/Bell/Notify/index.tsx +++ b/packages/shared/src/components/icons/Bell/Notify/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Bell/Subscribed/index.tsx b/packages/shared/src/components/icons/Bell/Subscribed/index.tsx index abd271f5bf..a7561f8d69 100644 --- a/packages/shared/src/components/icons/Bell/Subscribed/index.tsx +++ b/packages/shared/src/components/icons/Bell/Subscribed/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Bell/index.tsx b/packages/shared/src/components/icons/Bell/index.tsx index 9c18a48192..5b26c2e446 100644 --- a/packages/shared/src/components/icons/Bell/index.tsx +++ b/packages/shared/src/components/icons/Bell/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Block/index.tsx b/packages/shared/src/components/icons/Block/index.tsx index e642847aec..812e5f2324 100644 --- a/packages/shared/src/components/icons/Block/index.tsx +++ b/packages/shared/src/components/icons/Block/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Bookmark/Reminder/index.tsx b/packages/shared/src/components/icons/Bookmark/Reminder/index.tsx index f33e4996c4..54c23a7a99 100644 --- a/packages/shared/src/components/icons/Bookmark/Reminder/index.tsx +++ b/packages/shared/src/components/icons/Bookmark/Reminder/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Bookmark/index.tsx b/packages/shared/src/components/icons/Bookmark/index.tsx index 58d8e2b233..fa41e6badd 100644 --- a/packages/shared/src/components/icons/Bookmark/index.tsx +++ b/packages/shared/src/components/icons/Bookmark/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/BringForward/index.tsx b/packages/shared/src/components/icons/BringForward/index.tsx index d065749159..9f830ea161 100644 --- a/packages/shared/src/components/icons/BringForward/index.tsx +++ b/packages/shared/src/components/icons/BringForward/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Browser/Chrome/index.tsx b/packages/shared/src/components/icons/Browser/Chrome/index.tsx index 10bd8a625c..3f3b2d6de9 100644 --- a/packages/shared/src/components/icons/Browser/Chrome/index.tsx +++ b/packages/shared/src/components/icons/Browser/Chrome/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import Chrome from './chrome.svg'; export const ChromeIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Browser/Edge/index.tsx b/packages/shared/src/components/icons/Browser/Edge/index.tsx index 3f1d39cd5e..b03d7afab8 100644 --- a/packages/shared/src/components/icons/Browser/Edge/index.tsx +++ b/packages/shared/src/components/icons/Browser/Edge/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import Edge from './edge.svg'; export const EdgeIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Browsers/index.tsx b/packages/shared/src/components/icons/Browsers/index.tsx index d18d180be2..0fc89705be 100644 --- a/packages/shared/src/components/icons/Browsers/index.tsx +++ b/packages/shared/src/components/icons/Browsers/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import Group from './group.svg'; export const BrowserGroupIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Calendar/index.tsx b/packages/shared/src/components/icons/Calendar/index.tsx index 969b9d18aa..340704e710 100644 --- a/packages/shared/src/components/icons/Calendar/index.tsx +++ b/packages/shared/src/components/icons/Calendar/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Camera/index.tsx b/packages/shared/src/components/icons/Camera/index.tsx index 513468b9df..8bb97b287c 100644 --- a/packages/shared/src/components/icons/Camera/index.tsx +++ b/packages/shared/src/components/icons/Camera/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Card/index.tsx b/packages/shared/src/components/icons/Card/index.tsx index ebfbed1f45..8c46c8b45e 100644 --- a/packages/shared/src/components/icons/Card/index.tsx +++ b/packages/shared/src/components/icons/Card/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/CardLayout/index.tsx b/packages/shared/src/components/icons/CardLayout/index.tsx index da5872aec8..8d47880028 100644 --- a/packages/shared/src/components/icons/CardLayout/index.tsx +++ b/packages/shared/src/components/icons/CardLayout/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import CardsIcon from './cards.svg'; import ListIcon from './list.svg'; diff --git a/packages/shared/src/components/icons/ChecklistA/index.tsx b/packages/shared/src/components/icons/ChecklistA/index.tsx index 7f25cdbce0..d4e078065f 100644 --- a/packages/shared/src/components/icons/ChecklistA/index.tsx +++ b/packages/shared/src/components/icons/ChecklistA/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import FilledIcon from './filled.svg'; import OutlinedIcon from './outlined.svg'; diff --git a/packages/shared/src/components/icons/ChecklistB/index.tsx b/packages/shared/src/components/icons/ChecklistB/index.tsx index 9fcdd338ae..6a724bf474 100644 --- a/packages/shared/src/components/icons/ChecklistB/index.tsx +++ b/packages/shared/src/components/icons/ChecklistB/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import FilledIcon from './filled.svg'; import OutlinedIcon from './outlined.svg'; diff --git a/packages/shared/src/components/icons/Clear/index.tsx b/packages/shared/src/components/icons/Clear/index.tsx index cd5e5a6cff..43215faa0b 100644 --- a/packages/shared/src/components/icons/Clear/index.tsx +++ b/packages/shared/src/components/icons/Clear/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/CodePen/index.tsx b/packages/shared/src/components/icons/CodePen/index.tsx index c8ce48ab84..406dcd4c02 100644 --- a/packages/shared/src/components/icons/CodePen/index.tsx +++ b/packages/shared/src/components/icons/CodePen/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import MonoIcon from './mono.svg'; export const CodePenIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/CommunityPicksIcon/index.tsx b/packages/shared/src/components/icons/CommunityPicksIcon/index.tsx index c3b36cc661..2edd5c3218 100644 --- a/packages/shared/src/components/icons/CommunityPicksIcon/index.tsx +++ b/packages/shared/src/components/icons/CommunityPicksIcon/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import PrimaryIcon from './primary.svg'; export const CommunityPicksIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Cookie/index.tsx b/packages/shared/src/components/icons/Cookie/index.tsx index 590c92ca6f..64178f7b18 100644 --- a/packages/shared/src/components/icons/Cookie/index.tsx +++ b/packages/shared/src/components/icons/Cookie/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Copy/index.tsx b/packages/shared/src/components/icons/Copy/index.tsx index da95978577..398d8ba5ab 100644 --- a/packages/shared/src/components/icons/Copy/index.tsx +++ b/packages/shared/src/components/icons/Copy/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/DailyIcon/index.tsx b/packages/shared/src/components/icons/DailyIcon/index.tsx index fe46f1428e..b7b97bf27d 100644 --- a/packages/shared/src/components/icons/DailyIcon/index.tsx +++ b/packages/shared/src/components/icons/DailyIcon/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import PrimaryIcon from './primary.svg'; import SecondaryIcon from './secondary.svg'; diff --git a/packages/shared/src/components/icons/DefaultSquad/index.tsx b/packages/shared/src/components/icons/DefaultSquad/index.tsx index ecd1813933..290dbca61e 100644 --- a/packages/shared/src/components/icons/DefaultSquad/index.tsx +++ b/packages/shared/src/components/icons/DefaultSquad/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import SquadIcon from './primary.svg'; export const DefaultSquadIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/DevCard/index.tsx b/packages/shared/src/components/icons/DevCard/index.tsx index df64dd484f..f823f9d00d 100644 --- a/packages/shared/src/components/icons/DevCard/index.tsx +++ b/packages/shared/src/components/icons/DevCard/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/DevPlus/index.tsx b/packages/shared/src/components/icons/DevPlus/index.tsx index d239b5f2a3..c8c11c2275 100644 --- a/packages/shared/src/components/icons/DevPlus/index.tsx +++ b/packages/shared/src/components/icons/DevPlus/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/DigitalOcean/index.tsx b/packages/shared/src/components/icons/DigitalOcean/index.tsx index 2e4c7ecf16..6ae50ac906 100644 --- a/packages/shared/src/components/icons/DigitalOcean/index.tsx +++ b/packages/shared/src/components/icons/DigitalOcean/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; export const DigitalOceanIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Discord/index.tsx b/packages/shared/src/components/icons/Discord/index.tsx index 28379c7bda..fbdc171981 100644 --- a/packages/shared/src/components/icons/Discord/index.tsx +++ b/packages/shared/src/components/icons/Discord/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import ColorIcon from './color.svg'; export const DiscordIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Discuss/index.tsx b/packages/shared/src/components/icons/Discuss/index.tsx index 3e8310a0ce..4d68ef70e8 100644 --- a/packages/shared/src/components/icons/Discuss/index.tsx +++ b/packages/shared/src/components/icons/Discuss/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Docs/index.tsx b/packages/shared/src/components/icons/Docs/index.tsx index 075eb09c64..fbe328a9c4 100644 --- a/packages/shared/src/components/icons/Docs/index.tsx +++ b/packages/shared/src/components/icons/Docs/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Download/index.tsx b/packages/shared/src/components/icons/Download/index.tsx index 1376dd6995..77b307db09 100644 --- a/packages/shared/src/components/icons/Download/index.tsx +++ b/packages/shared/src/components/icons/Download/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Downvote/index.tsx b/packages/shared/src/components/icons/Downvote/index.tsx index 4bee7992ff..db01aa3b59 100644 --- a/packages/shared/src/components/icons/Downvote/index.tsx +++ b/packages/shared/src/components/icons/Downvote/index.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { UpvoteIcon } from '../Upvote'; -import { IconProps } from '../../Icon'; +import type { IconProps } from '../../Icon'; export const DownvoteIcon = ({ className, diff --git a/packages/shared/src/components/icons/DrawnArrow/index.tsx b/packages/shared/src/components/icons/DrawnArrow/index.tsx index c24cb297ec..3543649b6e 100644 --- a/packages/shared/src/components/icons/DrawnArrow/index.tsx +++ b/packages/shared/src/components/icons/DrawnArrow/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import Arrow from './arrow.svg'; export const DrawnArrowIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Earth/index.tsx b/packages/shared/src/components/icons/Earth/index.tsx index 61e225828b..a96e0bb18b 100644 --- a/packages/shared/src/components/icons/Earth/index.tsx +++ b/packages/shared/src/components/icons/Earth/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Edit/index.tsx b/packages/shared/src/components/icons/Edit/index.tsx index f7abb4fcf1..538ca5a6d7 100644 --- a/packages/shared/src/components/icons/Edit/index.tsx +++ b/packages/shared/src/components/icons/Edit/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Embed/index.tsx b/packages/shared/src/components/icons/Embed/index.tsx index 5d73932325..4178b24074 100644 --- a/packages/shared/src/components/icons/Embed/index.tsx +++ b/packages/shared/src/components/icons/Embed/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Exit/index.tsx b/packages/shared/src/components/icons/Exit/index.tsx index 38bf36495e..010bc26535 100644 --- a/packages/shared/src/components/icons/Exit/index.tsx +++ b/packages/shared/src/components/icons/Exit/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Eye/index.tsx b/packages/shared/src/components/icons/Eye/index.tsx index 10249a40b1..6e00007224 100644 --- a/packages/shared/src/components/icons/Eye/index.tsx +++ b/packages/shared/src/components/icons/Eye/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/EyeCancel/index.tsx b/packages/shared/src/components/icons/EyeCancel/index.tsx index 1ef8cf9d72..0c2a150e92 100644 --- a/packages/shared/src/components/icons/EyeCancel/index.tsx +++ b/packages/shared/src/components/icons/EyeCancel/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Facebook/index.tsx b/packages/shared/src/components/icons/Facebook/index.tsx index bac7635e29..aac0c5c98c 100644 --- a/packages/shared/src/components/icons/Facebook/index.tsx +++ b/packages/shared/src/components/icons/Facebook/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; import ColorIcon from './color.svg'; diff --git a/packages/shared/src/components/icons/Feather/index.tsx b/packages/shared/src/components/icons/Feather/index.tsx index d3b32617c1..8a07dc0d96 100644 --- a/packages/shared/src/components/icons/Feather/index.tsx +++ b/packages/shared/src/components/icons/Feather/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Feedback/index.tsx b/packages/shared/src/components/icons/Feedback/index.tsx index 35364be4e3..93353f9f0d 100644 --- a/packages/shared/src/components/icons/Feedback/index.tsx +++ b/packages/shared/src/components/icons/Feedback/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Filter/index.tsx b/packages/shared/src/components/icons/Filter/index.tsx index 3aafacafa4..1acb8be26a 100644 --- a/packages/shared/src/components/icons/Filter/index.tsx +++ b/packages/shared/src/components/icons/Filter/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Flag/index.tsx b/packages/shared/src/components/icons/Flag/index.tsx index 4a10346069..90ff01bc32 100644 --- a/packages/shared/src/components/icons/Flag/index.tsx +++ b/packages/shared/src/components/icons/Flag/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Folder/index.tsx b/packages/shared/src/components/icons/Folder/index.tsx index 2e4d8a1b60..50b66aac6d 100644 --- a/packages/shared/src/components/icons/Folder/index.tsx +++ b/packages/shared/src/components/icons/Folder/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; export const FolderIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/GitHub/index.tsx b/packages/shared/src/components/icons/GitHub/index.tsx index 00530086bf..d322e26980 100644 --- a/packages/shared/src/components/icons/GitHub/index.tsx +++ b/packages/shared/src/components/icons/GitHub/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; export const GitHubIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/GitLab/index.tsx b/packages/shared/src/components/icons/GitLab/index.tsx index 00934b48cd..cc48a8e07d 100644 --- a/packages/shared/src/components/icons/GitLab/index.tsx +++ b/packages/shared/src/components/icons/GitLab/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; export const GitLabIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Google/Play/index.tsx b/packages/shared/src/components/icons/Google/Play/index.tsx index db079615a1..3a8fb82785 100644 --- a/packages/shared/src/components/icons/Google/Play/index.tsx +++ b/packages/shared/src/components/icons/Google/Play/index.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import Primary from './primary.svg'; import type { IconProps } from '../../../Icon'; import Icon from '../../../Icon'; diff --git a/packages/shared/src/components/icons/Google/index.tsx b/packages/shared/src/components/icons/Google/index.tsx index 943e2cbe58..c0faeadae7 100644 --- a/packages/shared/src/components/icons/Google/index.tsx +++ b/packages/shared/src/components/icons/Google/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; import ColorIcon from './color.svg'; diff --git a/packages/shared/src/components/icons/Hamburger/index.tsx b/packages/shared/src/components/icons/Hamburger/index.tsx index 486515c39d..d8b9860afb 100644 --- a/packages/shared/src/components/icons/Hamburger/index.tsx +++ b/packages/shared/src/components/icons/Hamburger/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Hammer/index.tsx b/packages/shared/src/components/icons/Hammer/index.tsx index 318683721c..dc1a9b6ccd 100644 --- a/packages/shared/src/components/icons/Hammer/index.tsx +++ b/packages/shared/src/components/icons/Hammer/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Hashnode/index.tsx b/packages/shared/src/components/icons/Hashnode/index.tsx index 947e06f414..d37e4c2bbf 100644 --- a/packages/shared/src/components/icons/Hashnode/index.tsx +++ b/packages/shared/src/components/icons/Hashnode/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; export const HashnodeIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Hashtag/index.tsx b/packages/shared/src/components/icons/Hashtag/index.tsx index f51a503643..d3dbf06bcf 100644 --- a/packages/shared/src/components/icons/Hashtag/index.tsx +++ b/packages/shared/src/components/icons/Hashtag/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Home/index.tsx b/packages/shared/src/components/icons/Home/index.tsx index 4a26ff9b5e..cfefebda76 100644 --- a/packages/shared/src/components/icons/Home/index.tsx +++ b/packages/shared/src/components/icons/Home/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Hot/index.tsx b/packages/shared/src/components/icons/Hot/index.tsx index 2f658aaea1..b9db39950d 100644 --- a/packages/shared/src/components/icons/Hot/index.tsx +++ b/packages/shared/src/components/icons/Hot/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Image/index.tsx b/packages/shared/src/components/icons/Image/index.tsx index cfaef30348..b2c43d685e 100644 --- a/packages/shared/src/components/icons/Image/index.tsx +++ b/packages/shared/src/components/icons/Image/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Info/index.tsx b/packages/shared/src/components/icons/Info/index.tsx index 1c26b96b6d..c8341e4435 100644 --- a/packages/shared/src/components/icons/Info/index.tsx +++ b/packages/shared/src/components/icons/Info/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; export const InfoIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Invite/index.tsx b/packages/shared/src/components/icons/Invite/index.tsx index 1732d74951..81bc2a18b0 100644 --- a/packages/shared/src/components/icons/Invite/index.tsx +++ b/packages/shared/src/components/icons/Invite/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/JetBrains/index.tsx b/packages/shared/src/components/icons/JetBrains/index.tsx index a9aa7920e8..a658f2ac5f 100644 --- a/packages/shared/src/components/icons/JetBrains/index.tsx +++ b/packages/shared/src/components/icons/JetBrains/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; export const JetBrainsIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Key/KeyReferral/index.tsx b/packages/shared/src/components/icons/Key/KeyReferral/index.tsx index d3ede1f739..783b7469cf 100644 --- a/packages/shared/src/components/icons/Key/KeyReferral/index.tsx +++ b/packages/shared/src/components/icons/Key/KeyReferral/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Key/KeyReferralOutline/index.tsx b/packages/shared/src/components/icons/Key/KeyReferralOutline/index.tsx index 7ccdac556a..ba9ff3f85c 100644 --- a/packages/shared/src/components/icons/Key/KeyReferralOutline/index.tsx +++ b/packages/shared/src/components/icons/Key/KeyReferralOutline/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Key/index.tsx b/packages/shared/src/components/icons/Key/index.tsx index 9cb4ed7ef7..2751268ba3 100644 --- a/packages/shared/src/components/icons/Key/index.tsx +++ b/packages/shared/src/components/icons/Key/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Language/index.tsx b/packages/shared/src/components/icons/Language/index.tsx index fb4654051e..c3a98b2313 100644 --- a/packages/shared/src/components/icons/Language/index.tsx +++ b/packages/shared/src/components/icons/Language/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Layout/index.tsx b/packages/shared/src/components/icons/Layout/index.tsx index 2b8a2e6f1a..9e0e196e62 100644 --- a/packages/shared/src/components/icons/Layout/index.tsx +++ b/packages/shared/src/components/icons/Layout/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Line/index.tsx b/packages/shared/src/components/icons/Line/index.tsx index dde13f1966..a4856ccecc 100644 --- a/packages/shared/src/components/icons/Line/index.tsx +++ b/packages/shared/src/components/icons/Line/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Link/index.tsx b/packages/shared/src/components/icons/Link/index.tsx index 1c14936245..9147a2e6e1 100644 --- a/packages/shared/src/components/icons/Link/index.tsx +++ b/packages/shared/src/components/icons/Link/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/LinkedIn/index.tsx b/packages/shared/src/components/icons/LinkedIn/index.tsx index baadb9e52f..d31a378f79 100644 --- a/packages/shared/src/components/icons/LinkedIn/index.tsx +++ b/packages/shared/src/components/icons/LinkedIn/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import PrimaryIcon from './primary.svg'; import SecondaryIcon from './secondary.svg'; diff --git a/packages/shared/src/components/icons/Loader/index.tsx b/packages/shared/src/components/icons/Loader/index.tsx index 3d3b469aaf..2bd08ad927 100644 --- a/packages/shared/src/components/icons/Loader/index.tsx +++ b/packages/shared/src/components/icons/Loader/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import IconImage from './loader.svg'; export const LoaderIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Lock/index.tsx b/packages/shared/src/components/icons/Lock/index.tsx index d5f6098d4b..98c8a143d4 100644 --- a/packages/shared/src/components/icons/Lock/index.tsx +++ b/packages/shared/src/components/icons/Lock/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Magic/index.tsx b/packages/shared/src/components/icons/Magic/index.tsx index a419c7b937..17f0a2d0b2 100644 --- a/packages/shared/src/components/icons/Magic/index.tsx +++ b/packages/shared/src/components/icons/Magic/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Mail/index.tsx b/packages/shared/src/components/icons/Mail/index.tsx index f4f2f9c0ab..6de6086d20 100644 --- a/packages/shared/src/components/icons/Mail/index.tsx +++ b/packages/shared/src/components/icons/Mail/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Markdown/index.tsx b/packages/shared/src/components/icons/Markdown/index.tsx index c83abe7169..fc33e9def3 100644 --- a/packages/shared/src/components/icons/Markdown/index.tsx +++ b/packages/shared/src/components/icons/Markdown/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Mastodon/index.tsx b/packages/shared/src/components/icons/Mastodon/index.tsx index 9b9dfbe8c1..8a442f32e9 100644 --- a/packages/shared/src/components/icons/Mastodon/index.tsx +++ b/packages/shared/src/components/icons/Mastodon/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import MonoIcon from './mono.svg'; import ColorIcon from './color.svg'; diff --git a/packages/shared/src/components/icons/MedalBadge/index.tsx b/packages/shared/src/components/icons/MedalBadge/index.tsx index 4bfd152317..88d120e459 100644 --- a/packages/shared/src/components/icons/MedalBadge/index.tsx +++ b/packages/shared/src/components/icons/MedalBadge/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Megaphone/index.tsx b/packages/shared/src/components/icons/Megaphone/index.tsx index 481dc27b33..517eed47ce 100644 --- a/packages/shared/src/components/icons/Megaphone/index.tsx +++ b/packages/shared/src/components/icons/Megaphone/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import FilledIcon from './filled.svg'; import OutlinedIcon from './outlined.svg'; diff --git a/packages/shared/src/components/icons/Menu/index.tsx b/packages/shared/src/components/icons/Menu/index.tsx index 1147cad5a8..68f75a5f69 100644 --- a/packages/shared/src/components/icons/Menu/index.tsx +++ b/packages/shared/src/components/icons/Menu/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Microsoft/index.tsx b/packages/shared/src/components/icons/Microsoft/index.tsx index fb73850ec5..718ef51b56 100644 --- a/packages/shared/src/components/icons/Microsoft/index.tsx +++ b/packages/shared/src/components/icons/Microsoft/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; export const MicrosoftIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/MiniClose/index.tsx b/packages/shared/src/components/icons/MiniClose/index.tsx index 73edd6ac59..44ca65b6bc 100644 --- a/packages/shared/src/components/icons/MiniClose/index.tsx +++ b/packages/shared/src/components/icons/MiniClose/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Minus/index.tsx b/packages/shared/src/components/icons/Minus/index.tsx index 8e7ee9aa8c..9b64313a0c 100644 --- a/packages/shared/src/components/icons/Minus/index.tsx +++ b/packages/shared/src/components/icons/Minus/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Moon/index.tsx b/packages/shared/src/components/icons/Moon/index.tsx index 38860a59d0..c06b72432e 100644 --- a/packages/shared/src/components/icons/Moon/index.tsx +++ b/packages/shared/src/components/icons/Moon/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/NewSquad/index.tsx b/packages/shared/src/components/icons/NewSquad/index.tsx index f2cfd8ac00..29436cf480 100644 --- a/packages/shared/src/components/icons/NewSquad/index.tsx +++ b/packages/shared/src/components/icons/NewSquad/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import { PlusIcon } from '../Plus'; const Primary = () => ( diff --git a/packages/shared/src/components/icons/OpenLink/index.tsx b/packages/shared/src/components/icons/OpenLink/index.tsx index cd30d52cd4..4e10a13d92 100644 --- a/packages/shared/src/components/icons/OpenLink/index.tsx +++ b/packages/shared/src/components/icons/OpenLink/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Pause/index.tsx b/packages/shared/src/components/icons/Pause/index.tsx index 46af372862..27c1eab96b 100644 --- a/packages/shared/src/components/icons/Pause/index.tsx +++ b/packages/shared/src/components/icons/Pause/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Pin/index.tsx b/packages/shared/src/components/icons/Pin/index.tsx index 429816d5f6..b120bf5818 100644 --- a/packages/shared/src/components/icons/Pin/index.tsx +++ b/packages/shared/src/components/icons/Pin/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Play/index.tsx b/packages/shared/src/components/icons/Play/index.tsx index 101134d971..fff5148805 100644 --- a/packages/shared/src/components/icons/Play/index.tsx +++ b/packages/shared/src/components/icons/Play/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Plus/index.tsx b/packages/shared/src/components/icons/Plus/index.tsx index 7f70360ee5..7198daaaf9 100644 --- a/packages/shared/src/components/icons/Plus/index.tsx +++ b/packages/shared/src/components/icons/Plus/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Power/index.tsx b/packages/shared/src/components/icons/Power/index.tsx index ba4c3599c2..f95390c056 100644 --- a/packages/shared/src/components/icons/Power/index.tsx +++ b/packages/shared/src/components/icons/Power/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/ReadingStreak/index.tsx b/packages/shared/src/components/icons/ReadingStreak/index.tsx index 888ee4655f..ad0a95ac8c 100644 --- a/packages/shared/src/components/icons/ReadingStreak/index.tsx +++ b/packages/shared/src/components/icons/ReadingStreak/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import PrimaryIcon from './primary.svg'; import SecondaryIcon from './secondary.svg'; diff --git a/packages/shared/src/components/icons/Reddit/index.tsx b/packages/shared/src/components/icons/Reddit/index.tsx index 6e6b873a17..9c400e55e5 100644 --- a/packages/shared/src/components/icons/Reddit/index.tsx +++ b/packages/shared/src/components/icons/Reddit/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import PrimaryIcon from './primary.svg'; import SecondaryIcon from './secondary.svg'; diff --git a/packages/shared/src/components/icons/Redis/index.tsx b/packages/shared/src/components/icons/Redis/index.tsx index 04693b1774..b66d2c2dff 100644 --- a/packages/shared/src/components/icons/Redis/index.tsx +++ b/packages/shared/src/components/icons/Redis/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; export const RedisIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Refresh/index.tsx b/packages/shared/src/components/icons/Refresh/index.tsx index 66bb64fd36..7f42bdb8e7 100644 --- a/packages/shared/src/components/icons/Refresh/index.tsx +++ b/packages/shared/src/components/icons/Refresh/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/RemoveUser/index.tsx b/packages/shared/src/components/icons/RemoveUser/index.tsx index daaf3d5ce0..3e49458cce 100644 --- a/packages/shared/src/components/icons/RemoveUser/index.tsx +++ b/packages/shared/src/components/icons/RemoveUser/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import FilledIcon from './filled.svg'; import OutlinedIcon from './outlined.svg'; diff --git a/packages/shared/src/components/icons/Reputation/index.tsx b/packages/shared/src/components/icons/Reputation/index.tsx index 65a533fe33..1c36cbed0f 100644 --- a/packages/shared/src/components/icons/Reputation/index.tsx +++ b/packages/shared/src/components/icons/Reputation/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import FilledIcon from './filled.svg'; export const ReputationIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/ReputationLightning/index.tsx b/packages/shared/src/components/icons/ReputationLightning/index.tsx index 622ae9d58a..f8e44c816e 100644 --- a/packages/shared/src/components/icons/ReputationLightning/index.tsx +++ b/packages/shared/src/components/icons/ReputationLightning/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Roadmap/index.tsx b/packages/shared/src/components/icons/Roadmap/index.tsx index 9eb097da7d..2352b59a48 100644 --- a/packages/shared/src/components/icons/Roadmap/index.tsx +++ b/packages/shared/src/components/icons/Roadmap/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import MonoIcon from './mono.svg'; export const RoadmapIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Scout/index.tsx b/packages/shared/src/components/icons/Scout/index.tsx index 53cadd781f..d02b2d47dd 100644 --- a/packages/shared/src/components/icons/Scout/index.tsx +++ b/packages/shared/src/components/icons/Scout/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Search/index.tsx b/packages/shared/src/components/icons/Search/index.tsx index 1354a123ca..063b26330c 100644 --- a/packages/shared/src/components/icons/Search/index.tsx +++ b/packages/shared/src/components/icons/Search/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/SendAirplane/index.tsx b/packages/shared/src/components/icons/SendAirplane/index.tsx index 3846e8a1e5..c59953ff35 100644 --- a/packages/shared/src/components/icons/SendAirplane/index.tsx +++ b/packages/shared/src/components/icons/SendAirplane/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/SendBackward/index.tsx b/packages/shared/src/components/icons/SendBackward/index.tsx index 35ef6d8a29..03c1c1176f 100644 --- a/packages/shared/src/components/icons/SendBackward/index.tsx +++ b/packages/shared/src/components/icons/SendBackward/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Settings/index.tsx b/packages/shared/src/components/icons/Settings/index.tsx index aeee567ff2..03edc1da66 100644 --- a/packages/shared/src/components/icons/Settings/index.tsx +++ b/packages/shared/src/components/icons/Settings/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Share/index.tsx b/packages/shared/src/components/icons/Share/index.tsx index 7fd49eda5d..a40b06ed1e 100644 --- a/packages/shared/src/components/icons/Share/index.tsx +++ b/packages/shared/src/components/icons/Share/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Shield/index.tsx b/packages/shared/src/components/icons/Shield/index.tsx index c3e006d9d5..de740e838f 100644 --- a/packages/shared/src/components/icons/Shield/index.tsx +++ b/packages/shared/src/components/icons/Shield/index.tsx @@ -1,5 +1,7 @@ -import React, { type ReactElement } from 'react'; -import Icon, { type IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/ShieldCheck/index.tsx b/packages/shared/src/components/icons/ShieldCheck/index.tsx index 1d6bf73b3c..abcf90bfb7 100644 --- a/packages/shared/src/components/icons/ShieldCheck/index.tsx +++ b/packages/shared/src/components/icons/ShieldCheck/index.tsx @@ -1,5 +1,7 @@ -import React, { type ReactElement } from 'react'; -import Icon, { type IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/ShieldPlus/index.tsx b/packages/shared/src/components/icons/ShieldPlus/index.tsx index adb83d0dc9..49ed305632 100644 --- a/packages/shared/src/components/icons/ShieldPlus/index.tsx +++ b/packages/shared/src/components/icons/ShieldPlus/index.tsx @@ -1,5 +1,7 @@ -import React, { type ReactElement } from 'react'; -import Icon, { type IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/ShieldWarning/index.tsx b/packages/shared/src/components/icons/ShieldWarning/index.tsx index 6919be31b9..da359e556c 100644 --- a/packages/shared/src/components/icons/ShieldWarning/index.tsx +++ b/packages/shared/src/components/icons/ShieldWarning/index.tsx @@ -1,5 +1,7 @@ -import React, { type ReactElement } from 'react'; -import Icon, { type IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Sidebar/SidebarArrowLeft/index.tsx b/packages/shared/src/components/icons/Sidebar/SidebarArrowLeft/index.tsx index 00e3554e66..315ffa3f5f 100644 --- a/packages/shared/src/components/icons/Sidebar/SidebarArrowLeft/index.tsx +++ b/packages/shared/src/components/icons/Sidebar/SidebarArrowLeft/index.tsx @@ -1,5 +1,7 @@ -import React, { type ReactElement } from 'react'; -import Icon, { type IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Sidebar/SidebarArrowRight/index.tsx b/packages/shared/src/components/icons/Sidebar/SidebarArrowRight/index.tsx index 03164fce4d..c878ceaf9d 100644 --- a/packages/shared/src/components/icons/Sidebar/SidebarArrowRight/index.tsx +++ b/packages/shared/src/components/icons/Sidebar/SidebarArrowRight/index.tsx @@ -1,5 +1,7 @@ -import React, { type ReactElement } from 'react'; -import Icon, { type IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Sites/index.tsx b/packages/shared/src/components/icons/Sites/index.tsx index fd0a71d86b..a6c6781add 100644 --- a/packages/shared/src/components/icons/Sites/index.tsx +++ b/packages/shared/src/components/icons/Sites/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Slack/index.tsx b/packages/shared/src/components/icons/Slack/index.tsx index 99b2c99e62..5b2d34aea6 100644 --- a/packages/shared/src/components/icons/Slack/index.tsx +++ b/packages/shared/src/components/icons/Slack/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import ColorIcon from './color.svg'; export const SlackIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Sort/Time/index.tsx b/packages/shared/src/components/icons/Sort/Time/index.tsx index 954532cc44..d9306aab20 100644 --- a/packages/shared/src/components/icons/Sort/Time/index.tsx +++ b/packages/shared/src/components/icons/Sort/Time/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../../Icon'; +import Icon from '../../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Sort/index.tsx b/packages/shared/src/components/icons/Sort/index.tsx index 361bdb750e..568146c864 100644 --- a/packages/shared/src/components/icons/Sort/index.tsx +++ b/packages/shared/src/components/icons/Sort/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Source/index.tsx b/packages/shared/src/components/icons/Source/index.tsx index 25e71c5b02..7bc81430e6 100644 --- a/packages/shared/src/components/icons/Source/index.tsx +++ b/packages/shared/src/components/icons/Source/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Sparkle/index.tsx b/packages/shared/src/components/icons/Sparkle/index.tsx index 6acf9fa49e..bff014b3d0 100644 --- a/packages/shared/src/components/icons/Sparkle/index.tsx +++ b/packages/shared/src/components/icons/Sparkle/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import FilledIcon from './filled.svg'; export const SparkleIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Spotify/index.tsx b/packages/shared/src/components/icons/Spotify/index.tsx index 066053ba51..4d3f184752 100644 --- a/packages/shared/src/components/icons/Spotify/index.tsx +++ b/packages/shared/src/components/icons/Spotify/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; export const SpotifyIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Squad/index.tsx b/packages/shared/src/components/icons/Squad/index.tsx index 8830ccfb20..dc6eb9d19f 100644 --- a/packages/shared/src/components/icons/Squad/index.tsx +++ b/packages/shared/src/components/icons/Squad/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/StackOverflow/index.tsx b/packages/shared/src/components/icons/StackOverflow/index.tsx index 243a56b20c..915ec01f5f 100644 --- a/packages/shared/src/components/icons/StackOverflow/index.tsx +++ b/packages/shared/src/components/icons/StackOverflow/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import MonoIcon from './mono.svg'; import ColorIcon from './color.svg'; diff --git a/packages/shared/src/components/icons/Star/index.tsx b/packages/shared/src/components/icons/Star/index.tsx index 9f5acf9057..2d533d1802 100644 --- a/packages/shared/src/components/icons/Star/index.tsx +++ b/packages/shared/src/components/icons/Star/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Telegram/index.tsx b/packages/shared/src/components/icons/Telegram/index.tsx index 33205e2b2b..7d7164233b 100644 --- a/packages/shared/src/components/icons/Telegram/index.tsx +++ b/packages/shared/src/components/icons/Telegram/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import PrimaryIcon from './primary.svg'; import SecondaryIcon from './secondary.svg'; diff --git a/packages/shared/src/components/icons/Terminal/index.tsx b/packages/shared/src/components/icons/Terminal/index.tsx index 47365067aa..ee5fe84fcc 100644 --- a/packages/shared/src/components/icons/Terminal/index.tsx +++ b/packages/shared/src/components/icons/Terminal/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Threads/index.tsx b/packages/shared/src/components/icons/Threads/index.tsx index 7c58967d30..ffacc88b68 100644 --- a/packages/shared/src/components/icons/Threads/index.tsx +++ b/packages/shared/src/components/icons/Threads/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import MonoIcon from './mono.svg'; export const ThreadsIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/TimeZone/DaytimeIcon.tsx b/packages/shared/src/components/icons/TimeZone/DaytimeIcon.tsx index f4e391faa3..a87ea534d2 100644 --- a/packages/shared/src/components/icons/TimeZone/DaytimeIcon.tsx +++ b/packages/shared/src/components/icons/TimeZone/DaytimeIcon.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import SvgIcon from './timezone_daytime.svg'; export const DaytimeIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/TimeZone/NighttimeIcon.tsx b/packages/shared/src/components/icons/TimeZone/NighttimeIcon.tsx index 29c5f2ad8e..8e51dde8be 100644 --- a/packages/shared/src/components/icons/TimeZone/NighttimeIcon.tsx +++ b/packages/shared/src/components/icons/TimeZone/NighttimeIcon.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import SvgIcon from './timezone_nighttime.svg'; export const NighttimeIcon = (props: IconProps): ReactElement => ( diff --git a/packages/shared/src/components/icons/Timer/index.tsx b/packages/shared/src/components/icons/Timer/index.tsx index 52f8c0aa1f..6b8c394119 100644 --- a/packages/shared/src/components/icons/Timer/index.tsx +++ b/packages/shared/src/components/icons/Timer/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Tour/index.tsx b/packages/shared/src/components/icons/Tour/index.tsx index 1b70f7b5bd..11ffef5fc9 100644 --- a/packages/shared/src/components/icons/Tour/index.tsx +++ b/packages/shared/src/components/icons/Tour/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Trash/index.tsx b/packages/shared/src/components/icons/Trash/index.tsx index 2c8318a7ea..1600af2d6f 100644 --- a/packages/shared/src/components/icons/Trash/index.tsx +++ b/packages/shared/src/components/icons/Trash/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Trending/index.tsx b/packages/shared/src/components/icons/Trending/index.tsx index 929e196ce0..3b6d97187a 100644 --- a/packages/shared/src/components/icons/Trending/index.tsx +++ b/packages/shared/src/components/icons/Trending/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Twitter/index.tsx b/packages/shared/src/components/icons/Twitter/index.tsx index 0ff02e1fb6..c265882969 100644 --- a/packages/shared/src/components/icons/Twitter/index.tsx +++ b/packages/shared/src/components/icons/Twitter/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; import ColorIcon from './color.svg'; diff --git a/packages/shared/src/components/icons/Unread/index.tsx b/packages/shared/src/components/icons/Unread/index.tsx index 4312a92390..ed030b0811 100644 --- a/packages/shared/src/components/icons/Unread/index.tsx +++ b/packages/shared/src/components/icons/Unread/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Upvote/index.tsx b/packages/shared/src/components/icons/Upvote/index.tsx index a55582270e..285fc3ec8f 100644 --- a/packages/shared/src/components/icons/Upvote/index.tsx +++ b/packages/shared/src/components/icons/Upvote/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/User/index.tsx b/packages/shared/src/components/icons/User/index.tsx index d40d7092fc..8ef39def8a 100644 --- a/packages/shared/src/components/icons/User/index.tsx +++ b/packages/shared/src/components/icons/User/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/UserShare/index.tsx b/packages/shared/src/components/icons/UserShare/index.tsx index 10498d0588..3672e83a2c 100644 --- a/packages/shared/src/components/icons/UserShare/index.tsx +++ b/packages/shared/src/components/icons/UserShare/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/V/index.tsx b/packages/shared/src/components/icons/V/index.tsx index d2a241ac75..1a95f1882b 100644 --- a/packages/shared/src/components/icons/V/index.tsx +++ b/packages/shared/src/components/icons/V/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Warning/index.tsx b/packages/shared/src/components/icons/Warning/index.tsx index 85460431cb..d2f9548b0f 100644 --- a/packages/shared/src/components/icons/Warning/index.tsx +++ b/packages/shared/src/components/icons/Warning/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import OutlinedIcon from './outlined.svg'; import FilledIcon from './filled.svg'; diff --git a/packages/shared/src/components/icons/Whatsapp/index.tsx b/packages/shared/src/components/icons/Whatsapp/index.tsx index 404b2c3f91..4d73c0b210 100644 --- a/packages/shared/src/components/icons/Whatsapp/index.tsx +++ b/packages/shared/src/components/icons/Whatsapp/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import WhiteIcon from './white.svg'; import ColorIcon from './color.svg'; diff --git a/packages/shared/src/components/icons/Youtube/index.tsx b/packages/shared/src/components/icons/Youtube/index.tsx index 9931da8ab9..55d32e8d9f 100644 --- a/packages/shared/src/components/icons/Youtube/index.tsx +++ b/packages/shared/src/components/icons/Youtube/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Icon, { IconProps } from '../../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import Icon from '../../Icon'; import MonoIcon from './mono.svg'; import ColorIcon from './color.svg'; diff --git a/packages/shared/src/components/image/Image.tsx b/packages/shared/src/components/image/Image.tsx index 162b7c651f..46bf2a487e 100644 --- a/packages/shared/src/components/image/Image.tsx +++ b/packages/shared/src/components/image/Image.tsx @@ -1,10 +1,10 @@ -import React, { +import type { ComponentPropsWithoutRef, - forwardRef, ReactElement, Ref, SyntheticEvent, } from 'react'; +import React, { forwardRef } from 'react'; import { cloudinaryPostImageCoverPlaceholder, cloudinarySquadsImageFallback, diff --git a/packages/shared/src/components/image/VideoImage.tsx b/packages/shared/src/components/image/VideoImage.tsx index 94f498d4b5..1755961697 100644 --- a/packages/shared/src/components/image/VideoImage.tsx +++ b/packages/shared/src/components/image/VideoImage.tsx @@ -1,8 +1,10 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { PlayIcon } from '../icons'; import { IconSize } from '../Icon'; -import { ImageProps, ImageType } from './Image'; +import type { ImageProps } from './Image'; +import { ImageType } from './Image'; import { CardImage } from '../cards/common/Card'; export interface VideoImageProps { diff --git a/packages/shared/src/components/integrations/NewUserIntegration.tsx b/packages/shared/src/components/integrations/NewUserIntegration.tsx index 66abe50915..fdbc84f4c3 100644 --- a/packages/shared/src/components/integrations/NewUserIntegration.tsx +++ b/packages/shared/src/components/integrations/NewUserIntegration.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { IconProps } from '../Icon'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../Icon'; import { Button } from '../buttons/Button'; import { ButtonVariant, ButtonSize } from '../buttons/common'; import { diff --git a/packages/shared/src/components/integrations/UserIntegrationItem.tsx b/packages/shared/src/components/integrations/UserIntegrationItem.tsx index 8cbd81b3ea..259668ceef 100644 --- a/packages/shared/src/components/integrations/UserIntegrationItem.tsx +++ b/packages/shared/src/components/integrations/UserIntegrationItem.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import dynamic from 'next/dynamic'; import { getIconForIntegration } from '../../lib/integrations'; -import { UserIntegration } from '../../graphql/integrations'; +import type { UserIntegration } from '../../graphql/integrations'; import { ContextMenuIds } from '../../hooks/constants'; import { Button } from '../buttons/Button'; import { ButtonSize } from '../buttons/common'; diff --git a/packages/shared/src/components/integrations/UserSourceIntegrationList.tsx b/packages/shared/src/components/integrations/UserSourceIntegrationList.tsx index 727e4783bd..bb06662850 100644 --- a/packages/shared/src/components/integrations/UserSourceIntegrationList.tsx +++ b/packages/shared/src/components/integrations/UserSourceIntegrationList.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useSourceIntegrationsQuery } from '../../hooks/integrations/useSourceIntegrationsQuery'; import { ProfileImageSize } from '../ProfilePicture'; import { SourceAvatar } from '../profile/source'; diff --git a/packages/shared/src/components/layout/DefaultSquadHeader.tsx b/packages/shared/src/components/layout/DefaultSquadHeader.tsx index 19f253bb4d..1a76cd02be 100644 --- a/packages/shared/src/components/layout/DefaultSquadHeader.tsx +++ b/packages/shared/src/components/layout/DefaultSquadHeader.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { PageHeader, PageHeaderTitle } from './common'; import { Button, ButtonVariant } from '../buttons/Button'; import { ArrowIcon } from '../icons'; diff --git a/packages/shared/src/components/layout/HeaderButtons.tsx b/packages/shared/src/components/layout/HeaderButtons.tsx index 0c0363beac..2d24cf8037 100644 --- a/packages/shared/src/components/layout/HeaderButtons.tsx +++ b/packages/shared/src/components/layout/HeaderButtons.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import LoginButton from '../LoginButton'; import NotificationsBell from '../notifications/NotificationsBell'; import { CreatePostButton } from '../post/write'; diff --git a/packages/shared/src/components/layout/HeaderLogo.tsx b/packages/shared/src/components/layout/HeaderLogo.tsx index 491ab1703c..f0d3f54703 100644 --- a/packages/shared/src/components/layout/HeaderLogo.tsx +++ b/packages/shared/src/components/layout/HeaderLogo.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import Logo, { LogoPosition } from '../Logo'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { LogoPosition } from '../Logo'; +import Logo from '../Logo'; import { useFeatureTheme } from '../../hooks/utils/useFeatureTheme'; import { useAuthContext } from '../../contexts/AuthContext'; import { withNoSSR } from '../../lib/withNoSSR'; diff --git a/packages/shared/src/components/layout/MainLayoutHeader.tsx b/packages/shared/src/components/layout/MainLayoutHeader.tsx index 70fb4dc3d1..c511b68e5f 100644 --- a/packages/shared/src/components/layout/MainLayoutHeader.tsx +++ b/packages/shared/src/components/layout/MainLayoutHeader.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, ReactNode, useCallback } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useCallback } from 'react'; import dynamic from 'next/dynamic'; import HeaderLogo from './HeaderLogo'; import { useViewSize, ViewSize } from '../../hooks'; diff --git a/packages/shared/src/components/layout/PageWrapperLayout.tsx b/packages/shared/src/components/layout/PageWrapperLayout.tsx index 6cd89c6ebc..f8abfe8a99 100644 --- a/packages/shared/src/components/layout/PageWrapperLayout.tsx +++ b/packages/shared/src/components/layout/PageWrapperLayout.tsx @@ -1,4 +1,5 @@ -import React, { ComponentProps, PropsWithChildren, ReactElement } from 'react'; +import type { ComponentProps, PropsWithChildren, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; export const pageMainClassNames = 'tablet:p-4 laptop:px-10 laptop:py-5'; diff --git a/packages/shared/src/components/layout/common.tsx b/packages/shared/src/components/layout/common.tsx index ae51db0db7..81d5bfaab7 100644 --- a/packages/shared/src/components/layout/common.tsx +++ b/packages/shared/src/components/layout/common.tsx @@ -1,15 +1,16 @@ -import React, { +import type { Dispatch, PropsWithChildren, ReactElement, SetStateAction, - useContext, } from 'react'; +import React, { useContext } from 'react'; import { useRouter } from 'next/router'; import classed from '../../lib/classed'; import { SharedFeedPage } from '../utilities'; import MyFeedHeading from '../filters/MyFeedHeading'; -import { Dropdown, DropdownProps } from '../fields/Dropdown'; +import type { DropdownProps } from '../fields/Dropdown'; +import { Dropdown } from '../fields/Dropdown'; import { ButtonSize, ButtonVariant } from '../buttons/common'; import { CalendarIcon, SortIcon } from '../icons'; import { IconSize } from '../Icon'; @@ -20,14 +21,11 @@ import { usePlusSubscription, useViewSize, ViewSize } from '../../hooks'; import ConditionalWrapper from '../ConditionalWrapper'; import { ReadingStreakButton } from '../streak/ReadingStreakButton'; import { useReadingStreak } from '../../hooks/streaks'; -import { AllFeedPages } from '../../lib/query'; +import type { AllFeedPages } from '../../lib/query'; import { webappUrl } from '../../lib/constants'; import { QueryStateKeys, useQueryState } from '../../hooks/utils/useQueryState'; -import { - AllowedTags, - Typography, - TypographyProps, -} from '../typography/Typography'; +import type { AllowedTags, TypographyProps } from '../typography/Typography'; +import { Typography } from '../typography/Typography'; import { ToggleClickbaitShield } from '../buttons/ToggleClickbaitShield'; import { Origin } from '../../lib/log'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/components/marketingCta/MarketingCtaCard.tsx b/packages/shared/src/components/marketingCta/MarketingCtaCard.tsx index b789d321ef..69858042b2 100644 --- a/packages/shared/src/components/marketingCta/MarketingCtaCard.tsx +++ b/packages/shared/src/components/marketingCta/MarketingCtaCard.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement, useCallback, useEffect, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useEffect, useRef } from 'react'; import { Card } from '../cards/common/Card'; import { CardCover } from '../cards/common/CardCover'; -import { CTAButton, Description, Header, MarketingCta, Title } from './common'; +import type { MarketingCta } from './common'; +import { CTAButton, Description, Header, Title } from './common'; import { useBoot } from '../../hooks'; import { useLogContext } from '../../contexts/LogContext'; import { LogEvent, TargetType } from '../../lib/log'; diff --git a/packages/shared/src/components/marketingCta/MarketingCtaList.tsx b/packages/shared/src/components/marketingCta/MarketingCtaList.tsx index 89a98be3bb..39c8db47f9 100644 --- a/packages/shared/src/components/marketingCta/MarketingCtaList.tsx +++ b/packages/shared/src/components/marketingCta/MarketingCtaList.tsx @@ -1,9 +1,11 @@ -import React, { ReactElement, useCallback, useEffect, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useEffect, useRef } from 'react'; import { ListCard } from '../cards/common/list/ListCard'; import { useBoot } from '../../hooks'; import { useLogContext } from '../../contexts/LogContext'; import { LogEvent, TargetType } from '../../lib/log'; -import { CTAButton, Description, Header, MarketingCta, Title } from './common'; +import type { MarketingCta } from './common'; +import { CTAButton, Description, Header, Title } from './common'; import { CardCoverList } from '../cards/common/list/CardCover'; export function MarketingCtaList({ diff --git a/packages/shared/src/components/marketingCta/MarketingCtaModal.tsx b/packages/shared/src/components/marketingCta/MarketingCtaModal.tsx index b37d62d512..727ad834ed 100644 --- a/packages/shared/src/components/marketingCta/MarketingCtaModal.tsx +++ b/packages/shared/src/components/marketingCta/MarketingCtaModal.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { Modal, ModalProps } from '../modals/common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from '../modals/common/Modal'; +import { Modal } from '../modals/common/Modal'; import { ButtonSize } from '../buttons/Button'; import { CardCover } from '../cards/common/CardCover'; import type { MarketingCta } from './common'; diff --git a/packages/shared/src/components/marketingCta/MarketingCtaPopoverSmall.tsx b/packages/shared/src/components/marketingCta/MarketingCtaPopoverSmall.tsx index 5bdcd9490f..9b813818da 100644 --- a/packages/shared/src/components/marketingCta/MarketingCtaPopoverSmall.tsx +++ b/packages/shared/src/components/marketingCta/MarketingCtaPopoverSmall.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement, useCallback, useEffect, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useEffect, useRef } from 'react'; import classNames from 'classnames'; import { CardCover } from '../cards/common/CardCover'; -import { CTAButton, Description, MarketingCta, Title } from './common'; +import type { MarketingCta } from './common'; +import { CTAButton, Description, Title } from './common'; import { ViewSize, useBoot, useViewSize } from '../../hooks'; import { useLogContext } from '../../contexts/LogContext'; import { LogEvent, TargetType } from '../../lib/log'; diff --git a/packages/shared/src/components/marketingCta/common.tsx b/packages/shared/src/components/marketingCta/common.tsx index f98a74499d..a4cdd4f03c 100644 --- a/packages/shared/src/components/marketingCta/common.tsx +++ b/packages/shared/src/components/marketingCta/common.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { MiniCloseIcon } from '../icons'; import { CardTitle } from '../cards/common/Card'; diff --git a/packages/shared/src/components/modals/ArticlePostModal.tsx b/packages/shared/src/components/modals/ArticlePostModal.tsx index f5e1e1878a..8abe6dfc22 100644 --- a/packages/shared/src/components/modals/ArticlePostModal.tsx +++ b/packages/shared/src/components/modals/ArticlePostModal.tsx @@ -1,10 +1,13 @@ -import React, { ReactElement } from 'react'; -import { Modal, ModalProps, modalSizeToClassName } from './common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from './common/Modal'; +import { Modal, modalSizeToClassName } from './common/Modal'; import { PostContent } from '../post/PostContent'; import usePostNavigationPosition from '../../hooks/usePostNavigationPosition'; import BasePostModal from './BasePostModal'; -import { Post, PostType } from '../../graphql/posts'; -import { PassedPostNavigationProps } from '../post/common'; +import type { Post } from '../../graphql/posts'; +import { PostType } from '../../graphql/posts'; +import type { PassedPostNavigationProps } from '../post/common'; import { Origin } from '../../lib/log'; interface ArticlePostModalProps extends ModalProps, PassedPostNavigationProps { diff --git a/packages/shared/src/components/modals/BasePostModal.tsx b/packages/shared/src/components/modals/BasePostModal.tsx index 6b383d4e8d..9e6ab5c89d 100644 --- a/packages/shared/src/components/modals/BasePostModal.tsx +++ b/packages/shared/src/components/modals/BasePostModal.tsx @@ -1,10 +1,12 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Modal, ModalProps } from './common/Modal'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import styles from './BasePostModal.module.css'; import PostLoadingSkeleton from '../post/PostLoadingSkeleton'; -import { PostType } from '../../graphql/posts'; -import { Source } from '../../graphql/sources'; +import type { PostType } from '../../graphql/posts'; +import type { Source } from '../../graphql/sources'; interface BasePostModalProps extends ModalProps { postType: PostType; diff --git a/packages/shared/src/components/modals/BootPopups.tsx b/packages/shared/src/components/modals/BootPopups.tsx index 40de317333..4a8c6d416d 100644 --- a/packages/shared/src/components/modals/BootPopups.tsx +++ b/packages/shared/src/components/modals/BootPopups.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { useLazyModal } from '../../hooks/useLazyModal'; import { useAuthContext } from '../../contexts/AuthContext'; import { useActions, useBoot } from '../../hooks'; @@ -10,9 +11,9 @@ import { LogEvent, Origin, TargetType } from '../../lib/log'; import LogContext from '../../contexts/LogContext'; import { promotion } from './generic'; import { useReadingStreak } from '../../hooks/streaks'; +import type { InteractivePopupProps } from '../tooltips/InteractivePopup'; import InteractivePopup, { InteractivePopupPosition, - InteractivePopupProps, } from '../tooltips/InteractivePopup'; import { MarketingCtaPopoverSmall } from '../marketingCta/MarketingCtaPopoverSmall'; import { ButtonVariant } from '../buttons/common'; diff --git a/packages/shared/src/components/modals/ClickbaitShieldModal.tsx b/packages/shared/src/components/modals/ClickbaitShieldModal.tsx index f4f484eae9..ccd2f71f7a 100644 --- a/packages/shared/src/components/modals/ClickbaitShieldModal.tsx +++ b/packages/shared/src/components/modals/ClickbaitShieldModal.tsx @@ -1,5 +1,7 @@ -import React, { type MouseEvent, type ReactElement } from 'react'; -import { Modal, type ModalProps } from './common/Modal'; +import type { MouseEvent, ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import { Image } from '../image/Image'; import { Typography, diff --git a/packages/shared/src/components/modals/CollectionPostModal.tsx b/packages/shared/src/components/modals/CollectionPostModal.tsx index 287da960ac..0fffef0c60 100644 --- a/packages/shared/src/components/modals/CollectionPostModal.tsx +++ b/packages/shared/src/components/modals/CollectionPostModal.tsx @@ -1,10 +1,13 @@ -import React, { ReactElement } from 'react'; -import { Modal, ModalProps, modalSizeToClassName } from './common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from './common/Modal'; +import { Modal, modalSizeToClassName } from './common/Modal'; import { Origin } from '../../lib/log'; import usePostNavigationPosition from '../../hooks/usePostNavigationPosition'; import BasePostModal from './BasePostModal'; -import { Post, PostType } from '../../graphql/posts'; -import { PassedPostNavigationProps } from '../post/common'; +import type { Post } from '../../graphql/posts'; +import { PostType } from '../../graphql/posts'; +import type { PassedPostNavigationProps } from '../post/common'; import { CollectionPostContent } from '../post/collection'; interface CollectionPostModalProps diff --git a/packages/shared/src/components/modals/KeywordSynonymModal.tsx b/packages/shared/src/components/modals/KeywordSynonymModal.tsx index 2508891ef6..553ac0c877 100644 --- a/packages/shared/src/components/modals/KeywordSynonymModal.tsx +++ b/packages/shared/src/components/modals/KeywordSynonymModal.tsx @@ -1,13 +1,15 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { useMutation, useQuery } from '@tanstack/react-query'; import { TextField } from '../fields/TextField'; +import type { SearchKeywordData } from '../../graphql/keywords'; import { SEARCH_KEYWORDS_QUERY, - SearchKeywordData, SET_KEYWORD_AS_SYNONYM_MUTATION, } from '../../graphql/keywords'; import { Button, ButtonVariant } from '../buttons/Button'; -import { Modal, ModalProps } from './common/Modal'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import { gqlClient } from '../../graphql/common'; export type KeywordSynonymModalProps = { selectedKeyword: string } & ModalProps; diff --git a/packages/shared/src/components/modals/LazyModalElement.tsx b/packages/shared/src/components/modals/LazyModalElement.tsx index cedc09b3e7..b46a8e6c8a 100644 --- a/packages/shared/src/components/modals/LazyModalElement.tsx +++ b/packages/shared/src/components/modals/LazyModalElement.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useLazyModal } from '../../hooks/useLazyModal'; -import { LazyPropTypes, modals } from './common'; +import type { LazyPropTypes } from './common'; +import { modals } from './common'; export function LazyModalElement(): ReactElement { const { modal, closeModal } = useLazyModal(); diff --git a/packages/shared/src/components/modals/NewSourceModal.spec.tsx b/packages/shared/src/components/modals/NewSourceModal.spec.tsx index e1ba393e56..a86a2860cc 100644 --- a/packages/shared/src/components/modals/NewSourceModal.spec.tsx +++ b/packages/shared/src/components/modals/NewSourceModal.spec.tsx @@ -1,20 +1,19 @@ -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React from 'react'; import nock from 'nock'; import NewSourceModal from './NewSourceModal'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '../../../__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '../../../__tests__/helpers/graphql'; +import { mockGraphQL } from '../../../__tests__/helpers/graphql'; import { REQUEST_SOURCE_MUTATION, SOURCE_BY_FEED_QUERY, SOURCE_REQUEST_AVAILABILITY_QUERY, } from '../../graphql/newSource'; import { AuthContextProvider } from '../../contexts/AuthContext'; -import { AnonymousUser, LoggedUser } from '../../lib/user'; +import type { AnonymousUser, LoggedUser } from '../../lib/user'; import user from '../../../__tests__/fixture/loggedUser'; import { NotificationsContextProvider } from '../../contexts/NotificationsContext'; diff --git a/packages/shared/src/components/modals/NewSourceModal.tsx b/packages/shared/src/components/modals/NewSourceModal.tsx index daeaf54dcb..dde974e391 100644 --- a/packages/shared/src/components/modals/NewSourceModal.tsx +++ b/packages/shared/src/components/modals/NewSourceModal.tsx @@ -1,10 +1,5 @@ -import React, { - ReactElement, - ReactNode, - useContext, - useRef, - useState, -} from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useRef, useState } from 'react'; import { useMutation, useQuery } from '@tanstack/react-query'; import classNames from 'classnames'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; @@ -13,16 +8,17 @@ import { formToJson } from '../../lib/form'; import { apiUrl } from '../../lib/config'; import fetchTimeout from '../../lib/fetchTimeout'; import { contentGuidelines } from '../../lib/constants'; +import type { SourceRequestAvailability } from '../../graphql/newSource'; import { REQUEST_SOURCE_MUTATION, SOURCE_BY_FEED_QUERY, SOURCE_REQUEST_AVAILABILITY_QUERY, - SourceRequestAvailability, } from '../../graphql/newSource'; -import { Source } from '../../graphql/sources'; +import type { Source } from '../../graphql/sources'; import AuthContext from '../../contexts/AuthContext'; import { AuthTriggers } from '../../lib/auth'; -import { Modal, ModalProps } from './common/Modal'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import PushNotificationModal from './PushNotificationModal'; import usePersistentContext from '../../hooks/usePersistentContext'; import Alert, { AlertType } from '../widgets/Alert'; diff --git a/packages/shared/src/components/modals/Prompt.tsx b/packages/shared/src/components/modals/Prompt.tsx index cd23dda2e6..fcca95a53f 100644 --- a/packages/shared/src/components/modals/Prompt.tsx +++ b/packages/shared/src/components/modals/Prompt.tsx @@ -1,9 +1,11 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { usePrompt } from '../../hooks/usePrompt'; import { Button, ButtonVariant } from '../buttons/Button'; import classed from '../../lib/classed'; -import { Modal, ModalProps } from './common/Modal'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; const Title = classed('h1', 'font-bold typo-title3 text-center'); const Description = classed( diff --git a/packages/shared/src/components/modals/PushNotificationModal.tsx b/packages/shared/src/components/modals/PushNotificationModal.tsx index 0dfa457305..4694c8d546 100644 --- a/packages/shared/src/components/modals/PushNotificationModal.tsx +++ b/packages/shared/src/components/modals/PushNotificationModal.tsx @@ -1,9 +1,11 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { cloudinaryNotificationsBig } from '../../lib/image'; import { Button, ButtonVariant } from '../buttons/Button'; import { Justify } from '../utilities'; -import { Modal, ModalProps } from './common/Modal'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import { NotificationPromptSource } from '../../lib/log'; import { usePushNotificationMutation } from '../../hooks/notifications'; import { useModalContext } from './common/types'; diff --git a/packages/shared/src/components/modals/ReputationAlert.tsx b/packages/shared/src/components/modals/ReputationAlert.tsx index 12cb17aace..ed5028305b 100644 --- a/packages/shared/src/components/modals/ReputationAlert.tsx +++ b/packages/shared/src/components/modals/ReputationAlert.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import Link from '../utilities/Link'; -import Alert, { AlertProps, AlertType } from '../widgets/Alert'; +import type { AlertProps } from '../widgets/Alert'; +import Alert, { AlertType } from '../widgets/Alert'; import { webappUrl } from '../../lib/constants'; export type ReputationAlertProps = Omit; diff --git a/packages/shared/src/components/modals/ReputationPrivilegesModal.tsx b/packages/shared/src/components/modals/ReputationPrivilegesModal.tsx index afbbcc3750..69755c42af 100644 --- a/packages/shared/src/components/modals/ReputationPrivilegesModal.tsx +++ b/packages/shared/src/components/modals/ReputationPrivilegesModal.tsx @@ -1,5 +1,7 @@ -import React, { MouseEvent, ReactElement } from 'react'; -import { Modal, ModalProps } from './common/Modal'; +import type { MouseEvent, ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import { Button, ButtonVariant } from '../buttons/Button'; import { ModalClose } from './common/ModalClose'; import { useActions } from '../../hooks'; diff --git a/packages/shared/src/components/modals/ShareModal.spec.tsx b/packages/shared/src/components/modals/ShareModal.spec.tsx index e65088e8a6..fe67a4e2b6 100644 --- a/packages/shared/src/components/modals/ShareModal.spec.tsx +++ b/packages/shared/src/components/modals/ShareModal.spec.tsx @@ -1,10 +1,5 @@ -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; import React from 'react'; import nock from 'nock'; diff --git a/packages/shared/src/components/modals/ShareModal.tsx b/packages/shared/src/components/modals/ShareModal.tsx index e3b4ea1f00..a7500e22e8 100644 --- a/packages/shared/src/components/modals/ShareModal.tsx +++ b/packages/shared/src/components/modals/ShareModal.tsx @@ -1,12 +1,14 @@ -import React, { ReactElement, useContext, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { useSwipeable } from 'react-swipeable'; import { SocialShare } from '../widgets/SocialShare'; import LogContext from '../../contexts/LogContext'; import { postLogEvent } from '../../lib/feed'; -import { Modal, ModalProps } from './common/Modal'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import { ExperimentWinner } from '../../lib/featureValues'; -import { ShareProps } from './post/common'; -import { Squad } from '../../graphql/sources'; +import type { ShareProps } from './post/common'; +import type { Squad } from '../../graphql/sources'; import { useViewSize, ViewSize } from '../../hooks'; export default function ShareModal({ diff --git a/packages/shared/src/components/modals/SharePostModal.tsx b/packages/shared/src/components/modals/SharePostModal.tsx index fdb9014885..18fee97d4b 100644 --- a/packages/shared/src/components/modals/SharePostModal.tsx +++ b/packages/shared/src/components/modals/SharePostModal.tsx @@ -1,10 +1,13 @@ -import React, { ReactElement } from 'react'; -import { Modal, ModalProps } from './common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import BasePostModal from './BasePostModal'; import { NotificationPromptSource, Origin } from '../../lib/log'; import usePostNavigationPosition from '../../hooks/usePostNavigationPosition'; -import { PassedPostNavigationProps } from '../post/common'; -import { Post, PostType } from '../../graphql/posts'; +import type { PassedPostNavigationProps } from '../post/common'; +import type { Post } from '../../graphql/posts'; +import { PostType } from '../../graphql/posts'; import EnableNotification from '../notifications/EnableNotification'; import { SquadPostContent } from '../post/SquadPostContent'; diff --git a/packages/shared/src/components/modals/SharedBookmarksModal.spec.tsx b/packages/shared/src/components/modals/SharedBookmarksModal.spec.tsx index 1125d58728..174183d28e 100644 --- a/packages/shared/src/components/modals/SharedBookmarksModal.spec.tsx +++ b/packages/shared/src/components/modals/SharedBookmarksModal.spec.tsx @@ -1,8 +1,8 @@ +import type { RenderResult } from '@testing-library/react'; import { fireEvent, queryByText, render, - RenderResult, screen, waitFor, } from '@testing-library/react'; @@ -10,10 +10,8 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React from 'react'; import nock from 'nock'; import SharedBookmarksModal from './SharedBookmarksModal'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '../../../__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '../../../__tests__/helpers/graphql'; +import { mockGraphQL } from '../../../__tests__/helpers/graphql'; import { BOOKMARK_SHARING_MUTATION, BOOKMARK_SHARING_QUERY, diff --git a/packages/shared/src/components/modals/SharedBookmarksModal.tsx b/packages/shared/src/components/modals/SharedBookmarksModal.tsx index 9215aecbb6..1937053263 100644 --- a/packages/shared/src/components/modals/SharedBookmarksModal.tsx +++ b/packages/shared/src/components/modals/SharedBookmarksModal.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { CopyIcon, @@ -9,15 +10,16 @@ import { } from '../icons'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { Switch } from '../fields/Switch'; +import type { BookmarksSharingData } from '../../graphql/bookmarksSharing'; import { BOOKMARK_SHARING_MUTATION, BOOKMARK_SHARING_QUERY, - BookmarksSharingData, } from '../../graphql/bookmarksSharing'; import { TextField } from '../fields/TextField'; import { useCopyLink } from '../../hooks/useCopy'; import { sharingBookmarks } from '../../lib/constants'; -import { Modal, ModalProps } from './common/Modal'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import { IconSize } from '../Icon'; import { gqlClient } from '../../graphql/common'; diff --git a/packages/shared/src/components/modals/SlackIntegrationModal/SlackIntegrationIntroBody.tsx b/packages/shared/src/components/modals/SlackIntegrationModal/SlackIntegrationIntroBody.tsx index 55cafb66d5..d72b6c2bca 100644 --- a/packages/shared/src/components/modals/SlackIntegrationModal/SlackIntegrationIntroBody.tsx +++ b/packages/shared/src/components/modals/SlackIntegrationModal/SlackIntegrationIntroBody.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { slackIntegration } from '../../../lib/constants'; import { Button } from '../../buttons/Button'; import { ButtonVariant, ButtonSize } from '../../buttons/common'; diff --git a/packages/shared/src/components/modals/SlackIntegrationModal/SlackIntegrationModal.tsx b/packages/shared/src/components/modals/SlackIntegrationModal/SlackIntegrationModal.tsx index 214b61b6f1..17e1e9f0d0 100644 --- a/packages/shared/src/components/modals/SlackIntegrationModal/SlackIntegrationModal.tsx +++ b/packages/shared/src/components/modals/SlackIntegrationModal/SlackIntegrationModal.tsx @@ -1,11 +1,13 @@ -import React, { ReactElement, useEffect, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useRef } from 'react'; import classNames from 'classnames'; -import { Modal, ModalProps } from '../common/Modal'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { Dropdown } from '../../fields/Dropdown'; import { ButtonSize, ButtonVariant } from '../../buttons/common'; import { Button } from '../../buttons/Button'; import { useViewSize, ViewSize } from '../../../hooks'; -import { Source } from '../../../graphql/sources'; +import type { Source } from '../../../graphql/sources'; import { SourceAvatar } from '../../profile/source'; import { ProfileImageSize } from '../../ProfilePicture'; import { diff --git a/packages/shared/src/components/modals/SlackIntegrationModal/useSlackIntegrationModal.ts b/packages/shared/src/components/modals/SlackIntegrationModal/useSlackIntegrationModal.ts index 49db81771b..5fc2365d5b 100644 --- a/packages/shared/src/components/modals/SlackIntegrationModal/useSlackIntegrationModal.ts +++ b/packages/shared/src/components/modals/SlackIntegrationModal/useSlackIntegrationModal.ts @@ -1,9 +1,9 @@ import { useCallback, useMemo, useState } from 'react'; -import { +import type { SlackChannel, UserIntegration, - UserIntegrationType, } from '../../../graphql/integrations'; +import { UserIntegrationType } from '../../../graphql/integrations'; import { SourceType } from '../../../graphql/sources'; import { useSlack } from '../../../hooks/integrations/slack/useSlack'; import { LazyModal } from '../common/types'; diff --git a/packages/shared/src/components/modals/SquadMemberModal.tsx b/packages/shared/src/components/modals/SquadMemberModal.tsx index e957805e1c..f3f71441b8 100644 --- a/packages/shared/src/components/modals/SquadMemberModal.tsx +++ b/packages/shared/src/components/modals/SquadMemberModal.tsx @@ -1,11 +1,9 @@ -import React, { ReactElement, useState } from 'react'; -import { Modal, ModalProps } from './common/Modal'; -import { - SourceMember, - SourceMemberRole, - SourcePermissions, - Squad, -} from '../../graphql/sources'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; +import type { SourceMember, Squad } from '../../graphql/sources'; +import { SourceMemberRole, SourcePermissions } from '../../graphql/sources'; import UserListModal from './UserListModal'; import { checkFetchMore } from '../containers/InfiniteScrolling'; import useContextMenu from '../../hooks/useContextMenu'; diff --git a/packages/shared/src/components/modals/SquadTourModal.tsx b/packages/shared/src/components/modals/SquadTourModal.tsx index c219bd0f35..e9a9b74348 100644 --- a/packages/shared/src/components/modals/SquadTourModal.tsx +++ b/packages/shared/src/components/modals/SquadTourModal.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import SquadTour from '../squads/SquadTour'; -import { Modal, ModalProps } from './common/Modal'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import { ButtonSize, ButtonVariant } from '../buttons/Button'; import { useSquadTour } from '../../hooks/useSquadTour'; import { ModalClose } from './common/ModalClose'; diff --git a/packages/shared/src/components/modals/SubmitArticleModal.spec.tsx b/packages/shared/src/components/modals/SubmitArticleModal.spec.tsx index b7cf1c4523..21814050d4 100644 --- a/packages/shared/src/components/modals/SubmitArticleModal.spec.tsx +++ b/packages/shared/src/components/modals/SubmitArticleModal.spec.tsx @@ -1,20 +1,13 @@ -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React from 'react'; import nock from 'nock'; import { AuthContextProvider } from '../../contexts/AuthContext'; -import { AnonymousUser, LoggedUser } from '../../lib/user'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '../../../__tests__/helpers/graphql'; +import type { AnonymousUser, LoggedUser } from '../../lib/user'; +import type { MockedGraphQLResponse } from '../../../__tests__/helpers/graphql'; +import { mockGraphQL } from '../../../__tests__/helpers/graphql'; import { SUBMISSION_AVAILABILITY_QUERY, SUBMIT_ARTICLE_MUTATION, diff --git a/packages/shared/src/components/modals/SubmitArticleModal.tsx b/packages/shared/src/components/modals/SubmitArticleModal.tsx index adc1fc51f1..da4356bce2 100644 --- a/packages/shared/src/components/modals/SubmitArticleModal.tsx +++ b/packages/shared/src/components/modals/SubmitArticleModal.tsx @@ -1,10 +1,5 @@ -import React, { - ReactElement, - useContext, - useEffect, - useRef, - useState, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useRef, useState } from 'react'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { Button, ButtonVariant } from '../buttons/Button'; import { formToJson } from '../../lib/form'; @@ -14,17 +9,18 @@ import { } from '../../lib/constants'; import { TextField } from '../fields/TextField'; import AuthContext from '../../contexts/AuthContext'; +import type { SubmissionAvailability } from '../../graphql/submitArticle'; import { - SubmissionAvailability, SUBMISSION_AVAILABILITY_QUERY, SUBMIT_ARTICLE_MUTATION, } from '../../graphql/submitArticle'; import PostItemCard from '../post/PostItemCard'; -import { PostItem } from '../../graphql/posts'; +import type { PostItem } from '../../graphql/posts'; import LogContext from '../../contexts/LogContext'; import { LinkIcon, LockIcon } from '../icons'; import Alert, { AlertParagraph, AlertType } from '../widgets/Alert'; -import { Modal, ModalProps } from './common/Modal'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import EnableNotification from '../notifications/EnableNotification'; import { LogEvent, diff --git a/packages/shared/src/components/modals/UpvotedPopupModal.spec.tsx b/packages/shared/src/components/modals/UpvotedPopupModal.spec.tsx index b870cfa2bc..dac9980bec 100644 --- a/packages/shared/src/components/modals/UpvotedPopupModal.spec.tsx +++ b/packages/shared/src/components/modals/UpvotedPopupModal.spec.tsx @@ -1,20 +1,17 @@ import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import nock from 'nock'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import AuthContext from '../../contexts/AuthContext'; import { COMMENT_UPVOTES_BY_ID_QUERY } from '../../graphql/comments'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '../../../__tests__/helpers/graphql'; -import { - DEFAULT_UPVOTES_PER_PAGE, - RequestQuery, - UpvotesData, -} from '../../graphql/common'; +import type { MockedGraphQLResponse } from '../../../__tests__/helpers/graphql'; +import { mockGraphQL } from '../../../__tests__/helpers/graphql'; +import type { RequestQuery, UpvotesData } from '../../graphql/common'; +import { DEFAULT_UPVOTES_PER_PAGE } from '../../graphql/common'; import { POST_UPVOTES_BY_ID_QUERY } from '../../graphql/posts'; -import { UpvotedPopupModal, UpvotedPopupModalProps } from './UpvotedPopupModal'; +import type { UpvotedPopupModalProps } from './UpvotedPopupModal'; +import { UpvotedPopupModal } from './UpvotedPopupModal'; import user from '../../../__tests__/fixture/loggedUser'; beforeEach(() => { diff --git a/packages/shared/src/components/modals/UpvotedPopupModal.tsx b/packages/shared/src/components/modals/UpvotedPopupModal.tsx index 6a36723e1d..faad9d04a3 100644 --- a/packages/shared/src/components/modals/UpvotedPopupModal.tsx +++ b/packages/shared/src/components/modals/UpvotedPopupModal.tsx @@ -1,9 +1,10 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useInfiniteQuery } from '@tanstack/react-query'; -import { RequestQuery, UpvotesData } from '../../graphql/common'; +import type { RequestQuery, UpvotesData } from '../../graphql/common'; import { useRequestProtocol } from '../../hooks/useRequestProtocol'; -import { ModalProps } from './common/Modal'; +import type { ModalProps } from './common/Modal'; import { checkFetchMore } from '../containers/InfiniteScrolling'; import UserListModal from './UserListModal'; import { Origin } from '../../lib/log'; diff --git a/packages/shared/src/components/modals/UserFollowersModal.tsx b/packages/shared/src/components/modals/UserFollowersModal.tsx index 5d25fee2fb..c7a405a4dd 100644 --- a/packages/shared/src/components/modals/UserFollowersModal.tsx +++ b/packages/shared/src/components/modals/UserFollowersModal.tsx @@ -1,12 +1,11 @@ -import React, { ReactElement } from 'react'; -import { ModalProps } from './common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from './common/Modal'; import { checkFetchMore } from '../containers/InfiniteScrolling'; import UserListModal from './UserListModal'; -import { - useFollowersQuery, - UseFollowersQueryProps, -} from '../../hooks/contentPreference/useFollowersQuery'; +import type { UseFollowersQueryProps } from '../../hooks/contentPreference/useFollowersQuery'; +import { useFollowersQuery } from '../../hooks/contentPreference/useFollowersQuery'; import { FlexCentered } from '../utilities'; import { Origin } from '../../lib/log'; diff --git a/packages/shared/src/components/modals/UserFollowingModal.tsx b/packages/shared/src/components/modals/UserFollowingModal.tsx index a655ebae90..3a23ad1958 100644 --- a/packages/shared/src/components/modals/UserFollowingModal.tsx +++ b/packages/shared/src/components/modals/UserFollowingModal.tsx @@ -1,10 +1,9 @@ -import React, { ReactElement } from 'react'; -import { ModalProps } from './common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from './common/Modal'; import UserListModal from './UserListModal'; -import { - useFollowingQuery, - UseFollowingQueryProps, -} from '../../hooks/contentPreference/useFollowingQuery'; +import type { UseFollowingQueryProps } from '../../hooks/contentPreference/useFollowingQuery'; +import { useFollowingQuery } from '../../hooks/contentPreference/useFollowingQuery'; import { checkFetchMore } from '../containers/InfiniteScrolling'; import { FlexCentered } from '../utilities'; import { Origin } from '../../lib/log'; diff --git a/packages/shared/src/components/modals/UserListModal.tsx b/packages/shared/src/components/modals/UserListModal.tsx index dc48274c6d..2d2951207e 100644 --- a/packages/shared/src/components/modals/UserListModal.tsx +++ b/packages/shared/src/components/modals/UserListModal.tsx @@ -1,10 +1,13 @@ -import React, { ReactElement, ReactNode, useRef, useState } from 'react'; -import { Modal, ModalProps } from './common/Modal'; -import UserList, { UserListProps } from '../profile/UserList'; -import { InfiniteScrollingProps } from '../containers/InfiniteScrolling'; -import { UserShortProfile } from '../../lib/user'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useRef, useState } from 'react'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; +import type { UserListProps } from '../profile/UserList'; +import UserList from '../profile/UserList'; +import type { InfiniteScrollingProps } from '../containers/InfiniteScrolling'; +import type { UserShortProfile } from '../../lib/user'; import { SearchField } from '../fields/SearchField'; -import { Origin } from '../../lib/log'; +import type { Origin } from '../../lib/log'; export interface UserListModalProps extends Omit { users: UserShortProfile[]; diff --git a/packages/shared/src/components/modals/UserSettingsModal.tsx b/packages/shared/src/components/modals/UserSettingsModal.tsx index f474165421..a7563ba42e 100644 --- a/packages/shared/src/components/modals/UserSettingsModal.tsx +++ b/packages/shared/src/components/modals/UserSettingsModal.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { Modal, ModalProps } from './common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from './common/Modal'; +import { Modal } from './common/Modal'; import Settings from '../Settings'; import { useLogModal } from '../../hooks/useLogModal'; diff --git a/packages/shared/src/components/modals/VideoModal.tsx b/packages/shared/src/components/modals/VideoModal.tsx index 09e3ad6c3d..4b9f3eed03 100644 --- a/packages/shared/src/components/modals/VideoModal.tsx +++ b/packages/shared/src/components/modals/VideoModal.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import type ReactModal from 'react-modal'; import { Modal } from './common/Modal'; import { ModalKind, ModalSize } from './common/types'; diff --git a/packages/shared/src/components/modals/badges/TopReaderBadgeModal.tsx b/packages/shared/src/components/modals/badges/TopReaderBadgeModal.tsx index 68473653d1..b58280e594 100644 --- a/packages/shared/src/components/modals/badges/TopReaderBadgeModal.tsx +++ b/packages/shared/src/components/modals/badges/TopReaderBadgeModal.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement, useCallback } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback } from 'react'; import classNames from 'classnames'; import { useMutation } from '@tanstack/react-query'; -import { Modal, type ModalProps } from '../common/Modal'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { ModalSize } from '../common/types'; import { useAuthContext } from '../../../contexts/AuthContext'; import { TopReaderBadge } from '../../badges/TopReaderBadge'; @@ -10,7 +12,8 @@ import { DownloadIcon } from '../../icons'; import { useViewSize, ViewSize } from '../../../hooks'; import { downloadUrl } from '../../../lib/blob'; import { useLogContext } from '../../../contexts/LogContext'; -import { LogEvent, TargetId, TargetType, type Origin } from '../../../lib/log'; +import type { Origin } from '../../../lib/log'; +import { LogEvent, TargetId, TargetType } from '../../../lib/log'; import { formatDate, TimeFormatType } from '../../../lib/dateFormat'; import { useTopReader } from '../../../hooks/useTopReader'; import { ModalClose } from '../common/ModalClose'; diff --git a/packages/shared/src/components/modals/bookmark/BookmarkFolderModal.tsx b/packages/shared/src/components/modals/bookmark/BookmarkFolderModal.tsx index 524e4fd66e..2a1d02f170 100644 --- a/packages/shared/src/components/modals/bookmark/BookmarkFolderModal.tsx +++ b/packages/shared/src/components/modals/bookmark/BookmarkFolderModal.tsx @@ -1,7 +1,9 @@ -import React, { type FormEvent, type ReactElement, useState } from 'react'; +import type { FormEvent, ReactElement } from 'react'; +import React, { useState } from 'react'; import classNames from 'classnames'; import { usePlusSubscription, useViewSize, ViewSize } from '../../../hooks'; -import { Modal, type ModalProps } from '../common/Modal'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { TextField } from '../../fields/TextField'; import { Typography, @@ -16,7 +18,7 @@ import { anchorDefaultRel } from '../../../lib/strings'; import { LogEvent, TargetId } from '../../../lib/log'; import { IconSize } from '../../Icon'; import { ModalHeader } from '../common/ModalHeader'; -import { BookmarkFolder } from '../../../graphql/bookmarks'; +import type { BookmarkFolder } from '../../../graphql/bookmarks'; type BookmarkFolderModalProps = Omit & { onSubmit: (folder: BookmarkFolder) => void; diff --git a/packages/shared/src/components/modals/bookmark/MoveBookmarkModal.tsx b/packages/shared/src/components/modals/bookmark/MoveBookmarkModal.tsx index 9e190737c9..e2f2121f4b 100644 --- a/packages/shared/src/components/modals/bookmark/MoveBookmarkModal.tsx +++ b/packages/shared/src/components/modals/bookmark/MoveBookmarkModal.tsx @@ -1,5 +1,7 @@ -import React, { type ReactElement } from 'react'; -import { Modal, type ModalProps } from '../common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { ModalHeader } from '../common/ModalHeader'; import { Button, ButtonVariant } from '../../buttons/Button'; import { BookmarkIcon, PlusIcon, VIcon, FolderIcon } from '../../icons'; diff --git a/packages/shared/src/components/modals/common.tsx b/packages/shared/src/components/modals/common.tsx index 11aa798a73..aa1702927c 100644 --- a/packages/shared/src/components/modals/common.tsx +++ b/packages/shared/src/components/modals/common.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; import dynamic from 'next/dynamic'; import { LazyModal } from './common/types'; diff --git a/packages/shared/src/components/modals/common/Modal.tsx b/packages/shared/src/components/modals/common/Modal.tsx index 204aff0640..c88de04c19 100644 --- a/packages/shared/src/components/modals/common/Modal.tsx +++ b/packages/shared/src/components/modals/common/Modal.tsx @@ -1,24 +1,26 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import ReactModal from 'react-modal'; import classNames from 'classnames'; import { ModalHeader } from './ModalHeader'; import { ModalBody } from './ModalBody'; import { ModalFooter } from './ModalFooter'; import { ModalSidebar } from './ModalSidebar'; +import type { ModalStep, ModalTabItem } from './types'; import { ModalKind, ModalPropsContext, ModalSize, - ModalStep, - ModalTabItem, modalTabTitle, } from './types'; import classed from '../../../lib/classed'; import { ModalStepsWrapper } from './ModalStepsWrapper'; -import { LogEvent } from '../../../lib/log'; +import type { LogEvent } from '../../../lib/log'; import { useViewSize, ViewSize } from '../../../hooks'; -import { Drawer, DrawerOnMobileProps } from '../../drawers'; -import { FormWrapper, FormWrapperProps } from '../../fields/form'; +import type { DrawerOnMobileProps } from '../../drawers'; +import { Drawer } from '../../drawers'; +import type { FormWrapperProps } from '../../fields/form'; +import { FormWrapper } from '../../fields/form'; import ConditionalWrapper from '../../ConditionalWrapper'; import { initReactModal, isExtension } from '../../../lib/func'; diff --git a/packages/shared/src/components/modals/common/ModalBody.tsx b/packages/shared/src/components/modals/common/ModalBody.tsx index 6253a3184f..042f8fcb9a 100644 --- a/packages/shared/src/components/modals/common/ModalBody.tsx +++ b/packages/shared/src/components/modals/common/ModalBody.tsx @@ -1,11 +1,6 @@ import classNames from 'classnames'; -import React, { - forwardRef, - MutableRefObject, - ReactElement, - ReactNode, - useContext, -} from 'react'; +import type { MutableRefObject, ReactElement, ReactNode } from 'react'; +import React, { forwardRef, useContext } from 'react'; import { ModalKind, ModalPropsContext, ModalSize } from './types'; export type ModalBodyProps = JSX.IntrinsicElements['section'] & { diff --git a/packages/shared/src/components/modals/common/ModalClose.tsx b/packages/shared/src/components/modals/common/ModalClose.tsx index 615ed7bc21..e68557be86 100644 --- a/packages/shared/src/components/modals/common/ModalClose.tsx +++ b/packages/shared/src/components/modals/common/ModalClose.tsx @@ -1,6 +1,7 @@ -import React, { forwardRef, ReactElement, Ref } from 'react'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; -import { ButtonProps } from '../../buttons/Button'; +import type { ButtonProps } from '../../buttons/Button'; import CloseButton from '../../CloseButton'; import { useModalContext } from './types'; diff --git a/packages/shared/src/components/modals/common/ModalFooter.tsx b/packages/shared/src/components/modals/common/ModalFooter.tsx index 7a28a48796..92e1da74b5 100644 --- a/packages/shared/src/components/modals/common/ModalFooter.tsx +++ b/packages/shared/src/components/modals/common/ModalFooter.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, ReactNode, useContext } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext } from 'react'; import { ModalPropsContext } from './types'; import { Justify } from '../../utilities'; diff --git a/packages/shared/src/components/modals/common/ModalHeader.tsx b/packages/shared/src/components/modals/common/ModalHeader.tsx index 8827f4b8c6..8f6a81cc07 100644 --- a/packages/shared/src/components/modals/common/ModalHeader.tsx +++ b/packages/shared/src/components/modals/common/ModalHeader.tsx @@ -1,15 +1,13 @@ -import React, { ReactElement, ReactNode, useContext } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import classed from '../../../lib/classed'; -import { ModalTabs, ModalTabsProps } from './ModalTabs'; +import type { ModalTabsProps } from './ModalTabs'; +import { ModalTabs } from './ModalTabs'; import { ModalClose } from './ModalClose'; import { ModalHeaderKind, ModalPropsContext } from './types'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from '../../buttons/Button'; +import type { ButtonProps } from '../../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; import { ArrowIcon } from '../../icons'; import { ModalStepsWrapper } from './ModalStepsWrapper'; import { ProgressBar } from '../../fields/ProgressBar'; diff --git a/packages/shared/src/components/modals/common/ModalSidebar.tsx b/packages/shared/src/components/modals/common/ModalSidebar.tsx index 04927fee40..972607d013 100644 --- a/packages/shared/src/components/modals/common/ModalSidebar.tsx +++ b/packages/shared/src/components/modals/common/ModalSidebar.tsx @@ -1,8 +1,10 @@ import classNames from 'classnames'; -import React, { ReactElement, ReactNode, useContext, useState } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useState } from 'react'; import classed from '../../../lib/classed'; import SidebarList from '../../sidebar/SidebarList'; -import { ModalPropsContext, ModalTabItem } from './types'; +import type { ModalTabItem } from './types'; +import { ModalPropsContext } from './types'; export type ModalSidebarProps = { children?: ReactNode; diff --git a/packages/shared/src/components/modals/common/ModalStepsWrapper.tsx b/packages/shared/src/components/modals/common/ModalStepsWrapper.tsx index ad0211ae33..1e1e9cd555 100644 --- a/packages/shared/src/components/modals/common/ModalStepsWrapper.tsx +++ b/packages/shared/src/components/modals/common/ModalStepsWrapper.tsx @@ -1,9 +1,5 @@ -import { - MouseEventHandler, - ReactElement, - ReactEventHandler, - useContext, -} from 'react'; +import type { MouseEventHandler, ReactElement, ReactEventHandler } from 'react'; +import { useContext } from 'react'; import { isNullOrUndefined } from '../../../lib/func'; import { ModalPropsContext } from './types'; import LogContext from '../../../contexts/LogContext'; diff --git a/packages/shared/src/components/modals/common/ModalTabs.tsx b/packages/shared/src/components/modals/common/ModalTabs.tsx index 026aa6bf0a..078c6a93f8 100644 --- a/packages/shared/src/components/modals/common/ModalTabs.tsx +++ b/packages/shared/src/components/modals/common/ModalTabs.tsx @@ -1,6 +1,8 @@ import classNames from 'classnames'; -import React, { ReactElement, useContext } from 'react'; -import { ModalPropsContext, ModalTabItem, modalTabTitle } from './types'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; +import type { ModalTabItem } from './types'; +import { ModalPropsContext, modalTabTitle } from './types'; export type ModalTabsProps = { className?: string; diff --git a/packages/shared/src/components/modals/common/types.ts b/packages/shared/src/components/modals/common/types.ts index 45d8e59f0b..f5e9f32c70 100644 --- a/packages/shared/src/components/modals/common/types.ts +++ b/packages/shared/src/components/modals/common/types.ts @@ -1,11 +1,6 @@ -import { - KeyboardEvent, - MouseEvent, - createContext, - ReactNode, - useContext, -} from 'react'; -import { LogEvent } from '../../../lib/log'; +import type { KeyboardEvent, MouseEvent, ReactNode } from 'react'; +import { createContext, useContext } from 'react'; +import type { LogEvent } from '../../../lib/log'; export enum ModalHeaderKind { Primary = 'primary', diff --git a/packages/shared/src/components/modals/feed/AddToCustomFeedModal.tsx b/packages/shared/src/components/modals/feed/AddToCustomFeedModal.tsx index 411c5bc536..e329b92af9 100644 --- a/packages/shared/src/components/modals/feed/AddToCustomFeedModal.tsx +++ b/packages/shared/src/components/modals/feed/AddToCustomFeedModal.tsx @@ -1,5 +1,7 @@ -import React, { type ReactElement } from 'react'; -import { Modal, type ModalProps } from '../common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { ModalHeader } from '../common/ModalHeader'; import { Button, ButtonVariant } from '../../buttons/Button'; import { PlusIcon, HashtagIcon } from '../../icons'; diff --git a/packages/shared/src/components/modals/generic/common.ts b/packages/shared/src/components/modals/generic/common.ts index 236f412294..aadef45927 100644 --- a/packages/shared/src/components/modals/generic/common.ts +++ b/packages/shared/src/components/modals/generic/common.ts @@ -1,6 +1,7 @@ import { cloudinaryStreakMigrate } from '../../../lib/image'; import { migrateUserToStreaks } from '../../../lib/constants'; -import { MarketingCta, MarketingCtaVariant } from '../../marketingCta/common'; +import type { MarketingCta } from '../../marketingCta/common'; +import { MarketingCtaVariant } from '../../marketingCta/common'; export const promotion: Record = { migrateStreaks: { diff --git a/packages/shared/src/components/modals/post/BookmarkReminderModal.tsx b/packages/shared/src/components/modals/post/BookmarkReminderModal.tsx index f468b47efd..77df1cc896 100644 --- a/packages/shared/src/components/modals/post/BookmarkReminderModal.tsx +++ b/packages/shared/src/components/modals/post/BookmarkReminderModal.tsx @@ -1,6 +1,8 @@ -import React, { FormEventHandler, ReactElement, useState } from 'react'; +import type { FormEventHandler, ReactElement } from 'react'; +import React, { useState } from 'react'; import { format } from 'date-fns'; -import { LazyModalCommonProps, Modal } from '../common/Modal'; +import type { LazyModalCommonProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { ModalHeader } from '../common/ModalHeader'; import { ModalBody } from '../common/ModalBody'; import { ModalSize } from '../common/types'; @@ -10,8 +12,9 @@ import { ReminderPreference, useBookmarkReminder, } from '../../../hooks/notifications'; -import { Post } from '../../../graphql/posts'; -import { ActiveFeedContext, ActiveFeedContextValue } from '../../../contexts'; +import type { Post } from '../../../graphql/posts'; +import type { ActiveFeedContextValue } from '../../../contexts'; +import { ActiveFeedContext } from '../../../contexts'; import ConditionalWrapper from '../../ConditionalWrapper'; export interface BookmarkReminderProps extends LazyModalCommonProps { diff --git a/packages/shared/src/components/modals/post/CommentModal.tsx b/packages/shared/src/components/modals/post/CommentModal.tsx index 8609f04248..298ca3e32a 100644 --- a/packages/shared/src/components/modals/post/CommentModal.tsx +++ b/packages/shared/src/components/modals/post/CommentModal.tsx @@ -1,22 +1,22 @@ +import type { ReactElement } from 'react'; import React, { - ReactElement, useCallback, useLayoutEffect, useMemo, useRef, useState, } from 'react'; -import { QueryClient, useQueryClient } from '@tanstack/react-query'; +import type { QueryClient } from '@tanstack/react-query'; +import { useQueryClient } from '@tanstack/react-query'; import classNames from 'classnames'; -import { Modal, LazyModalCommonProps } from '../common/Modal'; +import type { LazyModalCommonProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { FormWrapper } from '../../fields/form'; -import { - CommentMarkdownInput, - CommentMarkdownInputProps, -} from '../../fields/MarkdownInput/CommentMarkdownInput'; +import type { CommentMarkdownInputProps } from '../../fields/MarkdownInput/CommentMarkdownInput'; +import { CommentMarkdownInput } from '../../fields/MarkdownInput/CommentMarkdownInput'; import { useMutateComment } from '../../../hooks/post/useMutateComment'; import { useVisualViewport } from '../../../hooks/utils/useVisualViewport'; -import { Comment, PostCommentsData } from '../../../graphql/comments'; +import type { Comment, PostCommentsData } from '../../../graphql/comments'; import { useNotificationToggle } from '../../../hooks/notifications'; import { NotificationPromptSource } from '../../../lib/log'; import { Switch } from '../../fields/Switch'; diff --git a/packages/shared/src/components/modals/post/CreateSharedPostModal.tsx b/packages/shared/src/components/modals/post/CreateSharedPostModal.tsx index 638ad8f5f1..1f1092686b 100644 --- a/packages/shared/src/components/modals/post/CreateSharedPostModal.tsx +++ b/packages/shared/src/components/modals/post/CreateSharedPostModal.tsx @@ -1,7 +1,10 @@ -import React, { FormEventHandler, ReactElement, useRef, useState } from 'react'; -import { Modal, ModalProps } from '../common/Modal'; -import { ExternalLinkPreview } from '../../../graphql/posts'; -import MarkdownInput, { MarkdownRef } from '../../fields/MarkdownInput'; +import type { FormEventHandler, ReactElement } from 'react'; +import React, { useRef, useState } from 'react'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; +import type { ExternalLinkPreview } from '../../../graphql/posts'; +import type { MarkdownRef } from '../../fields/MarkdownInput'; +import MarkdownInput from '../../fields/MarkdownInput'; import { WriteLinkPreview, WritePreviewSkeleton } from '../../post/write'; import { usePostToSquad } from '../../../hooks'; import { @@ -13,7 +16,7 @@ import { import { AtIcon } from '../../icons'; import { Divider, Justify } from '../../utilities'; import SourceButton from '../../cards/common/SourceButton'; -import { Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; import { formToJson } from '../../../lib/form'; import { useDebouncedUrl } from '../../../hooks/input'; import { useNotificationToggle } from '../../../hooks/notifications'; diff --git a/packages/shared/src/components/modals/post/ReadingHistoryModal.tsx b/packages/shared/src/components/modals/post/ReadingHistoryModal.tsx index fbca8fc791..7635717369 100644 --- a/packages/shared/src/components/modals/post/ReadingHistoryModal.tsx +++ b/packages/shared/src/components/modals/post/ReadingHistoryModal.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement } from 'react'; -import { Modal, ModalProps } from '../common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { InfiniteReadingHistory } from '../../post/infinite'; -import { PostItem } from '../../../graphql/posts'; +import type { PostItem } from '../../../graphql/posts'; import { usePublicReadingHistory } from '../../../hooks/post'; import { ReadingHistoryTitle } from './ReadingHistoryTitle'; import ReadingHistoryPlaceholder from '../../history/ReadingHistoryPlaceholder'; diff --git a/packages/shared/src/components/modals/post/ReadingHistoryTitle.tsx b/packages/shared/src/components/modals/post/ReadingHistoryTitle.tsx index fd3f302f82..1c9d5b60c8 100644 --- a/packages/shared/src/components/modals/post/ReadingHistoryTitle.tsx +++ b/packages/shared/src/components/modals/post/ReadingHistoryTitle.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { SquadTitle, SquadTitleColor } from '../../squads/utils'; interface ReadingHistoryTitleProps { diff --git a/packages/shared/src/components/modals/post/common.ts b/packages/shared/src/components/modals/post/common.ts index 9e0f1ae2a8..050d64e5cf 100644 --- a/packages/shared/src/components/modals/post/common.ts +++ b/packages/shared/src/components/modals/post/common.ts @@ -1,7 +1,7 @@ -import { FeedItemPosition } from '../../../lib/feed'; -import { Post } from '../../../graphql/posts'; -import { Comment } from '../../../graphql/comments'; -import { Origin } from '../../../lib/log'; +import type { FeedItemPosition } from '../../../lib/feed'; +import type { Post } from '../../../graphql/posts'; +import type { Comment } from '../../../graphql/comments'; +import type { Origin } from '../../../lib/log'; export interface ShareProps extends FeedItemPosition { post: Post; diff --git a/packages/shared/src/components/modals/referral/GenericReferralModal.tsx b/packages/shared/src/components/modals/referral/GenericReferralModal.tsx index 97254942e2..62b16afbcb 100644 --- a/packages/shared/src/components/modals/referral/GenericReferralModal.tsx +++ b/packages/shared/src/components/modals/referral/GenericReferralModal.tsx @@ -1,11 +1,7 @@ -import React, { - ReactElement, - useContext, - useEffect, - useRef, - useState, -} from 'react'; -import { Modal, ModalProps } from '../common/Modal'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useRef, useState } from 'react'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { cloudinaryReferralCampaignGenericHappy, cloudinaryReferralCampaignGenericSad, diff --git a/packages/shared/src/components/modals/report/ReasonSelectionModal.tsx b/packages/shared/src/components/modals/report/ReasonSelectionModal.tsx index 7382a5a5a5..471d827c4a 100644 --- a/packages/shared/src/components/modals/report/ReasonSelectionModal.tsx +++ b/packages/shared/src/components/modals/report/ReasonSelectionModal.tsx @@ -1,11 +1,14 @@ -import React, { ReactElement, ReactNode, useState } from 'react'; -import { Radio, RadioItemProps } from '../../fields/Radio'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useState } from 'react'; +import type { RadioItemProps } from '../../fields/Radio'; +import { Radio } from '../../fields/Radio'; import { Button, ButtonVariant } from '../../buttons/Button'; -import { Modal, ModalProps } from '../common/Modal'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { Justify } from '../../utilities'; import { useViewSize, ViewSize } from '../../../hooks'; import { ReportReason } from '../../../report'; -import { PostModerationReason } from '../../../graphql/squads'; +import type { PostModerationReason } from '../../../graphql/squads'; interface Props extends ModalProps { diff --git a/packages/shared/src/components/modals/report/ReportComentModal.spec.tsx b/packages/shared/src/components/modals/report/ReportComentModal.spec.tsx index ecb0a07ce8..bd66d714b5 100644 --- a/packages/shared/src/components/modals/report/ReportComentModal.spec.tsx +++ b/packages/shared/src/components/modals/report/ReportComentModal.spec.tsx @@ -1,10 +1,5 @@ -import { - render, - RenderResult, - screen, - waitFor, - fireEvent, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor, fireEvent } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React, { act } from 'react'; import nock from 'nock'; diff --git a/packages/shared/src/components/modals/report/ReportCommentModal.tsx b/packages/shared/src/components/modals/report/ReportCommentModal.tsx index f1ec87daef..04535bd712 100644 --- a/packages/shared/src/components/modals/report/ReportCommentModal.tsx +++ b/packages/shared/src/components/modals/report/ReportCommentModal.tsx @@ -1,12 +1,13 @@ -import React, { ReactElement } from 'react'; -import { ModalProps } from '../common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from '../common/Modal'; import { ReasonSelectionModal } from './ReasonSelectionModal'; import useReportComment from '../../../hooks/useReportComment'; -import { Comment } from '../../../graphql/comments'; +import type { Comment } from '../../../graphql/comments'; import { useLogContext } from '../../../contexts/LogContext'; import { postLogEvent } from '../../../lib/feed'; -import { Post } from '../../../graphql/posts'; -import { PostBootData } from '../../../lib/boot'; +import type { Post } from '../../../graphql/posts'; +import type { PostBootData } from '../../../lib/boot'; import { LogEvent } from '../../../lib/log'; import { ReportReason } from '../../../report'; diff --git a/packages/shared/src/components/modals/report/ReportPostModal.tsx b/packages/shared/src/components/modals/report/ReportPostModal.tsx index ae39afbef4..facd2b3305 100644 --- a/packages/shared/src/components/modals/report/ReportPostModal.tsx +++ b/packages/shared/src/components/modals/report/ReportPostModal.tsx @@ -1,22 +1,15 @@ -import React, { - ReactElement, - MouseEvent, - useState, - useRef, - SetStateAction, - Dispatch, - useCallback, -} from 'react'; -import { RadioItemProps } from '../../fields/Radio'; -import { Post, ReadHistoryPost } from '../../../graphql/posts'; +import type { ReactElement, MouseEvent, SetStateAction, Dispatch } from 'react'; +import React, { useState, useRef, useCallback } from 'react'; +import type { RadioItemProps } from '../../fields/Radio'; +import type { Post, ReadHistoryPost } from '../../../graphql/posts'; import { Checkbox } from '../../fields/Checkbox'; import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; -import { PostBootData } from '../../../lib/boot'; -import { ModalProps } from '../common/Modal'; +import type { PostBootData } from '../../../lib/boot'; +import type { ModalProps } from '../common/Modal'; import { FlexRow } from '../../utilities'; import useReportPost from '../../../hooks/useReportPost'; import { postLogEvent } from '../../../lib/feed'; -import { Origin } from '../../../lib/log'; +import type { Origin } from '../../../lib/log'; import { useLogContext } from '../../../contexts/LogContext'; import { ReasonSelectionModal } from './ReasonSelectionModal'; import { ReportReason } from '../../../report'; diff --git a/packages/shared/src/components/modals/report/ReportSourceModal.tsx b/packages/shared/src/components/modals/report/ReportSourceModal.tsx index a26ba84802..666b1b77d3 100644 --- a/packages/shared/src/components/modals/report/ReportSourceModal.tsx +++ b/packages/shared/src/components/modals/report/ReportSourceModal.tsx @@ -1,11 +1,12 @@ -import React, { ReactElement, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useRef } from 'react'; import { useMutation } from '@tanstack/react-query'; import { Checkbox } from '../../fields/Checkbox'; -import { ModalProps } from '../common/Modal'; +import type { ModalProps } from '../common/Modal'; import { useLogContext } from '../../../contexts/LogContext'; import { ReasonSelectionModal } from './ReasonSelectionModal'; import { ReportReason, sendSourceReport } from '../../../report'; -import { Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; import { useLeaveSquad, useToastNotification } from '../../../hooks'; import { useAuthContext } from '../../../contexts/AuthContext'; import { LogEvent } from '../../../lib/log'; diff --git a/packages/shared/src/components/modals/soon/AdvancedCustomFeedSoonModal.tsx b/packages/shared/src/components/modals/soon/AdvancedCustomFeedSoonModal.tsx index f863582151..7c60072bd7 100644 --- a/packages/shared/src/components/modals/soon/AdvancedCustomFeedSoonModal.tsx +++ b/packages/shared/src/components/modals/soon/AdvancedCustomFeedSoonModal.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { Modal, ModalProps } from '../common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { ModalClose } from '../common/ModalClose'; import { ButtonSize, ButtonVariant } from '../../buttons/common'; import { Image } from '../../image/Image'; diff --git a/packages/shared/src/components/modals/soon/BookmarkFolderSoonModal.tsx b/packages/shared/src/components/modals/soon/BookmarkFolderSoonModal.tsx index 6ae04f784e..41acd55d9a 100644 --- a/packages/shared/src/components/modals/soon/BookmarkFolderSoonModal.tsx +++ b/packages/shared/src/components/modals/soon/BookmarkFolderSoonModal.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { Modal, ModalProps } from '../common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { usePlusSubscription } from '../../../hooks/usePlusSubscription'; import { ModalClose } from '../common/ModalClose'; import { ButtonSize, ButtonVariant } from '../../buttons/common'; diff --git a/packages/shared/src/components/modals/squads/NewSquadModal.tsx b/packages/shared/src/components/modals/squads/NewSquadModal.tsx index b098b2a88a..8903a4e455 100644 --- a/packages/shared/src/components/modals/squads/NewSquadModal.tsx +++ b/packages/shared/src/components/modals/squads/NewSquadModal.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement, useCallback } from 'react'; -import { Modal, ModalProps } from '../common/Modal'; +import type { ReactElement } from 'react'; +import React, { useCallback } from 'react'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { ModalSize } from '../common/types'; import { Button, ButtonVariant } from '../../buttons/Button'; import { useSquadNavigation } from '../../../hooks'; diff --git a/packages/shared/src/components/modals/squads/PostModerationModal.tsx b/packages/shared/src/components/modals/squads/PostModerationModal.tsx index 7de258879a..ceaa950341 100644 --- a/packages/shared/src/components/modals/squads/PostModerationModal.tsx +++ b/packages/shared/src/components/modals/squads/PostModerationModal.tsx @@ -1,20 +1,21 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import Link from 'next/link'; -import { Modal, ModalProps } from '../common/Modal'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { Typography, TypographyTag, TypographyType, } from '../../typography/Typography'; -import { - SourcePostModeration, - verifyPermission, -} from '../../../graphql/squads'; +import type { SourcePostModeration } from '../../../graphql/squads'; +import { verifyPermission } from '../../../graphql/squads'; import { SquadModerationActions } from '../../squads/moderation/SquadModerationActions'; import PostSourceInfo from '../../post/PostSourceInfo'; import SquadPostAuthor from '../../post/SquadPostAuthor'; import { CommonSharePostContent } from '../../post/SharePostContent'; -import { SourcePermissions, Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; +import { SourcePermissions } from '../../../graphql/sources'; import { Origin } from '../../../lib/log'; import { useReadArticle } from '../../../hooks/usePostContent'; import { SharePostTitle } from '../../post/share'; diff --git a/packages/shared/src/components/modals/squads/PrivilegedMembersModal.tsx b/packages/shared/src/components/modals/squads/PrivilegedMembersModal.tsx index b734c1fd26..75df585813 100644 --- a/packages/shared/src/components/modals/squads/PrivilegedMembersModal.tsx +++ b/packages/shared/src/components/modals/squads/PrivilegedMembersModal.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import Link from '../../utilities/Link'; -import { Modal, ModalProps } from '../common/Modal'; -import { Source } from '../../../graphql/sources'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; +import type { Source } from '../../../graphql/sources'; import { UserShortInfo } from '../../profile/UserShortInfo'; import SquadMemberBadge from '../../squads/SquadMemberBadge'; import { Origin } from '../../../lib/log'; diff --git a/packages/shared/src/components/modals/squads/SquadNotificationsModal.tsx b/packages/shared/src/components/modals/squads/SquadNotificationsModal.tsx index 98de9968ef..7c8375a01d 100644 --- a/packages/shared/src/components/modals/squads/SquadNotificationsModal.tsx +++ b/packages/shared/src/components/modals/squads/SquadNotificationsModal.tsx @@ -1,11 +1,14 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import { useQueryClient } from '@tanstack/react-query'; -import { Modal, ModalProps } from '../common/Modal'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { checkHasStatusPreference, useNotificationPreference, } from '../../../hooks/notifications'; -import { SourceMemberRole, Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; +import { SourceMemberRole } from '../../../graphql/sources'; import { Switch } from '../../fields/Switch'; import { NotificationType } from '../../notifications/utils'; import { generateQueryKey, RequestKey } from '../../../lib/query'; diff --git a/packages/shared/src/components/modals/squads/SquadPromotionModal.tsx b/packages/shared/src/components/modals/squads/SquadPromotionModal.tsx index a789d19222..0bfd1b219f 100644 --- a/packages/shared/src/components/modals/squads/SquadPromotionModal.tsx +++ b/packages/shared/src/components/modals/squads/SquadPromotionModal.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { Modal, ModalProps } from '../common/Modal'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; import { ButtonSize, ButtonVariant } from '../../buttons/Button'; import PromotionTour from '../../squads/PromotionTour'; import { useSquad } from '../../../hooks'; diff --git a/packages/shared/src/components/modals/streaks/NewStreakModal.tsx b/packages/shared/src/components/modals/streaks/NewStreakModal.tsx index 844f1d8321..7b90c287cb 100644 --- a/packages/shared/src/components/modals/streaks/NewStreakModal.tsx +++ b/packages/shared/src/components/modals/streaks/NewStreakModal.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useRef } from 'react'; import classNames from 'classnames'; import { useQueryClient } from '@tanstack/react-query'; import { Modal } from '../common/Modal'; @@ -9,7 +10,7 @@ import { cloudinaryStreakSplash, cloudinaryStreakFire, } from '../../../lib/image'; -import { StreakModalProps } from './common'; +import type { StreakModalProps } from './common'; import { useLogContext } from '../../../contexts/LogContext'; import { LogEvent, TargetType } from '../../../lib/log'; import { generateQueryKey, RequestKey } from '../../../lib/query'; diff --git a/packages/shared/src/components/modals/streaks/StreakRecoverModal.spec.tsx b/packages/shared/src/components/modals/streaks/StreakRecoverModal.spec.tsx index e5097be402..62b0e4be8a 100644 --- a/packages/shared/src/components/modals/streaks/StreakRecoverModal.spec.tsx +++ b/packages/shared/src/components/modals/streaks/StreakRecoverModal.spec.tsx @@ -5,13 +5,14 @@ import { subDays } from 'date-fns'; import { TestBootProvider } from '../../../../__tests__/helpers/boot'; import type { LoggedUser } from '../../../lib/user'; import loggedUser from '../../../../__tests__/fixture/loggedUser'; -import { Alerts, UPDATE_ALERTS } from '../../../graphql/alerts'; +import type { Alerts } from '../../../graphql/alerts'; +import { UPDATE_ALERTS } from '../../../graphql/alerts'; import { BootPopups } from '../BootPopups'; import { waitForNock } from '../../../../__tests__/helpers/utilities'; +import type { UserStreakRecoverData } from '../../../graphql/users'; import { USER_STREAK_RECOVER_MUTATION, USER_STREAK_RECOVER_QUERY, - UserStreakRecoverData, } from '../../../graphql/users'; import { mockGraphQL } from '../../../../__tests__/helpers/graphql'; import * as actionHook from '../../../hooks/useActions'; diff --git a/packages/shared/src/components/modals/streaks/StreakRecoverModal.tsx b/packages/shared/src/components/modals/streaks/StreakRecoverModal.tsx index bcdeaec8a5..aa21ffe4c8 100644 --- a/packages/shared/src/components/modals/streaks/StreakRecoverModal.tsx +++ b/packages/shared/src/components/modals/streaks/StreakRecoverModal.tsx @@ -1,27 +1,23 @@ -import React, { ReactElement, useId } from 'react'; +import type { ReactElement } from 'react'; +import React, { useId } from 'react'; import { ModalSize } from '../common/types'; import { ModalBody } from '../common/ModalBody'; -import { Modal, ModalProps } from '../common/Modal'; -import { LoggedUser } from '../../../lib/user'; +import type { ModalProps } from '../common/Modal'; +import { Modal } from '../common/Modal'; +import type { LoggedUser } from '../../../lib/user'; import { Typography, TypographyTag, TypographyType, } from '../../typography/Typography'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from '../../buttons/Button'; +import type { ButtonProps } from '../../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; import { anchorDefaultRel } from '../../../lib/strings'; import { reputation as reputationHref } from '../../../lib/constants'; import { ReputationIcon } from '../../icons'; import { IconSize } from '../../Icon'; -import { - useStreakRecover, - UseStreakRecoverReturn, -} from '../../../hooks/streaks/useStreakRecover'; +import type { UseStreakRecoverReturn } from '../../../hooks/streaks/useStreakRecover'; +import { useStreakRecover } from '../../../hooks/streaks/useStreakRecover'; import { Checkbox } from '../../fields/Checkbox'; import { ModalClose } from '../common/ModalClose'; import { cloudinaryStreakLost } from '../../../lib/image'; diff --git a/packages/shared/src/components/modals/streaks/common.ts b/packages/shared/src/components/modals/streaks/common.ts index 1f621b317a..31e291821f 100644 --- a/packages/shared/src/components/modals/streaks/common.ts +++ b/packages/shared/src/components/modals/streaks/common.ts @@ -1,5 +1,5 @@ -import { UserStreak } from '../../../graphql/users'; -import { LazyModalCommonProps } from '../common/Modal'; +import type { UserStreak } from '../../../graphql/users'; +import type { LazyModalCommonProps } from '../common/Modal'; export interface StreakModalProps extends LazyModalCommonProps { currentStreak: UserStreak['current']; diff --git a/packages/shared/src/components/multiLevelMenu/MultiLevelMenu.tsx b/packages/shared/src/components/multiLevelMenu/MultiLevelMenu.tsx index e76fab5312..e189ee227a 100644 --- a/packages/shared/src/components/multiLevelMenu/MultiLevelMenu.tsx +++ b/packages/shared/src/components/multiLevelMenu/MultiLevelMenu.tsx @@ -1,5 +1,6 @@ -import React, { useState, ReactElement } from 'react'; -import { MenuItem } from '../filters/common'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; +import type { MenuItem } from '../filters/common'; import MultiLevelMenuDetail from './MultiLevelMenuDetail'; import MultiLevelMenuMaster from './MultiLevelMenuMaster'; diff --git a/packages/shared/src/components/multiLevelMenu/MultiLevelMenuDetail.tsx b/packages/shared/src/components/multiLevelMenu/MultiLevelMenuDetail.tsx index 4ae3764c2b..f588115466 100644 --- a/packages/shared/src/components/multiLevelMenu/MultiLevelMenuDetail.tsx +++ b/packages/shared/src/components/multiLevelMenu/MultiLevelMenuDetail.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { Button } from '../buttons/Button'; import { ArrowIcon } from '../icons'; -import { MenuItem } from '../filters/common'; +import type { MenuItem } from '../filters/common'; export default function MultiLevelMenuDetail({ children, diff --git a/packages/shared/src/components/multiLevelMenu/MultiLevelMenuMaster.tsx b/packages/shared/src/components/multiLevelMenu/MultiLevelMenuMaster.tsx index 12500cba1e..063f2b1e45 100644 --- a/packages/shared/src/components/multiLevelMenu/MultiLevelMenuMaster.tsx +++ b/packages/shared/src/components/multiLevelMenu/MultiLevelMenuMaster.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ArrowIcon } from '../icons'; import classed from '../../lib/classed'; -import { MenuItem } from '../filters/common'; +import type { MenuItem } from '../filters/common'; export const menuItemClassNames = 'flex items-center py-3 px-4 w-full'; diff --git a/packages/shared/src/components/notifications/EnableNotification.tsx b/packages/shared/src/components/notifications/EnableNotification.tsx index 47611e4975..973f3847f7 100644 --- a/packages/shared/src/components/notifications/EnableNotification.tsx +++ b/packages/shared/src/components/notifications/EnableNotification.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Button, diff --git a/packages/shared/src/components/notifications/FirstNotification.tsx b/packages/shared/src/components/notifications/FirstNotification.tsx index 20a962e2bc..85b693379e 100644 --- a/packages/shared/src/components/notifications/FirstNotification.tsx +++ b/packages/shared/src/components/notifications/FirstNotification.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; import usePersistentContext from '../../hooks/usePersistentContext'; import { firstNotificationLink } from '../../lib/constants'; import NotificationItem from './NotificationItem'; diff --git a/packages/shared/src/components/notifications/InAppNotification.tsx b/packages/shared/src/components/notifications/InAppNotification.tsx index c0a18f8adc..1775e1f1e3 100644 --- a/packages/shared/src/components/notifications/InAppNotification.tsx +++ b/packages/shared/src/components/notifications/InAppNotification.tsx @@ -1,10 +1,11 @@ -import React, { ReactElement, useCallback, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import { useRouter } from 'next/router'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import classNames from 'classnames'; +import type { InAppNotification } from '../../hooks/useInAppNotification'; import { IN_APP_NOTIFICATION_KEY, - InAppNotification, useInAppNotification, } from '../../hooks/useInAppNotification'; import classed from '../../lib/classed'; diff --git a/packages/shared/src/components/notifications/InAppNotificationItem.tsx b/packages/shared/src/components/notifications/InAppNotificationItem.tsx index 21de469450..a361a4a8fb 100644 --- a/packages/shared/src/components/notifications/InAppNotificationItem.tsx +++ b/packages/shared/src/components/notifications/InAppNotificationItem.tsx @@ -1,11 +1,12 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { useObjectPurify } from '../../hooks/useDomPurify'; import classed from '../../lib/classed'; import NotificationItemIcon from './NotificationIcon'; import NotificationItemAvatar from './NotificationItemAvatar'; import styles from './InAppNotification.module.css'; -import { NewNotification } from '../../graphql/notifications'; +import type { NewNotification } from '../../graphql/notifications'; const NotificationLink = classed( 'a', diff --git a/packages/shared/src/components/notifications/NotificationIcon.tsx b/packages/shared/src/components/notifications/NotificationIcon.tsx index a9bb6e1a44..60a5152fb7 100644 --- a/packages/shared/src/components/notifications/NotificationIcon.tsx +++ b/packages/shared/src/components/notifications/NotificationIcon.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { notificationIcon, NotificationIconType, diff --git a/packages/shared/src/components/notifications/NotificationItem.spec.tsx b/packages/shared/src/components/notifications/NotificationItem.spec.tsx index a3c6526a62..5bc51b27ef 100644 --- a/packages/shared/src/components/notifications/NotificationItem.spec.tsx +++ b/packages/shared/src/components/notifications/NotificationItem.spec.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; -import NotificationItem, { NotificationItemProps } from './NotificationItem'; +import type { NotificationItemProps } from './NotificationItem'; +import NotificationItem from './NotificationItem'; import { NotificationAttachmentType, NotificationAvatarType, diff --git a/packages/shared/src/components/notifications/NotificationItem.tsx b/packages/shared/src/components/notifications/NotificationItem.tsx index 5694f8ca80..3d2348ece1 100644 --- a/packages/shared/src/components/notifications/NotificationItem.tsx +++ b/packages/shared/src/components/notifications/NotificationItem.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; import Link from '../utilities/Link'; -import { Notification } from '../../graphql/notifications'; +import type { Notification } from '../../graphql/notifications'; import { useObjectPurify } from '../../hooks/useDomPurify'; import NotificationItemIcon from './NotificationIcon'; import NotificationItemAttachment from './NotificationItemAttachment'; diff --git a/packages/shared/src/components/notifications/NotificationItemAttachment.tsx b/packages/shared/src/components/notifications/NotificationItemAttachment.tsx index 0721495227..6c69ec5488 100644 --- a/packages/shared/src/components/notifications/NotificationItemAttachment.tsx +++ b/packages/shared/src/components/notifications/NotificationItemAttachment.tsx @@ -1,8 +1,7 @@ -import React, { ReactElement } from 'react'; -import { - NotificationAttachment, - NotificationAttachmentType, -} from '../../graphql/notifications'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NotificationAttachment } from '../../graphql/notifications'; +import { NotificationAttachmentType } from '../../graphql/notifications'; import { IconSize } from '../Icon'; import { CardCover } from '../cards/common/CardCover'; diff --git a/packages/shared/src/components/notifications/NotificationItemAvatar.tsx b/packages/shared/src/components/notifications/NotificationItemAvatar.tsx index 6006031d44..54bc07676e 100644 --- a/packages/shared/src/components/notifications/NotificationItemAvatar.tsx +++ b/packages/shared/src/components/notifications/NotificationItemAvatar.tsx @@ -1,8 +1,7 @@ -import React, { ReactElement } from 'react'; -import { - NotificationAvatar, - NotificationAvatarType, -} from '../../graphql/notifications'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NotificationAvatar } from '../../graphql/notifications'; +import { NotificationAvatarType } from '../../graphql/notifications'; import SourceButton from '../cards/common/SourceButton'; import { ProfileTooltip } from '../profile/ProfileTooltip'; import { ProfileImageLink } from '../profile/ProfileImageLink'; diff --git a/packages/shared/src/components/notifications/NotificationsBell.tsx b/packages/shared/src/components/notifications/NotificationsBell.tsx index 957ef8b17b..7d2b1c006a 100644 --- a/packages/shared/src/components/notifications/NotificationsBell.tsx +++ b/packages/shared/src/components/notifications/NotificationsBell.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import { Button, ButtonVariant } from '../buttons/Button'; import { BellIcon } from '../icons'; diff --git a/packages/shared/src/components/notifications/Toast.tsx b/packages/shared/src/components/notifications/Toast.tsx index dc8edefe37..9968275722 100644 --- a/packages/shared/src/components/notifications/Toast.tsx +++ b/packages/shared/src/components/notifications/Toast.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement, useEffect, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useRef } from 'react'; import { useRouter } from 'next/router'; import { useQuery, useQueryClient } from '@tanstack/react-query'; -import { TOAST_NOTIF_KEY, ToastNotification } from '../../hooks'; +import type { ToastNotification } from '../../hooks'; +import { TOAST_NOTIF_KEY } from '../../hooks'; import classed from '../../lib/classed'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import styles from './Toast.module.css'; diff --git a/packages/shared/src/components/notifications/utils.ts b/packages/shared/src/components/notifications/utils.ts index de441ac4c6..df5fae942e 100644 --- a/packages/shared/src/components/notifications/utils.ts +++ b/packages/shared/src/components/notifications/utils.ts @@ -1,6 +1,6 @@ -import { ComponentType } from 'react'; +import type { ComponentType } from 'react'; import classed from '../../lib/classed'; -import { IconProps } from '../Icon'; +import type { IconProps } from '../Icon'; import { BellIcon, CommunityPicksIcon, @@ -15,7 +15,7 @@ import { ReadingStreakIcon, TimerIcon, } from '../icons'; -import { NotificationPromptSource } from '../../lib/log'; +import type { NotificationPromptSource } from '../../lib/log'; import { BookmarkReminderIcon } from '../icons/Bookmark/Reminder'; export const NotifContainer = classed( diff --git a/packages/shared/src/components/onboarding/ContentTypes/ContentTypes.tsx b/packages/shared/src/components/onboarding/ContentTypes/ContentTypes.tsx index f4131b2a47..470fc2ca8d 100644 --- a/packages/shared/src/components/onboarding/ContentTypes/ContentTypes.tsx +++ b/packages/shared/src/components/onboarding/ContentTypes/ContentTypes.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import useFeedSettings from '../../../hooks/useFeedSettings'; import { useAdvancedSettings } from '../../../hooks'; diff --git a/packages/shared/src/components/onboarding/ContentTypes/helpers.ts b/packages/shared/src/components/onboarding/ContentTypes/helpers.ts index ba47ecb69f..2d747fc6a3 100644 --- a/packages/shared/src/components/onboarding/ContentTypes/helpers.ts +++ b/packages/shared/src/components/onboarding/ContentTypes/helpers.ts @@ -1,10 +1,10 @@ -import { AdvancedSettings } from '../../../graphql/feedSettings'; +import type { AdvancedSettings } from '../../../graphql/feedSettings'; import { getContentCurationList, getContentSourceList, getVideoSetting, } from '../../filters/helpers'; -import { Source } from '../../../graphql/sources'; +import type { Source } from '../../../graphql/sources'; interface GetContentTypeNotEmptyProps { advancedSettings: AdvancedSettings[]; diff --git a/packages/shared/src/components/onboarding/CreateFeedButton.tsx b/packages/shared/src/components/onboarding/CreateFeedButton.tsx index 21d153d6e5..28cb8e2320 100644 --- a/packages/shared/src/components/onboarding/CreateFeedButton.tsx +++ b/packages/shared/src/components/onboarding/CreateFeedButton.tsx @@ -1,6 +1,8 @@ -import React, { HTMLAttributes, ReactElement } from 'react'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React from 'react'; import useFeedSettings from '../../hooks/useFeedSettings'; -import { Button, ButtonElementType, ButtonVariant } from '../buttons/Button'; +import type { ButtonElementType } from '../buttons/Button'; +import { Button, ButtonVariant } from '../buttons/Button'; import { SimpleTooltip } from '../tooltips'; import { isTesting } from '../../lib/constants'; import useSidebarRendered from '../../hooks/useSidebarRendered'; diff --git a/packages/shared/src/components/onboarding/EditTag.tsx b/packages/shared/src/components/onboarding/EditTag.tsx index 2de781d0a0..17e5ae53a4 100644 --- a/packages/shared/src/components/onboarding/EditTag.tsx +++ b/packages/shared/src/components/onboarding/EditTag.tsx @@ -1,11 +1,13 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { FeedPreviewControls } from '../feeds'; -import { OnboardingStep, REQUIRED_TAGS_THRESHOLD } from './common'; +import type { OnboardingStep } from './common'; +import { REQUIRED_TAGS_THRESHOLD } from './common'; import { Origin } from '../../lib/log'; import Feed from '../Feed'; import { OtherFeedPage, RequestKey } from '../../lib/query'; import { PREVIEW_FEED_QUERY } from '../../graphql/feed'; -import { FeedSettings } from '../../graphql/feedSettings'; +import type { FeedSettings } from '../../graphql/feedSettings'; import { CreateFeedButton } from './CreateFeedButton'; import { TagSelection } from '../tags/TagSelection'; import { FeedLayoutProvider } from '../../contexts/FeedContext'; diff --git a/packages/shared/src/components/onboarding/Extension/OnboardingExtension.tsx b/packages/shared/src/components/onboarding/Extension/OnboardingExtension.tsx index 6bc3a9534b..73f8e7b6b1 100644 --- a/packages/shared/src/components/onboarding/Extension/OnboardingExtension.tsx +++ b/packages/shared/src/components/onboarding/Extension/OnboardingExtension.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Typography, TypographyColor, diff --git a/packages/shared/src/components/onboarding/FilterOnboarding.tsx b/packages/shared/src/components/onboarding/FilterOnboarding.tsx index 8b9a0cf8d5..cbd8e4acc0 100644 --- a/packages/shared/src/components/onboarding/FilterOnboarding.tsx +++ b/packages/shared/src/components/onboarding/FilterOnboarding.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import classNames from 'classnames'; -import FeedTopicCard, { ButtonEvent } from '../containers/FeedTopicCard'; +import type { ButtonEvent } from '../containers/FeedTopicCard'; +import FeedTopicCard from '../containers/FeedTopicCard'; import useTagAndSource from '../../hooks/useTagAndSource'; import useFeedSettings from '../../hooks/useFeedSettings'; import { Origin } from '../../lib/log'; diff --git a/packages/shared/src/components/onboarding/MemberAlready.tsx b/packages/shared/src/components/onboarding/MemberAlready.tsx index cfd6ac7b16..b8516adab9 100644 --- a/packages/shared/src/components/onboarding/MemberAlready.tsx +++ b/packages/shared/src/components/onboarding/MemberAlready.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ClickableText } from '../buttons/ClickableText'; diff --git a/packages/shared/src/components/onboarding/OnboardingAndroidApp.tsx b/packages/shared/src/components/onboarding/OnboardingAndroidApp.tsx index 00090e629f..263cb9f18c 100644 --- a/packages/shared/src/components/onboarding/OnboardingAndroidApp.tsx +++ b/packages/shared/src/components/onboarding/OnboardingAndroidApp.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Button, ButtonVariant } from '../buttons/Button'; import { Image } from '../image/Image'; import { cloudinaryAndroidApp } from '../../lib/image'; diff --git a/packages/shared/src/components/onboarding/OnboardingFooter.tsx b/packages/shared/src/components/onboarding/OnboardingFooter.tsx index afb34225c9..910c3d0f53 100644 --- a/packages/shared/src/components/onboarding/OnboardingFooter.tsx +++ b/packages/shared/src/components/onboarding/OnboardingFooter.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { wrapperMaxWidth } from './common'; import SignupDisclaimer from '../auth/SignupDisclaimer'; diff --git a/packages/shared/src/components/onboarding/OnboardingHeader.tsx b/packages/shared/src/components/onboarding/OnboardingHeader.tsx index a168bd9e48..a019f77b99 100644 --- a/packages/shared/src/components/onboarding/OnboardingHeader.tsx +++ b/packages/shared/src/components/onboarding/OnboardingHeader.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { Dispatch, ReactElement, SetStateAction, useId } from 'react'; +import type { Dispatch, ReactElement, SetStateAction } from 'react'; +import React, { useId } from 'react'; import { useViewSize, ViewSize } from '../../hooks'; import { cloudinaryFeedBgLaptop, @@ -7,7 +8,8 @@ import { cloudinaryFeedBgTablet, } from '../../lib/image'; import Logo, { LogoPosition } from '../Logo'; -import { AuthDisplay, AuthProps } from '../auth/AuthOptions'; +import type { AuthProps } from '../auth/AuthOptions'; +import { AuthDisplay } from '../auth/AuthOptions'; import { Button, ButtonVariant } from '../buttons/Button'; import { CreateFeedButton } from './CreateFeedButton'; import { OnboardingStep, wrapperMaxWidth } from './common'; diff --git a/packages/shared/src/components/onboarding/OnboardingPWA.tsx b/packages/shared/src/components/onboarding/OnboardingPWA.tsx index cd1a767722..b9364880e0 100644 --- a/packages/shared/src/components/onboarding/OnboardingPWA.tsx +++ b/packages/shared/src/components/onboarding/OnboardingPWA.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { OnboardingTitle } from './common'; import { cloudinaryPWA, cloudinaryPWAVideo } from '../../lib/image'; import { Typography } from '../typography/Typography'; diff --git a/packages/shared/src/components/onboarding/OnboardingPlusStep.tsx b/packages/shared/src/components/onboarding/OnboardingPlusStep.tsx index 3dc326db7b..ed1b7fc824 100644 --- a/packages/shared/src/components/onboarding/OnboardingPlusStep.tsx +++ b/packages/shared/src/components/onboarding/OnboardingPlusStep.tsx @@ -1,10 +1,9 @@ -import React, { ReactElement, useMemo, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo, useState } from 'react'; import classNames from 'classnames'; import { useViewSize, ViewSize } from '../../hooks'; -import { - ProductOption, - usePaymentContext, -} from '../../contexts/PaymentContext'; +import type { ProductOption } from '../../contexts/PaymentContext'; +import { usePaymentContext } from '../../contexts/PaymentContext'; import { Typography, TypographyColor, diff --git a/packages/shared/src/components/onboarding/OnboardingStep.tsx b/packages/shared/src/components/onboarding/OnboardingStep.tsx index a85a0f24f0..38b1bdad20 100644 --- a/packages/shared/src/components/onboarding/OnboardingStep.tsx +++ b/packages/shared/src/components/onboarding/OnboardingStep.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { Modal } from '../modals/common/Modal'; import { OnboardingTitle } from './common'; diff --git a/packages/shared/src/components/onboarding/ReadingReminder.tsx b/packages/shared/src/components/onboarding/ReadingReminder.tsx index edbd3399a7..3840502ea3 100644 --- a/packages/shared/src/components/onboarding/ReadingReminder.tsx +++ b/packages/shared/src/components/onboarding/ReadingReminder.tsx @@ -1,10 +1,5 @@ -import React, { - ReactElement, - useContext, - useEffect, - useRef, - useState, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useRef, useState } from 'react'; import { ClickableText } from '../buttons/ClickableText'; import { Radio } from '../fields/Radio'; import Alert, { AlertParagraph, AlertType } from '../widgets/Alert'; diff --git a/packages/shared/src/components/pagination/PaginationActions.tsx b/packages/shared/src/components/pagination/PaginationActions.tsx index 38dea7c07c..12d3acc732 100644 --- a/packages/shared/src/components/pagination/PaginationActions.tsx +++ b/packages/shared/src/components/pagination/PaginationActions.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ArrowIcon } from '../icons'; -import { UsePagination } from '../../hooks/utils'; +import type { UsePagination } from '../../hooks/utils'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; export type ExtendedPaginationProps = Pick< diff --git a/packages/shared/src/components/plus/ClickbaitTrial.tsx b/packages/shared/src/components/plus/ClickbaitTrial.tsx index 37ddb933ad..30ac12626e 100644 --- a/packages/shared/src/components/plus/ClickbaitTrial.tsx +++ b/packages/shared/src/components/plus/ClickbaitTrial.tsx @@ -1,4 +1,5 @@ -import React, { useState, type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { PlusUser } from '../PlusUser'; import CloseButton from '../CloseButton'; import { ButtonSize, ButtonVariant } from '../buttons/common'; diff --git a/packages/shared/src/components/plus/PlusComparingCards.tsx b/packages/shared/src/components/plus/PlusComparingCards.tsx index bf4e636305..06fb672365 100644 --- a/packages/shared/src/components/plus/PlusComparingCards.tsx +++ b/packages/shared/src/components/plus/PlusComparingCards.tsx @@ -1,9 +1,10 @@ -import React, { ReactElement, useId } from 'react'; -import { +import type { ReactElement } from 'react'; +import React, { useId } from 'react'; +import type { PaymentContextData, ProductOption, - usePaymentContext, } from '../../contexts/PaymentContext'; +import { usePaymentContext } from '../../contexts/PaymentContext'; import { Typography, TypographyColor, diff --git a/packages/shared/src/components/plus/PlusDesktop.tsx b/packages/shared/src/components/plus/PlusDesktop.tsx index d61e49f36c..42bce48f2b 100644 --- a/packages/shared/src/components/plus/PlusDesktop.tsx +++ b/packages/shared/src/components/plus/PlusDesktop.tsx @@ -1,10 +1,5 @@ -import React, { - type ReactElement, - useCallback, - useEffect, - useRef, - useState, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; import { useRouter } from 'next/router'; import { usePaymentContext } from '../../contexts/PaymentContext'; diff --git a/packages/shared/src/components/plus/PlusInfo.tsx b/packages/shared/src/components/plus/PlusInfo.tsx index a733149dab..496a6f7d6e 100644 --- a/packages/shared/src/components/plus/PlusInfo.tsx +++ b/packages/shared/src/components/plus/PlusInfo.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { PlusUser } from '../PlusUser'; import { IconSize } from '../Icon'; @@ -10,10 +11,8 @@ import { } from '../typography/Typography'; import { RadioItem } from '../fields/RadioItem'; import { PlusList } from './PlusList'; -import { - ProductOption, - usePaymentContext, -} from '../../contexts/PaymentContext'; +import type { ProductOption } from '../../contexts/PaymentContext'; +import { usePaymentContext } from '../../contexts/PaymentContext'; import { Button, ButtonColor, diff --git a/packages/shared/src/components/plus/PlusList.tsx b/packages/shared/src/components/plus/PlusList.tsx index 674b8399ab..818b0ac9ca 100644 --- a/packages/shared/src/components/plus/PlusList.tsx +++ b/packages/shared/src/components/plus/PlusList.tsx @@ -1,12 +1,9 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import classNames from 'classnames'; -import { WithClassNameProps } from '../utilities'; -import { - PlusItem, - PlusItemStatus, - PlusListItem, - PlusListItemProps, -} from './PlusListItem'; +import type { WithClassNameProps } from '../utilities'; +import type { PlusItem, PlusListItemProps } from './PlusListItem'; +import { PlusItemStatus, PlusListItem } from './PlusListItem'; import { usePaymentContext } from '../../contexts/PaymentContext'; export const defaultFeatureList: Array = [ diff --git a/packages/shared/src/components/plus/PlusListItem.tsx b/packages/shared/src/components/plus/PlusListItem.tsx index c2b61cf30b..29e6c80117 100644 --- a/packages/shared/src/components/plus/PlusListItem.tsx +++ b/packages/shared/src/components/plus/PlusListItem.tsx @@ -1,13 +1,15 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import ConditionalWrapper from '../ConditionalWrapper'; import { SimpleTooltip } from '../tooltips'; import { ChecklistAIcon, InfoIcon } from '../icons'; -import { IconProps, IconSize } from '../Icon'; +import type { IconProps } from '../Icon'; +import { IconSize } from '../Icon'; +import type { TypographyProps } from '../typography/Typography'; import { Typography, TypographyColor, - TypographyProps, TypographyTag, TypographyType, } from '../typography/Typography'; diff --git a/packages/shared/src/components/plus/PlusMobile.tsx b/packages/shared/src/components/plus/PlusMobile.tsx index c100292201..ed82b3204e 100644 --- a/packages/shared/src/components/plus/PlusMobile.tsx +++ b/packages/shared/src/components/plus/PlusMobile.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useCallback, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useState } from 'react'; import { useRouter } from 'next/router'; import { PlusInfo } from './PlusInfo'; import { usePaymentContext } from '../../contexts/PaymentContext'; diff --git a/packages/shared/src/components/post/AuthorOnboarding.tsx b/packages/shared/src/components/post/AuthorOnboarding.tsx index 2994f44630..d1d1dd4c5b 100644 --- a/packages/shared/src/components/post/AuthorOnboarding.tsx +++ b/packages/shared/src/components/post/AuthorOnboarding.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ownershipGuide } from '../../lib/constants'; import { FeatherIcon } from '../icons'; diff --git a/packages/shared/src/components/post/BasePostContent.tsx b/packages/shared/src/components/post/BasePostContent.tsx index 1738018e38..265c203b55 100644 --- a/packages/shared/src/components/post/BasePostContent.tsx +++ b/packages/shared/src/components/post/BasePostContent.tsx @@ -1,8 +1,9 @@ import dynamic from 'next/dynamic'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import PostEngagements from './PostEngagements'; -import { BasePostContentProps } from './common'; +import type { BasePostContentProps } from './common'; import { PostHeaderActions } from './PostHeaderActions'; import PostNavigation from './PostNavigation'; diff --git a/packages/shared/src/components/post/FixedPostNavigation.tsx b/packages/shared/src/components/post/FixedPostNavigation.tsx index 3b22219fa3..ef71fd31d4 100644 --- a/packages/shared/src/components/post/FixedPostNavigation.tsx +++ b/packages/shared/src/components/post/FixedPostNavigation.tsx @@ -1,7 +1,8 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import PostNavigation from './PostNavigation'; -import { PostNavigationProps } from './common'; +import type { PostNavigationProps } from './common'; import { useSmartTitle } from '../../hooks/post/useSmartTitle'; function FixedPostNavigation({ diff --git a/packages/shared/src/components/post/GoBackHeaderMobile.tsx b/packages/shared/src/components/post/GoBackHeaderMobile.tsx index d27e754647..c5f69911f6 100644 --- a/packages/shared/src/components/post/GoBackHeaderMobile.tsx +++ b/packages/shared/src/components/post/GoBackHeaderMobile.tsx @@ -1,9 +1,10 @@ -import React, { PropsWithChildren, ReactElement, useCallback } from 'react'; +import type { PropsWithChildren, ReactElement } from 'react'; +import React, { useCallback } from 'react'; import { useRouter } from 'next/router'; import classNames from 'classnames'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { ArrowIcon } from '../icons'; -import { WithClassNameProps } from '../utilities'; +import type { WithClassNameProps } from '../utilities'; import { isDevelopment } from '../../lib/constants'; import Logo, { LogoPosition } from '../Logo'; import { useFeatureTheme } from '../../hooks/utils/useFeatureTheme'; diff --git a/packages/shared/src/components/post/MarkdownPostContent.tsx b/packages/shared/src/components/post/MarkdownPostContent.tsx index 1dd42f5528..425804652a 100644 --- a/packages/shared/src/components/post/MarkdownPostContent.tsx +++ b/packages/shared/src/components/post/MarkdownPostContent.tsx @@ -1,9 +1,12 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import Link from '../utilities/Link'; -import { Post, PostType } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; +import { PostType } from '../../graphql/posts'; import Markdown from '../Markdown'; -import { LazyImage, LazyImageProps } from '../LazyImage'; +import type { LazyImageProps } from '../LazyImage'; +import { LazyImage } from '../LazyImage'; import { cloudinaryPostImageCoverPlaceholder } from '../../lib/image'; import { useSmartTitle } from '../../hooks/post/useSmartTitle'; import { PostClickbaitShield } from './common/PostClickbaitShield'; diff --git a/packages/shared/src/components/post/NewComment.tsx b/packages/shared/src/components/post/NewComment.tsx index 2945c638a5..e6e2653007 100644 --- a/packages/shared/src/components/post/NewComment.tsx +++ b/packages/shared/src/components/post/NewComment.tsx @@ -1,7 +1,6 @@ +import type { MutableRefObject, ReactElement } from 'react'; import React, { forwardRef, - MutableRefObject, - ReactElement, useCallback, useEffect, useImperativeHandle, @@ -18,7 +17,7 @@ import { import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { Image } from '../image/Image'; import { fallbackImages } from '../../lib/config'; -import { CommentMarkdownInputProps } from '../fields/MarkdownInput/CommentMarkdownInput'; +import type { CommentMarkdownInputProps } from '../fields/MarkdownInput/CommentMarkdownInput'; import { useAuthContext } from '../../contexts/AuthContext'; import { useLogContext } from '../../contexts/LogContext'; import { postLogEvent } from '../../lib/feed'; diff --git a/packages/shared/src/components/post/PostActions.tsx b/packages/shared/src/components/post/PostActions.tsx index 1d3c3c6f03..e30a12eba2 100644 --- a/packages/shared/src/components/post/PostActions.tsx +++ b/packages/shared/src/components/post/PostActions.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { QueryKey } from '@tanstack/react-query'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { QueryKey } from '@tanstack/react-query'; import classNames from 'classnames'; import { UpvoteIcon, @@ -7,9 +8,10 @@ import { DownvoteIcon, LinkIcon, } from '../icons'; -import { Post, UserVote } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; +import { UserVote } from '../../graphql/posts'; import { QuaternaryButton } from '../buttons/QuaternaryButton'; -import { PostOrigin } from '../../hooks/log/useLogContextData'; +import type { PostOrigin } from '../../hooks/log/useLogContextData'; import { useVotePost } from '../../hooks'; import { Origin } from '../../lib/log'; import { Card } from '../cards/common/Card'; diff --git a/packages/shared/src/components/post/PostCodeSnippets.tsx b/packages/shared/src/components/post/PostCodeSnippets.tsx index ebfa5e2e66..94238ffba1 100644 --- a/packages/shared/src/components/post/PostCodeSnippets.tsx +++ b/packages/shared/src/components/post/PostCodeSnippets.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext, useMemo, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo, useState } from 'react'; import classNames from 'classnames'; import { usePostCodeSnippetsQuery } from '../../hooks/post/usePostCodeSnippets'; import { RenderMarkdown } from '../RenderMarkdown'; diff --git a/packages/shared/src/components/post/PostComments.tsx b/packages/shared/src/components/post/PostComments.tsx index 370e173c0a..362446f0a0 100644 --- a/packages/shared/src/components/post/PostComments.tsx +++ b/packages/shared/src/components/post/PostComments.tsx @@ -1,25 +1,21 @@ -import React, { - ReactElement, - useContext, - useEffect, - useRef, - useState, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useRef, useState } from 'react'; import { useQuery } from '@tanstack/react-query'; import AuthContext from '../../contexts/AuthContext'; -import { +import type { Comment, - POST_COMMENTS_QUERY, PostCommentsData, SortCommentsBy, } from '../../graphql/comments'; -import { Post } from '../../graphql/posts'; -import MainComment, { MainCommentProps } from '../comments/MainComment'; +import { POST_COMMENTS_QUERY } from '../../graphql/comments'; +import type { Post } from '../../graphql/posts'; +import type { MainCommentProps } from '../comments/MainComment'; +import MainComment from '../comments/MainComment'; import PlaceholderCommentList from '../comments/PlaceholderCommentList'; import { useRequestProtocol } from '../../hooks/useRequestProtocol'; import { initialDataKey } from '../../lib/constants'; -import { Origin } from '../../lib/log'; -import { CommentClassName } from '../fields/MarkdownInput/CommentMarkdownInput'; +import type { Origin } from '../../lib/log'; +import type { CommentClassName } from '../fields/MarkdownInput/CommentMarkdownInput'; import { useDeleteComment } from '../../hooks/comments/useDeleteComment'; import { lazyCommentThreshold } from '../utilities'; import { isNullOrUndefined } from '../../lib/func'; diff --git a/packages/shared/src/components/post/PostContent.tsx b/packages/shared/src/components/post/PostContent.tsx index c3ca0359f7..b0141a9139 100644 --- a/packages/shared/src/components/post/PostContent.tsx +++ b/packages/shared/src/components/post/PostContent.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ComponentProps, ReactElement, useEffect } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; +import React, { useEffect } from 'react'; import dynamic from 'next/dynamic'; import { isVideoPost } from '../../graphql/posts'; import PostMetadata from '../cards/common/PostMetadata'; @@ -12,7 +13,8 @@ import PostContentContainer from './PostContentContainer'; import usePostContent from '../../hooks/usePostContent'; import { BasePostContent } from './BasePostContent'; import { combinedClicks } from '../../lib/click'; -import { PostContainer, PostContentProps, PostNavigationProps } from './common'; +import type { PostContentProps, PostNavigationProps } from './common'; +import { PostContainer } from './common'; import YoutubeVideo from '../video/YoutubeVideo'; import { useAuthContext } from '../../contexts/AuthContext'; import { useViewPost } from '../../hooks/post'; diff --git a/packages/shared/src/components/post/PostContentContainer.tsx b/packages/shared/src/components/post/PostContentContainer.tsx index 9aa3679007..886ade9c83 100644 --- a/packages/shared/src/components/post/PostContentContainer.tsx +++ b/packages/shared/src/components/post/PostContentContainer.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classed from '../../lib/classed'; import FixedPostNavigation from './FixedPostNavigation'; -import { PostNavigationProps } from './common'; +import type { PostNavigationProps } from './common'; import ConditionalWrapper from '../ConditionalWrapper'; import { useViewSize, ViewSize } from '../../hooks'; diff --git a/packages/shared/src/components/post/PostEngagements.tsx b/packages/shared/src/components/post/PostEngagements.tsx index 92a8750e89..2b4b12309d 100644 --- a/packages/shared/src/components/post/PostEngagements.tsx +++ b/packages/shared/src/components/post/PostEngagements.tsx @@ -1,16 +1,19 @@ import dynamic from 'next/dynamic'; -import React, { ReactElement, useEffect, useRef, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { useAuthContext } from '../../contexts/AuthContext'; -import { Post } from '../../graphql/posts'; -import { PostOrigin } from '../../hooks/log/useLogContextData'; +import type { Post } from '../../graphql/posts'; +import type { PostOrigin } from '../../hooks/log/useLogContextData'; import { useShareComment } from '../../hooks/useShareComment'; import { useUpvoteQuery } from '../../hooks/useUpvoteQuery'; import { AuthTriggers } from '../../lib/auth'; -import { NewComment, NewCommentRef } from './NewComment'; +import type { NewCommentRef } from './NewComment'; +import { NewComment } from './NewComment'; import { PostActions } from './PostActions'; import { PostComments } from './PostComments'; import { PostUpvotesCommentsCount } from './PostUpvotesCommentsCount'; -import { Comment, SortCommentsBy } from '../../graphql/comments'; +import type { Comment } from '../../graphql/comments'; +import { SortCommentsBy } from '../../graphql/comments'; import { Origin } from '../../lib/log'; import { isSourcePublicSquad, diff --git a/packages/shared/src/components/post/PostHeaderActions.tsx b/packages/shared/src/components/post/PostHeaderActions.tsx index 28109e1747..90e834cff2 100644 --- a/packages/shared/src/components/post/PostHeaderActions.tsx +++ b/packages/shared/src/components/post/PostHeaderActions.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useCallback, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useContext } from 'react'; import classNames from 'classnames'; import { OpenLinkIcon } from '../icons'; import { @@ -10,7 +11,7 @@ import classed from '../../lib/classed'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import SettingsContext from '../../contexts/SettingsContext'; -import { PostHeaderActionsProps } from './common'; +import type { PostHeaderActionsProps } from './common'; import { PostMenuOptions } from './PostMenuOptions'; import { Origin } from '../../lib/log'; import { CollectionSubscribeButton } from './collection/CollectionSubscribeButton'; diff --git a/packages/shared/src/components/post/PostItemCard.tsx b/packages/shared/src/components/post/PostItemCard.tsx index 5a9d9fbecc..68af1f7694 100644 --- a/packages/shared/src/components/post/PostItemCard.tsx +++ b/packages/shared/src/components/post/PostItemCard.tsx @@ -1,8 +1,10 @@ -import React, { MouseEvent, ReactElement } from 'react'; +import type { MouseEvent, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import Link from '../utilities/Link'; -import { HidePostItemCardProps } from '../../graphql/users'; -import { PostItem, UserVote, isVideoPost } from '../../graphql/posts'; +import type { HidePostItemCardProps } from '../../graphql/users'; +import type { PostItem } from '../../graphql/posts'; +import { UserVote, isVideoPost } from '../../graphql/posts'; import { MiniCloseIcon as XIcon, MenuIcon, diff --git a/packages/shared/src/components/post/PostLoadingPlaceholder.tsx b/packages/shared/src/components/post/PostLoadingPlaceholder.tsx index d144836276..d8925dc928 100644 --- a/packages/shared/src/components/post/PostLoadingPlaceholder.tsx +++ b/packages/shared/src/components/post/PostLoadingPlaceholder.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { UserItemPlaceholder } from '../widgets/UserItemPlaceholder'; import { PageWidgets } from '../utilities'; import { diff --git a/packages/shared/src/components/post/PostLoadingSkeleton.tsx b/packages/shared/src/components/post/PostLoadingSkeleton.tsx index b4aa3b0c78..1f9e2a8b49 100644 --- a/packages/shared/src/components/post/PostLoadingSkeleton.tsx +++ b/packages/shared/src/components/post/PostLoadingSkeleton.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { PostType } from '../../graphql/posts'; +import type { PostType } from '../../graphql/posts'; import { PostLoadingPlaceholder } from './PostLoadingPlaceholder'; import PostContentContainer from './PostContentContainer'; diff --git a/packages/shared/src/components/post/PostMenuOptions.tsx b/packages/shared/src/components/post/PostMenuOptions.tsx index 4336713a1d..0a45df6c8a 100644 --- a/packages/shared/src/components/post/PostMenuOptions.tsx +++ b/packages/shared/src/components/post/PostMenuOptions.tsx @@ -1,24 +1,25 @@ -import React, { +import type { KeyboardEventHandler, MouseEventHandler, ReactElement, - useCallback, - useContext, } from 'react'; +import React, { useCallback, useContext } from 'react'; import { MenuIcon, MiniCloseIcon as CloseIcon } from '../icons'; import { Roles } from '../../lib/user'; import AuthContext from '../../contexts/AuthContext'; +import type { Post } from '../../graphql/posts'; import { banPost, clickbaitPost, demotePost, - Post, promotePost, } from '../../graphql/posts'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; -import PostOptionsMenu, { PostOptionsMenuProps } from '../PostOptionsMenu'; -import { PromptOptions, usePrompt } from '../../hooks/usePrompt'; -import { Origin } from '../../lib/log'; +import type { PostOptionsMenuProps } from '../PostOptionsMenu'; +import PostOptionsMenu from '../PostOptionsMenu'; +import type { PromptOptions } from '../../hooks/usePrompt'; +import { usePrompt } from '../../hooks/usePrompt'; +import type { Origin } from '../../lib/log'; import useContextMenu from '../../hooks/useContextMenu'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; diff --git a/packages/shared/src/components/post/PostNavigation.tsx b/packages/shared/src/components/post/PostNavigation.tsx index d767a65dbd..0001f717a8 100644 --- a/packages/shared/src/components/post/PostNavigation.tsx +++ b/packages/shared/src/components/post/PostNavigation.tsx @@ -1,11 +1,12 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Button, ButtonVariant } from '../buttons/Button'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; import { ArrowIcon } from '../icons'; import { PostHeaderActions } from './PostHeaderActions'; import { PostPosition } from '../../hooks/usePostModalNavigation'; -import { PostNavigationProps } from './common'; +import type { PostNavigationProps } from './common'; function PostNavigation({ postPosition, diff --git a/packages/shared/src/components/post/PostPreview.tsx b/packages/shared/src/components/post/PostPreview.tsx index 3d6d393acb..4a9323e4c2 100644 --- a/packages/shared/src/components/post/PostPreview.tsx +++ b/packages/shared/src/components/post/PostPreview.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Image } from '../image/Image'; import { cloudinaryPostImageCoverPlaceholder } from '../../lib/image'; @@ -6,7 +7,7 @@ import { OpenLinkIcon } from '../icons'; import { ElementPlaceholder } from '../ElementPlaceholder'; import classed from '../../lib/classed'; import { IconSize } from '../Icon'; -import { ExternalLinkPreview } from '../../graphql/posts'; +import type { ExternalLinkPreview } from '../../graphql/posts'; interface PostPreviewProps { preview: Partial; diff --git a/packages/shared/src/components/post/PostSourceInfo.tsx b/packages/shared/src/components/post/PostSourceInfo.tsx index e45f820359..784c395b99 100644 --- a/packages/shared/src/components/post/PostSourceInfo.tsx +++ b/packages/shared/src/components/post/PostSourceInfo.tsx @@ -1,7 +1,8 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import Link from 'next/link'; -import { Source } from '../../graphql/sources'; +import type { Source } from '../../graphql/sources'; import { Separator } from '../cards/common/common'; import SourceButton from '../cards/common/SourceButton'; import { ProfileImageSize } from '../ProfilePicture'; diff --git a/packages/shared/src/components/post/PostUpvotesCommentsCount.tsx b/packages/shared/src/components/post/PostUpvotesCommentsCount.tsx index d44f4ebf05..11092525fc 100644 --- a/packages/shared/src/components/post/PostUpvotesCommentsCount.tsx +++ b/packages/shared/src/components/post/PostUpvotesCommentsCount.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { Post } from '../../graphql/posts'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Post } from '../../graphql/posts'; import { ClickableText } from '../buttons/ClickableText'; import { largeNumberFormat } from '../../lib'; diff --git a/packages/shared/src/components/post/PostWidgets.tsx b/packages/shared/src/components/post/PostWidgets.tsx index db9a6c0cce..7c627b48cc 100644 --- a/packages/shared/src/components/post/PostWidgets.tsx +++ b/packages/shared/src/components/post/PostWidgets.tsx @@ -1,12 +1,14 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { PageWidgets } from '../utilities'; -import { ShareMobile, ShareMobileProps } from '../ShareMobile'; +import type { ShareMobileProps } from '../ShareMobile'; +import { ShareMobile } from '../ShareMobile'; import AuthContext from '../../contexts/AuthContext'; import ShareBar from '../ShareBar'; import FurtherReading from '../widgets/FurtherReading'; import { PostUsersHighlights } from '../widgets/PostUsersHighlights'; import { PostHeaderActions } from './PostHeaderActions'; -import { PostHeaderActionsProps } from './common'; +import type { PostHeaderActionsProps } from './common'; import { FooterLinks } from '../footer'; export type PostWidgetsProps = Omit & diff --git a/packages/shared/src/components/post/RelatedPostsWidget.tsx b/packages/shared/src/components/post/RelatedPostsWidget.tsx index dbf244e2f1..40a7c56dc8 100644 --- a/packages/shared/src/components/post/RelatedPostsWidget.tsx +++ b/packages/shared/src/components/post/RelatedPostsWidget.tsx @@ -1,13 +1,11 @@ -import React, { ReactElement, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useState } from 'react'; import classNames from 'classnames'; import { widgetClasses } from '../widgets/common'; import { InfinitePaginationActions } from '../pagination'; import { ElementPlaceholder } from '../ElementPlaceholder'; -import { - Post, - PostRelationType, - RELATED_POSTS_PER_PAGE_DEFAULT, -} from '../../graphql/posts'; +import type { Post, PostRelationType } from '../../graphql/posts'; +import { RELATED_POSTS_PER_PAGE_DEFAULT } from '../../graphql/posts'; import { SourceAvatar } from '../profile/source'; import PostMetadata from '../cards/common/PostMetadata'; import { CardLink } from '../cards/common/Card'; diff --git a/packages/shared/src/components/post/SharePostContent.tsx b/packages/shared/src/components/post/SharePostContent.tsx index 8ded2fd225..8642fc9f8d 100644 --- a/packages/shared/src/components/post/SharePostContent.tsx +++ b/packages/shared/src/components/post/SharePostContent.tsx @@ -1,9 +1,9 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import PostSourceInfo from './PostSourceInfo'; import { ReadArticleButton } from '../cards/common/ReadArticleButton'; +import type { Post, SharedPost } from '../../graphql/posts'; import { - Post, - SharedPost, getReadPostButtonText, isInternalReadType, isSharedPostSquadPost, diff --git a/packages/shared/src/components/post/ShareYouTubeContent.tsx b/packages/shared/src/components/post/ShareYouTubeContent.tsx index ae7ce55b19..6834b55c20 100644 --- a/packages/shared/src/components/post/ShareYouTubeContent.tsx +++ b/packages/shared/src/components/post/ShareYouTubeContent.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import PostSourceInfo from './PostSourceInfo'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import { SharePostTitle } from './share'; import { SharedLinkContainer } from './common/SharedLinkContainer'; import { SharedPostLink } from './common/SharedPostLink'; diff --git a/packages/shared/src/components/post/SquadPostAuthor.tsx b/packages/shared/src/components/post/SquadPostAuthor.tsx index e31a3ea706..590eef1d68 100644 --- a/packages/shared/src/components/post/SquadPostAuthor.tsx +++ b/packages/shared/src/components/post/SquadPostAuthor.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ProfileTooltip } from '../profile/ProfileTooltip'; import { @@ -7,8 +8,8 @@ import { ProfilePicture, } from '../ProfilePicture'; import SquadMemberBadge from '../squads/SquadMemberBadge'; -import { Author } from '../../graphql/comments'; -import { SourceMemberRole } from '../../graphql/sources'; +import type { Author } from '../../graphql/comments'; +import type { SourceMemberRole } from '../../graphql/sources'; import { Separator } from '../cards/common/common'; import { ReputationUserBadge } from '../ReputationUserBadge'; import { TruncateText, DateFormat } from '../utilities'; diff --git a/packages/shared/src/components/post/SquadPostContent.tsx b/packages/shared/src/components/post/SquadPostContent.tsx index 8d96ad126b..2dd57ed8cd 100644 --- a/packages/shared/src/components/post/SquadPostContent.tsx +++ b/packages/shared/src/components/post/SquadPostContent.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; import classNames from 'classnames'; import PostContentContainer from './PostContentContainer'; import usePostContent from '../../hooks/usePostContent'; @@ -11,7 +12,7 @@ import SharePostContent from './SharePostContent'; import MarkdownPostContent from './MarkdownPostContent'; import { SquadPostWidgets } from './SquadPostWidgets'; import { useAuthContext } from '../../contexts/AuthContext'; -import { PostContentProps, PostNavigationProps } from './common'; +import type { PostContentProps, PostNavigationProps } from './common'; import ShareYouTubeContent from './ShareYouTubeContent'; import { useViewPost } from '../../hooks/post'; import { withPostById } from './withPostById'; diff --git a/packages/shared/src/components/post/SquadPostWidgets.tsx b/packages/shared/src/components/post/SquadPostWidgets.tsx index e66f3331f8..7ce833dfbc 100644 --- a/packages/shared/src/components/post/SquadPostWidgets.tsx +++ b/packages/shared/src/components/post/SquadPostWidgets.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { useQuery } from '@tanstack/react-query'; import { PageWidgets } from '../utilities'; import { ShareMobile } from '../ShareMobile'; @@ -7,13 +8,13 @@ import ShareBar from '../ShareBar'; import FurtherReading from '../widgets/FurtherReading'; import { PostHeaderActions } from './PostHeaderActions'; import SourceButton from '../cards/common/SourceButton'; -import { BasicSourceMember, Squad } from '../../graphql/sources'; +import type { BasicSourceMember, Squad } from '../../graphql/sources'; import { SquadActionButton } from '../squads/SquadActionButton'; import { Origin } from '../../lib/log'; import { useSquad } from '../../hooks'; import { getSquadMembers, isSourcePublicSquad } from '../../graphql/squads'; import SquadMemberShortList from '../squads/SquadMemberShortList'; -import { PostWidgetsProps } from './PostWidgets'; +import type { PostWidgetsProps } from './PostWidgets'; import { ProfileImageSize } from '../ProfilePicture'; import { FooterLinks } from '../footer'; diff --git a/packages/shared/src/components/post/block/PostBlockedPanel.tsx b/packages/shared/src/components/post/block/PostBlockedPanel.tsx index bdda52c2bb..1fe4ff5c87 100644 --- a/packages/shared/src/components/post/block/PostBlockedPanel.tsx +++ b/packages/shared/src/components/post/block/PostBlockedPanel.tsx @@ -1,4 +1,5 @@ -import React, { MouseEventHandler, ReactElement } from 'react'; +import type { MouseEventHandler, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; diff --git a/packages/shared/src/components/post/block/PostTagsPanel.tsx b/packages/shared/src/components/post/block/PostTagsPanel.tsx index 4ca6f0b712..484d065678 100644 --- a/packages/shared/src/components/post/block/PostTagsPanel.tsx +++ b/packages/shared/src/components/post/block/PostTagsPanel.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import classNames from 'classnames'; import { useBlockPostPanel } from '../../../hooks/post/useBlockPostPanel'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { isNullOrUndefined } from '../../../lib/func'; import { PostBlockedPanel } from './PostBlockedPanel'; import CloseButton from '../../CloseButton'; @@ -13,7 +14,8 @@ import { } from '../../buttons/Button'; import { SourceAvatar } from '../../profile/source'; import useFeedSettings from '../../../hooks/useFeedSettings'; -import { BlockTagSelection, getBlockedMessage } from './common'; +import type { BlockTagSelection } from './common'; +import { getBlockedMessage } from './common'; import { GenericTagButton } from '../../filters/TagButton'; import { SimpleTooltip } from '../../tooltips'; import ConditionalWrapper from '../../ConditionalWrapper'; diff --git a/packages/shared/src/components/post/collection/CollectionPillSources.tsx b/packages/shared/src/components/post/collection/CollectionPillSources.tsx index 0bcfa9efc4..9910e0e0d4 100644 --- a/packages/shared/src/components/post/collection/CollectionPillSources.tsx +++ b/packages/shared/src/components/post/collection/CollectionPillSources.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Pill } from '../../Pill'; -import { SourceAvatar, SourceAvatarProps } from '../../profile/source'; +import type { SourceAvatarProps } from '../../profile/source'; +import { SourceAvatar } from '../../profile/source'; import { ProfilePictureGroup } from '../../ProfilePictureGroup'; import { ProfileImageSize } from '../../ProfilePicture'; diff --git a/packages/shared/src/components/post/collection/CollectionPostContent.tsx b/packages/shared/src/components/post/collection/CollectionPostContent.tsx index 0bb309c8e0..03870cad21 100644 --- a/packages/shared/src/components/post/collection/CollectionPostContent.tsx +++ b/packages/shared/src/components/post/collection/CollectionPostContent.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; import Link from '../../utilities/Link'; import { LazyImage } from '../../LazyImage'; import { ToastSubject, useToastNotification } from '../../../hooks'; @@ -11,11 +12,8 @@ import { Separator } from '../../cards/common/common'; import { TimeFormatType } from '../../../lib/dateFormat'; import Markdown from '../../Markdown'; import { CollectionPostWidgets } from './CollectionPostWidgets'; -import { - PostContainer, - PostContentProps, - PostNavigationProps, -} from '../common'; +import type { PostContentProps, PostNavigationProps } from '../common'; +import { PostContainer } from '../common'; import { Pill } from '../../Pill'; import { CollectionsIntro } from '../widgets'; import { useAuthContext } from '../../../contexts/AuthContext'; diff --git a/packages/shared/src/components/post/collection/CollectionPostHeaderActions.tsx b/packages/shared/src/components/post/collection/CollectionPostHeaderActions.tsx index e4ca37b9e8..f162976e82 100644 --- a/packages/shared/src/components/post/collection/CollectionPostHeaderActions.tsx +++ b/packages/shared/src/components/post/collection/CollectionPostHeaderActions.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import classed from '../../../lib/classed'; import { Origin } from '../../../lib/log'; -import { PostHeaderActionsProps } from '../common'; +import type { PostHeaderActionsProps } from '../common'; import { PostMenuOptions } from '../PostMenuOptions'; import { CollectionSubscribeButton } from './CollectionSubscribeButton'; diff --git a/packages/shared/src/components/post/collection/CollectionPostWidgets.tsx b/packages/shared/src/components/post/collection/CollectionPostWidgets.tsx index b41d6ff27c..f9b47e553f 100644 --- a/packages/shared/src/components/post/collection/CollectionPostWidgets.tsx +++ b/packages/shared/src/components/post/collection/CollectionPostWidgets.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { PageWidgets } from '../../utilities'; import { ShareMobile } from '../../ShareMobile'; import ShareBar from '../../ShareBar'; @@ -6,7 +7,7 @@ import { CollectionPostHeaderActions } from './CollectionPostHeaderActions'; import { CollectionsIntro } from '../widgets'; import { RelatedPostsWidget } from '../RelatedPostsWidget'; import { PostRelationType } from '../../../graphql/posts'; -import { PostWidgetsProps } from '../PostWidgets'; +import type { PostWidgetsProps } from '../PostWidgets'; import { FooterLinks } from '../../footer'; export const CollectionPostWidgets = ({ diff --git a/packages/shared/src/components/post/collection/CollectionSubscribeButton.tsx b/packages/shared/src/components/post/collection/CollectionSubscribeButton.tsx index f8b23568f2..5e71234da2 100644 --- a/packages/shared/src/components/post/collection/CollectionSubscribeButton.tsx +++ b/packages/shared/src/components/post/collection/CollectionSubscribeButton.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { checkHasStatusPreference, useNotificationPreference, @@ -6,7 +7,7 @@ import { import { NotificationType } from '../../notifications/utils'; import { NotificationPreferenceStatus } from '../../../graphql/notifications'; import { BellDisabledIcon, BellIcon } from '../../icons'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; import { AuthTriggers } from '../../../lib/auth'; import { useAuthContext } from '../../../contexts/AuthContext'; diff --git a/packages/shared/src/components/post/common.tsx b/packages/shared/src/components/post/common.tsx index 8e48102901..c9f202385b 100644 --- a/packages/shared/src/components/post/common.tsx +++ b/packages/shared/src/components/post/common.tsx @@ -1,15 +1,15 @@ -import { +import type { CSSProperties, KeyboardEventHandler, MouseEventHandler, ReactNode, } from 'react'; -import { Post } from '../../graphql/posts'; -import { PostOrigin } from '../../hooks/log/useLogContextData'; +import type { Post } from '../../graphql/posts'; +import type { PostOrigin } from '../../hooks/log/useLogContextData'; import classed from '../../lib/classed'; -import { PostOptionsMenuProps } from '../PostOptionsMenu'; -import { PostPosition } from '../../hooks/usePostModalNavigation'; -import { +import type { PostOptionsMenuProps } from '../PostOptionsMenu'; +import type { PostPosition } from '../../hooks/usePostModalNavigation'; +import type { UsePostContent, UsePostContentProps, } from '../../hooks/usePostContent'; diff --git a/packages/shared/src/components/post/common/PostClickbaitShield.tsx b/packages/shared/src/components/post/common/PostClickbaitShield.tsx index aa4da191d3..ccef4ba7a3 100644 --- a/packages/shared/src/components/post/common/PostClickbaitShield.tsx +++ b/packages/shared/src/components/post/common/PostClickbaitShield.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; diff --git a/packages/shared/src/components/post/common/PostContentReminder.tsx b/packages/shared/src/components/post/common/PostContentReminder.tsx index 09d08132c1..c100752df6 100644 --- a/packages/shared/src/components/post/common/PostContentReminder.tsx +++ b/packages/shared/src/components/post/common/PostContentReminder.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { PostContentWidget } from './PostContentWidget'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { BookmarkReminderIcon } from '../../icons/Bookmark/Reminder'; import { IconSize } from '../../Icon'; import { PostReminderOptions } from './PostReminderOptions'; diff --git a/packages/shared/src/components/post/common/PostContentShare.tsx b/packages/shared/src/components/post/common/PostContentShare.tsx index b0763e3b20..a367d5fec9 100644 --- a/packages/shared/src/components/post/common/PostContentShare.tsx +++ b/packages/shared/src/components/post/common/PostContentShare.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { InviteLinkInput } from '../../referral/InviteLinkInput'; import { Origin } from '../../../lib/log'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { usePostShareLoop } from '../../../hooks/post/usePostShareLoop'; import { postLogEvent } from '../../../lib/feed'; import { ShareProvider } from '../../../lib/share'; diff --git a/packages/shared/src/components/post/common/PostContentWidget.tsx b/packages/shared/src/components/post/common/PostContentWidget.tsx index bbcfcb05aa..97bae294f4 100644 --- a/packages/shared/src/components/post/common/PostContentWidget.tsx +++ b/packages/shared/src/components/post/common/PostContentWidget.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; interface PostContentWidgetProps { diff --git a/packages/shared/src/components/post/common/PostReminderOptions.tsx b/packages/shared/src/components/post/common/PostReminderOptions.tsx index e4c56325ba..ef10cc8dd9 100644 --- a/packages/shared/src/components/post/common/PostReminderOptions.tsx +++ b/packages/shared/src/components/post/common/PostReminderOptions.tsx @@ -1,17 +1,14 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from '../../buttons/Button'; +import type { ButtonProps } from '../../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; import { ReminderPreference, useBookmarkReminder, } from '../../../hooks/notifications'; import { LazyModal } from '../../modals/common/types'; -import { Post } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; import { useLazyModal } from '../../../hooks/useLazyModal'; import { wrapStopPropagation } from '../../../lib/func'; import { useActiveFeedContext } from '../../../contexts'; diff --git a/packages/shared/src/components/post/common/SharedLinkContainer.tsx b/packages/shared/src/components/post/common/SharedLinkContainer.tsx index 1b791a73ea..c8419021d2 100644 --- a/packages/shared/src/components/post/common/SharedLinkContainer.tsx +++ b/packages/shared/src/components/post/common/SharedLinkContainer.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode, useState } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useState } from 'react'; import classNames from 'classnames'; import PostSummary from '../../cards/common/PostSummary'; import { ArrowIcon } from '../../icons'; diff --git a/packages/shared/src/components/post/common/SharedPostLink.tsx b/packages/shared/src/components/post/common/SharedPostLink.tsx index 24107f536b..350e5e55eb 100644 --- a/packages/shared/src/components/post/common/SharedPostLink.tsx +++ b/packages/shared/src/components/post/common/SharedPostLink.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import Link from '../../utilities/Link'; -import { Post, SharedPost } from '../../../graphql/posts'; -import { CombinedClicks } from '../../../lib/click'; +import type { Post, SharedPost } from '../../../graphql/posts'; +import type { CombinedClicks } from '../../../lib/click'; interface SharedPostTitleProps { sharedPost: SharedPost; diff --git a/packages/shared/src/components/post/freeform/write/WriteFreeFormSkeleton.tsx b/packages/shared/src/components/post/freeform/write/WriteFreeFormSkeleton.tsx index 8105c6aef4..1ea227b0e8 100644 --- a/packages/shared/src/components/post/freeform/write/WriteFreeFormSkeleton.tsx +++ b/packages/shared/src/components/post/freeform/write/WriteFreeFormSkeleton.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { WritePageContainer, WritePageMain } from './common'; import { WritePostHeader } from './WritePostHeader'; import { ElementPlaceholder } from '../../../ElementPlaceholder'; diff --git a/packages/shared/src/components/post/freeform/write/WriteFreeformContent.tsx b/packages/shared/src/components/post/freeform/write/WriteFreeformContent.tsx index 1f7b8506a6..2b5b58ecde 100644 --- a/packages/shared/src/components/post/freeform/write/WriteFreeformContent.tsx +++ b/packages/shared/src/components/post/freeform/write/WriteFreeformContent.tsx @@ -1,15 +1,12 @@ -import React, { - FormEventHandler, - ReactElement, - useImperativeHandle, - useRef, -} from 'react'; +import type { FormEventHandler, ReactElement } from 'react'; +import React, { useImperativeHandle, useRef } from 'react'; import ImageInput from '../../../fields/ImageInput'; import { CameraIcon } from '../../../icons'; import { TextField } from '../../../fields/TextField'; import MarkdownInput from '../../../fields/MarkdownInput'; import { WritePageMain } from './common'; -import { EditPostProps, imageSizeLimitMB } from '../../../../graphql/posts'; +import type { EditPostProps } from '../../../../graphql/posts'; +import { imageSizeLimitMB } from '../../../../graphql/posts'; import { formToJson } from '../../../../lib/form'; import useDebounceFn from '../../../../hooks/useDebounceFn'; import AlertPointer, { AlertPlacement } from '../../../alert/AlertPointer'; @@ -17,11 +14,8 @@ import { useActions, useViewSize, ViewSize } from '../../../../hooks'; import { ActionType } from '../../../../graphql/actions'; import useSidebarRendered from '../../../../hooks/useSidebarRendered'; import { base64ToFile } from '../../../../lib/base64'; -import { - MergedWriteObject, - useWritePostContext, - WriteForm, -} from '../../../../contexts'; +import type { MergedWriteObject, WriteForm } from '../../../../contexts'; +import { useWritePostContext } from '../../../../contexts'; import { defaultMarkdownCommands } from '../../../../hooks/input'; import { WriteFooter } from '../../write'; diff --git a/packages/shared/src/components/post/freeform/write/WritePage.tsx b/packages/shared/src/components/post/freeform/write/WritePage.tsx index 9979dbe73e..2a33d92fb0 100644 --- a/packages/shared/src/components/post/freeform/write/WritePage.tsx +++ b/packages/shared/src/components/post/freeform/write/WritePage.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { WritePageContainer } from './common'; import { WriteFreeFormSkeleton } from './WriteFreeFormSkeleton'; import Unauthorized from '../../../errors/Unauthorized'; diff --git a/packages/shared/src/components/post/freeform/write/WritePostHeader.tsx b/packages/shared/src/components/post/freeform/write/WritePostHeader.tsx index cdc40059e9..530da96b70 100644 --- a/packages/shared/src/components/post/freeform/write/WritePostHeader.tsx +++ b/packages/shared/src/components/post/freeform/write/WritePostHeader.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import SourceButton from '../../../cards/common/SourceButton'; import { useWritePostContext } from '../../../../contexts'; diff --git a/packages/shared/src/components/post/infinite/InfiniteReadingHistory.tsx b/packages/shared/src/components/post/infinite/InfiniteReadingHistory.tsx index 42d203493b..269f443579 100644 --- a/packages/shared/src/components/post/infinite/InfiniteReadingHistory.tsx +++ b/packages/shared/src/components/post/infinite/InfiniteReadingHistory.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement, MouseEvent } from 'react'; -import { PostItem } from '../../../graphql/posts'; +import type { ReactElement, MouseEvent } from 'react'; +import React from 'react'; +import type { PostItem } from '../../../graphql/posts'; import InfiniteScrolling from '../../containers/InfiniteScrolling'; import PostItemCard from '../PostItemCard'; import { ArrowIcon } from '../../icons'; diff --git a/packages/shared/src/components/post/share/SharePostTitle.tsx b/packages/shared/src/components/post/share/SharePostTitle.tsx index ebbaa49f10..20e8c3e48a 100644 --- a/packages/shared/src/components/post/share/SharePostTitle.tsx +++ b/packages/shared/src/components/post/share/SharePostTitle.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import Markdown from '../../Markdown'; interface SharePostTitleProps { diff --git a/packages/shared/src/components/post/useCommentContentPreferenceMutationSubscription.ts b/packages/shared/src/components/post/useCommentContentPreferenceMutationSubscription.ts index c4d733e9d6..77e8118f5b 100644 --- a/packages/shared/src/components/post/useCommentContentPreferenceMutationSubscription.ts +++ b/packages/shared/src/components/post/useCommentContentPreferenceMutationSubscription.ts @@ -1,12 +1,13 @@ -import { PostCommentsData } from '../../graphql/comments'; +import type { PostCommentsData } from '../../graphql/comments'; +import type { ContentPreferenceMutation } from '../../hooks/contentPreference/types'; import { - ContentPreferenceMutation, contentPreferenceMutationMatcher, mutationKeyToContentPreferenceStatusMap, } from '../../hooks/contentPreference/types'; import { useMutationSubscription } from '../../hooks/mutationSubscription/useMutationSubscription'; -import { RequestKey, updateCommentContentPreference } from '../../lib/query'; -import { PropsParameters } from '../../types'; +import type { RequestKey } from '../../lib/query'; +import { updateCommentContentPreference } from '../../lib/query'; +import type { PropsParameters } from '../../types'; type UseCommentContentPreferenceMutationSubscriptionProps = { queryKey: unknown[]; diff --git a/packages/shared/src/components/post/widgets/CollectionsIntro.tsx b/packages/shared/src/components/post/widgets/CollectionsIntro.tsx index d042c36a0f..537125443d 100644 --- a/packages/shared/src/components/post/widgets/CollectionsIntro.tsx +++ b/packages/shared/src/components/post/widgets/CollectionsIntro.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import CloseButton from '../../CloseButton'; import { useActions } from '../../../hooks'; diff --git a/packages/shared/src/components/post/withPostById.tsx b/packages/shared/src/components/post/withPostById.tsx index 31fe73361e..b6c5f5bc6e 100644 --- a/packages/shared/src/components/post/withPostById.tsx +++ b/packages/shared/src/components/post/withPostById.tsx @@ -1,6 +1,7 @@ -import React, { ComponentType, ReactElement, ReactNode } from 'react'; +import type { ComponentType, ReactElement, ReactNode } from 'react'; +import React from 'react'; import usePostById from '../../hooks/usePostById'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; type WrappedComponentType< Props, diff --git a/packages/shared/src/components/post/write/CreatePostButton.tsx b/packages/shared/src/components/post/write/CreatePostButton.tsx index 4fd879e389..225c1286c3 100644 --- a/packages/shared/src/components/post/write/CreatePostButton.tsx +++ b/packages/shared/src/components/post/write/CreatePostButton.tsx @@ -1,18 +1,17 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import { link } from '../../../lib/links'; import { useAuthContext } from '../../../contexts/AuthContext'; import { useSquad, useViewSize, ViewSize } from '../../../hooks'; import { verifyPermission } from '../../../graphql/squads'; import { SourcePermissions } from '../../../graphql/sources'; -import { +import type { AllowedElements, AllowedTags, - Button, ButtonProps, - ButtonSize, - ButtonVariant, } from '../../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; import { PlusIcon } from '../../icons'; import ConditionalWrapper from '../../ConditionalWrapper'; import { SimpleTooltip } from '../../tooltips'; diff --git a/packages/shared/src/components/post/write/ShareLink.tsx b/packages/shared/src/components/post/write/ShareLink.tsx index 9d157c904e..8130afac31 100644 --- a/packages/shared/src/components/post/write/ShareLink.tsx +++ b/packages/shared/src/components/post/write/ShareLink.tsx @@ -1,19 +1,21 @@ -import React, { FormEventHandler, ReactElement, useState } from 'react'; +import type { FormEventHandler, ReactElement } from 'react'; +import React, { useState } from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; -import { Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; import MarkdownInput from '../../fields/MarkdownInput'; import { WriteFooter } from './WriteFooter'; import { SubmitExternalLink } from './SubmitExternalLink'; import { usePostToSquad } from '../../../hooks'; import { useToastNotification } from '../../../hooks/useToastNotification'; -import { Post, PostType } from '../../../graphql/posts'; +import type { Post } from '../../../graphql/posts'; +import { PostType } from '../../../graphql/posts'; import { WriteLinkPreview } from './WriteLinkPreview'; import { generateDefaultSquad } from './SquadsDropdown'; import { useSquadCreate } from '../../../hooks/squads/useSquadCreate'; import { useAuthContext } from '../../../contexts/AuthContext'; import useSourcePostModeration from '../../../hooks/source/useSourcePostModeration'; -import { SourcePostModeration } from '../../../graphql/squads'; +import type { SourcePostModeration } from '../../../graphql/squads'; interface ShareLinkProps { squad: Squad; diff --git a/packages/shared/src/components/post/write/SquadsDropdown.tsx b/packages/shared/src/components/post/write/SquadsDropdown.tsx index 6eed869004..e80df9967b 100644 --- a/packages/shared/src/components/post/write/SquadsDropdown.tsx +++ b/packages/shared/src/components/post/write/SquadsDropdown.tsx @@ -1,8 +1,10 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { SourceAvatar, SourceShortInfo } from '../../profile/source'; import { ArrowIcon, SquadIcon } from '../../icons'; import { Dropdown } from '../../fields/Dropdown'; -import { SourceMemberRole, SourceType, Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; +import { SourceMemberRole, SourceType } from '../../../graphql/sources'; import { ButtonSize } from '../../buttons/common'; import { useViewSize, ViewSize } from '../../../hooks'; import { ProfileImageSize } from '../../ProfilePicture'; diff --git a/packages/shared/src/components/post/write/SubmitExternalLink.tsx b/packages/shared/src/components/post/write/SubmitExternalLink.tsx index acdafa5001..bd961d1c16 100644 --- a/packages/shared/src/components/post/write/SubmitExternalLink.tsx +++ b/packages/shared/src/components/post/write/SubmitExternalLink.tsx @@ -1,6 +1,10 @@ -import React, { FormEventHandler, ReactElement, useState } from 'react'; +import type { FormEventHandler, ReactElement } from 'react'; +import React, { useState } from 'react'; import classNames from 'classnames'; -import { ExternalLinkPreview, ReadHistoryPost } from '../../../graphql/posts'; +import type { + ExternalLinkPreview, + ReadHistoryPost, +} from '../../../graphql/posts'; import { TextField } from '../../fields/TextField'; import { LinkIcon } from '../../icons'; import { ClickableText } from '../../buttons/ClickableText'; diff --git a/packages/shared/src/components/post/write/WriteFooter.tsx b/packages/shared/src/components/post/write/WriteFooter.tsx index 8538792577..5be82930df 100644 --- a/packages/shared/src/components/post/write/WriteFooter.tsx +++ b/packages/shared/src/components/post/write/WriteFooter.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Switch } from '../../fields/Switch'; import { useNotificationToggle } from '../../../hooks/notifications'; diff --git a/packages/shared/src/components/post/write/WriteLinkPreview.tsx b/packages/shared/src/components/post/write/WriteLinkPreview.tsx index c41ef924e5..b9473fab4f 100644 --- a/packages/shared/src/components/post/write/WriteLinkPreview.tsx +++ b/packages/shared/src/components/post/write/WriteLinkPreview.tsx @@ -1,4 +1,5 @@ -import React, { FormEventHandler, ReactElement } from 'react'; +import type { FormEventHandler, ReactElement } from 'react'; +import React from 'react'; import { TextField } from '../../fields/TextField'; import { LinkIcon, OpenLinkIcon } from '../../icons'; import { SourceAvatar } from '../../profile/source'; @@ -8,7 +9,7 @@ import { WritePreviewContainer, WritePreviewContent, } from './common'; -import { ExternalLinkPreview } from '../../../graphql/posts'; +import type { ExternalLinkPreview } from '../../../graphql/posts'; import { Button, ButtonVariant } from '../../buttons/Button'; import { ProfileImageSize } from '../../ProfilePicture'; diff --git a/packages/shared/src/components/post/write/WritePreviewSkeleton.tsx b/packages/shared/src/components/post/write/WritePreviewSkeleton.tsx index 0dee12f02b..673bca14a1 100644 --- a/packages/shared/src/components/post/write/WritePreviewSkeleton.tsx +++ b/packages/shared/src/components/post/write/WritePreviewSkeleton.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { TextField } from '../../fields/TextField'; import { Loader } from '../../Loader'; import { ElementPlaceholder } from '../../ElementPlaceholder'; diff --git a/packages/shared/src/components/profile/AccountDangerZone.tsx b/packages/shared/src/components/profile/AccountDangerZone.tsx index 9983756fb8..52e0d1cf09 100644 --- a/packages/shared/src/components/profile/AccountDangerZone.tsx +++ b/packages/shared/src/components/profile/AccountDangerZone.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { DangerZone } from '../widgets/DangerZone'; import { anchorDefaultRel } from '../../lib/strings'; diff --git a/packages/shared/src/components/profile/ActivitySection.tsx b/packages/shared/src/components/profile/ActivitySection.tsx index 23672e6c10..670f15c0c1 100644 --- a/packages/shared/src/components/profile/ActivitySection.tsx +++ b/packages/shared/src/components/profile/ActivitySection.tsx @@ -1,10 +1,11 @@ -import React, { Fragment, ReactElement, ReactNode } from 'react'; -import { UseInfiniteQueryResult } from '@tanstack/react-query/build/legacy/types'; -import { InfiniteData } from '@tanstack/react-query'; +import type { ReactElement, ReactNode } from 'react'; +import React, { Fragment } from 'react'; +import type { UseInfiniteQueryResult } from '@tanstack/react-query/build/legacy/types'; +import type { InfiniteData } from '@tanstack/react-query'; import classed from '../../lib/classed'; import { IconSize } from '../Icon'; -import { FeedData } from '../../graphql/feed'; -import { Post } from '../../graphql/posts'; +import type { FeedData } from '../../graphql/feed'; +import type { Post } from '../../graphql/posts'; import type { WithClassNameProps } from '../utilities'; export const ActivityContainer = classed('section', 'flex flex-col'); diff --git a/packages/shared/src/components/profile/ExperienceLevelDropdown.tsx b/packages/shared/src/components/profile/ExperienceLevelDropdown.tsx index 1548d1807e..e0fd552265 100644 --- a/packages/shared/src/components/profile/ExperienceLevelDropdown.tsx +++ b/packages/shared/src/components/profile/ExperienceLevelDropdown.tsx @@ -1,8 +1,10 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Dropdown, DropdownClassName } from '../fields/Dropdown'; +import type { DropdownClassName } from '../fields/Dropdown'; +import { Dropdown } from '../fields/Dropdown'; import { TerminalIcon } from '../icons'; -import { BaseFieldProps } from '../fields/BaseFieldContainer'; +import type { BaseFieldProps } from '../fields/BaseFieldContainer'; import { UserExperienceLevel } from '../../lib/user'; interface ClassName extends DropdownClassName { diff --git a/packages/shared/src/components/profile/Header.tsx b/packages/shared/src/components/profile/Header.tsx index 640b235c5a..b165f147c5 100644 --- a/packages/shared/src/components/profile/Header.tsx +++ b/packages/shared/src/components/profile/Header.tsx @@ -1,7 +1,8 @@ -import React, { CSSProperties, ReactElement, useState } from 'react'; +import type { CSSProperties, ReactElement } from 'react'; +import React, { useState } from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; -import { PublicProfile } from '../../lib/user'; +import type { PublicProfile } from '../../lib/user'; import { SettingsIcon } from '../icons'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { ProfileImageSize, ProfilePicture } from '../ProfilePicture'; diff --git a/packages/shared/src/components/profile/HeroImage.tsx b/packages/shared/src/components/profile/HeroImage.tsx index 1dde28a01e..3a478a9c24 100644 --- a/packages/shared/src/components/profile/HeroImage.tsx +++ b/packages/shared/src/components/profile/HeroImage.tsx @@ -1,11 +1,9 @@ -import React, { forwardRef, ReactElement, ReactNode, Ref } from 'react'; +import type { ReactElement, ReactNode, Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; import { Image } from '../image/Image'; -import { - ProfileImageSize, - ProfilePicture, - ProfilePictureProps, -} from '../ProfilePicture'; +import type { ProfilePictureProps } from '../ProfilePicture'; +import { ProfileImageSize, ProfilePicture } from '../ProfilePicture'; export type HeroImageProps = ProfilePictureProps['user'] & { cover: string; diff --git a/packages/shared/src/components/profile/JoinedDate.tsx b/packages/shared/src/components/profile/JoinedDate.tsx index adc4e77a48..e7a5bcbec9 100644 --- a/packages/shared/src/components/profile/JoinedDate.tsx +++ b/packages/shared/src/components/profile/JoinedDate.tsx @@ -1,4 +1,5 @@ -import React, { HTMLAttributes, ReactElement } from 'react'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React from 'react'; import { format } from 'date-fns'; export interface JoinedDateProps extends HTMLAttributes { diff --git a/packages/shared/src/components/profile/LanguageDropdown.tsx b/packages/shared/src/components/profile/LanguageDropdown.tsx index bcf629b62b..ef5aa9ebfe 100644 --- a/packages/shared/src/components/profile/LanguageDropdown.tsx +++ b/packages/shared/src/components/profile/LanguageDropdown.tsx @@ -1,10 +1,12 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import classNames from 'classnames'; -import { Dropdown, DropdownClassName } from '../fields/Dropdown'; +import type { DropdownClassName } from '../fields/Dropdown'; +import { Dropdown } from '../fields/Dropdown'; import { LanguageIcon } from '../icons'; -import { BaseFieldProps } from '../fields/BaseFieldContainer'; +import type { BaseFieldProps } from '../fields/BaseFieldContainer'; import { ContentLanguage, contnetLanguageToLabelMap } from '../../lib/user'; -import { IconProps } from '../Icon'; +import type { IconProps } from '../Icon'; type ClassName = { hint?: string; diff --git a/packages/shared/src/components/profile/MyProfileEmptyScreen.tsx b/packages/shared/src/components/profile/MyProfileEmptyScreen.tsx index 6fdbe85887..8097f8410d 100644 --- a/packages/shared/src/components/profile/MyProfileEmptyScreen.tsx +++ b/packages/shared/src/components/profile/MyProfileEmptyScreen.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Button, ButtonProps, ButtonVariant } from '../buttons/Button'; +import type { ButtonProps } from '../buttons/Button'; +import { Button, ButtonVariant } from '../buttons/Button'; export interface MyProfileEmptyScreenProps { text: string; diff --git a/packages/shared/src/components/profile/ProfileButton.spec.tsx b/packages/shared/src/components/profile/ProfileButton.spec.tsx index 67aaf3843d..92d0984b37 100644 --- a/packages/shared/src/components/profile/ProfileButton.spec.tsx +++ b/packages/shared/src/components/profile/ProfileButton.spec.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { QueryClient } from '@tanstack/react-query'; -import { waitFor, render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { waitFor, render, screen } from '@testing-library/react'; import ProfileButton from './ProfileButton'; import defaultUser from '../../../__tests__/fixture/loggedUser'; import { TestBootProvider } from '../../../__tests__/helpers/boot'; diff --git a/packages/shared/src/components/profile/ProfileButton.tsx b/packages/shared/src/components/profile/ProfileButton.tsx index f3c11e7172..927a5ce591 100644 --- a/packages/shared/src/components/profile/ProfileButton.tsx +++ b/packages/shared/src/components/profile/ProfileButton.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import dynamic from 'next/dynamic'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/components/profile/ProfileEmptyScreen.tsx b/packages/shared/src/components/profile/ProfileEmptyScreen.tsx index 77a86efc9a..1cf7941f6e 100644 --- a/packages/shared/src/components/profile/ProfileEmptyScreen.tsx +++ b/packages/shared/src/components/profile/ProfileEmptyScreen.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; export interface ProfileEmptyScreenProps { diff --git a/packages/shared/src/components/profile/ProfileImageLink.tsx b/packages/shared/src/components/profile/ProfileImageLink.tsx index 71de3c69a8..6189680422 100644 --- a/packages/shared/src/components/profile/ProfileImageLink.tsx +++ b/packages/shared/src/components/profile/ProfileImageLink.tsx @@ -1,11 +1,10 @@ -import React, { forwardRef, ReactElement, Ref } from 'react'; -import { ProfileLink, ProfileLinkProps } from './ProfileLink'; -import { - ProfileImageSize, - ProfilePicture, - ProfilePictureProps, -} from '../ProfilePicture'; -import { Author } from '../../graphql/comments'; +import type { ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; +import type { ProfileLinkProps } from './ProfileLink'; +import { ProfileLink } from './ProfileLink'; +import type { ProfilePictureProps } from '../ProfilePicture'; +import { ProfileImageSize, ProfilePicture } from '../ProfilePicture'; +import type { Author } from '../../graphql/comments'; interface ProfileImageLinkProps extends ProfileLinkProps { picture?: Omit; diff --git a/packages/shared/src/components/profile/ProfileLink.tsx b/packages/shared/src/components/profile/ProfileLink.tsx index 5e4c9e24cd..f06c75cfa7 100644 --- a/packages/shared/src/components/profile/ProfileLink.tsx +++ b/packages/shared/src/components/profile/ProfileLink.tsx @@ -1,9 +1,5 @@ -import React, { - forwardRef, - AnchorHTMLAttributes, - ReactElement, - Ref, -} from 'react'; +import type { AnchorHTMLAttributes, ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; import Link from '../utilities/Link'; diff --git a/packages/shared/src/components/profile/ProfileSettingsMenu.tsx b/packages/shared/src/components/profile/ProfileSettingsMenu.tsx index 8352e0bc8e..d2913f82ee 100644 --- a/packages/shared/src/components/profile/ProfileSettingsMenu.tsx +++ b/packages/shared/src/components/profile/ProfileSettingsMenu.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useCallback, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { AddUserIcon, BellIcon, diff --git a/packages/shared/src/components/profile/ProfileTooltip.tsx b/packages/shared/src/components/profile/ProfileTooltip.tsx index a4f54f4ef0..8ca8a5d330 100644 --- a/packages/shared/src/components/profile/ProfileTooltip.tsx +++ b/packages/shared/src/components/profile/ProfileTooltip.tsx @@ -1,15 +1,14 @@ -import React, { ReactElement, useRef, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useRef, useState } from 'react'; import { useQueryClient } from '@tanstack/react-query'; -import { Author } from '../../graphql/comments'; -import { TooltipProps } from '../tooltips/BaseTooltip'; -import { - LinkWithTooltip, - LinkWithTooltipProps, -} from '../tooltips/LinkWithTooltip'; +import type { Author } from '../../graphql/comments'; +import type { TooltipProps } from '../tooltips/BaseTooltip'; +import type { LinkWithTooltipProps } from '../tooltips/LinkWithTooltip'; +import { LinkWithTooltip } from '../tooltips/LinkWithTooltip'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; import { DevCard, DevCardType } from './devcard'; import { useDevCard } from '../../hooks/profile/useDevCard'; -import { MostReadTag, UserReadingRank } from '../../graphql/users'; +import type { MostReadTag, UserReadingRank } from '../../graphql/users'; export interface ProfileTooltipProps extends ProfileTooltipContentProps { children: ReactElement; diff --git a/packages/shared/src/components/profile/ProfileWidgets.spec.tsx b/packages/shared/src/components/profile/ProfileWidgets.spec.tsx index b0f91fe7e8..d2d5b6bbab 100644 --- a/packages/shared/src/components/profile/ProfileWidgets.spec.tsx +++ b/packages/shared/src/components/profile/ProfileWidgets.spec.tsx @@ -1,17 +1,14 @@ import React from 'react'; -import { render, RenderResult, screen, within } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, within } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import userEvent from '@testing-library/user-event'; -import { LoggedUser, PublicProfile } from '../../lib/user'; +import type { LoggedUser, PublicProfile } from '../../lib/user'; import AuthContext from '../../contexts/AuthContext'; import { ProfileWidgets } from './ProfileWidgets'; -import { Connection } from '../../graphql/common'; -import { - SourceMember, - SourceMemberRole, - SourceType, - Squad, -} from '../../graphql/sources'; +import type { Connection } from '../../graphql/common'; +import type { SourceMember, Squad } from '../../graphql/sources'; +import { SourceMemberRole, SourceType } from '../../graphql/sources'; import { mockGraphQL } from '../../../__tests__/helpers/graphql'; import { PUBLIC_SOURCE_MEMBERSHIPS_QUERY } from '../../graphql/users'; import { waitForNock } from '../../../__tests__/helpers/utilities'; diff --git a/packages/shared/src/components/profile/ProfileWidgets.tsx b/packages/shared/src/components/profile/ProfileWidgets.tsx index 2e94ccaf75..7fae2ea3da 100644 --- a/packages/shared/src/components/profile/ProfileWidgets.tsx +++ b/packages/shared/src/components/profile/ProfileWidgets.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import { Header } from './Header'; import { HeroImage } from './HeroImage'; @@ -8,7 +9,7 @@ import { SocialChips } from './SocialChips'; import { SquadsList } from './SquadsList'; import { useDynamicHeader } from '../../useDynamicHeader'; import AuthContext from '../../contexts/AuthContext'; -import { ProfileV2 } from '../../graphql/users'; +import type { ProfileV2 } from '../../graphql/users'; import { ReferralCampaignKey, useReferralCampaign } from '../../hooks'; import ReferralWidget from '../widgets/ReferralWidget'; import { ButtonSize, ButtonVariant } from '../buttons/common'; diff --git a/packages/shared/src/components/profile/ReadingHeatmapWidget.tsx b/packages/shared/src/components/profile/ReadingHeatmapWidget.tsx index a60e6bf55e..2cd1333a57 100644 --- a/packages/shared/src/components/profile/ReadingHeatmapWidget.tsx +++ b/packages/shared/src/components/profile/ReadingHeatmapWidget.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement, ReactNode, useMemo } from 'react'; -import { UserReadHistory } from '../../graphql/users'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useMemo } from 'react'; +import type { UserReadHistory } from '../../graphql/users'; import { ActivityContainer, ActivitySectionTitle, diff --git a/packages/shared/src/components/profile/ReadingStreaksWidget.tsx b/packages/shared/src/components/profile/ReadingStreaksWidget.tsx index be6e7f2cd1..472be8f5e1 100644 --- a/packages/shared/src/components/profile/ReadingStreaksWidget.tsx +++ b/packages/shared/src/components/profile/ReadingStreaksWidget.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ActivityContainer, ActivitySectionHeader } from './ActivitySection'; import { ReadingStreakIcon } from '../icons'; -import { UserStreak } from '../../graphql/users'; +import type { UserStreak } from '../../graphql/users'; import { largeNumberFormat } from '../../lib'; interface StreakTagProps { diff --git a/packages/shared/src/components/profile/ReadingTagProgress.spec.tsx b/packages/shared/src/components/profile/ReadingTagProgress.spec.tsx index 07fec01918..8b8c1b3f76 100644 --- a/packages/shared/src/components/profile/ReadingTagProgress.spec.tsx +++ b/packages/shared/src/components/profile/ReadingTagProgress.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; import nock from 'nock'; import { render, screen } from '@testing-library/react'; -import { MostReadTag } from '../../graphql/users'; +import type { MostReadTag } from '../../graphql/users'; import { ReadingTagProgress } from './ReadingTagProgress'; beforeEach(() => { diff --git a/packages/shared/src/components/profile/ReadingTagProgress.tsx b/packages/shared/src/components/profile/ReadingTagProgress.tsx index c7d505e0f4..fadd6540b8 100644 --- a/packages/shared/src/components/profile/ReadingTagProgress.tsx +++ b/packages/shared/src/components/profile/ReadingTagProgress.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; -import { MostReadTag } from '../../graphql/users'; +import type { MostReadTag } from '../../graphql/users'; import Link from '../utilities/Link'; import { getTagPageLink } from '../../lib'; diff --git a/packages/shared/src/components/profile/ReadingTagsWidget.tsx b/packages/shared/src/components/profile/ReadingTagsWidget.tsx index bb9ad6327a..8974d6411f 100644 --- a/packages/shared/src/components/profile/ReadingTagsWidget.tsx +++ b/packages/shared/src/components/profile/ReadingTagsWidget.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { MostReadTag } from '../../graphql/users'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { MostReadTag } from '../../graphql/users'; import { ActivityContainer, ActivitySectionHeader } from './ActivitySection'; import { ReadingTagProgress } from './ReadingTagProgress'; diff --git a/packages/shared/src/components/profile/Readme.tsx b/packages/shared/src/components/profile/Readme.tsx index a4e616f768..4c6860f57f 100644 --- a/packages/shared/src/components/profile/Readme.tsx +++ b/packages/shared/src/components/profile/Readme.tsx @@ -1,5 +1,6 @@ -import React, { FormEventHandler, ReactElement, useContext } from 'react'; -import { PublicProfile } from '../../lib/user'; +import type { FormEventHandler, ReactElement } from 'react'; +import React, { useContext } from 'react'; +import type { PublicProfile } from '../../lib/user'; import AuthContext from '../../contexts/AuthContext'; import { MyProfileEmptyScreen } from './MyProfileEmptyScreen'; import Markdown from '../Markdown'; diff --git a/packages/shared/src/components/profile/SocialChips.tsx b/packages/shared/src/components/profile/SocialChips.tsx index e73f169c91..74c1ee8b95 100644 --- a/packages/shared/src/components/profile/SocialChips.tsx +++ b/packages/shared/src/components/profile/SocialChips.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { GitHubIcon, TwitterIcon, diff --git a/packages/shared/src/components/profile/SourceList.tsx b/packages/shared/src/components/profile/SourceList.tsx index 60a1547034..9420ff49fc 100644 --- a/packages/shared/src/components/profile/SourceList.tsx +++ b/packages/shared/src/components/profile/SourceList.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; -import InfiniteScrolling, { - InfiniteScrollingProps, -} from '../containers/InfiniteScrolling'; -import { Source, SourceType } from '../../graphql/sources'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { InfiniteScrollingProps } from '../containers/InfiniteScrolling'; +import InfiniteScrolling from '../containers/InfiniteScrolling'; +import type { Source } from '../../graphql/sources'; +import { SourceType } from '../../graphql/sources'; import { ProfileImageSize, ProfilePicture } from '../ProfilePicture'; import { Typography, diff --git a/packages/shared/src/components/profile/SourceListPlaceholder.tsx b/packages/shared/src/components/profile/SourceListPlaceholder.tsx index 5e26b2bf36..adf4f8ab72 100644 --- a/packages/shared/src/components/profile/SourceListPlaceholder.tsx +++ b/packages/shared/src/components/profile/SourceListPlaceholder.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ElementPlaceholder } from '../ElementPlaceholder'; export interface SourceListPlaceholderProps { diff --git a/packages/shared/src/components/profile/SourceProfilePicture.tsx b/packages/shared/src/components/profile/SourceProfilePicture.tsx index 14966e6fbc..b46143a798 100644 --- a/packages/shared/src/components/profile/SourceProfilePicture.tsx +++ b/packages/shared/src/components/profile/SourceProfilePicture.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement } from 'react'; -import { Source } from '../../graphql/sources'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Source } from '../../graphql/sources'; import ConditionalWrapper from '../ConditionalWrapper'; -import { ProfilePicture, ProfilePictureProps } from '../ProfilePicture'; +import type { ProfilePictureProps } from '../ProfilePicture'; +import { ProfilePicture } from '../ProfilePicture'; import { ProfileLink } from './ProfileLink'; import { cloudinarySquadsImageFallback } from '../../lib/image'; import { useRequestProtocol } from '../../hooks/useRequestProtocol'; diff --git a/packages/shared/src/components/profile/SquadsList.tsx b/packages/shared/src/components/profile/SquadsList.tsx index 355e35049d..7ebaf653f1 100644 --- a/packages/shared/src/components/profile/SquadsList.tsx +++ b/packages/shared/src/components/profile/SquadsList.tsx @@ -1,8 +1,10 @@ -import React, { ReactElement, useContext, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useState } from 'react'; import { useMutation, useQuery } from '@tanstack/react-query'; import { useRouter } from 'next/router'; import Link from '../utilities/Link'; -import { SourceMember, SourceMemberRole } from '../../graphql/sources'; +import type { SourceMember } from '../../graphql/sources'; +import { SourceMemberRole } from '../../graphql/sources'; import { largeNumberFormat } from '../../lib/numberFormat'; import { Image } from '../image/Image'; import SquadMemberBadge from '../squads/SquadMemberBadge'; @@ -19,11 +21,10 @@ import { import { labels } from '../../lib'; import { generateQueryKey, RequestKey } from '../../lib/query'; import AuthContext from '../../contexts/AuthContext'; -import { - ProfileV2, - PUBLIC_SOURCE_MEMBERSHIPS_QUERY, -} from '../../graphql/users'; -import { Connection, gqlClient } from '../../graphql/common'; +import type { ProfileV2 } from '../../graphql/users'; +import { PUBLIC_SOURCE_MEMBERSHIPS_QUERY } from '../../graphql/users'; +import type { Connection } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; import { AuthTriggers } from '../../lib/auth'; import { webappUrl } from '../../lib/constants'; diff --git a/packages/shared/src/components/profile/TagList.tsx b/packages/shared/src/components/profile/TagList.tsx index 126f7c6aff..4de97d1d76 100644 --- a/packages/shared/src/components/profile/TagList.tsx +++ b/packages/shared/src/components/profile/TagList.tsx @@ -1,16 +1,14 @@ -import React, { ReactElement } from 'react'; -import InfiniteScrolling, { - InfiniteScrollingProps, -} from '../containers/InfiniteScrolling'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { InfiniteScrollingProps } from '../containers/InfiniteScrolling'; +import InfiniteScrolling from '../containers/InfiniteScrolling'; import { Typography, TypographyColor, TypographyType, } from '../typography/Typography'; -import { - ContentPreference, - ContentPreferenceType, -} from '../../graphql/contentPreference'; +import type { ContentPreference } from '../../graphql/contentPreference'; +import { ContentPreferenceType } from '../../graphql/contentPreference'; import { FollowButton } from '../contentPreference/FollowButton'; import { useFeedSettingsEditContext } from '../feeds/FeedSettings/FeedSettingsEditContext'; import { CopyType } from '../sources/SourceActions/SourceActionsFollow'; diff --git a/packages/shared/src/components/profile/TagListPlaceholder.tsx b/packages/shared/src/components/profile/TagListPlaceholder.tsx index d1798a4768..b0e43b8b74 100644 --- a/packages/shared/src/components/profile/TagListPlaceholder.tsx +++ b/packages/shared/src/components/profile/TagListPlaceholder.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ElementPlaceholder } from '../ElementPlaceholder'; export interface TagListPlaceholderProps { diff --git a/packages/shared/src/components/profile/TopReaderWidget.tsx b/packages/shared/src/components/profile/TopReaderWidget.tsx index 1e346a0898..23ccfaff90 100644 --- a/packages/shared/src/components/profile/TopReaderWidget.tsx +++ b/packages/shared/src/components/profile/TopReaderWidget.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ActivityContainer, diff --git a/packages/shared/src/components/profile/UserList.tsx b/packages/shared/src/components/profile/UserList.tsx index dd6778d11e..28478226ec 100644 --- a/packages/shared/src/components/profile/UserList.tsx +++ b/packages/shared/src/components/profile/UserList.tsx @@ -1,11 +1,12 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import Link from '../utilities/Link'; import { UserShortInfoPlaceholder } from './UserShortInfoPlaceholder'; -import { UserShortInfo, UserShortInfoProps } from './UserShortInfo'; -import InfiniteScrolling, { - InfiniteScrollingProps, -} from '../containers/InfiniteScrolling'; -import { UserShortProfile } from '../../lib/user'; +import type { UserShortInfoProps } from './UserShortInfo'; +import { UserShortInfo } from './UserShortInfo'; +import type { InfiniteScrollingProps } from '../containers/InfiniteScrolling'; +import InfiniteScrolling from '../containers/InfiniteScrolling'; +import type { UserShortProfile } from '../../lib/user'; export interface UserListProps { scrollingProps: Omit; diff --git a/packages/shared/src/components/profile/UserMetadata.tsx b/packages/shared/src/components/profile/UserMetadata.tsx index 85a278e988..391135ef15 100644 --- a/packages/shared/src/components/profile/UserMetadata.tsx +++ b/packages/shared/src/components/profile/UserMetadata.tsx @@ -1,13 +1,14 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { type PublicProfile } from '../../lib/user'; +import type { PublicProfile } from '../../lib/user'; import JoinedDate from './JoinedDate'; import { Separator } from '../cards/common/common'; import { ReputationUserBadge } from '../ReputationUserBadge'; import { IconSize } from '../Icon'; import { TruncateText, truncateTextClassNames } from '../utilities'; import { ProfileImageSize, ProfilePicture } from '../ProfilePicture'; -import { Company } from '../../lib/userCompany'; +import type { Company } from '../../lib/userCompany'; import { Typography, TypographyColor, diff --git a/packages/shared/src/components/profile/UserShortInfo.tsx b/packages/shared/src/components/profile/UserShortInfo.tsx index 1aac6b74dc..c6bc08b3c0 100644 --- a/packages/shared/src/components/profile/UserShortInfo.tsx +++ b/packages/shared/src/components/profile/UserShortInfo.tsx @@ -1,19 +1,20 @@ import classNames from 'classnames'; -import React, { forwardRef, ReactElement, ReactNode, Ref } from 'react'; +import type { ReactElement, ReactNode, Ref } from 'react'; +import React, { forwardRef } from 'react'; import { ProfileImageSize, ProfilePicture } from '../ProfilePicture'; -import { TooltipProps } from '../tooltips/BaseTooltip'; +import type { TooltipProps } from '../tooltips/BaseTooltip'; import { TruncateText } from '../utilities'; import { ProfileTooltip } from './ProfileTooltip'; -import { LoggedUser, UserShortProfile } from '../../lib/user'; +import type { LoggedUser, UserShortProfile } from '../../lib/user'; import { ReputationUserBadge } from '../ReputationUserBadge'; import { VerifiedCompanyUserBadge } from '../VerifiedCompanyUserBadge'; import { ContentPreferenceType } from '../../graphql/contentPreference'; import { FollowButton } from '../contentPreference/FollowButton'; -import { Origin } from '../../lib/log'; +import type { Origin } from '../../lib/log'; import { Separator } from '../cards/common/common'; import { TopReaderIn } from '../TopReaderIn'; import { PlusUserBadge } from '../PlusUserBadge'; -import { CopyType } from '../sources/SourceActions/SourceActionsFollow'; +import type { CopyType } from '../sources/SourceActions/SourceActionsFollow'; type PropsOf = Tag extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[Tag] diff --git a/packages/shared/src/components/profile/UserShortInfoPlaceholder.tsx b/packages/shared/src/components/profile/UserShortInfoPlaceholder.tsx index a63008efe8..3e1a3750eb 100644 --- a/packages/shared/src/components/profile/UserShortInfoPlaceholder.tsx +++ b/packages/shared/src/components/profile/UserShortInfoPlaceholder.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ElementPlaceholder } from '../ElementPlaceholder'; export interface UserShortInfoPlaceholderProps { diff --git a/packages/shared/src/components/profile/UserStats.tsx b/packages/shared/src/components/profile/UserStats.tsx index 285e51eced..29282ff78c 100644 --- a/packages/shared/src/components/profile/UserStats.tsx +++ b/packages/shared/src/components/profile/UserStats.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { largeNumberFormat } from '../../lib/numberFormat'; import classed from '../../lib/classed'; diff --git a/packages/shared/src/components/profile/devcard/DevCard.tsx b/packages/shared/src/components/profile/devcard/DevCard.tsx index b78b9f98ec..05f3cce5bb 100644 --- a/packages/shared/src/components/profile/devcard/DevCard.tsx +++ b/packages/shared/src/components/profile/devcard/DevCard.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Separator } from '../../cards/common/common'; import { TimeFormatType } from '../../../lib/dateFormat'; @@ -13,7 +14,7 @@ import { } from './common'; import { DevCardFooter } from './DevCardFooter'; import { DevCardContainer } from './DevCardContainer'; -import { UseDevCard } from '../../../hooks/profile/useDevCard'; +import type { UseDevCard } from '../../../hooks/profile/useDevCard'; import { DevCardTwitterCover } from './DevCardTwitterCover'; import { checkLowercaseEquality } from '../../../lib/strings'; import { devcardBorder } from '../../../styles/custom'; diff --git a/packages/shared/src/components/profile/devcard/DevCardContainer.tsx b/packages/shared/src/components/profile/devcard/DevCardContainer.tsx index 9d04d3f1a2..1828387cb4 100644 --- a/packages/shared/src/components/profile/devcard/DevCardContainer.tsx +++ b/packages/shared/src/components/profile/devcard/DevCardContainer.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { DevCardTheme, themeToLinearGradient } from './common'; +import type { DevCardTheme } from './common'; +import { themeToLinearGradient } from './common'; interface DevCardContainerProps { theme: DevCardTheme; diff --git a/packages/shared/src/components/profile/devcard/DevCardFetchWrapper.tsx b/packages/shared/src/components/profile/devcard/DevCardFetchWrapper.tsx index be1750753e..181c3ec787 100644 --- a/packages/shared/src/components/profile/devcard/DevCardFetchWrapper.tsx +++ b/packages/shared/src/components/profile/devcard/DevCardFetchWrapper.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useDevCard } from '../../../hooks/profile/useDevCard'; -import { DevCard, DevCardProps } from './DevCard'; +import type { DevCardProps } from './DevCard'; +import { DevCard } from './DevCard'; interface DevCardFetchWrapperProps extends Omit { userId: string; diff --git a/packages/shared/src/components/profile/devcard/DevCardFooter.tsx b/packages/shared/src/components/profile/devcard/DevCardFooter.tsx index 60b6d0162d..3f24b91523 100644 --- a/packages/shared/src/components/profile/devcard/DevCardFooter.tsx +++ b/packages/shared/src/components/profile/devcard/DevCardFooter.tsx @@ -1,11 +1,12 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { TagLinks } from '../../TagLinks'; import { ButtonVariant } from '../../buttons/common'; import SourceButton from '../../cards/common/SourceButton'; import Logo, { LogoPosition } from '../../Logo'; import { DevCardTheme, DevCardType } from './common'; -import { Source } from '../../../graphql/sources'; +import type { Source } from '../../../graphql/sources'; import { checkLowercaseEquality } from '../../../lib/strings'; import { ProfileImageSize } from '../../ProfilePicture'; diff --git a/packages/shared/src/components/profile/devcard/DevCardStats.tsx b/packages/shared/src/components/profile/devcard/DevCardStats.tsx index d498e07525..e1795be857 100644 --- a/packages/shared/src/components/profile/devcard/DevCardStats.tsx +++ b/packages/shared/src/components/profile/devcard/DevCardStats.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { EyeIcon, ReadingStreakIcon, ReputationIcon } from '../../icons'; import { DevCardStatsSection } from './DevCardStatsSection'; -import { PublicProfile } from '../../../lib/user'; +import type { PublicProfile } from '../../../lib/user'; interface DevCardStatsProps { user: PublicProfile; diff --git a/packages/shared/src/components/profile/devcard/DevCardStatsSection.tsx b/packages/shared/src/components/profile/devcard/DevCardStatsSection.tsx index 72cf65d275..fe2d9c61d8 100644 --- a/packages/shared/src/components/profile/devcard/DevCardStatsSection.tsx +++ b/packages/shared/src/components/profile/devcard/DevCardStatsSection.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { largeNumberFormat } from '../../../lib/numberFormat'; import { IconSize } from '../../Icon'; -import { ReputationIcon } from '../../icons'; +import type { ReputationIcon } from '../../icons'; interface StatsSectionProps { Icon: typeof ReputationIcon; diff --git a/packages/shared/src/components/profile/devcard/DevCardTwitterCover.tsx b/packages/shared/src/components/profile/devcard/DevCardTwitterCover.tsx index 720a152a8b..ae0fb90f1d 100644 --- a/packages/shared/src/components/profile/devcard/DevCardTwitterCover.tsx +++ b/packages/shared/src/components/profile/devcard/DevCardTwitterCover.tsx @@ -1,10 +1,11 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { DevCardContainer } from './DevCardContainer'; import { devCardBoxShadow, DevCardType } from './common'; import { DevCardStats } from './DevCardStats'; import { DevCardFooter } from './DevCardFooter'; import Logo from '../../Logo'; -import { UseDevCard } from '../../../hooks/profile/useDevCard'; +import type { UseDevCard } from '../../../hooks/profile/useDevCard'; export function DevCardTwitterCover({ devcard, diff --git a/packages/shared/src/components/profile/source/SourceAvatar.tsx b/packages/shared/src/components/profile/source/SourceAvatar.tsx index 09659a1cd7..69e2d4216d 100644 --- a/packages/shared/src/components/profile/source/SourceAvatar.tsx +++ b/packages/shared/src/components/profile/source/SourceAvatar.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Image, ImageType } from '../../image/Image'; -import { Source } from '../../../graphql/sources'; +import type { Source } from '../../../graphql/sources'; import { ProfileImageSize, sizeClasses } from '../../ProfilePicture'; export type SourceAvatarProps = { diff --git a/packages/shared/src/components/profile/source/SourceShortInfo.tsx b/packages/shared/src/components/profile/source/SourceShortInfo.tsx index eb631a314b..b8d3316c93 100644 --- a/packages/shared/src/components/profile/source/SourceShortInfo.tsx +++ b/packages/shared/src/components/profile/source/SourceShortInfo.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement, ReactNode } from 'react'; -import { Source } from '../../../graphql/sources'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; +import type { Source } from '../../../graphql/sources'; import { FlexRow } from '../../utilities'; import { SourceAvatar } from './SourceAvatar'; -import { ProfileImageSize } from '../../ProfilePicture'; +import type { ProfileImageSize } from '../../ProfilePicture'; interface SourceShortInfoProps { source: Source; diff --git a/packages/shared/src/components/referral/InviteLinkInput.tsx b/packages/shared/src/components/referral/InviteLinkInput.tsx index 628f2cb3a0..1d36abb6f5 100644 --- a/packages/shared/src/components/referral/InviteLinkInput.tsx +++ b/packages/shared/src/components/referral/InviteLinkInput.tsx @@ -1,10 +1,11 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { TextField } from '../fields/TextField'; import { useCopyLink } from '../../hooks/useCopy'; import { useLogContext } from '../../contexts/LogContext'; -import { FieldClassName } from '../fields/BaseFieldContainer'; -import { LogEvent } from '../../hooks/log/useLogQueue'; +import type { FieldClassName } from '../fields/BaseFieldContainer'; +import type { LogEvent } from '../../hooks/log/useLogQueue'; interface Text { copied?: string; diff --git a/packages/shared/src/components/search/MobileSearch.tsx b/packages/shared/src/components/search/MobileSearch.tsx index 8f8abf6ca9..c81914b59a 100644 --- a/packages/shared/src/components/search/MobileSearch.tsx +++ b/packages/shared/src/components/search/MobileSearch.tsx @@ -1,12 +1,10 @@ -import React, { +import type { MouseEvent, FormEventHandler, ReactElement, - useEffect, - useRef, - useState, FormEvent, } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import InteractivePopup, { InteractivePopupPosition, } from '../tooltips/InteractivePopup'; @@ -14,10 +12,8 @@ import { cloudinaryFeedBgMobile } from '../../lib/image'; import CloseButton from '../CloseButton'; import { Button, ButtonVariant } from '../buttons/Button'; import { SearchSubmitButton } from './SearchSubmitButton'; -import { - SearchBarSuggestionList, - SearchBarSuggestionListProps, -} from './SearchBarSuggestionList'; +import type { SearchBarSuggestionListProps } from './SearchBarSuggestionList'; +import { SearchBarSuggestionList } from './SearchBarSuggestionList'; import { SearchHistory } from './SearchHistory'; interface MobileSearchProps { diff --git a/packages/shared/src/components/search/PlaceholderSearchSource.tsx b/packages/shared/src/components/search/PlaceholderSearchSource.tsx index fa7ea8e91d..5aed7da494 100644 --- a/packages/shared/src/components/search/PlaceholderSearchSource.tsx +++ b/packages/shared/src/components/search/PlaceholderSearchSource.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ElementPlaceholder } from '../ElementPlaceholder'; export const PlaceholderSearchSource = (): ReactElement => { diff --git a/packages/shared/src/components/search/SearchBar.spec.tsx b/packages/shared/src/components/search/SearchBar.spec.tsx index d0519d0ec0..2521d02348 100644 --- a/packages/shared/src/components/search/SearchBar.spec.tsx +++ b/packages/shared/src/components/search/SearchBar.spec.tsx @@ -1,11 +1,13 @@ import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import nock from 'nock'; import { AuthContextProvider } from '../../contexts/AuthContext'; import loggedUser from '../../../__tests__/fixture/loggedUser'; import { generateTestSquad } from '../../../__tests__/fixture/squads'; -import { SearchBar, SearchBarProps } from './SearchBar'; +import type { SearchBarProps } from './SearchBar'; +import { SearchBar } from './SearchBar'; beforeEach(async () => { nock.cleanAll(); diff --git a/packages/shared/src/components/search/SearchBar.tsx b/packages/shared/src/components/search/SearchBar.tsx index b03cb3084c..942dac1fb0 100644 --- a/packages/shared/src/components/search/SearchBar.tsx +++ b/packages/shared/src/components/search/SearchBar.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { SearchBarSuggestionList } from './SearchBarSuggestionList'; import Alert, { AlertType } from '../widgets/Alert'; @@ -7,7 +8,7 @@ import { Origin } from '../../lib/log'; import { labels } from '../../lib'; import { isNullOrUndefined } from '../../lib/func'; import { SearchProgressBar } from './SearchProgressBar'; -import { SearchBarInputProps } from './common'; +import type { SearchBarInputProps } from './common'; export type SearchBarProps = Pick< SearchBarInputProps, diff --git a/packages/shared/src/components/search/SearchBarSuggestion.tsx b/packages/shared/src/components/search/SearchBarSuggestion.tsx index 0e83b2b83d..589990f068 100644 --- a/packages/shared/src/components/search/SearchBarSuggestion.tsx +++ b/packages/shared/src/components/search/SearchBarSuggestion.tsx @@ -1,20 +1,13 @@ -import React, { - ReactElement, - useCallback, - useContext, - useEffect, - useRef, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useContext, useEffect, useRef } from 'react'; import classNames from 'classnames'; -import { - AllowedTags, - Button, - ButtonProps, - ButtonVariant, -} from '../buttons/Button'; +import type { AllowedTags, ButtonProps } from '../buttons/Button'; +import { Button, ButtonVariant } from '../buttons/Button'; import { AiIcon } from '../icons'; -import { LogEvent, Origin, TargetType } from '../../lib/log'; -import { SearchProviderEnum, SearchQuestion } from '../../graphql/search'; +import type { Origin } from '../../lib/log'; +import { LogEvent, TargetType } from '../../lib/log'; +import type { SearchQuestion } from '../../graphql/search'; +import { SearchProviderEnum } from '../../graphql/search'; import LogContext from '../../contexts/LogContext'; export type SuggestionOrigin = diff --git a/packages/shared/src/components/search/SearchBarSuggestionList.tsx b/packages/shared/src/components/search/SearchBarSuggestionList.tsx index b11f50c24f..9a375308b0 100644 --- a/packages/shared/src/components/search/SearchBarSuggestionList.tsx +++ b/packages/shared/src/components/search/SearchBarSuggestionList.tsx @@ -1,13 +1,11 @@ import React, { useContext } from 'react'; import classNames from 'classnames'; -import { SearchBarSuggestion, SuggestionOrigin } from './SearchBarSuggestion'; +import type { SuggestionOrigin } from './SearchBarSuggestion'; +import { SearchBarSuggestion } from './SearchBarSuggestion'; import AuthContext from '../../contexts/AuthContext'; import { AiIcon, FeedbackIcon } from '../icons'; -import { - getSearchUrl, - SearchProviderEnum, - SearchQuestion, -} from '../../graphql/search'; +import type { SearchQuestion } from '../../graphql/search'; +import { getSearchUrl, SearchProviderEnum } from '../../graphql/search'; import { Pill } from '../utilities/loaders'; import { AuthTriggers } from '../../lib/auth'; import { Button, ButtonVariant } from '../buttons/Button'; diff --git a/packages/shared/src/components/search/SearchContainer.tsx b/packages/shared/src/components/search/SearchContainer.tsx index 66bbb027c7..054718e438 100644 --- a/packages/shared/src/components/search/SearchContainer.tsx +++ b/packages/shared/src/components/search/SearchContainer.tsx @@ -1,11 +1,12 @@ -import React, { ReactNode } from 'react'; +import type { ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { SearchFeedback } from './SearchFeedback'; import { Pill } from '../utilities/loaders'; import { PageWidgets } from '../utilities'; import { SearchSourceList } from './SearchSourceList'; import { SearchBar } from './SearchBar'; -import { SearchBarInputProps } from './common'; +import type { SearchBarInputProps } from './common'; interface SearchContainerProps extends Pick { children: ReactNode; diff --git a/packages/shared/src/components/search/SearchEmpty.tsx b/packages/shared/src/components/search/SearchEmpty.tsx index c5b2f5b1fe..32c177a7b7 100644 --- a/packages/shared/src/components/search/SearchEmpty.tsx +++ b/packages/shared/src/components/search/SearchEmpty.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { SearchHistoryContainer } from './common'; import { AiIcon } from '../icons'; import { IconSize } from '../Icon'; diff --git a/packages/shared/src/components/search/SearchFeedback.tsx b/packages/shared/src/components/search/SearchFeedback.tsx index feefaf1d08..b27ddf8b71 100644 --- a/packages/shared/src/components/search/SearchFeedback.tsx +++ b/packages/shared/src/components/search/SearchFeedback.tsx @@ -1,10 +1,11 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { WidgetContainer } from '../widgets/common'; import { FeedbackIcon, DocsIcon } from '../icons'; import { ListCardDivider } from '../cards/common/Card'; import { searchDocs, searchFeedback } from '../../lib/constants'; -import { WithClassNameProps } from '../utilities'; +import type { WithClassNameProps } from '../utilities'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; export const SearchFeedback = ({ diff --git a/packages/shared/src/components/search/SearchHistory.tsx b/packages/shared/src/components/search/SearchHistory.tsx index 26c65f013c..a19486f7a9 100644 --- a/packages/shared/src/components/search/SearchHistory.tsx +++ b/packages/shared/src/components/search/SearchHistory.tsx @@ -1,9 +1,11 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { SearchProviderEnum, getSearchUrl } from '../../graphql/search'; import { InfiniteScrollScreenOffset } from '../../hooks/feed/useFeedInfiniteScroll'; import { SearchEmpty } from './SearchEmpty'; import { SearchHistoryContainer } from './common'; -import { SearchBarSuggestion, SuggestionOrigin } from './SearchBarSuggestion'; +import type { SuggestionOrigin } from './SearchBarSuggestion'; +import { SearchBarSuggestion } from './SearchBarSuggestion'; import { SearchSkeleton } from './SearchSkeleton'; import { TimerIcon } from '../icons'; import { useSearchHistory } from '../../hooks/search'; diff --git a/packages/shared/src/components/search/SearchHistoryButton.tsx b/packages/shared/src/components/search/SearchHistoryButton.tsx index 67f8b92a0d..63a6bf8ce4 100644 --- a/packages/shared/src/components/search/SearchHistoryButton.tsx +++ b/packages/shared/src/components/search/SearchHistoryButton.tsx @@ -1,15 +1,11 @@ -import React, { - MouseEventHandler, - ReactElement, - useContext, - useMemo, - useState, -} from 'react'; +import type { MouseEventHandler, ReactElement } from 'react'; +import React, { useContext, useMemo, useState } from 'react'; import { useRouter } from 'next/router'; import { TimerIcon } from '../icons'; import { SimpleTooltip } from '../tooltips'; import { useSearchHistory } from '../../hooks/search'; -import ContextMenu, { MenuItemProps } from '../fields/ContextMenu'; +import type { MenuItemProps } from '../fields/ContextMenu'; +import ContextMenu from '../fields/ContextMenu'; import useContextMenu from '../../hooks/useContextMenu'; import { ContextMenu as ContextMenuIds } from '../../hooks/constants'; import { SearchProviderEnum, getSearchUrl } from '../../graphql/search'; diff --git a/packages/shared/src/components/search/SearchMessage.tsx b/packages/shared/src/components/search/SearchMessage.tsx index fc3d05eb77..31016b44e5 100644 --- a/packages/shared/src/components/search/SearchMessage.tsx +++ b/packages/shared/src/components/search/SearchMessage.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { RenderMarkdown, RenderMarkdownProps } from '../RenderMarkdown'; +import type { RenderMarkdownProps } from '../RenderMarkdown'; +import { RenderMarkdown } from '../RenderMarkdown'; import styles from './SearchMessage.module.css'; export type SearchMessageProps = Pick< diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanel.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanel.tsx index da4f30266b..f6357fdea1 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanel.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanel.tsx @@ -1,19 +1,12 @@ -import React, { - ReactElement, - useEffect, - useMemo, - useRef, - useState, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useMemo, useRef, useState } from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; import dynamic from 'next/dynamic'; import { SearchPanelInput } from './SearchPanelInput'; import { minSearchQueryLength } from '../../../graphql/search'; -import { - SearchPanelContext, - SearchPanelContextValue, -} from './SearchPanelContext'; +import type { SearchPanelContextValue } from './SearchPanelContext'; +import { SearchPanelContext } from './SearchPanelContext'; import { defaultSearchProvider, providerToLabelTextMap } from './common'; const SearchPanelDropdown = dynamic( diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelAction.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelAction.tsx index 8ba4ca8da5..22ee0afab1 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelAction.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelAction.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; -import { SearchProviderEnum } from '../../../graphql/search'; +import type { SearchProviderEnum } from '../../../graphql/search'; import { SearchPanelContext } from './SearchPanelContext'; import { SearchPanelItem } from './SearchPanelItem'; import { useSearchProvider } from '../../../hooks/search'; diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelContext.ts b/packages/shared/src/components/search/SearchPanel/SearchPanelContext.ts index 12d91d3837..fc36494d36 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelContext.ts +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelContext.ts @@ -1,4 +1,5 @@ -import { createContext, ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import { createContext } from 'react'; import { SearchProviderEnum } from '../../../graphql/search'; export type SearchPanelContextValue = { diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelCustomAction.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelCustomAction.tsx index 7709f6182b..c074bf0e7d 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelCustomAction.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelCustomAction.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement, ReactNode } from 'react'; -import { SearchPanelItem, SearchPanelItemProps } from './SearchPanelItem'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; +import type { SearchPanelItemProps } from './SearchPanelItem'; +import { SearchPanelItem } from './SearchPanelItem'; import { useSearchPanelAction } from './useSearchPanelAction'; -import { SearchProviderEnum } from '../../../graphql/search'; +import type { SearchProviderEnum } from '../../../graphql/search'; export type SearchPanelCustomActionProps = { provider: SearchProviderEnum; diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelDropdown.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelDropdown.tsx index b5827682f1..e3b74d7da1 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelDropdown.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelDropdown.tsx @@ -1,4 +1,5 @@ -import React, { MutableRefObject, ReactElement } from 'react'; +import type { MutableRefObject, ReactElement } from 'react'; +import React from 'react'; import { SearchProviderEnum } from '../../../graphql/search'; import { ArrowKeyEnum, isExtension } from '../../../lib/func'; import { LogEvent } from '../../../lib/log'; diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelInput.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelInput.tsx index 40d07dddbb..f8cf98511c 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelInput.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelInput.tsx @@ -1,12 +1,11 @@ -import React, { +import type { FormEvent, InputHTMLAttributes, MouseEvent, ReactElement, ReactNode, - useContext, - useRef, } from 'react'; +import React, { useContext, useRef } from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; import { BaseField, FieldInput } from '../../fields/common'; diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelInputContainer.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelInputContainer.tsx index c8e88c26e6..af2879f015 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelInputContainer.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelInputContainer.tsx @@ -1,4 +1,5 @@ -import React, { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import type { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import React from 'react'; export type SearchPanelItemContainerProps = { children?: ReactNode; diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelInputCursor.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelInputCursor.tsx index 60416a658b..e1657eb6ec 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelInputCursor.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelInputCursor.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import { SearchPanelContext } from './SearchPanelContext'; import { useDomPurify } from '../../../hooks/useDomPurify'; diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelItem.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelItem.tsx index 4167fef4da..6657977e58 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelItem.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelItem.tsx @@ -1,10 +1,9 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; -import { IconType } from '../../buttons/Button'; -import { - SearchPanelItemContainerProps, - SearchPanelItemContainer, -} from './SearchPanelInputContainer'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { IconType } from '../../buttons/Button'; +import type { SearchPanelItemContainerProps } from './SearchPanelInputContainer'; +import { SearchPanelItemContainer } from './SearchPanelInputContainer'; export type SearchPanelItemProps = { icon?: IconType; diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelPostSuggestions.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelPostSuggestions.tsx index 59e6679ad1..a36090348d 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelPostSuggestions.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelPostSuggestions.tsx @@ -1,11 +1,13 @@ import classNames from 'classnames'; -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { useRouter } from 'next/router'; import { SearchIcon } from '../../icons'; -import { SearchPanelItem, SearchPanelItemProps } from './SearchPanelItem'; +import type { SearchPanelItemProps } from './SearchPanelItem'; +import { SearchPanelItem } from './SearchPanelItem'; +import type { SearchSuggestion } from '../../../graphql/search'; import { SearchProviderEnum, - SearchSuggestion, sanitizeSearchTitleMatch, } from '../../../graphql/search'; import { diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelProvider.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelProvider.tsx index 2a6ec84871..f98d950b0e 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelProvider.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelProvider.tsx @@ -1,7 +1,9 @@ -import React, { FunctionComponent, ReactElement, useContext } from 'react'; +import type { FunctionComponent, ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import { SearchProviderEnum } from '../../../graphql/search'; -import { IconProps, IconSize } from '../../Icon'; +import type { IconProps } from '../../Icon'; +import { IconSize } from '../../Icon'; import { SearchPanelContext } from './SearchPanelContext'; import { providerToIconMap } from './common'; diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelSourceSuggestions.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelSourceSuggestions.tsx index 2809bc0e7b..510b4a17b9 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelSourceSuggestions.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelSourceSuggestions.tsx @@ -1,14 +1,16 @@ import classNames from 'classnames'; -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { useRouter } from 'next/router'; -import { SearchProviderEnum, SearchSuggestion } from '../../../graphql/search'; +import type { SearchSuggestion } from '../../../graphql/search'; +import { SearchProviderEnum } from '../../../graphql/search'; import { useSearchProviderSuggestions } from '../../../hooks/search'; import { SearchPanelContext } from './SearchPanelContext'; import { useSearchPanelAction } from './useSearchPanelAction'; import { LogEvent, Origin, TargetType } from '../../../lib/log'; import LogContext from '../../../contexts/LogContext'; import { webappUrl } from '../../../lib/constants'; -import { ButtonProps } from '../../buttons/Button'; +import type { ButtonProps } from '../../buttons/Button'; import { SearchPanelItem } from './SearchPanelItem'; import { Image } from '../../image/Image'; import { diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelTagSuggestions.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelTagSuggestions.tsx index 798935d7cf..2f67fed8ea 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelTagSuggestions.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelTagSuggestions.tsx @@ -1,7 +1,9 @@ import classNames from 'classnames'; -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { useRouter } from 'next/router'; -import { SearchProviderEnum, SearchSuggestion } from '../../../graphql/search'; +import type { SearchSuggestion } from '../../../graphql/search'; +import { SearchProviderEnum } from '../../../graphql/search'; import { useSearchProviderSuggestions } from '../../../hooks/search'; import { SearchPanelContext } from './SearchPanelContext'; import { useSearchPanelAction } from './useSearchPanelAction'; @@ -10,7 +12,7 @@ import LogContext from '../../../contexts/LogContext'; import { SearchPanelItemContainer } from './SearchPanelInputContainer'; import { TagLink } from '../../TagLinks'; import { webappUrl } from '../../../lib/constants'; -import { ButtonProps } from '../../buttons/Button'; +import type { ButtonProps } from '../../buttons/Button'; export type SearchPanelTagSuggestionsProps = { className?: string; diff --git a/packages/shared/src/components/search/SearchPanel/SearchPanelUserSuggestions.tsx b/packages/shared/src/components/search/SearchPanel/SearchPanelUserSuggestions.tsx index 5e8b64cc3f..f184c23d99 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchPanelUserSuggestions.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchPanelUserSuggestions.tsx @@ -1,14 +1,16 @@ import classNames from 'classnames'; -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { useRouter } from 'next/router'; -import { SearchProviderEnum, SearchSuggestion } from '../../../graphql/search'; +import type { SearchSuggestion } from '../../../graphql/search'; +import { SearchProviderEnum } from '../../../graphql/search'; import { useSearchProviderSuggestions } from '../../../hooks/search'; import { SearchPanelContext } from './SearchPanelContext'; import { useSearchPanelAction } from './useSearchPanelAction'; import { LogEvent, Origin, TargetType } from '../../../lib/log'; import LogContext from '../../../contexts/LogContext'; import { webappUrl } from '../../../lib/constants'; -import { ButtonProps } from '../../buttons/Button'; +import type { ButtonProps } from '../../buttons/Button'; import { SearchPanelItem } from './SearchPanelItem'; import { Image } from '../../image/Image'; import { diff --git a/packages/shared/src/components/search/SearchPanel/SearchProviderButton.tsx b/packages/shared/src/components/search/SearchPanel/SearchProviderButton.tsx index eb80090498..5ab8f54c4c 100644 --- a/packages/shared/src/components/search/SearchPanel/SearchProviderButton.tsx +++ b/packages/shared/src/components/search/SearchPanel/SearchProviderButton.tsx @@ -1,6 +1,7 @@ -import React, { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import type { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { SearchProviderEnum } from '../../../graphql/search'; +import type { SearchProviderEnum } from '../../../graphql/search'; import { Button, ButtonIconPosition, diff --git a/packages/shared/src/components/search/SearchPanel/common.tsx b/packages/shared/src/components/search/SearchPanel/common.tsx index 72970ecf5e..930ff1e784 100644 --- a/packages/shared/src/components/search/SearchPanel/common.tsx +++ b/packages/shared/src/components/search/SearchPanel/common.tsx @@ -1,7 +1,8 @@ -import React, { FunctionComponent } from 'react'; +import type { FunctionComponent } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { SearchProviderEnum } from '../../../graphql/search'; -import { IconProps } from '../../Icon'; +import type { IconProps } from '../../Icon'; import { GoogleIcon, MagicIcon, SearchIcon } from '../../icons'; export const defaultSearchProvider = SearchProviderEnum.Posts; diff --git a/packages/shared/src/components/search/SearchPanel/useSearchPanelAction.ts b/packages/shared/src/components/search/SearchPanel/useSearchPanelAction.ts index 1d3d30563a..e9d44053cd 100644 --- a/packages/shared/src/components/search/SearchPanel/useSearchPanelAction.ts +++ b/packages/shared/src/components/search/SearchPanel/useSearchPanelAction.ts @@ -1,5 +1,6 @@ -import { HTMLAttributes, ReactElement, useContext } from 'react'; -import { SearchProviderEnum } from '../../../graphql/search'; +import type { HTMLAttributes, ReactElement } from 'react'; +import { useContext } from 'react'; +import type { SearchProviderEnum } from '../../../graphql/search'; import { SearchPanelContext } from './SearchPanelContext'; import { providerToLabelTextMap } from './common'; diff --git a/packages/shared/src/components/search/SearchProgressBar.tsx b/packages/shared/src/components/search/SearchProgressBar.tsx index 3b31856804..c1dd1d09d3 100644 --- a/packages/shared/src/components/search/SearchProgressBar.tsx +++ b/packages/shared/src/components/search/SearchProgressBar.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import styles from './SearchProgressBar.module.css'; diff --git a/packages/shared/src/components/search/SearchResult.tsx b/packages/shared/src/components/search/SearchResult.tsx index 69a3e34e54..fb13d17245 100644 --- a/packages/shared/src/components/search/SearchResult.tsx +++ b/packages/shared/src/components/search/SearchResult.tsx @@ -1,21 +1,20 @@ -import React, { ReactElement, ReactNode, useCallback, useContext } from 'react'; -import { QueryKey, useMutation, useQueryClient } from '@tanstack/react-query'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useCallback, useContext } from 'react'; +import type { QueryKey } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import classNames from 'classnames'; import { WidgetContainer } from '../widgets/common'; import LogoIcon from '../../svg/LogoIcon'; import { UpvoteIcon, DownvoteIcon, CopyIcon } from '../icons'; -import { SearchMessage, SearchMessageProps } from './SearchMessage'; -import { - Search, - SearchChunk, - sendSearchFeedback, - updateSearchData, -} from '../../graphql/search'; +import type { SearchMessageProps } from './SearchMessage'; +import { SearchMessage } from './SearchMessage'; +import type { Search, SearchChunk } from '../../graphql/search'; +import { sendSearchFeedback, updateSearchData } from '../../graphql/search'; import { useCopyText } from '../../hooks/useCopy'; import { useToastNotification } from '../../hooks'; import { labels } from '../../lib'; import { Pill } from '../utilities/loaders'; -import { WithClassNameProps } from '../utilities'; +import type { WithClassNameProps } from '../utilities'; import classed from '../../lib/classed'; import LogContext from '../../contexts/LogContext'; import { LogEvent } from '../../lib/log'; diff --git a/packages/shared/src/components/search/SearchResults/SearchResultsLayout.tsx b/packages/shared/src/components/search/SearchResults/SearchResultsLayout.tsx index 0fc25621de..5a97e114b1 100644 --- a/packages/shared/src/components/search/SearchResults/SearchResultsLayout.tsx +++ b/packages/shared/src/components/search/SearchResults/SearchResultsLayout.tsx @@ -1,4 +1,5 @@ -import React, { PropsWithChildren, ReactElement, useContext } from 'react'; +import type { PropsWithChildren, ReactElement } from 'react'; +import React, { useContext } from 'react'; import { useRouter } from 'next/router'; import classNames from 'classnames'; import { PageWidgets } from '../../utilities'; @@ -8,7 +9,8 @@ import { providerToLabelTextMap, SearchProviderButton, } from '../SearchPanel'; -import { SearchProviderEnum, SearchSuggestion } from '../../../graphql/search'; +import type { SearchSuggestion } from '../../../graphql/search'; +import { SearchProviderEnum } from '../../../graphql/search'; import { useSearchResultsLayout } from '../../../hooks/search/useSearchResultsLayout'; import { LogEvent, Origin, TargetType } from '../../../lib/log'; import { useLogContext } from '../../../contexts/LogContext'; diff --git a/packages/shared/src/components/search/SearchResults/SearchResultsSources.tsx b/packages/shared/src/components/search/SearchResults/SearchResultsSources.tsx index 73b9e2a43d..29fe9a0f1a 100644 --- a/packages/shared/src/components/search/SearchResults/SearchResultsSources.tsx +++ b/packages/shared/src/components/search/SearchResults/SearchResultsSources.tsx @@ -1,9 +1,11 @@ -import React, { ReactElement } from 'react'; -import { Source, SourceType } from '../../../graphql/sources'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Source } from '../../../graphql/sources'; +import { SourceType } from '../../../graphql/sources'; import { WidgetCard } from '../../widgets/WidgetCard'; import { UserHighlight, UserType } from '../../widgets/PostUsersHighlights'; import { ListItemPlaceholder } from '../../widgets/ListItemPlaceholder'; -import { SearchSuggestion } from '../../../graphql/search'; +import type { SearchSuggestion } from '../../../graphql/search'; interface SearchResultsSourcesProps { items: SearchSuggestion[]; diff --git a/packages/shared/src/components/search/SearchResults/SearchResultsTags.tsx b/packages/shared/src/components/search/SearchResults/SearchResultsTags.tsx index 2ffa24005c..eb75d2e3aa 100644 --- a/packages/shared/src/components/search/SearchResults/SearchResultsTags.tsx +++ b/packages/shared/src/components/search/SearchResults/SearchResultsTags.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { WidgetCard } from '../../widgets/WidgetCard'; import { TagLink } from '../../TagLinks'; import { ListItemPlaceholder } from '../../widgets/ListItemPlaceholder'; -import { SearchSuggestion } from '../../../graphql/search'; +import type { SearchSuggestion } from '../../../graphql/search'; interface SearchResultsTagsProps { items: string[]; diff --git a/packages/shared/src/components/search/SearchResults/SearchResultsUsers.tsx b/packages/shared/src/components/search/SearchResults/SearchResultsUsers.tsx index a7263a2eee..e9b0627553 100644 --- a/packages/shared/src/components/search/SearchResults/SearchResultsUsers.tsx +++ b/packages/shared/src/components/search/SearchResults/SearchResultsUsers.tsx @@ -1,13 +1,15 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { WidgetCard } from '../../widgets/WidgetCard'; import { UserHighlight } from '../../widgets/PostUsersHighlights'; import { ListItemPlaceholder } from '../../widgets/ListItemPlaceholder'; -import { SearchProviderEnum, SearchSuggestion } from '../../../graphql/search'; +import type { SearchSuggestion } from '../../../graphql/search'; +import { SearchProviderEnum } from '../../../graphql/search'; import { useLogContext } from '../../../contexts/LogContext'; import { LogEvent, Origin, TargetType } from '../../../lib/log'; import { FollowButton } from '../../contentPreference/FollowButton'; import { ContentPreferenceType } from '../../../graphql/contentPreference'; -import { LoggedUser } from '../../../lib/user'; +import type { LoggedUser } from '../../../lib/user'; interface SearchResultsUsersProps { items: SearchSuggestion[]; diff --git a/packages/shared/src/components/search/SearchSkeleton.tsx b/packages/shared/src/components/search/SearchSkeleton.tsx index d33470ccf5..dfac14f54f 100644 --- a/packages/shared/src/components/search/SearchSkeleton.tsx +++ b/packages/shared/src/components/search/SearchSkeleton.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { SearchHistoryContainer } from './common'; import classed from '../../lib/classed'; import { Pill } from '../utilities/loaders'; -import { WithClassNameProps } from '../utilities'; +import type { WithClassNameProps } from '../utilities'; const ShortPill = classed(Pill, 'w-1/2'); const LongPill = classed(Pill, 'w-4/5'); diff --git a/packages/shared/src/components/search/SearchSourceItem.tsx b/packages/shared/src/components/search/SearchSourceItem.tsx index f033eaf079..d03b92da59 100644 --- a/packages/shared/src/components/search/SearchSourceItem.tsx +++ b/packages/shared/src/components/search/SearchSourceItem.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement, useCallback, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useContext } from 'react'; import { ClickableText } from '../buttons/ClickableText'; -import { SearchChunkSource } from '../../graphql/search'; +import type { SearchChunkSource } from '../../graphql/search'; import LogContext from '../../contexts/LogContext'; import { LogEvent, TargetType } from '../../lib/log'; diff --git a/packages/shared/src/components/search/SearchSourceList.tsx b/packages/shared/src/components/search/SearchSourceList.tsx index 30aca44e4e..458db568be 100644 --- a/packages/shared/src/components/search/SearchSourceList.tsx +++ b/packages/shared/src/components/search/SearchSourceList.tsx @@ -1,11 +1,12 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import classNames from 'classnames'; import { widgetClasses } from '../widgets/common'; import { ArrowIcon } from '../icons'; import { PlaceholderSearchSource } from './PlaceholderSearchSource'; import { PageWidgets } from '../utilities'; import { SearchSourceItem } from './SearchSourceItem'; -import { SearchChunkSource } from '../../graphql/search'; +import type { SearchChunkSource } from '../../graphql/search'; import { PaginationActions } from '../pagination'; import { usePagination } from '../../hooks/utils'; import useSidebarRendered from '../../hooks/useSidebarRendered'; diff --git a/packages/shared/src/components/search/SearchSubmitButton.tsx b/packages/shared/src/components/search/SearchSubmitButton.tsx index e7a10744b6..3861f78428 100644 --- a/packages/shared/src/components/search/SearchSubmitButton.tsx +++ b/packages/shared/src/components/search/SearchSubmitButton.tsx @@ -1,14 +1,11 @@ -import React, { ReactElement } from 'react'; -import { - AllowedTags, - Button, - ButtonProps, - ButtonVariant, -} from '../buttons/Button'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { AllowedTags, ButtonProps } from '../buttons/Button'; +import { Button, ButtonVariant } from '../buttons/Button'; import { SendAirplaneIcon } from '../icons'; import { IconSize } from '../Icon'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; -import { TooltipProps } from '../tooltips/BaseTooltip'; +import type { TooltipProps } from '../tooltips/BaseTooltip'; interface SearchSubmitButtonProps { tooltipProps: TooltipProps; diff --git a/packages/shared/src/components/search/common.ts b/packages/shared/src/components/search/common.ts index fce981b261..955de038a1 100644 --- a/packages/shared/src/components/search/common.ts +++ b/packages/shared/src/components/search/common.ts @@ -1,7 +1,7 @@ -import { FormEvent, InputHTMLAttributes } from 'react'; +import type { FormEvent, InputHTMLAttributes } from 'react'; import classed from '../../lib/classed'; -import { SearchChunk } from '../../graphql/search'; -import { SearchBarSuggestionListProps } from './SearchBarSuggestionList'; +import type { SearchChunk } from '../../graphql/search'; +import type { SearchBarSuggestionListProps } from './SearchBarSuggestionList'; export const SearchHistoryContainer = classed('div', 'flex flex-col gap-3 p-6'); diff --git a/packages/shared/src/components/sidebar/ClickableNavItem.tsx b/packages/shared/src/components/sidebar/ClickableNavItem.tsx index 3048d6afd9..d0e0dd0bbe 100644 --- a/packages/shared/src/components/sidebar/ClickableNavItem.tsx +++ b/packages/shared/src/components/sidebar/ClickableNavItem.tsx @@ -1,12 +1,9 @@ -import React, { - HTMLAttributes, - ReactElement, - ReactNode, - useCallback, -} from 'react'; +import type { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import React, { useCallback } from 'react'; import classNames from 'classnames'; import Link from '../utilities/Link'; -import { navBtnClass, SidebarMenuItem } from './common'; +import type { SidebarMenuItem } from './common'; +import { navBtnClass } from './common'; import { combinedClicks } from '../../lib/click'; interface ClickableNavItemProps diff --git a/packages/shared/src/components/sidebar/Section.tsx b/packages/shared/src/components/sidebar/Section.tsx index 866ae2af68..e65048c36c 100644 --- a/packages/shared/src/components/sidebar/Section.tsx +++ b/packages/shared/src/components/sidebar/Section.tsx @@ -1,15 +1,12 @@ import classNames from 'classnames'; -import React, { ReactElement, useRef } from 'react'; -import { - ItemInnerProps, - NavHeader, - NavSection, - SidebarMenuItem, -} from './common'; +import type { ReactElement } from 'react'; +import React, { useRef } from 'react'; +import type { ItemInnerProps, SidebarMenuItem } from './common'; +import { NavHeader, NavSection } from './common'; import { SidebarItem } from './SidebarItem'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { ArrowIcon } from '../icons'; -import { SettingsFlags } from '../../graphql/settings'; +import type { SettingsFlags } from '../../graphql/settings'; import { useSettingsContext } from '../../contexts/SettingsContext'; import { isNullOrUndefined } from '../../lib/func'; diff --git a/packages/shared/src/components/sidebar/Sidebar.spec.tsx b/packages/shared/src/components/sidebar/Sidebar.spec.tsx index 7127d502f3..b2d020e6f9 100644 --- a/packages/shared/src/components/sidebar/Sidebar.spec.tsx +++ b/packages/shared/src/components/sidebar/Sidebar.spec.tsx @@ -1,23 +1,20 @@ import React from 'react'; import nock from 'nock'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import AuthContext from '../../contexts/AuthContext'; import defaultUser from '../../../__tests__/fixture/loggedUser'; -import { LoggedUser } from '../../lib/user'; -import SettingsContext, { - SettingsContextData, - ThemeMode, -} from '../../contexts/SettingsContext'; -import { - mockGraphQL, - MockedGraphQLResponse, -} from '../../../__tests__/helpers/graphql'; +import type { LoggedUser } from '../../lib/user'; +import type { SettingsContextData } from '../../contexts/SettingsContext'; +import SettingsContext, { ThemeMode } from '../../contexts/SettingsContext'; +import type { MockedGraphQLResponse } from '../../../__tests__/helpers/graphql'; +import { mockGraphQL } from '../../../__tests__/helpers/graphql'; import { FEED_SETTINGS_QUERY } from '../../graphql/feedSettings'; import { AlertContextProvider } from '../../contexts/AlertContext'; import { waitForNock } from '../../../__tests__/helpers/utilities'; import ProgressiveEnhancementContext from '../../contexts/ProgressiveEnhancementContext'; -import { Alerts } from '../../graphql/alerts'; +import type { Alerts } from '../../graphql/alerts'; import { SidebarDesktop } from './SidebarDesktop'; let client: QueryClient; diff --git a/packages/shared/src/components/sidebar/Sidebar.tsx b/packages/shared/src/components/sidebar/Sidebar.tsx index 38c63c178d..7433b7d087 100644 --- a/packages/shared/src/components/sidebar/Sidebar.tsx +++ b/packages/shared/src/components/sidebar/Sidebar.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import dynamic from 'next/dynamic'; import { useViewSize, ViewSize } from '../../hooks'; import { useFeatureTheme } from '../../hooks/utils/useFeatureTheme'; diff --git a/packages/shared/src/components/sidebar/SidebarDesktop.tsx b/packages/shared/src/components/sidebar/SidebarDesktop.tsx index 6aef51f733..afd4f0b98b 100644 --- a/packages/shared/src/components/sidebar/SidebarDesktop.tsx +++ b/packages/shared/src/components/sidebar/SidebarDesktop.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import { useRouter } from 'next/router'; import { Nav, SidebarAside, SidebarScrollWrapper } from './common'; import { useSettingsContext } from '../../contexts/SettingsContext'; diff --git a/packages/shared/src/components/sidebar/SidebarItem.tsx b/packages/shared/src/components/sidebar/SidebarItem.tsx index 27c4266aff..23f7b15831 100644 --- a/packages/shared/src/components/sidebar/SidebarItem.tsx +++ b/packages/shared/src/components/sidebar/SidebarItem.tsx @@ -1,9 +1,11 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { ClickableNavItem } from './ClickableNavItem'; -import { AuthTriggersType } from '../../lib/auth'; -import { ItemInner, NavItem, type SidebarMenuItem } from './common'; +import type { AuthTriggersType } from '../../lib/auth'; +import type { SidebarMenuItem } from './common'; +import { ItemInner, NavItem } from './common'; import AuthContext from '../../contexts/AuthContext'; -import { SidebarSectionProps } from './sections/common'; +import type { SidebarSectionProps } from './sections/common'; type SidebarItemProps = Pick< SidebarSectionProps, diff --git a/packages/shared/src/components/sidebar/SidebarList.tsx b/packages/shared/src/components/sidebar/SidebarList.tsx index 0cc8b886ad..8e5e3ababe 100644 --- a/packages/shared/src/components/sidebar/SidebarList.tsx +++ b/packages/shared/src/components/sidebar/SidebarList.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import SidebarListItem, { SidebarListItemProps } from './SidebarListItem'; +import type { SidebarListItemProps } from './SidebarListItem'; +import SidebarListItem from './SidebarListItem'; import { Button, ButtonSize } from '../buttons/Button'; import { ArrowIcon } from '../icons'; import { useModalContext } from '../modals/common/types'; diff --git a/packages/shared/src/components/sidebar/SidebarListItem.tsx b/packages/shared/src/components/sidebar/SidebarListItem.tsx index a988989d14..cab22c8648 100644 --- a/packages/shared/src/components/sidebar/SidebarListItem.tsx +++ b/packages/shared/src/components/sidebar/SidebarListItem.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import type { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import React from 'react'; import Link from '../utilities/Link'; import { ArrowIcon } from '../icons'; diff --git a/packages/shared/src/components/sidebar/SidebarMenuIcon.tsx b/packages/shared/src/components/sidebar/SidebarMenuIcon.tsx index 034dd45f7c..4e906d2de8 100644 --- a/packages/shared/src/components/sidebar/SidebarMenuIcon.tsx +++ b/packages/shared/src/components/sidebar/SidebarMenuIcon.tsx @@ -1,4 +1,5 @@ -import React, { type ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import { Typography, diff --git a/packages/shared/src/components/sidebar/SidebarTablet.tsx b/packages/shared/src/components/sidebar/SidebarTablet.tsx index 90816f3553..7a5cf8d822 100644 --- a/packages/shared/src/components/sidebar/SidebarTablet.tsx +++ b/packages/shared/src/components/sidebar/SidebarTablet.tsx @@ -1,10 +1,11 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; +import type { ButtonProps } from '../buttons/Button'; import { Button, ButtonColor, ButtonIconPosition, - ButtonProps, ButtonSize, ButtonVariant, } from '../buttons/Button'; diff --git a/packages/shared/src/components/sidebar/common.tsx b/packages/shared/src/components/sidebar/common.tsx index 35f597bd38..3ad6d9ec1f 100644 --- a/packages/shared/src/components/sidebar/common.tsx +++ b/packages/shared/src/components/sidebar/common.tsx @@ -1,14 +1,14 @@ -import React, { +import type { ReactNode, ReactElement, HTMLAttributeAnchorTarget, - forwardRef, MutableRefObject, } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; import classed from '../../lib/classed'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; -import { TooltipProps } from '../tooltips/BaseTooltip'; +import type { TooltipProps } from '../tooltips/BaseTooltip'; export interface SidebarProps { promotionalBannerActive?: boolean; diff --git a/packages/shared/src/components/sidebar/sections/BookmarkSection.tsx b/packages/shared/src/components/sidebar/sections/BookmarkSection.tsx index 517ed42f3e..dac27a1d27 100644 --- a/packages/shared/src/components/sidebar/sections/BookmarkSection.tsx +++ b/packages/shared/src/components/sidebar/sections/BookmarkSection.tsx @@ -1,10 +1,12 @@ -import React, { ReactElement } from 'react'; -import { ListIcon, SidebarMenuItem } from '../common'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { SidebarMenuItem } from '../common'; +import { ListIcon } from '../common'; import { ArrowIcon, BookmarkIcon, PlusIcon } from '../../icons'; import { Section } from '../Section'; import { webappUrl } from '../../../lib/constants'; import { SidebarSettingsFlags } from '../../../graphql/settings'; -import { SidebarSectionProps } from './common'; +import type { SidebarSectionProps } from './common'; import { useLazyModal } from '../../../hooks/useLazyModal'; import { LazyModal } from '../../modals/common/types'; import { BookmarkReminderIcon } from '../../icons/Bookmark/Reminder'; diff --git a/packages/shared/src/components/sidebar/sections/CustomFeedSection.tsx b/packages/shared/src/components/sidebar/sections/CustomFeedSection.tsx index ce9e21ea55..c159fb83d5 100644 --- a/packages/shared/src/components/sidebar/sections/CustomFeedSection.tsx +++ b/packages/shared/src/components/sidebar/sections/CustomFeedSection.tsx @@ -1,11 +1,12 @@ -import React, { ReactElement, useMemo } from 'react'; -import { SidebarMenuItem } from '../common'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; +import type { SidebarMenuItem } from '../common'; import { HashtagIcon, PlusIcon } from '../../icons'; import { Section } from '../Section'; import { customFeedsPlusDate, webappUrl } from '../../../lib/constants'; import { useFeeds, usePlusSubscription } from '../../../hooks'; import { SidebarSettingsFlags } from '../../../graphql/settings'; -import { SidebarSectionProps } from './common'; +import type { SidebarSectionProps } from './common'; import { useLazyModal } from '../../../hooks/useLazyModal'; import { LazyModal } from '../../modals/common/types'; import useCustomDefaultFeed from '../../../hooks/feed/useCustomDefaultFeed'; diff --git a/packages/shared/src/components/sidebar/sections/DiscoverSection.tsx b/packages/shared/src/components/sidebar/sections/DiscoverSection.tsx index cd6e254ce8..f46da7f2d5 100644 --- a/packages/shared/src/components/sidebar/sections/DiscoverSection.tsx +++ b/packages/shared/src/components/sidebar/sections/DiscoverSection.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement, useMemo } from 'react'; -import { ListIcon, SidebarMenuItem } from '../common'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; +import type { SidebarMenuItem } from '../common'; +import { ListIcon } from '../common'; import { DiscussIcon, EarthIcon, @@ -8,7 +10,7 @@ import { SquadIcon, } from '../../icons'; import { Section } from '../Section'; -import { SidebarSectionProps } from './common'; +import type { SidebarSectionProps } from './common'; import { LazyModal } from '../../modals/common/types'; import { useLazyModal } from '../../../hooks/useLazyModal'; import { SidebarSettingsFlags } from '../../../graphql/settings'; diff --git a/packages/shared/src/components/sidebar/sections/MainSection.tsx b/packages/shared/src/components/sidebar/sections/MainSection.tsx index 03ac878ce7..2657b7ea31 100644 --- a/packages/shared/src/components/sidebar/sections/MainSection.tsx +++ b/packages/shared/src/components/sidebar/sections/MainSection.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement, useCallback, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { Section } from '../Section'; -import { ListIcon, SidebarMenuItem } from '../common'; +import type { SidebarMenuItem } from '../common'; +import { ListIcon } from '../common'; import { BookmarkIcon, DevPlusIcon, @@ -11,7 +13,7 @@ import { import { useAuthContext } from '../../../contexts/AuthContext'; import { ProfileImageSize, ProfilePicture } from '../../ProfilePicture'; import { OtherFeedPage } from '../../../lib/query'; -import { SidebarSectionProps } from './common'; +import type { SidebarSectionProps } from './common'; import { webappUrl } from '../../../lib/constants'; import { usePlusSubscription } from '../../../hooks/usePlusSubscription'; import { LogEvent, TargetId } from '../../../lib/log'; diff --git a/packages/shared/src/components/sidebar/sections/NetworkSection.tsx b/packages/shared/src/components/sidebar/sections/NetworkSection.tsx index dbfda26659..4a542ae749 100644 --- a/packages/shared/src/components/sidebar/sections/NetworkSection.tsx +++ b/packages/shared/src/components/sidebar/sections/NetworkSection.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement, useMemo } from 'react'; -import { ListIcon, SidebarMenuItem } from '../common'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; +import type { SidebarMenuItem } from '../common'; +import { ListIcon } from '../common'; import { DefaultSquadIcon, NewSquadIcon, SourceIcon } from '../../icons'; import { Section } from '../Section'; import { Origin } from '../../../lib/log'; @@ -8,7 +10,7 @@ import { useAuthContext } from '../../../contexts/AuthContext'; import { SquadImage } from '../../squads/SquadImage'; import { SidebarSettingsFlags } from '../../../graphql/settings'; import { webappUrl } from '../../../lib/constants'; -import { SidebarSectionProps } from './common'; +import type { SidebarSectionProps } from './common'; export const NetworkSection = ({ isItemsButton, diff --git a/packages/shared/src/components/sidebar/sections/ResourceSection.tsx b/packages/shared/src/components/sidebar/sections/ResourceSection.tsx index ad017d8384..6c84106c91 100644 --- a/packages/shared/src/components/sidebar/sections/ResourceSection.tsx +++ b/packages/shared/src/components/sidebar/sections/ResourceSection.tsx @@ -1,12 +1,14 @@ -import React, { ReactElement, useMemo } from 'react'; -import { ListIcon, SidebarMenuItem } from '../common'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; +import type { SidebarMenuItem } from '../common'; +import { ListIcon } from '../common'; import { DocsIcon, FeedbackIcon, TerminalIcon } from '../../icons'; import { docs, feedback, webappUrl } from '../../../lib/constants'; import { Section } from '../Section'; import { AlertColor, AlertDot } from '../../AlertDot'; import { useChangelog } from '../../../hooks/useChangelog'; import { SidebarSettingsFlags } from '../../../graphql/settings'; -import { SidebarSectionProps } from './common'; +import type { SidebarSectionProps } from './common'; export const ResourceSection = ({ isItemsButton, diff --git a/packages/shared/src/components/sources/SourceActions/SourceActionsBlock.tsx b/packages/shared/src/components/sources/SourceActions/SourceActionsBlock.tsx index 7f735ff6c5..9b77b4de9e 100644 --- a/packages/shared/src/components/sources/SourceActions/SourceActionsBlock.tsx +++ b/packages/shared/src/components/sources/SourceActions/SourceActionsBlock.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; import { BlockIcon } from '../../icons'; diff --git a/packages/shared/src/components/sources/SourceActions/SourceActionsFollow.tsx b/packages/shared/src/components/sources/SourceActions/SourceActionsFollow.tsx index be0ffcedb7..7ff7b35ecc 100644 --- a/packages/shared/src/components/sources/SourceActions/SourceActionsFollow.tsx +++ b/packages/shared/src/components/sources/SourceActions/SourceActionsFollow.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ButtonSize, ButtonVariant } from '../../buttons/common'; import { Button } from '../../buttons/Button'; diff --git a/packages/shared/src/components/sources/SourceActions/SourceActionsNotify.tsx b/packages/shared/src/components/sources/SourceActions/SourceActionsNotify.tsx index a5c010e441..e045343227 100644 --- a/packages/shared/src/components/sources/SourceActions/SourceActionsNotify.tsx +++ b/packages/shared/src/components/sources/SourceActions/SourceActionsNotify.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ButtonSize, ButtonVariant } from '../../buttons/common'; import { SimpleTooltip } from '../../tooltips/SimpleTooltip'; import { Button } from '../../buttons/Button'; diff --git a/packages/shared/src/components/sources/SourceActions/index.tsx b/packages/shared/src/components/sources/SourceActions/index.tsx index 2807670fd1..266ef8d4c3 100644 --- a/packages/shared/src/components/sources/SourceActions/index.tsx +++ b/packages/shared/src/components/sources/SourceActions/index.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import { ButtonVariant } from '../../buttons/common'; -import { Source } from '../../../graphql/sources'; +import type { Source } from '../../../graphql/sources'; import { ReferralCampaignKey, useSourceActions } from '../../../hooks'; import SourceActionsNotify from './SourceActionsNotify'; import SourceActionsBlock from './SourceActionsBlock'; diff --git a/packages/shared/src/components/squads/Details.tsx b/packages/shared/src/components/squads/Details.tsx index 45977d3358..502c4e1fc1 100644 --- a/packages/shared/src/components/squads/Details.tsx +++ b/packages/shared/src/components/squads/Details.tsx @@ -1,13 +1,7 @@ -import React, { - FormEvent, - ReactElement, - ReactNode, - useCallback, - useMemo, - useState, -} from 'react'; +import type { FormEvent, ReactElement, ReactNode } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; import classNames from 'classnames'; -import { ClientError } from 'graphql-request'; +import type { ClientError } from 'graphql-request'; import { useMutation } from '@tanstack/react-query'; import { useRouter } from 'next/router'; import { ButtonColor, ButtonSize, ButtonVariant } from '../buttons/Button'; @@ -17,7 +11,8 @@ import Textarea from '../fields/Textarea'; import ImageInput from '../fields/ImageInput'; import { cloudinarySquadsImageFallback } from '../../lib/image'; import { formToJson } from '../../lib/form'; -import { checkExistingHandle, SquadForm } from '../../graphql/squads'; +import type { SquadForm } from '../../graphql/squads'; +import { checkExistingHandle } from '../../graphql/squads'; import { capitalize } from '../../lib/strings'; import { IconSize } from '../Icon'; import { FormWrapper } from '../fields/form'; @@ -27,7 +22,7 @@ import { SquadSettingsSection } from './settings'; import { SquadStats } from './common/SquadStat'; import { SquadPrivacyState } from './common/SquadPrivacyState'; import { SquadDangerZone } from './settings/SquadDangerZone'; -import { Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; import { useViewSize, ViewSize } from '../../hooks'; import { useSlackChannelsQuery } from '../../hooks/integrations/slack/useSlackChannelsQuery'; import { Dropdown } from '../fields/Dropdown'; diff --git a/packages/shared/src/components/squads/MangeSquadPageSkeleton.tsx b/packages/shared/src/components/squads/MangeSquadPageSkeleton.tsx index fd0ceac7f2..683e10e5d3 100644 --- a/packages/shared/src/components/squads/MangeSquadPageSkeleton.tsx +++ b/packages/shared/src/components/squads/MangeSquadPageSkeleton.tsx @@ -1,4 +1,5 @@ -import React, { PropsWithChildren, ReactElement } from 'react'; +import type { PropsWithChildren, ReactElement } from 'react'; +import React from 'react'; import { ManageSquadPageMain, ManageSquadPageContainer } from './utils'; import { ElementPlaceholder } from '../ElementPlaceholder'; diff --git a/packages/shared/src/components/squads/Members/BlockedMembersPlaceholder.tsx b/packages/shared/src/components/squads/Members/BlockedMembersPlaceholder.tsx index f36618b568..c736bbda4d 100644 --- a/packages/shared/src/components/squads/Members/BlockedMembersPlaceholder.tsx +++ b/packages/shared/src/components/squads/Members/BlockedMembersPlaceholder.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { BlockIcon } from '../../icons'; import { IconSize } from '../../Icon'; diff --git a/packages/shared/src/components/squads/Members/PrivilegedMemberItem.tsx b/packages/shared/src/components/squads/Members/PrivilegedMemberItem.tsx index c0219b2473..9ad4746473 100644 --- a/packages/shared/src/components/squads/Members/PrivilegedMemberItem.tsx +++ b/packages/shared/src/components/squads/Members/PrivilegedMemberItem.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ProfileImageSize, ProfilePicture } from '../../ProfilePicture'; import SquadMemberBadge from '../SquadMemberBadge'; -import { SourceMember } from '../../../graphql/sources'; +import type { SourceMember } from '../../../graphql/sources'; import { ProfileTooltip } from '../../profile/ProfileTooltip'; import { ProfileLink } from '../../profile/ProfileLink'; diff --git a/packages/shared/src/components/squads/PromotionTour.tsx b/packages/shared/src/components/squads/PromotionTour.tsx index a271d830c0..fdde039c88 100644 --- a/packages/shared/src/components/squads/PromotionTour.tsx +++ b/packages/shared/src/components/squads/PromotionTour.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import { cloudinarySquadsPromotionRemove, cloudinarySquadsPromotionPromote, @@ -13,7 +14,8 @@ import Carousel from '../containers/Carousel'; import { ModalFooter } from '../modals/common/ModalFooter'; import SquadTourCard from './SquadTourCard'; import classed from '../../lib/classed'; -import { Source, SourceMemberRole } from '../../graphql/sources'; +import type { Source } from '../../graphql/sources'; +import { SourceMemberRole } from '../../graphql/sources'; import { StarIcon, UserIcon } from '../icons'; import { capitalize } from '../../lib/strings'; import { ProfileImageSize, ProfilePicture } from '../ProfilePicture'; diff --git a/packages/shared/src/components/squads/SharePostBar.tsx b/packages/shared/src/components/squads/SharePostBar.tsx index bb52082de2..307d00ab19 100644 --- a/packages/shared/src/components/squads/SharePostBar.tsx +++ b/packages/shared/src/components/squads/SharePostBar.tsx @@ -1,4 +1,5 @@ -import React, { FormEvent, ReactElement, useRef, useState } from 'react'; +import type { FormEvent, ReactElement } from 'react'; +import React, { useRef, useState } from 'react'; import classNames from 'classnames'; import { ProfileImageSize, ProfilePicture } from '../ProfilePicture'; import { Button, ButtonColor, ButtonVariant } from '../buttons/Button'; @@ -10,8 +11,8 @@ import { usePostToSquad, useViewSize, ViewSize } from '../../hooks'; import { ClickableText } from '../buttons/ClickableText'; import { useLazyModal } from '../../hooks/useLazyModal'; import { LazyModal } from '../modals/common/types'; -import { Squad } from '../../graphql/sources'; -import { ExternalLinkPreview } from '../../graphql/posts'; +import type { Squad } from '../../graphql/sources'; +import type { ExternalLinkPreview } from '../../graphql/posts'; export interface SharePostBarProps { className?: string; diff --git a/packages/shared/src/components/squads/SquadActionButton.tsx b/packages/shared/src/components/squads/SquadActionButton.tsx index d3de5dbe1e..f53d83a437 100644 --- a/packages/shared/src/components/squads/SquadActionButton.tsx +++ b/packages/shared/src/components/squads/SquadActionButton.tsx @@ -1,17 +1,21 @@ -import React, { ReactElement, useEffect, MouseEvent } from 'react'; +import type { ReactElement, MouseEvent } from 'react'; +import React, { useEffect } from 'react'; import classNames from 'classnames'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import Link from 'next/link'; -import { SourceMemberRole, Squad } from '../../graphql/sources'; -import { Button, ButtonProps, ButtonVariant } from '../buttons/Button'; +import type { Squad } from '../../graphql/sources'; +import { SourceMemberRole } from '../../graphql/sources'; +import type { ButtonProps } from '../buttons/Button'; +import { Button, ButtonVariant } from '../buttons/Button'; import { useAuthContext } from '../../contexts/AuthContext'; import { useToastNotification } from '../../hooks/useToastNotification'; import { useJoinSquad, useLeaveSquad } from '../../hooks'; import { labels } from '../../lib'; import { useLogContext } from '../../contexts/LogContext'; -import { LogEvent, Origin, TargetType } from '../../lib/log'; +import type { Origin } from '../../lib/log'; +import { LogEvent, TargetType } from '../../lib/log'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; -import { UserShortProfile } from '../../lib/user'; +import type { UserShortProfile } from '../../lib/user'; import { generateQueryKey, RequestKey } from '../../lib/query'; import { AuthTriggers } from '../../lib/auth'; diff --git a/packages/shared/src/components/squads/SquadCommentJoinBanner.tsx b/packages/shared/src/components/squads/SquadCommentJoinBanner.tsx index 488243873a..88e5f65a52 100644 --- a/packages/shared/src/components/squads/SquadCommentJoinBanner.tsx +++ b/packages/shared/src/components/squads/SquadCommentJoinBanner.tsx @@ -1,17 +1,18 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import classNames from 'classnames'; -import { Origin } from '../../lib/log'; +import type { Origin } from '../../lib/log'; import { Button, ButtonColor, ButtonVariant } from '../buttons/Button'; import { SimpleSquadJoinButton } from './SquadActionButton'; -import { Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; import usePersistentContext from '../../hooks/usePersistentContext'; import { useJoinSquad, useViewSize, ViewSize } from '../../hooks'; import { labels } from '../../lib'; import { useToastNotification } from '../../hooks/useToastNotification'; import SourceButton from '../cards/common/SourceButton'; import { SQUAD_COMMENT_JOIN_BANNER_KEY } from '../../graphql/squads'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import { ProfileImageSize } from '../ProfilePicture'; export type SquadCommentJoinBannerProps = { diff --git a/packages/shared/src/components/squads/SquadEmptyScreen.tsx b/packages/shared/src/components/squads/SquadEmptyScreen.tsx index d20500edd6..38866c87ec 100644 --- a/packages/shared/src/components/squads/SquadEmptyScreen.tsx +++ b/packages/shared/src/components/squads/SquadEmptyScreen.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import SettingsContext, { ThemeMode } from '../../contexts/SettingsContext'; import { useViewSize, ViewSize } from '../../hooks'; import { diff --git a/packages/shared/src/components/squads/SquadFeedHeading.tsx b/packages/shared/src/components/squads/SquadFeedHeading.tsx index 64227d3580..94d0841253 100644 --- a/packages/shared/src/components/squads/SquadFeedHeading.tsx +++ b/packages/shared/src/components/squads/SquadFeedHeading.tsx @@ -1,7 +1,8 @@ -import React, { ReactElement, useContext, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; import { Button, ButtonVariant } from '../buttons/Button'; import { PinIcon } from '../icons'; -import { Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; import { ActiveFeedContext } from '../../contexts'; import { useSquadActions } from '../../hooks'; diff --git a/packages/shared/src/components/squads/SquadHeaderBar.spec.tsx b/packages/shared/src/components/squads/SquadHeaderBar.spec.tsx index 02149e6f18..1f014b256c 100644 --- a/packages/shared/src/components/squads/SquadHeaderBar.spec.tsx +++ b/packages/shared/src/components/squads/SquadHeaderBar.spec.tsx @@ -1,5 +1,6 @@ import { QueryClient } from '@tanstack/react-query'; -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import React from 'react'; import { SquadHeaderBar } from './SquadHeaderBar'; diff --git a/packages/shared/src/components/squads/SquadHeaderBar.tsx b/packages/shared/src/components/squads/SquadHeaderBar.tsx index f5b59390aa..8b09dfbb2c 100644 --- a/packages/shared/src/components/squads/SquadHeaderBar.tsx +++ b/packages/shared/src/components/squads/SquadHeaderBar.tsx @@ -1,18 +1,13 @@ import classNames from 'classnames'; -import React, { HTMLAttributes, ReactElement, useMemo } from 'react'; -import { - AllowedTags, - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from '../buttons/Button'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React, { useMemo } from 'react'; +import type { AllowedTags, ButtonProps } from '../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; import SquadHeaderMenu from './SquadHeaderMenu'; import useContextMenu from '../../hooks/useContextMenu'; -import SquadMemberShortList, { - SquadMemberShortListProps, -} from './SquadMemberShortList'; +import type { SquadMemberShortListProps } from './SquadMemberShortList'; +import SquadMemberShortList from './SquadMemberShortList'; import { useSquadInvitation } from '../../hooks/useSquadInvitation'; import { Origin } from '../../lib/log'; import { verifyPermission } from '../../graphql/squads'; diff --git a/packages/shared/src/components/squads/SquadHeaderMenu.tsx b/packages/shared/src/components/squads/SquadHeaderMenu.tsx index 2fdc1a9ef6..242b273c51 100644 --- a/packages/shared/src/components/squads/SquadHeaderMenu.tsx +++ b/packages/shared/src/components/squads/SquadHeaderMenu.tsx @@ -1,12 +1,10 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import dynamic from 'next/dynamic'; import { useRouter } from 'next/router'; import { useMutation } from '@tanstack/react-query'; -import { - Squad, - SourcePermissions, - SourceMemberRole, -} from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; +import { SourcePermissions, SourceMemberRole } from '../../graphql/sources'; import { useLazyModal } from '../../hooks/useLazyModal'; import { LazyModal } from '../modals/common/types'; import { useDeleteSquad } from '../../hooks/useDeleteSquad'; @@ -28,7 +26,7 @@ import { HashtagIcon, } from '../icons'; import { squadFeedback } from '../../lib/constants'; -import { MenuItemProps } from '../fields/ContextMenu'; +import type { MenuItemProps } from '../fields/ContextMenu'; import { useSquadInvitation } from '../../hooks/useSquadInvitation'; import { Origin } from '../../lib/log'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/components/squads/SquadImage.tsx b/packages/shared/src/components/squads/SquadImage.tsx index 0c0c822dc1..24574cc83e 100644 --- a/packages/shared/src/components/squads/SquadImage.tsx +++ b/packages/shared/src/components/squads/SquadImage.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; import { Image } from '../image/Image'; import { cloudinarySquadsImageFallback } from '../../lib/image'; diff --git a/packages/shared/src/components/squads/SquadMemberBadge.tsx b/packages/shared/src/components/squads/SquadMemberBadge.tsx index e1116d5e6c..5d9d6b4941 100644 --- a/packages/shared/src/components/squads/SquadMemberBadge.tsx +++ b/packages/shared/src/components/squads/SquadMemberBadge.tsx @@ -1,9 +1,10 @@ -import React, { FunctionComponent, ReactElement } from 'react'; +import type { FunctionComponent, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { SourceMemberRole } from '../../graphql/sources'; import { StarIcon, UserIcon } from '../icons'; import UserBadge from '../UserBadge'; -import { IconProps } from '../Icon'; +import type { IconProps } from '../Icon'; interface SquadMemberBadgeProps { role: SourceMemberRole; diff --git a/packages/shared/src/components/squads/SquadMemberItemOptionsButton.tsx b/packages/shared/src/components/squads/SquadMemberItemOptionsButton.tsx index 1baf2fb442..7ab52d10cc 100644 --- a/packages/shared/src/components/squads/SquadMemberItemOptionsButton.tsx +++ b/packages/shared/src/components/squads/SquadMemberItemOptionsButton.tsx @@ -1,10 +1,13 @@ -import React, { ReactElement } from 'react'; -import { SourceMember, SourceMemberRole } from '../../graphql/sources'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { SourceMember } from '../../graphql/sources'; +import { SourceMemberRole } from '../../graphql/sources'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { BlockIcon, MenuIcon } from '../icons'; import { SimpleTooltip } from '../tooltips/SimpleTooltip'; import { useAuthContext } from '../../contexts/AuthContext'; -import { PromptOptions, usePrompt } from '../../hooks/usePrompt'; +import type { PromptOptions } from '../../hooks/usePrompt'; +import { usePrompt } from '../../hooks/usePrompt'; import { UserShortInfo } from '../profile/UserShortInfo'; import { useToastNotification } from '../../hooks'; diff --git a/packages/shared/src/components/squads/SquadMemberItemRole.tsx b/packages/shared/src/components/squads/SquadMemberItemRole.tsx index 890fb72220..caa9c1cf35 100644 --- a/packages/shared/src/components/squads/SquadMemberItemRole.tsx +++ b/packages/shared/src/components/squads/SquadMemberItemRole.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { SourceMember, SourceMemberRole } from '../../graphql/sources'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { SourceMember } from '../../graphql/sources'; +import { SourceMemberRole } from '../../graphql/sources'; import { useAuthContext } from '../../contexts/AuthContext'; import SquadMemberBadge from './SquadMemberBadge'; diff --git a/packages/shared/src/components/squads/SquadMemberMenu.tsx b/packages/shared/src/components/squads/SquadMemberMenu.tsx index e273ab02c7..dd4d8e6bb5 100644 --- a/packages/shared/src/components/squads/SquadMemberMenu.tsx +++ b/packages/shared/src/components/squads/SquadMemberMenu.tsx @@ -1,18 +1,17 @@ -import React, { ReactElement, useContext, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; import AuthContext from '../../contexts/AuthContext'; import { reportSquadMember } from '../../lib/constants'; import { IconSize } from '../Icon'; -import { - SourceMember, - SourceMemberRole, - SourcePermissions, - Squad, -} from '../../graphql/sources'; +import type { SourceMember, Squad } from '../../graphql/sources'; +import { SourceMemberRole, SourcePermissions } from '../../graphql/sources'; import { StarIcon, UserIcon, SquadIcon, BlockIcon, FlagIcon } from '../icons'; import { usePrompt } from '../../hooks/usePrompt'; import { UserShortInfo } from '../profile/UserShortInfo'; -import ContextMenu, { MenuItemProps } from '../fields/ContextMenu'; -import { UseSquadActions, useToastNotification } from '../../hooks'; +import type { MenuItemProps } from '../fields/ContextMenu'; +import ContextMenu from '../fields/ContextMenu'; +import type { UseSquadActions } from '../../hooks'; +import { useToastNotification } from '../../hooks'; import { verifyPermission } from '../../graphql/squads'; import { ButtonColor, ButtonVariant } from '../buttons/Button'; import { ContextMenu as ContextMenuIds } from '../../hooks/constants'; diff --git a/packages/shared/src/components/squads/SquadMemberShortList.tsx b/packages/shared/src/components/squads/SquadMemberShortList.tsx index 14d6890c0b..d391240696 100644 --- a/packages/shared/src/components/squads/SquadMemberShortList.tsx +++ b/packages/shared/src/components/squads/SquadMemberShortList.tsx @@ -1,6 +1,7 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; -import { BasicSourceMember, Squad } from '../../graphql/sources'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { BasicSourceMember, Squad } from '../../graphql/sources'; import { useLazyModal } from '../../hooks/useLazyModal'; import { LazyModal } from '../modals/common/types'; import { diff --git a/packages/shared/src/components/squads/SquadPageHeader.tsx b/packages/shared/src/components/squads/SquadPageHeader.tsx index 51d674d0b2..70e052ad24 100644 --- a/packages/shared/src/components/squads/SquadPageHeader.tsx +++ b/packages/shared/src/components/squads/SquadPageHeader.tsx @@ -1,10 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { - BasicSourceMember, - SourcePermissions, - Squad, -} from '../../graphql/sources'; +import type { BasicSourceMember, Squad } from '../../graphql/sources'; +import { SourcePermissions } from '../../graphql/sources'; import { SquadHeaderBar } from './SquadHeaderBar'; import { SquadImage } from './SquadImage'; import EnableNotification from '../notifications/EnableNotification'; diff --git a/packages/shared/src/components/squads/SquadPostListItem.tsx b/packages/shared/src/components/squads/SquadPostListItem.tsx index 75805f203e..2be8425bcd 100644 --- a/packages/shared/src/components/squads/SquadPostListItem.tsx +++ b/packages/shared/src/components/squads/SquadPostListItem.tsx @@ -1,8 +1,9 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import styles from '../cards/common/Card.module.css'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import { ElementPlaceholder } from '../ElementPlaceholder'; import { TextPlaceholder } from '../widgets/common'; import SquadPostAuthor from '../post/SquadPostAuthor'; diff --git a/packages/shared/src/components/squads/SquadTabs.tsx b/packages/shared/src/components/squads/SquadTabs.tsx index 38144d7d1d..076ed18411 100644 --- a/packages/shared/src/components/squads/SquadTabs.tsx +++ b/packages/shared/src/components/squads/SquadTabs.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { TabContainer, Tab } from '../tabs/TabContainer'; import { webappUrl } from '../../lib/constants'; -import { SourcePermissions, Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; +import { SourcePermissions } from '../../graphql/sources'; import { verifyPermission } from '../../graphql/squads'; export enum SquadTab { diff --git a/packages/shared/src/components/squads/SquadTour.tsx b/packages/shared/src/components/squads/SquadTour.tsx index 6a9a880293..d2b3dfd456 100644 --- a/packages/shared/src/components/squads/SquadTour.tsx +++ b/packages/shared/src/components/squads/SquadTour.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { cloudinarySquadsTourBanner0, cloudinarySquadsTourBanner1V2, @@ -13,7 +14,7 @@ import { ModalFooter } from '../modals/common/ModalFooter'; import SquadTourCard from './SquadTourCard'; import classed from '../../lib/classed'; import { useSquadTour } from '../../hooks/useSquadTour'; -import { PopupCloseFunc } from '../drawers'; +import type { PopupCloseFunc } from '../drawers'; interface SquadTourProps { onClose: PopupCloseFunc; diff --git a/packages/shared/src/components/squads/SquadTourCard.tsx b/packages/shared/src/components/squads/SquadTourCard.tsx index e9e070919a..e3209835c5 100644 --- a/packages/shared/src/components/squads/SquadTourCard.tsx +++ b/packages/shared/src/components/squads/SquadTourCard.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { Badge } from '../tooltips/utils'; import { FlexCol } from '../utilities'; diff --git a/packages/shared/src/components/squads/SquadsToShare.tsx b/packages/shared/src/components/squads/SquadsToShare.tsx index 8bf39e7106..4fa411cf50 100644 --- a/packages/shared/src/components/squads/SquadsToShare.tsx +++ b/packages/shared/src/components/squads/SquadsToShare.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement, MouseEvent, useMemo } from 'react'; +import type { ReactElement, MouseEvent } from 'react'; +import React, { useMemo } from 'react'; import { verifyPermission } from '../../graphql/squads'; -import { SourcePermissions, Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; +import { SourcePermissions } from '../../graphql/sources'; import SourceProfilePicture from '../profile/SourceProfilePicture'; import { SocialShareButton } from '../widgets/SocialShareButton'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/components/squads/common/SquadPrivacyState.tsx b/packages/shared/src/components/squads/common/SquadPrivacyState.tsx index e2c14b387a..83fae55aa1 100644 --- a/packages/shared/src/components/squads/common/SquadPrivacyState.tsx +++ b/packages/shared/src/components/squads/common/SquadPrivacyState.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; import { EarthIcon, LockIcon, SourceIcon, SparkleIcon } from '../../icons'; diff --git a/packages/shared/src/components/squads/common/SquadStat.tsx b/packages/shared/src/components/squads/common/SquadStat.tsx index 6bfe281570..537c939752 100644 --- a/packages/shared/src/components/squads/common/SquadStat.tsx +++ b/packages/shared/src/components/squads/common/SquadStat.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { largeNumberFormat } from '../../../lib'; -import { Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; interface SquadStatProps { count: number; diff --git a/packages/shared/src/components/squads/layout/SquadDirectoryLayout.tsx b/packages/shared/src/components/squads/layout/SquadDirectoryLayout.tsx index 40ef6400f0..55ddcc99eb 100644 --- a/packages/shared/src/components/squads/layout/SquadDirectoryLayout.tsx +++ b/packages/shared/src/components/squads/layout/SquadDirectoryLayout.tsx @@ -1,18 +1,9 @@ -import React, { - ComponentProps, - PropsWithChildren, - ReactElement, - useEffect, - useId, -} from 'react'; +import type { ComponentProps, PropsWithChildren, ReactElement } from 'react'; +import React, { useEffect, useId } from 'react'; import { useRouter } from 'next/router'; import classNames from 'classnames'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from '../../buttons/Button'; +import type { ButtonProps } from '../../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; import { BaseFeedPage } from '../../utilities'; import { useSquadNavigation } from '../../../hooks'; import { Origin } from '../../../lib/log'; diff --git a/packages/shared/src/components/squads/layout/SquadDirectoryNavbar.tsx b/packages/shared/src/components/squads/layout/SquadDirectoryNavbar.tsx index 2b33121863..d73367f080 100644 --- a/packages/shared/src/components/squads/layout/SquadDirectoryNavbar.tsx +++ b/packages/shared/src/components/squads/layout/SquadDirectoryNavbar.tsx @@ -1,4 +1,5 @@ -import React, { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Button, ButtonSize, ButtonVariant } from '../../buttons/Button'; import { useHorizontalScrollHeader } from '../../HorizontalScroll/useHorizontalScrollHeader'; diff --git a/packages/shared/src/components/squads/layout/SquadDirectoryNavbarItem.tsx b/packages/shared/src/components/squads/layout/SquadDirectoryNavbarItem.tsx index 17aed354ca..a370fa1eed 100644 --- a/packages/shared/src/components/squads/layout/SquadDirectoryNavbarItem.tsx +++ b/packages/shared/src/components/squads/layout/SquadDirectoryNavbarItem.tsx @@ -1,13 +1,10 @@ import classNames from 'classnames'; -import React, { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; +import React from 'react'; import Link from 'next/link'; import ConditionalWrapper from '../../ConditionalWrapper'; -import { - Button, - ButtonProps, - ButtonSize, - ButtonVariant, -} from '../../buttons/Button'; +import type { ButtonProps, ButtonSize } from '../../buttons/Button'; +import { Button, ButtonVariant } from '../../buttons/Button'; interface SquadNavbarItemProps { buttonSize: ButtonSize; diff --git a/packages/shared/src/components/squads/layout/useSquadDirectoryLayout.ts b/packages/shared/src/components/squads/layout/useSquadDirectoryLayout.ts index dc1998dffb..43b7c2f10f 100644 --- a/packages/shared/src/components/squads/layout/useSquadDirectoryLayout.ts +++ b/packages/shared/src/components/squads/layout/useSquadDirectoryLayout.ts @@ -2,7 +2,7 @@ import { useMemo } from 'react'; import { useAuthContext } from '../../../contexts/AuthContext'; import { squadCategoriesPaths } from '../../../lib/constants'; import { useViewSize, ViewSize } from '../../../hooks'; -import { Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; import { useSquadCategories } from '../../../hooks/squads/useSquadCategories'; interface SquadDirectoryLayoutReturn { diff --git a/packages/shared/src/components/squads/moderation/SquadEmptyScreen.tsx b/packages/shared/src/components/squads/moderation/SquadEmptyScreen.tsx index cdec1dc697..1c84f31b4b 100644 --- a/packages/shared/src/components/squads/moderation/SquadEmptyScreen.tsx +++ b/packages/shared/src/components/squads/moderation/SquadEmptyScreen.tsx @@ -1,5 +1,7 @@ -import React, { FC, ReactElement } from 'react'; -import { IconProps, IconSize } from '../../Icon'; +import type { FC, ReactElement } from 'react'; +import React from 'react'; +import type { IconProps } from '../../Icon'; +import { IconSize } from '../../Icon'; import { TypographyColor, Typography, diff --git a/packages/shared/src/components/squads/moderation/SquadModerationActions.tsx b/packages/shared/src/components/squads/moderation/SquadModerationActions.tsx index 1a8d783921..6fc15e868c 100644 --- a/packages/shared/src/components/squads/moderation/SquadModerationActions.tsx +++ b/packages/shared/src/components/squads/moderation/SquadModerationActions.tsx @@ -1,4 +1,5 @@ -import React, { MouseEventHandler, ReactElement } from 'react'; +import type { MouseEventHandler, ReactElement } from 'react'; +import React from 'react'; import { Button } from '../../buttons/Button'; import { ButtonSize, ButtonVariant } from '../../buttons/common'; import { BlockIcon, VIcon } from '../../icons'; diff --git a/packages/shared/src/components/squads/moderation/SquadModerationEmptyScreen.tsx b/packages/shared/src/components/squads/moderation/SquadModerationEmptyScreen.tsx index b02302c75b..a387485478 100644 --- a/packages/shared/src/components/squads/moderation/SquadModerationEmptyScreen.tsx +++ b/packages/shared/src/components/squads/moderation/SquadModerationEmptyScreen.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { VIcon } from '../../icons'; -import { SourcePermissions, Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; +import { SourcePermissions } from '../../../graphql/sources'; import { SquadEmptyScreen } from './SquadEmptyScreen'; import { ElementPlaceholder } from '../../ElementPlaceholder'; import { verifyPermission } from '../../../graphql/squads'; diff --git a/packages/shared/src/components/squads/moderation/SquadModerationItem.tsx b/packages/shared/src/components/squads/moderation/SquadModerationItem.tsx index 77e5b79568..4bcc8a5f2e 100644 --- a/packages/shared/src/components/squads/moderation/SquadModerationItem.tsx +++ b/packages/shared/src/components/squads/moderation/SquadModerationItem.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Typography, TypographyColor, @@ -17,10 +18,8 @@ import { capitalize } from '../../../lib/strings'; import { TimerIcon, WarningIcon } from '../../icons'; import { AlertColor } from '../../AlertDot'; import { useTruncatedSummary } from '../../../hooks'; -import { - SquadModerationItemProps, - useSourceModerationItem, -} from './useSourceModerationItem'; +import type { SquadModerationItemProps } from './useSourceModerationItem'; +import { useSourceModerationItem } from './useSourceModerationItem'; import { SquadModerationItemContextMenu } from './SquadModerationItemContextMenu'; export function SquadModerationItem( diff --git a/packages/shared/src/components/squads/moderation/SquadModerationItemContextMenu.tsx b/packages/shared/src/components/squads/moderation/SquadModerationItemContextMenu.tsx index 352660405b..acc2a39e67 100644 --- a/packages/shared/src/components/squads/moderation/SquadModerationItemContextMenu.tsx +++ b/packages/shared/src/components/squads/moderation/SquadModerationItemContextMenu.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useId } from 'react'; +import type { ReactElement } from 'react'; +import React, { useId } from 'react'; import { useRouter } from 'next/router'; import OptionsButton from '../../buttons/OptionsButton'; import ContextMenu from '../../fields/ContextMenu'; @@ -6,7 +7,7 @@ import { EditIcon, TrashIcon } from '../../icons'; import useContextMenu from '../../../hooks/useContextMenu'; import { usePrompt } from '../../../hooks/usePrompt'; import { ButtonSize } from '../../buttons/common'; -import { SourcePostModeration } from '../../../graphql/squads'; +import type { SourcePostModeration } from '../../../graphql/squads'; interface SquadModerationItemContextMenuProps extends Pick { diff --git a/packages/shared/src/components/squads/moderation/SquadModerationList.tsx b/packages/shared/src/components/squads/moderation/SquadModerationList.tsx index 5f3b4dfc69..09ac12211e 100644 --- a/packages/shared/src/components/squads/moderation/SquadModerationList.tsx +++ b/packages/shared/src/components/squads/moderation/SquadModerationList.tsx @@ -1,11 +1,13 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import { Button } from '../../buttons/Button'; import { ButtonVariant, ButtonSize } from '../../buttons/common'; import { VIcon } from '../../icons'; import { useSourceModerationList } from '../../../hooks/squads/useSourceModerationList'; import { useSquadPendingPosts } from '../../../hooks/squads/useSquadPendingPosts'; import { SquadModerationItem } from './SquadModerationItem'; -import { SourcePermissions, Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; +import { SourcePermissions } from '../../../graphql/sources'; import InfiniteScrolling from '../../containers/InfiniteScrolling'; import { SourcePostModerationStatus, diff --git a/packages/shared/src/components/squads/moderation/useSourceModerationItem.ts b/packages/shared/src/components/squads/moderation/useSourceModerationItem.ts index 1b2e43b9c4..f64cf63e93 100644 --- a/packages/shared/src/components/squads/moderation/useSourceModerationItem.ts +++ b/packages/shared/src/components/squads/moderation/useSourceModerationItem.ts @@ -1,11 +1,11 @@ -import { MouseEventHandler, useId } from 'react'; -import { - SourcePostModeration, - verifyPermission, -} from '../../../graphql/squads'; +import type { MouseEventHandler } from 'react'; +import { useId } from 'react'; +import type { SourcePostModeration } from '../../../graphql/squads'; +import { verifyPermission } from '../../../graphql/squads'; import useContextMenu from '../../../hooks/useContextMenu'; import { useLazyModal } from '../../../hooks/useLazyModal'; -import { SourcePermissions, Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; +import { SourcePermissions } from '../../../graphql/sources'; import { LazyModal } from '../../modals/common/types'; import { useSourceModerationList } from '../../../hooks/squads/useSourceModerationList'; diff --git a/packages/shared/src/components/squads/settings/SquadCategoryDropdown.tsx b/packages/shared/src/components/squads/settings/SquadCategoryDropdown.tsx index ae95b9d82a..a3b51e06f2 100644 --- a/packages/shared/src/components/squads/settings/SquadCategoryDropdown.tsx +++ b/packages/shared/src/components/squads/settings/SquadCategoryDropdown.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect, useMemo, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; import { Typography, TypographyColor, diff --git a/packages/shared/src/components/squads/settings/SquadDangerZone.tsx b/packages/shared/src/components/squads/settings/SquadDangerZone.tsx index cd0a016b47..16d2b5a412 100644 --- a/packages/shared/src/components/squads/settings/SquadDangerZone.tsx +++ b/packages/shared/src/components/squads/settings/SquadDangerZone.tsx @@ -1,9 +1,10 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import { DangerZone } from '../../widgets/DangerZone'; import { SquadSettingsSection } from './SquadSettingsSection'; import { useDeleteSquad } from '../../../hooks/useDeleteSquad'; -import { Squad } from '../../../graphql/sources'; +import type { Squad } from '../../../graphql/sources'; import { anchorDefaultRel } from '../../../lib/strings'; interface SquadDangerZoneProps { diff --git a/packages/shared/src/components/squads/settings/SquadModerationSettingsSection.tsx b/packages/shared/src/components/squads/settings/SquadModerationSettingsSection.tsx index fea9667164..d497c7651e 100644 --- a/packages/shared/src/components/squads/settings/SquadModerationSettingsSection.tsx +++ b/packages/shared/src/components/squads/settings/SquadModerationSettingsSection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import { SquadSettingsSection } from './SquadSettingsSection'; import { Radio } from '../../fields/Radio'; import { SourceMemberRole } from '../../../graphql/sources'; diff --git a/packages/shared/src/components/squads/settings/SquadPrivacySection.tsx b/packages/shared/src/components/squads/settings/SquadPrivacySection.tsx index b8789d9b19..675b04b6d9 100644 --- a/packages/shared/src/components/squads/settings/SquadPrivacySection.tsx +++ b/packages/shared/src/components/squads/settings/SquadPrivacySection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useMemo, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo, useState } from 'react'; import { Radio } from '../../fields/Radio'; import { SquadSettingsSection } from './SquadSettingsSection'; import { diff --git a/packages/shared/src/components/squads/settings/SquadSettingsSection.tsx b/packages/shared/src/components/squads/settings/SquadSettingsSection.tsx index ea8dd21e73..045d09a912 100644 --- a/packages/shared/src/components/squads/settings/SquadSettingsSection.tsx +++ b/packages/shared/src/components/squads/settings/SquadSettingsSection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; interface SettingsSectionProps { diff --git a/packages/shared/src/components/squads/utils.tsx b/packages/shared/src/components/squads/utils.tsx index 51e814ee16..da2f560756 100644 --- a/packages/shared/src/components/squads/utils.tsx +++ b/packages/shared/src/components/squads/utils.tsx @@ -1,4 +1,5 @@ -import React, { PropsWithChildren, ReactElement } from 'react'; +import type { PropsWithChildren, ReactElement } from 'react'; +import React from 'react'; import classed from '../../lib/classed'; import { Typography, @@ -6,15 +7,13 @@ import { TypographyTag, TypographyType, } from '../typography/Typography'; -import { - BasePageContainer, - pageBorders, - WithClassNameProps, -} from '../utilities'; -import { SourcePermissions, Squad } from '../../graphql/sources'; +import type { WithClassNameProps } from '../utilities'; +import { BasePageContainer, pageBorders } from '../utilities'; +import type { Squad } from '../../graphql/sources'; +import { SourcePermissions } from '../../graphql/sources'; import { TimerIcon } from '../icons'; import { IconSize } from '../Icon'; -import { PromptOptions } from '../../hooks/usePrompt'; +import type { PromptOptions } from '../../hooks/usePrompt'; import { ModalSize } from '../modals/common/types'; import { verifyPermission } from '../../graphql/squads'; diff --git a/packages/shared/src/components/streak/ReadingStreakButton.tsx b/packages/shared/src/components/streak/ReadingStreakButton.tsx index d3e7f2d8e5..ed7502497f 100644 --- a/packages/shared/src/components/streak/ReadingStreakButton.tsx +++ b/packages/shared/src/components/streak/ReadingStreakButton.tsx @@ -1,15 +1,12 @@ -import React, { ReactElement, useCallback, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useState } from 'react'; import classnames from 'classnames'; import { ReadingStreakPopup } from './popup'; -import { - Button, - ButtonIconPosition, - ButtonSize, - ButtonVariant, -} from '../buttons/Button'; +import type { ButtonIconPosition } from '../buttons/Button'; +import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { ReadingStreakIcon } from '../icons'; import { SimpleTooltip } from '../tooltips'; -import { UserStreak } from '../../graphql/users'; +import type { UserStreak } from '../../graphql/users'; import { useViewSize, ViewSize } from '../../hooks'; import { isTesting } from '../../lib/constants'; import { useLogContext } from '../../contexts/LogContext'; @@ -17,7 +14,7 @@ import { LogEvent } from '../../lib/log'; import { RootPortal } from '../tooltips/Portal'; import { Drawer } from '../drawers'; import ConditionalWrapper from '../ConditionalWrapper'; -import { TooltipPosition } from '../tooltips/BaseTooltipContainer'; +import type { TooltipPosition } from '../tooltips/BaseTooltipContainer'; interface ReadingStreakButtonProps { streak: UserStreak; diff --git a/packages/shared/src/components/streak/ReadingStreakSwitch.tsx b/packages/shared/src/components/streak/ReadingStreakSwitch.tsx index 7efb40d9a7..bfce178d83 100644 --- a/packages/shared/src/components/streak/ReadingStreakSwitch.tsx +++ b/packages/shared/src/components/streak/ReadingStreakSwitch.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useSettingsContext } from '../../contexts/SettingsContext'; import { Switch } from '../fields/Switch'; diff --git a/packages/shared/src/components/streak/StreakReminderSwitch.tsx b/packages/shared/src/components/streak/StreakReminderSwitch.tsx index 2a78130334..aceac2aaac 100644 --- a/packages/shared/src/components/streak/StreakReminderSwitch.tsx +++ b/packages/shared/src/components/streak/StreakReminderSwitch.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Switch } from '../fields/Switch'; import { SendType, usePersonalizedDigest } from '../../hooks'; import { UserPersonalizedDigestType } from '../../graphql/users'; diff --git a/packages/shared/src/components/streak/popup/DayStreak.tsx b/packages/shared/src/components/streak/popup/DayStreak.tsx index d5e30d9e5a..278ce39b3b 100644 --- a/packages/shared/src/components/streak/popup/DayStreak.tsx +++ b/packages/shared/src/components/streak/popup/DayStreak.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ReadingStreakIcon, TriangleArrowIcon, EditIcon } from '../../icons'; import classed from '../../../lib/classed'; diff --git a/packages/shared/src/components/streak/popup/ReadingStreakPopup.tsx b/packages/shared/src/components/streak/popup/ReadingStreakPopup.tsx index 664511d7aa..74105300d0 100644 --- a/packages/shared/src/components/streak/popup/ReadingStreakPopup.tsx +++ b/packages/shared/src/components/streak/popup/ReadingStreakPopup.tsx @@ -1,15 +1,13 @@ -import React, { ReactElement, useEffect, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useMemo } from 'react'; import { addDays, isSameDay, subDays } from 'date-fns'; import { useQuery } from '@tanstack/react-query'; import classNames from 'classnames'; import { StreakSection } from './StreakSection'; import { DayStreak, Streak } from './DayStreak'; import { generateQueryKey, RequestKey, StaleTime } from '../../../lib/query'; -import { - getReadingStreak30Days, - ReadingDay, - UserStreak, -} from '../../../graphql/users'; +import type { ReadingDay, UserStreak } from '../../../graphql/users'; +import { getReadingStreak30Days } from '../../../graphql/users'; import { useAuthContext } from '../../../contexts/AuthContext'; import { useActions, useViewSize, ViewSize } from '../../../hooks'; import { ActionType } from '../../../graphql/actions'; diff --git a/packages/shared/src/components/streak/popup/StreakSection.tsx b/packages/shared/src/components/streak/popup/StreakSection.tsx index 485dea715f..bf45c7cb1e 100644 --- a/packages/shared/src/components/streak/popup/StreakSection.tsx +++ b/packages/shared/src/components/streak/popup/StreakSection.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; interface StreakSectionProps { streak: number; diff --git a/packages/shared/src/components/tabs/TabContainer.spec.tsx b/packages/shared/src/components/tabs/TabContainer.spec.tsx index bbd4835bae..0d790971c1 100644 --- a/packages/shared/src/components/tabs/TabContainer.spec.tsx +++ b/packages/shared/src/components/tabs/TabContainer.spec.tsx @@ -1,14 +1,12 @@ import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen } from '@testing-library/react'; import nock from 'nock'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import { mocked } from 'ts-jest/utils'; -import { Tab, TabContainer, TabContainerProps } from './TabContainer'; +import type { TabContainerProps } from './TabContainer'; +import { Tab, TabContainer } from './TabContainer'; beforeEach(() => { nock.cleanAll(); diff --git a/packages/shared/src/components/tabs/TabContainer.tsx b/packages/shared/src/components/tabs/TabContainer.tsx index 7176e83812..9389b733a6 100644 --- a/packages/shared/src/components/tabs/TabContainer.tsx +++ b/packages/shared/src/components/tabs/TabContainer.tsx @@ -1,15 +1,10 @@ -import React, { - createElement, - CSSProperties, - ReactElement, - ReactNode, - useRef, - useState, -} from 'react'; +import type { CSSProperties, ReactElement, ReactNode } from 'react'; +import React, { createElement, useRef, useState } from 'react'; import classNames from 'classnames'; import { useRouter } from 'next/router'; -import TabList, { AllowedTabTags, TabListProps } from './TabList'; -import { RenderTab } from './common'; +import type { AllowedTabTags, TabListProps } from './TabList'; +import TabList from './TabList'; +import type { RenderTab } from './common'; export interface TabProps { children?: ReactNode; diff --git a/packages/shared/src/components/tabs/TabList.tsx b/packages/shared/src/components/tabs/TabList.tsx index 463414f459..db675969c1 100644 --- a/packages/shared/src/components/tabs/TabList.tsx +++ b/packages/shared/src/components/tabs/TabList.tsx @@ -1,12 +1,7 @@ import classNames from 'classnames'; -import React, { - ReactElement, - useCallback, - useLayoutEffect, - useRef, - useState, -} from 'react'; -import { RenderTab } from './common'; +import type { ReactElement } from 'react'; +import React, { useCallback, useLayoutEffect, useRef, useState } from 'react'; +import type { RenderTab } from './common'; import type { TabProps } from './TabContainer'; export type AllowedTabTags = keyof Pick; diff --git a/packages/shared/src/components/tabs/common.tsx b/packages/shared/src/components/tabs/common.tsx index e4965a7dd9..35eaa2ebd9 100644 --- a/packages/shared/src/components/tabs/common.tsx +++ b/packages/shared/src/components/tabs/common.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; export type RenderTab = ({ label, diff --git a/packages/shared/src/components/tags/TagElement.tsx b/packages/shared/src/components/tags/TagElement.tsx index 23ab0a48ad..dbc06a399f 100644 --- a/packages/shared/src/components/tags/TagElement.tsx +++ b/packages/shared/src/components/tags/TagElement.tsx @@ -1,10 +1,11 @@ import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { AlertDot, AlertColor } from '../AlertDot'; import { Button, ButtonColor } from '../buttons/Button'; import { ButtonVariant } from '../buttons/common'; -import { Tag } from '../../graphql/feedSettings'; -import { OnSelectTagProps } from './common'; +import type { Tag } from '../../graphql/feedSettings'; +import type { OnSelectTagProps } from './common'; export type OnboardingTagProps = { tag: Tag; diff --git a/packages/shared/src/components/tags/TagSelection.tsx b/packages/shared/src/components/tags/TagSelection.tsx index 5eed9b881f..80b4c57268 100644 --- a/packages/shared/src/components/tags/TagSelection.tsx +++ b/packages/shared/src/components/tags/TagSelection.tsx @@ -1,17 +1,14 @@ -import React, { ReactElement, ReactNode, useMemo, useState } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useMemo, useState } from 'react'; import classNames from 'classnames'; -import { - QueryFilters, - useMutation, - useQuery, - useQueryClient, -} from '@tanstack/react-query'; +import type { QueryFilters } from '@tanstack/react-query'; +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import useFeedSettings from '../../hooks/useFeedSettings'; import { RequestKey, generateQueryKey } from '../../lib/query'; +import type { TagsData } from '../../graphql/feedSettings'; import { GET_ONBOARDING_TAGS_QUERY, GET_RECOMMENDED_TAGS_QUERY, - TagsData, } from '../../graphql/feedSettings'; import { disabledRefetch, getRandomNumber } from '../../lib/func'; import useDebounceFn from '../../hooks/useDebounceFn'; @@ -19,12 +16,10 @@ import type { FilterOnboardingProps } from '../onboarding/FilterOnboarding'; import useTagAndSource from '../../hooks/useTagAndSource'; import { Origin } from '../../lib/log'; import { ElementPlaceholder } from '../ElementPlaceholder'; -import { - OnboardingTagProps, - TagElement as TagElementDefault, -} from './TagElement'; +import type { OnboardingTagProps } from './TagElement'; +import { TagElement as TagElementDefault } from './TagElement'; import { gqlClient } from '../../graphql/common'; -import { OnSelectTagProps } from './common'; +import type { OnSelectTagProps } from './common'; import { Typography, TypographyColor, diff --git a/packages/shared/src/components/tags/common.tsx b/packages/shared/src/components/tags/common.tsx index 8f77a8119d..6b1b962933 100644 --- a/packages/shared/src/components/tags/common.tsx +++ b/packages/shared/src/components/tags/common.tsx @@ -1,4 +1,4 @@ -import { Tag } from '../../graphql/feedSettings'; +import type { Tag } from '../../graphql/feedSettings'; export type OnSelectTagProps = { tag: Tag; diff --git a/packages/shared/src/components/text/Anchor.tsx b/packages/shared/src/components/text/Anchor.tsx index 82e68c76ea..85d1073dbd 100644 --- a/packages/shared/src/components/text/Anchor.tsx +++ b/packages/shared/src/components/text/Anchor.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; export function Anchor({ diff --git a/packages/shared/src/components/tooltips/BaseTooltip.tsx b/packages/shared/src/components/tooltips/BaseTooltip.tsx index 947b2c592e..1854ec541a 100644 --- a/packages/shared/src/components/tooltips/BaseTooltip.tsx +++ b/packages/shared/src/components/tooltips/BaseTooltip.tsx @@ -1,13 +1,15 @@ -import React, { useState, ReactElement, Ref } from 'react'; -import Tippy, { TippyProps } from '@tippyjs/react'; +import type { ReactElement, Ref } from 'react'; +import React, { useState } from 'react'; +import type { TippyProps } from '@tippyjs/react'; +import Tippy from '@tippyjs/react'; import styles from './BaseTooltip.module.css'; import { isTouchDevice } from '../../lib/tooltip'; import { isTesting } from '../../lib/constants'; -import { - BaseTooltipContainer, +import type { BaseTooltipContainerProps, TooltipPosition, } from './BaseTooltipContainer'; +import { BaseTooltipContainer } from './BaseTooltipContainer'; const DEFAULT_DELAY_MS = 300; const DEFAULT_DURATION = 200; diff --git a/packages/shared/src/components/tooltips/BaseTooltipContainer.tsx b/packages/shared/src/components/tooltips/BaseTooltipContainer.tsx index abf845e5c5..c7321621fa 100644 --- a/packages/shared/src/components/tooltips/BaseTooltipContainer.tsx +++ b/packages/shared/src/components/tooltips/BaseTooltipContainer.tsx @@ -1,4 +1,5 @@ -import React, { FunctionComponent, ReactElement, ReactNode } from 'react'; +import type { FunctionComponent, ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import styles from './BaseTooltip.module.css'; diff --git a/packages/shared/src/components/tooltips/ChangelogTooltip.spec.tsx b/packages/shared/src/components/tooltips/ChangelogTooltip.spec.tsx index 33a310aaee..3798dceec4 100644 --- a/packages/shared/src/components/tooltips/ChangelogTooltip.spec.tsx +++ b/packages/shared/src/components/tooltips/ChangelogTooltip.spec.tsx @@ -1,10 +1,5 @@ -import { - act, - fireEvent, - render, - RenderResult, - screen, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { act, fireEvent, render, screen } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React from 'react'; import nock from 'nock'; @@ -15,14 +10,13 @@ import ChangelogTooltip from './ChangelogTooltip'; import { AlertColor, AlertDot } from '../AlertDot'; import { postDateFormat } from '../../lib/dateFormat'; import { AlertContextProvider } from '../../contexts/AlertContext'; -import { Alerts, UPDATE_ALERTS } from '../../graphql/alerts'; +import type { Alerts } from '../../graphql/alerts'; +import { UPDATE_ALERTS } from '../../graphql/alerts'; import { mockGraphQL } from '../../../__tests__/helpers/graphql'; import { waitForNock } from '../../../__tests__/helpers/utilities'; import { ExtensionMessageType } from '../../lib/extension'; -import { - ToastNotification, - TOAST_NOTIF_KEY, -} from '../../hooks/useToastNotification'; +import type { ToastNotification } from '../../hooks/useToastNotification'; +import { TOAST_NOTIF_KEY } from '../../hooks/useToastNotification'; import SettingsContext from '../../contexts/SettingsContext'; import * as hooks from '../../hooks/useChangelog'; diff --git a/packages/shared/src/components/tooltips/ChangelogTooltip.tsx b/packages/shared/src/components/tooltips/ChangelogTooltip.tsx index 82a9f710af..1e0b31c22e 100644 --- a/packages/shared/src/components/tooltips/ChangelogTooltip.tsx +++ b/packages/shared/src/components/tooltips/ChangelogTooltip.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useMutation } from '@tanstack/react-query'; import { Button, ButtonColor, ButtonSize } from '../buttons/Button'; import { cloudinaryPostImageCoverPlaceholder } from '../../lib/image'; diff --git a/packages/shared/src/components/tooltips/ContextMenuItem.tsx b/packages/shared/src/components/tooltips/ContextMenuItem.tsx index 001d7ba5d2..8fb7a60e8d 100644 --- a/packages/shared/src/components/tooltips/ContextMenuItem.tsx +++ b/packages/shared/src/components/tooltips/ContextMenuItem.tsx @@ -1,9 +1,11 @@ -import { Item, ItemProps } from '@dailydotdev/react-contexify'; +import type { ItemProps } from '@dailydotdev/react-contexify'; +import { Item } from '@dailydotdev/react-contexify'; import classNames from 'classnames'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import Link from '../utilities/Link'; import ConditionalWrapper from '../ConditionalWrapper'; -import { MenuItemProps } from '../fields/ContextMenu'; +import type { MenuItemProps } from '../fields/ContextMenu'; import { IconSize } from '../Icon'; export interface ContextMenuItemProps diff --git a/packages/shared/src/components/tooltips/InteractivePopup.tsx b/packages/shared/src/components/tooltips/InteractivePopup.tsx index 5435a2939d..b0a1cdb2b7 100644 --- a/packages/shared/src/components/tooltips/InteractivePopup.tsx +++ b/packages/shared/src/components/tooltips/InteractivePopup.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, ReactNode, useRef } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useRef } from 'react'; import { RootPortal } from './Portal'; import { useSettingsContext } from '../../contexts/SettingsContext'; import useSidebarRendered from '../../hooks/useSidebarRendered'; @@ -7,7 +8,8 @@ import ConditionalWrapper from '../ConditionalWrapper'; import { MiniCloseIcon as CloseIcon } from '../icons'; import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; import { useOutsideClick } from '../../hooks/utils/useOutsideClick'; -import { Drawer, DrawerOnMobileProps, PopupCloseFunc } from '../drawers'; +import type { DrawerOnMobileProps, PopupCloseFunc } from '../drawers'; +import { Drawer } from '../drawers'; import { useViewSize, ViewSize } from '../../hooks'; export enum InteractivePopupPosition { diff --git a/packages/shared/src/components/tooltips/LinkWithTooltip.tsx b/packages/shared/src/components/tooltips/LinkWithTooltip.tsx index 054c119d7f..c6bf346829 100644 --- a/packages/shared/src/components/tooltips/LinkWithTooltip.tsx +++ b/packages/shared/src/components/tooltips/LinkWithTooltip.tsx @@ -1,6 +1,9 @@ -import React, { ReactElement, useMemo, useState } from 'react'; -import Link, { LinkProps } from '../utilities/Link'; -import { BaseTooltip, getShouldLoadTooltip, TooltipProps } from './BaseTooltip'; +import type { ReactElement } from 'react'; +import React, { useMemo, useState } from 'react'; +import type { LinkProps } from '../utilities/Link'; +import Link from '../utilities/Link'; +import type { TooltipProps } from './BaseTooltip'; +import { BaseTooltip, getShouldLoadTooltip } from './BaseTooltip'; export interface LinkWithTooltipProps extends LinkProps { children?: ReactElement; diff --git a/packages/shared/src/components/tooltips/Portal.tsx b/packages/shared/src/components/tooltips/Portal.tsx index 7209dcbe42..e48cfb1b17 100644 --- a/packages/shared/src/components/tooltips/Portal.tsx +++ b/packages/shared/src/components/tooltips/Portal.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode, useMemo } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useMemo } from 'react'; import { createPortal } from 'react-dom'; import { useRequestProtocol } from '../../hooks/useRequestProtocol'; import { getCompanionWrapper } from '../../lib/extension'; diff --git a/packages/shared/src/components/tooltips/RecommendedMentionTooltip.tsx b/packages/shared/src/components/tooltips/RecommendedMentionTooltip.tsx index 015987440c..2b905ffdb2 100644 --- a/packages/shared/src/components/tooltips/RecommendedMentionTooltip.tsx +++ b/packages/shared/src/components/tooltips/RecommendedMentionTooltip.tsx @@ -1,7 +1,8 @@ -import React, { MutableRefObject, ReactElement } from 'react'; +import type { MutableRefObject, ReactElement } from 'react'; +import React from 'react'; import { BaseTooltip } from './BaseTooltip'; import { RecommendedMention } from '../RecommendedMention'; -import { UserShortProfile } from '../../lib/user'; +import type { UserShortProfile } from '../../lib/user'; import { isTesting } from '../../lib/constants'; interface RecommendedMentionTooltipProps { diff --git a/packages/shared/src/components/tooltips/SimpleTooltip.tsx b/packages/shared/src/components/tooltips/SimpleTooltip.tsx index 87aaa0ed49..ca33cf1a8f 100644 --- a/packages/shared/src/components/tooltips/SimpleTooltip.tsx +++ b/packages/shared/src/components/tooltips/SimpleTooltip.tsx @@ -1,8 +1,10 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import dynamicParent, { DynamicParentPlaceholder, } from '../../lib/dynamicParent'; -import { getShouldLoadTooltip, TooltipProps } from './BaseTooltip'; +import type { TooltipProps } from './BaseTooltip'; +import { getShouldLoadTooltip } from './BaseTooltip'; const BaseTooltipLoader = () => import(/* webpackChunkName: "lazyTooltip" */ './BaseTooltip'); diff --git a/packages/shared/src/components/tooltips/notifications/NotificationPreferenceMenu.tsx b/packages/shared/src/components/tooltips/notifications/NotificationPreferenceMenu.tsx index e5f352c2b1..f33e1077e8 100644 --- a/packages/shared/src/components/tooltips/notifications/NotificationPreferenceMenu.tsx +++ b/packages/shared/src/components/tooltips/notifications/NotificationPreferenceMenu.tsx @@ -1,10 +1,9 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import ContextMenu from '../../fields/ContextMenu'; import { Loader } from '../../Loader'; -import { - Notification, - NotificationPreferenceStatus, -} from '../../../graphql/notifications'; +import type { Notification } from '../../../graphql/notifications'; +import { NotificationPreferenceStatus } from '../../../graphql/notifications'; import { BellIcon, BellDisabledIcon } from '../../icons'; import { notificationMutingCopy } from '../../notifications/utils'; import { useNotificationPreference } from '../../../hooks/notifications'; diff --git a/packages/shared/src/components/typography/Typography.tsx b/packages/shared/src/components/typography/Typography.tsx index 29821e4988..4ffbe6ccc3 100644 --- a/packages/shared/src/components/typography/Typography.tsx +++ b/packages/shared/src/components/typography/Typography.tsx @@ -1,4 +1,5 @@ -import React, { HTMLAttributes, ReactElement, RefAttributes } from 'react'; +import type { HTMLAttributes, ReactElement, RefAttributes } from 'react'; +import React from 'react'; import classNames from 'classnames'; import classed from '../../lib/classed'; import { truncateTextClassNames } from '../utilities/common'; diff --git a/packages/shared/src/components/utilities/DateFormat.spec.tsx b/packages/shared/src/components/utilities/DateFormat.spec.tsx index 5f8da13fd9..126f6ce0a9 100644 --- a/packages/shared/src/components/utilities/DateFormat.spec.tsx +++ b/packages/shared/src/components/utilities/DateFormat.spec.tsx @@ -1,4 +1,5 @@ -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import React from 'react'; import { DateFormat } from './index'; import { TimeFormatType } from '../../lib/dateFormat'; diff --git a/packages/shared/src/components/utilities/DateFormat.tsx b/packages/shared/src/components/utilities/DateFormat.tsx index 812ce439c5..2811c52f16 100644 --- a/packages/shared/src/components/utilities/DateFormat.tsx +++ b/packages/shared/src/components/utilities/DateFormat.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement, useMemo } from 'react'; -import { formatDate, TimeFormatType } from '../../lib/dateFormat'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; +import type { TimeFormatType } from '../../lib/dateFormat'; +import { formatDate } from '../../lib/dateFormat'; interface DateFormatProps { date: string | number | Date; diff --git a/packages/shared/src/components/utilities/Divider.tsx b/packages/shared/src/components/utilities/Divider.tsx index 3663c01cb2..d79a228e94 100644 --- a/packages/shared/src/components/utilities/Divider.tsx +++ b/packages/shared/src/components/utilities/Divider.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import classed from '../../lib/classed'; diff --git a/packages/shared/src/components/utilities/Link.tsx b/packages/shared/src/components/utilities/Link.tsx index 2206ed9ef1..a4bd325abd 100644 --- a/packages/shared/src/components/utilities/Link.tsx +++ b/packages/shared/src/components/utilities/Link.tsx @@ -1,5 +1,7 @@ -import NextLink, { type LinkProps as NextLinkProps } from 'next/link'; -import React, { ReactElement, ReactNode } from 'react'; +import type { LinkProps as NextLinkProps } from 'next/link'; +import NextLink from 'next/link'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; interface LinkProps extends NextLinkProps { children?: ReactElement | ReactNode | string; diff --git a/packages/shared/src/components/utilities/SelectableLink.tsx b/packages/shared/src/components/utilities/SelectableLink.tsx index e6eff0fe0b..54803b1b99 100644 --- a/packages/shared/src/components/utilities/SelectableLink.tsx +++ b/packages/shared/src/components/utilities/SelectableLink.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement, AnchorHTMLAttributes, ReactNode } from 'react'; -import Link, { LinkProps } from './Link'; +import type { ReactElement, AnchorHTMLAttributes, ReactNode } from 'react'; +import React from 'react'; +import type { LinkProps } from './Link'; +import Link from './Link'; interface SelectableLinkProps { href: string; diff --git a/packages/shared/src/components/utilities/common.tsx b/packages/shared/src/components/utilities/common.tsx index abd5702580..3ba45b2ef3 100644 --- a/packages/shared/src/components/utilities/common.tsx +++ b/packages/shared/src/components/utilities/common.tsx @@ -1,4 +1,5 @@ -import React, { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import type { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import classed from '../../lib/classed'; import styles from './utilities.module.css'; diff --git a/packages/shared/src/components/utilities/loaders/generic.tsx b/packages/shared/src/components/utilities/loaders/generic.tsx index 4db4ac4800..5e361c6c58 100644 --- a/packages/shared/src/components/utilities/loaders/generic.tsx +++ b/packages/shared/src/components/utilities/loaders/generic.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classnames from 'classnames'; import { LoaderIcon } from '../../icons'; import { IconSize } from '../../Icon'; diff --git a/packages/shared/src/components/video/YoutubeVideo.spec.tsx b/packages/shared/src/components/video/YoutubeVideo.spec.tsx index 7e78e12f91..1c5337921f 100644 --- a/packages/shared/src/components/video/YoutubeVideo.spec.tsx +++ b/packages/shared/src/components/video/YoutubeVideo.spec.tsx @@ -1,4 +1,5 @@ -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import React from 'react'; import YoutubeVideo from './YoutubeVideo'; diff --git a/packages/shared/src/components/video/YoutubeVideo.tsx b/packages/shared/src/components/video/YoutubeVideo.tsx index f866f05327..0c10badc95 100644 --- a/packages/shared/src/components/video/YoutubeVideo.tsx +++ b/packages/shared/src/components/video/YoutubeVideo.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; interface YoutubeVideoProps { diff --git a/packages/shared/src/components/widgets/Alert.tsx b/packages/shared/src/components/widgets/Alert.tsx index 6169274dc2..f2988cc205 100644 --- a/packages/shared/src/components/widgets/Alert.tsx +++ b/packages/shared/src/components/widgets/Alert.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { AlertIcon, FeedbackIcon, VIcon as CheckIcon } from '../icons'; import classed from '../../lib/classed'; diff --git a/packages/shared/src/components/widgets/BestDiscussions.spec.tsx b/packages/shared/src/components/widgets/BestDiscussions.spec.tsx index 4e37705851..6583be87e0 100644 --- a/packages/shared/src/components/widgets/BestDiscussions.spec.tsx +++ b/packages/shared/src/components/widgets/BestDiscussions.spec.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; -import { Post } from '../../graphql/posts'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; +import type { Post } from '../../graphql/posts'; import defaultFeedPage from '../../../__tests__/fixture/feed'; import BestDiscussions from './BestDiscussions'; diff --git a/packages/shared/src/components/widgets/BestDiscussions.tsx b/packages/shared/src/components/widgets/BestDiscussions.tsx index d239f5320d..e11f194fdd 100644 --- a/packages/shared/src/components/widgets/BestDiscussions.tsx +++ b/packages/shared/src/components/widgets/BestDiscussions.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import Link from '../utilities/Link'; import { ArrowIcon } from '../icons'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import styles from '../cards/common/Card.module.css'; import { CardLink } from '../cards/common/Card'; import { ElementPlaceholder } from '../ElementPlaceholder'; diff --git a/packages/shared/src/components/widgets/DangerZone.tsx b/packages/shared/src/components/widgets/DangerZone.tsx index 476081c5ec..632b33292b 100644 --- a/packages/shared/src/components/widgets/DangerZone.tsx +++ b/packages/shared/src/components/widgets/DangerZone.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { Button, ButtonColor, diff --git a/packages/shared/src/components/widgets/FurtherReading.spec.tsx b/packages/shared/src/components/widgets/FurtherReading.spec.tsx index e33046c6b7..7f221b4026 100644 --- a/packages/shared/src/components/widgets/FurtherReading.spec.tsx +++ b/packages/shared/src/components/widgets/FurtherReading.spec.tsx @@ -1,21 +1,18 @@ import nock from 'nock'; import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import AuthContext from '../../contexts/AuthContext'; -import { LoggedUser } from '../../lib/user'; -import { Post } from '../../graphql/posts'; -import { - FURTHER_READING_QUERY, - FurtherReadingData, -} from '../../graphql/furtherReading'; +import type { LoggedUser } from '../../lib/user'; +import type { Post } from '../../graphql/posts'; +import type { FurtherReadingData } from '../../graphql/furtherReading'; +import { FURTHER_READING_QUERY } from '../../graphql/furtherReading'; import defaultFeedPage from '../../../__tests__/fixture/feed'; import defaultUser from '../../../__tests__/fixture/loggedUser'; import FurtherReading from './FurtherReading'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '../../../__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '../../../__tests__/helpers/graphql'; +import { mockGraphQL } from '../../../__tests__/helpers/graphql'; import { waitForNock } from '../../../__tests__/helpers/utilities'; import post from '../../../__tests__/fixture/post'; diff --git a/packages/shared/src/components/widgets/FurtherReading.tsx b/packages/shared/src/components/widgets/FurtherReading.tsx index 71b1964b56..9f837dd401 100644 --- a/packages/shared/src/components/widgets/FurtherReading.tsx +++ b/packages/shared/src/components/widgets/FurtherReading.tsx @@ -1,16 +1,18 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import { useQuery } from '@tanstack/react-query'; import AuthContext from '../../contexts/AuthContext'; -import { - FURTHER_READING_QUERY, - FurtherReadingData, -} from '../../graphql/furtherReading'; -import { Post, PostType } from '../../graphql/posts'; -import SimilarPosts, { SimilarPostsProps } from './SimilarPosts'; +import type { FurtherReadingData } from '../../graphql/furtherReading'; +import { FURTHER_READING_QUERY } from '../../graphql/furtherReading'; +import type { Post } from '../../graphql/posts'; +import { PostType } from '../../graphql/posts'; +import type { SimilarPostsProps } from './SimilarPosts'; +import SimilarPosts from './SimilarPosts'; import BestDiscussions from './BestDiscussions'; import PostToc from './PostToc'; -import { FeedData, SOURCE_FEED_QUERY } from '../../graphql/feed'; +import type { FeedData } from '../../graphql/feed'; +import { SOURCE_FEED_QUERY } from '../../graphql/feed'; import { isSourcePublicSquad } from '../../graphql/squads'; import { SquadPostListItem } from '../squads/SquadPostListItem'; import { disabledRefetch } from '../../lib/func'; diff --git a/packages/shared/src/components/widgets/ListItemPlaceholder.tsx b/packages/shared/src/components/widgets/ListItemPlaceholder.tsx index 8ee590e152..38da2a607b 100644 --- a/packages/shared/src/components/widgets/ListItemPlaceholder.tsx +++ b/packages/shared/src/components/widgets/ListItemPlaceholder.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { TextPlaceholder } from './common'; diff --git a/packages/shared/src/components/widgets/PostToc.tsx b/packages/shared/src/components/widgets/PostToc.tsx index ce4135893a..7ba6baed00 100644 --- a/packages/shared/src/components/widgets/PostToc.tsx +++ b/packages/shared/src/components/widgets/PostToc.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; -import { Post, TocItem } from '../../graphql/posts'; +import type { Post, TocItem } from '../../graphql/posts'; import { UnreadIcon as TocIcon } from '../icons'; import { Summary, SummaryArrow } from '../utilities'; import LogContext from '../../contexts/LogContext'; diff --git a/packages/shared/src/components/widgets/PostUsersHighlights.tsx b/packages/shared/src/components/widgets/PostUsersHighlights.tsx index 097c7302c2..13017b8f64 100644 --- a/packages/shared/src/components/widgets/PostUsersHighlights.tsx +++ b/packages/shared/src/components/widgets/PostUsersHighlights.tsx @@ -1,23 +1,25 @@ -import React, { ReactElement, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; import classNames from 'classnames'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import classed from '../../lib/classed'; import { LazyImage } from '../LazyImage'; import { WidgetContainer } from './common'; import { FeatherIcon, ScoutIcon } from '../icons'; import { LinkWithTooltip } from '../tooltips/LinkWithTooltip'; import { ProfileLink } from '../profile/ProfileLink'; -import { Author as CommentAuthor } from '../../graphql/comments'; +import type { Author as CommentAuthor } from '../../graphql/comments'; import { ProfileTooltip } from '../profile/ProfileTooltip'; import ConditionalWrapper from '../ConditionalWrapper'; import { ReputationUserBadge } from '../ReputationUserBadge'; import { ButtonVariant } from '../buttons/common'; import useFeedSettings from '../../hooks/useFeedSettings'; import EnableNotification from '../notifications/EnableNotification'; -import { NotificationPromptSource, Origin } from '../../lib/log'; +import type { Origin } from '../../lib/log'; +import { NotificationPromptSource } from '../../lib/log'; import { useSourceActionsNotify } from '../../hooks'; import { SourceActions } from '../sources/SourceActions'; -import { Source as ISource } from '../../graphql/sources'; +import type { Source as ISource } from '../../graphql/sources'; import { TruncateText } from '../utilities'; import { VerifiedCompanyUserBadge } from '../VerifiedCompanyUserBadge'; import { FollowButton } from '../contentPreference/FollowButton'; diff --git a/packages/shared/src/components/widgets/ReferralSocialShareButtons.tsx b/packages/shared/src/components/widgets/ReferralSocialShareButtons.tsx index aff3f47bcf..4142e80437 100644 --- a/packages/shared/src/components/widgets/ReferralSocialShareButtons.tsx +++ b/packages/shared/src/components/widgets/ReferralSocialShareButtons.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { Button, ButtonVariant } from '../buttons/Button'; import { getFacebookShareLink, @@ -10,7 +11,8 @@ import { TwitterIcon, FacebookIcon, WhatsappIcon } from '../icons'; import { link } from '../../lib/links'; import { labels } from '../../lib'; import { SimpleTooltip } from '../tooltips'; -import { LogEvent, TargetType } from '../../lib/log'; +import type { TargetType } from '../../lib/log'; +import { LogEvent } from '../../lib/log'; import LogContext from '../../contexts/LogContext'; interface ReferralSocialShareButtonsProps { diff --git a/packages/shared/src/components/widgets/ReferralWidget.tsx b/packages/shared/src/components/widgets/ReferralWidget.tsx index 18f8204d33..238c8f175b 100644 --- a/packages/shared/src/components/widgets/ReferralWidget.tsx +++ b/packages/shared/src/components/widgets/ReferralWidget.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { link } from '../../lib/links'; import { LogEvent, TargetId, TargetType } from '../../lib/log'; diff --git a/packages/shared/src/components/widgets/SimilarPosts.spec.tsx b/packages/shared/src/components/widgets/SimilarPosts.spec.tsx index aad3dbbd18..5746b5bec6 100644 --- a/packages/shared/src/components/widgets/SimilarPosts.spec.tsx +++ b/packages/shared/src/components/widgets/SimilarPosts.spec.tsx @@ -1,6 +1,7 @@ import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; -import { Post } from '../../graphql/posts'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; +import type { Post } from '../../graphql/posts'; import defaultFeedPage from '../../../__tests__/fixture/feed'; import SimilarPosts from './SimilarPosts'; diff --git a/packages/shared/src/components/widgets/SimilarPosts.tsx b/packages/shared/src/components/widgets/SimilarPosts.tsx index ff917904d3..71c3cbe94a 100644 --- a/packages/shared/src/components/widgets/SimilarPosts.tsx +++ b/packages/shared/src/components/widgets/SimilarPosts.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import classNames from 'classnames'; import Link from '../utilities/Link'; import { ArrowIcon } from '../icons'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import styles from '../cards/common/Card.module.css'; import { LazyImage } from '../LazyImage'; import { CardLink } from '../cards/common/Card'; diff --git a/packages/shared/src/components/widgets/SocialShare.tsx b/packages/shared/src/components/widgets/SocialShare.tsx index 78057356e6..ca5975bf39 100644 --- a/packages/shared/src/components/widgets/SocialShare.tsx +++ b/packages/shared/src/components/widgets/SocialShare.tsx @@ -1,10 +1,13 @@ -import React, { Dispatch, ReactElement, useContext } from 'react'; +import type { Dispatch, ReactElement } from 'react'; +import React, { useContext } from 'react'; import { ShareProvider, addLogQueryParams } from '../../lib/share'; -import { Post } from '../../graphql/posts'; -import { FeedItemPosition, postLogEvent } from '../../lib/feed'; +import type { Post } from '../../graphql/posts'; +import type { FeedItemPosition } from '../../lib/feed'; +import { postLogEvent } from '../../lib/feed'; import { LogEvent, Origin } from '../../lib/log'; import LogContext from '../../contexts/LogContext'; -import { Comment, getCommentHash } from '../../graphql/comments'; +import type { Comment } from '../../graphql/comments'; +import { getCommentHash } from '../../graphql/comments'; import { useSharePost } from '../../hooks/useSharePost'; import { SocialShareContainer } from './SocialShareContainer'; import { useCopyLink } from '../../hooks/useCopy'; @@ -13,9 +16,9 @@ import { SocialShareList } from './SocialShareList'; import { useGetShortUrl } from '../../hooks'; import { ReferralCampaignKey } from '../../lib'; import { useAuthContext } from '../../contexts/AuthContext'; -import { Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; import { CreateSharedPostModal } from '../modals/post/CreateSharedPostModal'; -import { ModalProps } from '../modals/common/Modal'; +import type { ModalProps } from '../modals/common/Modal'; interface SocialShareProps extends Pick { origin: Origin; diff --git a/packages/shared/src/components/widgets/SocialShareButton.tsx b/packages/shared/src/components/widgets/SocialShareButton.tsx index a778ae21a7..dc0e4f94c4 100644 --- a/packages/shared/src/components/widgets/SocialShareButton.tsx +++ b/packages/shared/src/components/widgets/SocialShareButton.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useRef } from 'react'; import classNames from 'classnames'; -import { Button, ButtonProps, ButtonSize } from '../buttons/Button'; +import type { ButtonProps } from '../buttons/Button'; +import { Button, ButtonSize } from '../buttons/Button'; import classed from '../../lib/classed'; type SocialShareButtonProps = ButtonProps<'a'> & { diff --git a/packages/shared/src/components/widgets/SocialShareContainer.tsx b/packages/shared/src/components/widgets/SocialShareContainer.tsx index 99d12aa247..75494cbcb9 100644 --- a/packages/shared/src/components/widgets/SocialShareContainer.tsx +++ b/packages/shared/src/components/widgets/SocialShareContainer.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; interface SocialShareContainerProps { diff --git a/packages/shared/src/components/widgets/SocialShareList.tsx b/packages/shared/src/components/widgets/SocialShareList.tsx index 8864056174..95617fdc72 100644 --- a/packages/shared/src/components/widgets/SocialShareList.tsx +++ b/packages/shared/src/components/widgets/SocialShareList.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { SocialShareButton } from './SocialShareButton'; import { getShareLink, ShareProvider } from '../../lib/share'; import { diff --git a/packages/shared/src/components/widgets/ThemeWidget.tsx b/packages/shared/src/components/widgets/ThemeWidget.tsx index 3dea1d9684..542eb5f472 100644 --- a/packages/shared/src/components/widgets/ThemeWidget.tsx +++ b/packages/shared/src/components/widgets/ThemeWidget.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement, ReactNode } from 'react'; -import { ThemeMode } from '../../contexts/SettingsContext'; -import { RadioItem, RadioItemProps } from '../fields/RadioItem'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; +import type { ThemeMode } from '../../contexts/SettingsContext'; +import type { RadioItemProps } from '../fields/RadioItem'; +import { RadioItem } from '../fields/RadioItem'; import ThemeWidgetBackground, { DarkNode, DarkNodeLayout, diff --git a/packages/shared/src/components/widgets/ThemeWidgetBackground.tsx b/packages/shared/src/components/widgets/ThemeWidgetBackground.tsx index 0a0471c00a..1daeba53a5 100644 --- a/packages/shared/src/components/widgets/ThemeWidgetBackground.tsx +++ b/packages/shared/src/components/widgets/ThemeWidgetBackground.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { CSSProperties, ReactElement, ReactNode } from 'react'; +import type { CSSProperties, ReactElement, ReactNode } from 'react'; +import React from 'react'; import classed from '../../lib/classed'; import { DailyIcon } from '../icons'; diff --git a/packages/shared/src/components/widgets/TimezoneDropdown.spec.tsx b/packages/shared/src/components/widgets/TimezoneDropdown.spec.tsx index 6e2e829073..d73f091f88 100644 --- a/packages/shared/src/components/widgets/TimezoneDropdown.spec.tsx +++ b/packages/shared/src/components/widgets/TimezoneDropdown.spec.tsx @@ -1,14 +1,9 @@ import React from 'react'; -import { - act, - fireEvent, - render, - RenderResult, - screen, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { act, fireEvent, render, screen } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { TimezoneDropdown } from './TimezoneDropdown'; -import { LoggedUser } from '../../lib/user'; +import type { LoggedUser } from '../../lib/user'; import loggedUser from '../../../__tests__/fixture/loggedUser'; import { AuthContextProvider } from '../../contexts/AuthContext'; import { getTimeZoneOptions } from '../../lib/timezones'; diff --git a/packages/shared/src/components/widgets/TimezoneDropdown.tsx b/packages/shared/src/components/widgets/TimezoneDropdown.tsx index 42bc408b63..3edbe46f1c 100644 --- a/packages/shared/src/components/widgets/TimezoneDropdown.tsx +++ b/packages/shared/src/components/widgets/TimezoneDropdown.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { ButtonSize } from '../buttons/common'; import { Dropdown } from '../fields/Dropdown'; diff --git a/packages/shared/src/components/widgets/ToggleWeekStart.tsx b/packages/shared/src/components/widgets/ToggleWeekStart.tsx index ca509a122c..adf7e445d6 100644 --- a/packages/shared/src/components/widgets/ToggleWeekStart.tsx +++ b/packages/shared/src/components/widgets/ToggleWeekStart.tsx @@ -1,6 +1,8 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { DayOfWeek, getDefaultStartOfWeek } from '../../lib/date'; -import { Radio, ClassName as RadioClassName } from '../fields/Radio'; +import type { ClassName as RadioClassName } from '../fields/Radio'; +import { Radio } from '../fields/Radio'; import { useReadingStreak } from '../../hooks/streaks'; export const ToggleWeekStart = ({ diff --git a/packages/shared/src/components/widgets/UserItemPlaceholder.tsx b/packages/shared/src/components/widgets/UserItemPlaceholder.tsx index 2bf3634ddb..0d99b369b9 100644 --- a/packages/shared/src/components/widgets/UserItemPlaceholder.tsx +++ b/packages/shared/src/components/widgets/UserItemPlaceholder.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { ElementPlaceholder } from '../ElementPlaceholder'; import { TextPlaceholder } from './common'; diff --git a/packages/shared/src/components/widgets/WidgetCard.tsx b/packages/shared/src/components/widgets/WidgetCard.tsx index 366894503c..7dba39c268 100644 --- a/packages/shared/src/components/widgets/WidgetCard.tsx +++ b/packages/shared/src/components/widgets/WidgetCard.tsx @@ -1,4 +1,5 @@ -import React, { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; interface WidgetCardProps extends ComponentProps<'section'> { diff --git a/packages/shared/src/components/withExperiment.tsx b/packages/shared/src/components/withExperiment.tsx index 99bd068744..023fbcf2b0 100644 --- a/packages/shared/src/components/withExperiment.tsx +++ b/packages/shared/src/components/withExperiment.tsx @@ -1,7 +1,8 @@ -import React, { ComponentType, ReactElement, ReactNode } from 'react'; -import { JSONValue, WidenPrimitives } from '@growthbook/growthbook'; +import type { ComponentType, ReactElement, ReactNode } from 'react'; +import React from 'react'; +import type { JSONValue, WidenPrimitives } from '@growthbook/growthbook'; import { useFeature } from './GrowthBookProvider'; -import { Feature } from '../lib/featureManagement'; +import type { Feature } from '../lib/featureManagement'; export type WrappedComponentType< Props, diff --git a/packages/shared/src/components/withFeaturesBoundary.tsx b/packages/shared/src/components/withFeaturesBoundary.tsx index b14d21af0c..fb5a4fe712 100644 --- a/packages/shared/src/components/withFeaturesBoundary.tsx +++ b/packages/shared/src/components/withFeaturesBoundary.tsx @@ -1,9 +1,5 @@ -import React, { - ComponentType, - ReactElement, - ReactNode, - useContext, -} from 'react'; +import type { ComponentType, ReactElement, ReactNode } from 'react'; +import React, { useContext } from 'react'; import { FeaturesReadyContext } from './GrowthBookProvider'; export type WrappedComponentType< diff --git a/packages/shared/src/contexts/ActiveFeedContext.tsx b/packages/shared/src/contexts/ActiveFeedContext.tsx index 1cd9c2575d..15441af546 100644 --- a/packages/shared/src/contexts/ActiveFeedContext.tsx +++ b/packages/shared/src/contexts/ActiveFeedContext.tsx @@ -1,6 +1,6 @@ import { createContext, useContext } from 'react'; -import { QueryKey } from '@tanstack/react-query'; -import { FeedReturnType } from '../hooks/useFeed'; +import type { QueryKey } from '@tanstack/react-query'; +import type { FeedReturnType } from '../hooks/useFeed'; export type ActiveFeedContextValue = { queryKey?: QueryKey; diff --git a/packages/shared/src/contexts/ActiveFeedNameContext.tsx b/packages/shared/src/contexts/ActiveFeedNameContext.tsx index ed8aebc2ed..30bd8e0d00 100644 --- a/packages/shared/src/contexts/ActiveFeedNameContext.tsx +++ b/packages/shared/src/contexts/ActiveFeedNameContext.tsx @@ -1,14 +1,13 @@ +import type { ReactElement, ReactNode } from 'react'; import React, { createContext, - ReactElement, - ReactNode, useContext, useEffect, useMemo, useState, } from 'react'; import { useRouter } from 'next/router'; -import { AllFeedPages } from '../lib/query'; +import type { AllFeedPages } from '../lib/query'; import { usePrevious } from '../hooks/usePrevious'; import { useAuthContext } from './AuthContext'; import { getFeedName } from '../lib/feed'; diff --git a/packages/shared/src/contexts/AlertContext.tsx b/packages/shared/src/contexts/AlertContext.tsx index 7c29cb0cbd..9fcab6247e 100644 --- a/packages/shared/src/contexts/AlertContext.tsx +++ b/packages/shared/src/contexts/AlertContext.tsx @@ -1,8 +1,9 @@ -import React, { ReactNode, ReactElement, useMemo, useContext } from 'react'; -import { UseMutateAsyncFunction, useMutation } from '@tanstack/react-query'; +import type { ReactNode, ReactElement } from 'react'; +import React, { useMemo, useContext } from 'react'; +import type { UseMutateAsyncFunction } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; +import type { Alerts, AlertsUpdate } from '../graphql/alerts'; import { - Alerts, - AlertsUpdate, UPDATE_ALERTS, UPDATE_LAST_BOOT_POPUP, UPDATE_LAST_REFERRAL_REMINDER, diff --git a/packages/shared/src/contexts/AuthContext.tsx b/packages/shared/src/contexts/AuthContext.tsx index d04815b87a..2f14b8bbfd 100644 --- a/packages/shared/src/contexts/AuthContext.tsx +++ b/packages/shared/src/contexts/AuthContext.tsx @@ -1,22 +1,17 @@ -import React, { - ReactElement, - ReactNode, - useCallback, - useContext, - useState, -} from 'react'; -import { QueryObserverResult } from '@tanstack/react-query'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useCallback, useContext, useState } from 'react'; +import type { QueryObserverResult } from '@tanstack/react-query'; +import type { AnonymousUser, LoggedUser } from '../lib/user'; import { - AnonymousUser, deleteAccount, - LoggedUser, logout as dispatchLogout, LogoutReason, } from '../lib/user'; -import { AccessToken, Boot, Visit } from '../lib/boot'; +import type { AccessToken, Boot, Visit } from '../lib/boot'; import { isCompanionActivated } from '../lib/element'; -import { AuthTriggers, AuthTriggersType } from '../lib/auth'; -import { Squad } from '../graphql/sources'; +import type { AuthTriggersType } from '../lib/auth'; +import { AuthTriggers } from '../lib/auth'; +import type { Squad } from '../graphql/sources'; import { checkIsExtension, isNullOrUndefined } from '../lib/func'; export interface LoginState { diff --git a/packages/shared/src/contexts/BootProvider.spec.tsx b/packages/shared/src/contexts/BootProvider.spec.tsx index f79430604e..90fff5d55e 100644 --- a/packages/shared/src/contexts/BootProvider.spec.tsx +++ b/packages/shared/src/contexts/BootProvider.spec.tsx @@ -1,16 +1,14 @@ -import React, { ReactNode, useContext } from 'react'; +import type { ReactNode } from 'react'; +import React, { useContext } from 'react'; import nock from 'nock'; -import { - fireEvent, - render, - RenderResult, - screen, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { mocked } from 'ts-jest/utils'; import AuthContext from './AuthContext'; import defaultUser from '../../__tests__/fixture/loggedUser'; -import { LoggedUser, deleteAccount, AnonymousUser } from '../lib/user'; +import type { LoggedUser, AnonymousUser } from '../lib/user'; +import { deleteAccount } from '../lib/user'; import SettingsContext, { remoteThemes, ThemeMode, @@ -18,15 +16,15 @@ import SettingsContext, { } from './SettingsContext'; import { mockGraphQL } from '../../__tests__/helpers/graphql'; import AlertContext from './AlertContext'; -import { Alerts, UPDATE_ALERTS } from '../graphql/alerts'; -import { - RemoteSettings, - Spaciness, - UPDATE_USER_SETTINGS_MUTATION, -} from '../graphql/settings'; +import type { Alerts } from '../graphql/alerts'; +import { UPDATE_ALERTS } from '../graphql/alerts'; +import type { RemoteSettings, Spaciness } from '../graphql/settings'; +import { UPDATE_USER_SETTINGS_MUTATION } from '../graphql/settings'; import { BootDataProvider } from './BootProvider'; -import { getBootData, Boot, BootCacheData } from '../lib/boot'; -import { AuthTriggers, AuthTriggersType } from '../lib/auth'; +import type { Boot, BootCacheData } from '../lib/boot'; +import { getBootData } from '../lib/boot'; +import type { AuthTriggersType } from '../lib/auth'; +import { AuthTriggers } from '../lib/auth'; import { expectToHaveTestValue } from '../../__tests__/helpers/utilities'; jest.mock('../lib/boot', () => ({ diff --git a/packages/shared/src/contexts/BootProvider.tsx b/packages/shared/src/contexts/BootProvider.tsx index 9be7b14277..5635cac4bf 100644 --- a/packages/shared/src/contexts/BootProvider.tsx +++ b/packages/shared/src/contexts/BootProvider.tsx @@ -1,16 +1,12 @@ -import React, { - ReactElement, - ReactNode, - useCallback, - useEffect, - useRef, - useState, -} from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import dynamic from 'next/dynamic'; -import { Boot, BootApp, BootCacheData, getBootData } from '../lib/boot'; +import type { Boot, BootApp, BootCacheData } from '../lib/boot'; +import { getBootData } from '../lib/boot'; import { AuthContextProvider } from './AuthContext'; -import { AnonymousUser, ContentLanguage, LoggedUser } from '../lib/user'; +import type { AnonymousUser, LoggedUser } from '../lib/user'; +import { ContentLanguage } from '../lib/user'; import { AlertContextProvider } from './AlertContext'; import { generateQueryKey, RequestKey, STALE_TIME } from '../lib/query'; import { @@ -25,7 +21,7 @@ import { BOOT_LOCAL_KEY, BOOT_QUERY_KEY } from './common'; import { GrowthBookProvider } from '../components/GrowthBookProvider'; import { useHostStatus } from '../hooks/useHostPermissionStatus'; import { checkIsExtension } from '../lib/func'; -import { Feed, FeedList } from '../graphql/feed'; +import type { Feed, FeedList } from '../graphql/feed'; import { gqlClient } from '../graphql/common'; import { ErrorBoundary } from '../components/ErrorBoundary'; import { LogContextProvider } from './LogContext'; diff --git a/packages/shared/src/contexts/DndContext.tsx b/packages/shared/src/contexts/DndContext.tsx index abfbf1fd9b..b2c9bae20a 100644 --- a/packages/shared/src/contexts/DndContext.tsx +++ b/packages/shared/src/contexts/DndContext.tsx @@ -1,10 +1,5 @@ -import React, { - Dispatch, - ReactElement, - ReactNode, - useContext, - useState, -} from 'react'; +import type { Dispatch, ReactElement, ReactNode } from 'react'; +import React, { useContext, useState } from 'react'; import usePersistentContext from '../hooks/usePersistentContext'; import { checkIsExtension } from '../lib/func'; diff --git a/packages/shared/src/contexts/ExtensionContext.tsx b/packages/shared/src/contexts/ExtensionContext.tsx index bd2a734929..e791820819 100644 --- a/packages/shared/src/contexts/ExtensionContext.tsx +++ b/packages/shared/src/contexts/ExtensionContext.tsx @@ -1,4 +1,4 @@ -import { Permissions } from 'webextension-polyfill'; +import type { Permissions } from 'webextension-polyfill'; import React, { useContext } from 'react'; export type RequestContentScripts = (data: { diff --git a/packages/shared/src/contexts/FeedContext.tsx b/packages/shared/src/contexts/FeedContext.tsx index a8926e1eb3..a2a743348b 100644 --- a/packages/shared/src/contexts/FeedContext.tsx +++ b/packages/shared/src/contexts/FeedContext.tsx @@ -1,10 +1,11 @@ -import React, { ReactElement, useMemo, type PropsWithChildren } from 'react'; +import type { ReactElement, PropsWithChildren } from 'react'; +import React, { useMemo } from 'react'; import { desktop, laptop, laptopL, laptopXL, tablet } from '../styles/media'; import { useConditionalFeature, useMedia, usePlusSubscription } from '../hooks'; import { useSettingsContext } from './SettingsContext'; import useSidebarRendered from '../hooks/useSidebarRendered'; -import { Spaciness } from '../graphql/settings'; +import type { Spaciness } from '../graphql/settings'; import { featureFeedAdTemplate } from '../lib/featureManagement'; import type { FeedAdTemplate } from '../lib/feed'; diff --git a/packages/shared/src/contexts/LogContext.spec.tsx b/packages/shared/src/contexts/LogContext.spec.tsx index 5aadd8cf52..7783efdc9a 100644 --- a/packages/shared/src/contexts/LogContext.spec.tsx +++ b/packages/shared/src/contexts/LogContext.spec.tsx @@ -1,14 +1,17 @@ -import React, { ReactElement, ReactNode, useContext, useEffect } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useEffect } from 'react'; import nock from 'nock'; import { fireEvent, render, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; import LogContext, { LogContextProvider } from './LogContext'; -import { LogContextData } from '../hooks/log/useLogContextData'; -import { SettingsContextData, ThemeMode } from './SettingsContext'; -import { AuthContextData } from './AuthContext'; -import { AnonymousUser } from '../lib/user'; -import { LogEvent } from '../hooks/log/useLogQueue'; -import { BootApp, Visit } from '../lib/boot'; +import type { LogContextData } from '../hooks/log/useLogContextData'; +import type { SettingsContextData } from './SettingsContext'; +import { ThemeMode } from './SettingsContext'; +import type { AuthContextData } from './AuthContext'; +import type { AnonymousUser } from '../lib/user'; +import type { LogEvent } from '../hooks/log/useLogQueue'; +import type { Visit } from '../lib/boot'; +import { BootApp } from '../lib/boot'; import { waitForNock } from '../../__tests__/helpers/utilities'; import { TestBootProvider } from '../../__tests__/helpers/boot'; diff --git a/packages/shared/src/contexts/LogContext.tsx b/packages/shared/src/contexts/LogContext.tsx index 1024489107..0d1b5efbba 100644 --- a/packages/shared/src/contexts/LogContext.tsx +++ b/packages/shared/src/contexts/LogContext.tsx @@ -1,18 +1,13 @@ -import React, { - ReactElement, - ReactNode, - createContext, - useRef, - useContext, -} from 'react'; -import useLogQueue, { LogEvent } from '../hooks/log/useLogQueue'; +import type { ReactElement, ReactNode } from 'react'; +import React, { createContext, useRef, useContext } from 'react'; +import type { LogEvent } from '../hooks/log/useLogQueue'; +import useLogQueue from '../hooks/log/useLogQueue'; import useLogSharedProps from '../hooks/log/useLogSharedProps'; -import useLogContextData, { - LogContextData, -} from '../hooks/log/useLogContextData'; +import type { LogContextData } from '../hooks/log/useLogContextData'; +import useLogContextData from '../hooks/log/useLogContextData'; import useBackfillPendingLogs from '../hooks/log/useBackfillPendingLogs'; import useLogLifecycleEvents from '../hooks/log/useLogLifecycleEvents'; -import { BootApp } from '../lib/boot'; +import type { BootApp } from '../lib/boot'; const LogContext = createContext({ logEvent: () => {}, diff --git a/packages/shared/src/contexts/NotificationsContext.tsx b/packages/shared/src/contexts/NotificationsContext.tsx index 19bbdd0ac4..8edeac3958 100644 --- a/packages/shared/src/contexts/NotificationsContext.tsx +++ b/packages/shared/src/contexts/NotificationsContext.tsx @@ -1,11 +1,5 @@ -import React, { - ReactElement, - ReactNode, - useCallback, - useContext, - useEffect, - useState, -} from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useCallback, useContext, useEffect, useState } from 'react'; export interface NotificationsContextData { unreadCount: number; diff --git a/packages/shared/src/contexts/PaymentContext.tsx b/packages/shared/src/contexts/PaymentContext.tsx index f6a2a45d4b..72fe61851d 100644 --- a/packages/shared/src/contexts/PaymentContext.tsx +++ b/packages/shared/src/contexts/PaymentContext.tsx @@ -1,6 +1,5 @@ +import type { ReactElement, ReactNode } from 'react'; import React, { - ReactElement, - ReactNode, useCallback, useContext, useEffect, @@ -8,13 +7,11 @@ import React, { useRef, useState, } from 'react'; +import type { Environments, Paddle, PaddleEventData } from '@paddle/paddle-js'; import { CheckoutEventNames, - Environments, getPaddleInstance, initializePaddle, - Paddle, - type PaddleEventData, } from '@paddle/paddle-js'; import { useQuery } from '@tanstack/react-query'; import { useRouter } from 'next/router'; diff --git a/packages/shared/src/contexts/ProgressiveEnhancementContext.tsx b/packages/shared/src/contexts/ProgressiveEnhancementContext.tsx index 2b45a79c4b..a5eadaa69f 100644 --- a/packages/shared/src/contexts/ProgressiveEnhancementContext.tsx +++ b/packages/shared/src/contexts/ProgressiveEnhancementContext.tsx @@ -1,10 +1,5 @@ -import React, { - ReactElement, - ReactNode, - useEffect, - useMemo, - useState, -} from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; import { requestIdleCallback } from 'next/dist/client/request-idle-callback'; export interface ProgressiveEnhancementContextData { diff --git a/packages/shared/src/contexts/PushNotificationContext.tsx b/packages/shared/src/contexts/PushNotificationContext.tsx index 138b620fdc..fd007640d5 100644 --- a/packages/shared/src/contexts/PushNotificationContext.tsx +++ b/packages/shared/src/contexts/PushNotificationContext.tsx @@ -1,6 +1,6 @@ +import type { ReactElement } from 'react'; import React, { createContext, - ReactElement, useCallback, useContext, useEffect, @@ -9,13 +9,14 @@ import React, { } from 'react'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import type OneSignal from 'react-onesignal'; -import { LogEvent, NotificationPromptSource } from '../lib/log'; +import type { NotificationPromptSource } from '../lib/log'; +import { LogEvent } from '../lib/log'; import { checkIsExtension, disabledRefetch } from '../lib/func'; import { useAuthContext } from './AuthContext'; import { generateQueryKey, RequestKey } from '../lib/query'; import { isTesting } from '../lib/constants'; import { useLogContext } from './LogContext'; -import { SubscriptionCallback } from '../components/notifications/utils'; +import type { SubscriptionCallback } from '../components/notifications/utils'; export interface PushNotificationsContextData { OneSignal: typeof OneSignal; diff --git a/packages/shared/src/contexts/SettingsContext.tsx b/packages/shared/src/contexts/SettingsContext.tsx index 5c15957382..dea724033b 100644 --- a/packages/shared/src/contexts/SettingsContext.tsx +++ b/packages/shared/src/contexts/SettingsContext.tsx @@ -1,6 +1,5 @@ +import type { ReactElement, ReactNode } from 'react'; import React, { - ReactElement, - ReactNode, useCallback, useContext, useEffect, @@ -8,12 +7,14 @@ import React, { useRef, } from 'react'; import { useMutation } from '@tanstack/react-query'; -import { - CampaignCtaPlacement, +import type { RemoteSettings, RemoteTheme, - type SettingsFlags, + SettingsFlags, Spaciness, +} from '../graphql/settings'; +import { + CampaignCtaPlacement, UPDATE_USER_SETTINGS_MUTATION, } from '../graphql/settings'; import AuthContext from './AuthContext'; diff --git a/packages/shared/src/contexts/SubscriptionContext.tsx b/packages/shared/src/contexts/SubscriptionContext.tsx index 0b8d43f3f3..4f26793177 100644 --- a/packages/shared/src/contexts/SubscriptionContext.tsx +++ b/packages/shared/src/contexts/SubscriptionContext.tsx @@ -1,11 +1,5 @@ -import React, { - ReactElement, - ReactNode, - useContext, - useEffect, - useMemo, - useState, -} from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useEffect, useMemo, useState } from 'react'; import type { Client } from 'graphql-ws'; import { requestIdleCallback } from 'next/dist/client/request-idle-callback'; import ProgressiveEnhancementContext from './ProgressiveEnhancementContext'; diff --git a/packages/shared/src/contexts/WriteCommentContext.ts b/packages/shared/src/contexts/WriteCommentContext.ts index 20114a54e6..796ceac6ba 100644 --- a/packages/shared/src/contexts/WriteCommentContext.ts +++ b/packages/shared/src/contexts/WriteCommentContext.ts @@ -1,5 +1,5 @@ import { createContext, useContext } from 'react'; -import { UseMutateCommentResult } from '../hooks/post/useMutateComment'; +import type { UseMutateCommentResult } from '../hooks/post/useMutateComment'; interface WriteCommentContextProp { mutateComment: UseMutateCommentResult; diff --git a/packages/shared/src/contexts/WritePostContext.tsx b/packages/shared/src/contexts/WritePostContext.tsx index 147b701d60..eca5a07272 100644 --- a/packages/shared/src/contexts/WritePostContext.tsx +++ b/packages/shared/src/contexts/WritePostContext.tsx @@ -1,17 +1,17 @@ -import React, { +import type { FormEvent, MutableRefObject, PropsWithChildren, ReactElement, - useContext, } from 'react'; +import React, { useContext } from 'react'; import { useRouter } from 'next/router'; -import { EditPostProps, Post, SharedPost } from '../graphql/posts'; -import { Squad } from '../graphql/sources'; +import type { EditPostProps, Post, SharedPost } from '../graphql/posts'; +import type { Squad } from '../graphql/sources'; import ConditionalWrapper from '../components/ConditionalWrapper'; import { useViewSize, ViewSize } from '../hooks'; import { FormWrapper } from '../components/fields/form'; -import { SourcePostModeration } from '../graphql/squads'; +import type { SourcePostModeration } from '../graphql/squads'; export interface WriteForm { title: string; diff --git a/packages/shared/src/graphql/alerts.ts b/packages/shared/src/graphql/alerts.ts index c301de31ed..a0ad09cbc3 100644 --- a/packages/shared/src/graphql/alerts.ts +++ b/packages/shared/src/graphql/alerts.ts @@ -1,5 +1,5 @@ import { gql } from 'graphql-request'; -import { EmptyResponse } from './emptyResponse'; +import type { EmptyResponse } from './emptyResponse'; import { gqlClient } from './common'; export type Alerts = { diff --git a/packages/shared/src/graphql/banner.ts b/packages/shared/src/graphql/banner.ts index df10d8f75f..23ac7cf170 100644 --- a/packages/shared/src/graphql/banner.ts +++ b/packages/shared/src/graphql/banner.ts @@ -1,5 +1,5 @@ import { gql } from 'graphql-request'; -import { Theme } from '../components/utilities'; +import type { Theme } from '../components/utilities'; export enum BannerCustomTheme { CabbageOnion = 'cabbage-onion', diff --git a/packages/shared/src/graphql/bookmarks.ts b/packages/shared/src/graphql/bookmarks.ts index eede2cf4c6..9ce6ebb892 100644 --- a/packages/shared/src/graphql/bookmarks.ts +++ b/packages/shared/src/graphql/bookmarks.ts @@ -1,5 +1,5 @@ import { gql } from 'graphql-request'; -import { EmptyResponse } from './emptyResponse'; +import type { EmptyResponse } from './emptyResponse'; import { gqlClient } from './common'; export const SET_BOOKMARK_REMINDER = gql` diff --git a/packages/shared/src/graphql/comments.ts b/packages/shared/src/graphql/comments.ts index b72541239a..a9c41a10cf 100644 --- a/packages/shared/src/graphql/comments.ts +++ b/packages/shared/src/graphql/comments.ts @@ -1,11 +1,11 @@ import { gql } from 'graphql-request'; -import { Connection, gqlClient } from './common'; +import type { Connection, gqlClient } from './common'; import { COMMENT_FRAGMENT, USER_SHORT_INFO_FRAGMENT } from './fragments'; -import { EmptyResponse } from './emptyResponse'; -import { UserShortProfile } from '../lib/user'; +import type { EmptyResponse } from './emptyResponse'; +import type { UserShortProfile } from '../lib/user'; import type { Post, UserVote } from './posts'; -import { Company } from '../lib/userCompany'; -import { ContentPreference } from './contentPreference'; +import type { Company } from '../lib/userCompany'; +import type { ContentPreference } from './contentPreference'; import type { TopReader } from '../components/badges/TopReaderBadge'; export interface Author { diff --git a/packages/shared/src/graphql/common.ts b/packages/shared/src/graphql/common.ts index dd190a8174..277b80c19f 100644 --- a/packages/shared/src/graphql/common.ts +++ b/packages/shared/src/graphql/common.ts @@ -1,6 +1,6 @@ import { GraphQLClient } from 'graphql-request'; -import { QueryKey, UseInfiniteQueryOptions } from '@tanstack/react-query'; -import { GraphQLError } from 'graphql-request/dist/types'; +import type { QueryKey, UseInfiniteQueryOptions } from '@tanstack/react-query'; +import type { GraphQLError } from 'graphql-request/dist/types'; import type { PublicProfile, UserShortProfile } from '../lib/user'; import { graphqlUrl } from '../lib/config'; // GraphQL Relay pagination types diff --git a/packages/shared/src/graphql/contentPreference.ts b/packages/shared/src/graphql/contentPreference.ts index 1b7390d25b..f9e20ea33e 100644 --- a/packages/shared/src/graphql/contentPreference.ts +++ b/packages/shared/src/graphql/contentPreference.ts @@ -3,7 +3,7 @@ import { CONTENT_PREFERENCE_FRAMENT, USER_SHORT_INFO_FRAGMENT, } from './fragments'; -import { UserShortProfile } from '../lib/user'; +import type { UserShortProfile } from '../lib/user'; import type { Source } from './sources'; export enum ContentPreferenceType { diff --git a/packages/shared/src/graphql/features.ts b/packages/shared/src/graphql/features.ts index a190cd7c56..fc6ee07311 100644 --- a/packages/shared/src/graphql/features.ts +++ b/packages/shared/src/graphql/features.ts @@ -1,5 +1,5 @@ import { gql } from 'graphql-request'; -import { ReferralCampaignKey } from '../hooks'; +import type { ReferralCampaignKey } from '../hooks'; import { gqlClient } from './common'; export const ACCEPT_FEATURE_MUTATION = gql` diff --git a/packages/shared/src/graphql/feed.ts b/packages/shared/src/graphql/feed.ts index da4d26569c..9227ec808a 100644 --- a/packages/shared/src/graphql/feed.ts +++ b/packages/shared/src/graphql/feed.ts @@ -1,8 +1,9 @@ import { gql } from 'graphql-request'; import { CUSTOM_FEED_FRAGMENT, FEED_POST_INFO_FRAGMENT } from './fragments'; -import { Post, PostType } from './posts'; -import { Connection } from './common'; -import { FeedOrder } from '../lib/constants'; +import type { Post } from './posts'; +import { PostType } from './posts'; +import type { Connection } from './common'; +import type { FeedOrder } from '../lib/constants'; export enum RankingAlgorithm { Popularity = 'POPULARITY', diff --git a/packages/shared/src/graphql/feedSettings.ts b/packages/shared/src/graphql/feedSettings.ts index 407bd38876..9f69231b19 100644 --- a/packages/shared/src/graphql/feedSettings.ts +++ b/packages/shared/src/graphql/feedSettings.ts @@ -1,5 +1,5 @@ import { gql } from 'graphql-request'; -import { Source } from './sources'; +import type { Source } from './sources'; import { SOURCE_SHORT_INFO_FRAGMENT } from './fragments'; export enum AdvancedSettingsGroup { diff --git a/packages/shared/src/graphql/furtherReading.ts b/packages/shared/src/graphql/furtherReading.ts index 392c3f7842..721d987cb7 100644 --- a/packages/shared/src/graphql/furtherReading.ts +++ b/packages/shared/src/graphql/furtherReading.ts @@ -1,6 +1,6 @@ import { gql } from 'graphql-request'; import { SOURCE_SHORT_INFO_FRAGMENT, USER_AUTHOR_FRAGMENT } from './fragments'; -import { Post } from './posts'; +import type { Post } from './posts'; export type FurtherReadingData = { trendingPosts: Post[]; diff --git a/packages/shared/src/graphql/newSource.ts b/packages/shared/src/graphql/newSource.ts index ef64556b37..1630fc261e 100644 --- a/packages/shared/src/graphql/newSource.ts +++ b/packages/shared/src/graphql/newSource.ts @@ -1,5 +1,5 @@ import { gql } from 'graphql-request'; -import { SubmissionAvailability } from './submitArticle'; +import type { SubmissionAvailability } from './submitArticle'; export type SourceRequestAvailability = Pick< SubmissionAvailability, diff --git a/packages/shared/src/graphql/notifications.ts b/packages/shared/src/graphql/notifications.ts index f0d67a3fe5..0cd96c5d84 100644 --- a/packages/shared/src/graphql/notifications.ts +++ b/packages/shared/src/graphql/notifications.ts @@ -1,11 +1,10 @@ import { gql } from 'graphql-request'; -import { - NotificationIconType, - NotificationType, -} from '../components/notifications/utils'; -import { Connection, gqlClient } from './common'; -import { EmptyResponse } from './emptyResponse'; -import { WithClassNameProps } from '../components/utilities'; +import type { NotificationIconType } from '../components/notifications/utils'; +import { NotificationType } from '../components/notifications/utils'; +import type { Connection } from './common'; +import { gqlClient } from './common'; +import type { EmptyResponse } from './emptyResponse'; +import type { WithClassNameProps } from '../components/utilities'; export enum NotificationAvatarType { User = 'user', diff --git a/packages/shared/src/graphql/posts.spec.ts b/packages/shared/src/graphql/posts.spec.ts index 6ab5b65f19..777db58690 100644 --- a/packages/shared/src/graphql/posts.spec.ts +++ b/packages/shared/src/graphql/posts.spec.ts @@ -1,9 +1,9 @@ +import type { Post } from './posts'; import { BAN_POST_MUTATION, DELETE_POST_MUTATION, banPost, deletePost, - Post, getLatestChangelogPost, LATEST_CHANGELOG_POST_QUERY, PostType, @@ -11,7 +11,7 @@ import { getReadPostButtonText, } from './posts'; import { mockGraphQL } from '../../__tests__/helpers/graphql'; -import { Connection } from './common'; +import type { Connection } from './common'; beforeEach(() => { jest.clearAllMocks(); diff --git a/packages/shared/src/graphql/posts.ts b/packages/shared/src/graphql/posts.ts index 647eb92ceb..fe63312c02 100644 --- a/packages/shared/src/graphql/posts.ts +++ b/packages/shared/src/graphql/posts.ts @@ -1,8 +1,10 @@ import { gql } from 'graphql-request'; import type { Author, Scout } from './comments'; -import { Connection, gqlClient, gqlRequest } from './common'; -import { Source, SourceType, Squad } from './sources'; -import { EmptyResponse } from './emptyResponse'; +import type { Connection } from './common'; +import { gqlClient, gqlRequest } from './common'; +import type { Source, Squad } from './sources'; +import { SourceType } from './sources'; +import type { EmptyResponse } from './emptyResponse'; import { POST_CODE_SNIPPET_FRAGMENT, RELATED_POST_FRAGMENT, @@ -11,8 +13,8 @@ import { USER_AUTHOR_FRAGMENT, } from './fragments'; import { acceptedTypesList, MEGABYTE } from '../components/fields/ImageInput'; -import { Bookmark, type BookmarkFolder } from './bookmarks'; -import { SourcePostModeration } from './squads'; +import type { Bookmark, BookmarkFolder } from './bookmarks'; +import type { SourcePostModeration } from './squads'; export type TocItem = { text: string; id?: string; children?: TocItem[] }; export type Toc = TocItem[]; diff --git a/packages/shared/src/graphql/search.ts b/packages/shared/src/graphql/search.ts index 876e599965..df884f2b9b 100644 --- a/packages/shared/src/graphql/search.ts +++ b/packages/shared/src/graphql/search.ts @@ -1,11 +1,12 @@ import { gql } from 'graphql-request'; import { apiUrl } from '../lib/config'; import { isNullOrUndefined } from '../lib/func'; -import { Connection, RequestQueryParams, gqlClient } from './common'; +import type { Connection, RequestQueryParams } from './common'; +import { gqlClient } from './common'; import { webappUrl } from '../lib/constants'; -import { Post } from './posts'; +import type { Post } from './posts'; import { labels } from '../lib'; -import { ContentPreference } from './contentPreference'; +import type { ContentPreference } from './contentPreference'; export enum SearchProviderEnum { Posts = 'posts', diff --git a/packages/shared/src/graphql/settings.ts b/packages/shared/src/graphql/settings.ts index b40cf67e4c..43caaa3408 100644 --- a/packages/shared/src/graphql/settings.ts +++ b/packages/shared/src/graphql/settings.ts @@ -1,5 +1,5 @@ import { gql } from 'graphql-request'; -import { ChecklistViewState } from '../lib/checklist'; +import type { ChecklistViewState } from '../lib/checklist'; export type Spaciness = 'eco' | 'roomy' | 'cozy'; export type RemoteTheme = 'darcula' | 'bright' | 'auto'; diff --git a/packages/shared/src/graphql/source/common.ts b/packages/shared/src/graphql/source/common.ts index 852fdd505b..e8d5c2ba02 100644 --- a/packages/shared/src/graphql/source/common.ts +++ b/packages/shared/src/graphql/source/common.ts @@ -1,7 +1,7 @@ -import { QueryClient } from '@tanstack/react-query'; +import type { QueryClient } from '@tanstack/react-query'; import { generateQueryKey, RequestKey } from '../../lib/query'; -import { SourceMemberFlag, Squad } from '../sources'; -import { LoggedUser } from '../../lib/user'; +import type { SourceMemberFlag, Squad } from '../sources'; +import type { LoggedUser } from '../../lib/user'; export const updateFlagsCache = ( client: QueryClient, diff --git a/packages/shared/src/graphql/squads.ts b/packages/shared/src/graphql/squads.ts index 87b976c134..41e3d27735 100644 --- a/packages/shared/src/graphql/squads.ts +++ b/packages/shared/src/graphql/squads.ts @@ -7,21 +7,22 @@ import { USER_BASIC_INFO, USER_SHORT_INFO_FRAGMENT, } from './fragments'; -import { Connection, gqlClient } from './common'; -import { +import type { Connection } from './common'; +import { gqlClient } from './common'; +import type { BasicSourceMember, Source, SourceMember, SourceMemberRole, SourcePermissions, - SourceType, Squad, } from './sources'; +import { SourceType } from './sources'; import type { Post } from './posts'; -import { EmptyResponse } from './emptyResponse'; +import type { EmptyResponse } from './emptyResponse'; import { generateStorageKey, StorageTopic } from '../lib/storage'; import { PrivacyOption } from '../components/squads/settings/SquadPrivacySection'; -import { Author } from './comments'; +import type { Author } from './comments'; interface BaseSquadForm extends Pick< diff --git a/packages/shared/src/graphql/submitArticle.ts b/packages/shared/src/graphql/submitArticle.ts index 0dcb67994f..efd14dff8f 100644 --- a/packages/shared/src/graphql/submitArticle.ts +++ b/packages/shared/src/graphql/submitArticle.ts @@ -1,5 +1,5 @@ import { gql } from 'graphql-request'; -import { Post } from './posts'; +import type { Post } from './posts'; interface Submission { id: string; diff --git a/packages/shared/src/graphql/subscriptions.ts b/packages/shared/src/graphql/subscriptions.ts index 807c80bf16..ceeb15290b 100644 --- a/packages/shared/src/graphql/subscriptions.ts +++ b/packages/shared/src/graphql/subscriptions.ts @@ -1,4 +1,5 @@ -import { Client, createClient } from 'graphql-ws'; +import type { Client } from 'graphql-ws'; +import { createClient } from 'graphql-ws'; export function createSubscriptionClient(token: string): Client { return createClient({ diff --git a/packages/shared/src/graphql/users.ts b/packages/shared/src/graphql/users.ts index d3218ad33a..a268a8dee4 100644 --- a/packages/shared/src/graphql/users.ts +++ b/packages/shared/src/graphql/users.ts @@ -7,10 +7,11 @@ import { USER_STREAK_FRAGMENT, } from './fragments'; import type { PublicProfile, UserShortProfile } from '../lib/user'; -import { Connection, gqlClient } from './common'; -import { SourceMember } from './sources'; +import type { Connection } from './common'; +import { gqlClient } from './common'; +import type { SourceMember } from './sources'; import type { SendType } from '../hooks'; -import { DayOfWeek } from '../lib/date'; +import type { DayOfWeek } from '../lib/date'; export const USER_SHORT_BY_ID = ` query UserShortById($id: ID!) { diff --git a/packages/shared/src/hooks/auth/useSignBack.ts b/packages/shared/src/hooks/auth/useSignBack.ts index b2af7bcc30..77db70f603 100644 --- a/packages/shared/src/hooks/auth/useSignBack.ts +++ b/packages/shared/src/hooks/auth/useSignBack.ts @@ -1,8 +1,8 @@ import { useCallback, useMemo } from 'react'; import usePersistentContext from '../usePersistentContext'; import { generateStorageKey, RequestKey } from '../../lib/query'; -import { SocialProvider } from '../../components/auth/common'; -import { LoggedUser } from '../../lib/user'; +import type { SocialProvider } from '../../components/auth/common'; +import type { LoggedUser } from '../../lib/user'; import { isNullOrUndefined } from '../../lib/func'; export const SIGNIN_METHOD_KEY = 'signin_method'; diff --git a/packages/shared/src/hooks/bookmark/types.ts b/packages/shared/src/hooks/bookmark/types.ts index 70a7ffb34d..a549f123c3 100644 --- a/packages/shared/src/hooks/bookmark/types.ts +++ b/packages/shared/src/hooks/bookmark/types.ts @@ -1,4 +1,4 @@ -import { UseMutationMatcher } from '../mutationSubscription'; +import type { UseMutationMatcher } from '../mutationSubscription'; export type UseBookmarkMutationProps = { id: string; diff --git a/packages/shared/src/hooks/bookmark/useBookmarkFolder.ts b/packages/shared/src/hooks/bookmark/useBookmarkFolder.ts index 9ff4d8bc7a..dd9b0801b1 100644 --- a/packages/shared/src/hooks/bookmark/useBookmarkFolder.ts +++ b/packages/shared/src/hooks/bookmark/useBookmarkFolder.ts @@ -1,14 +1,14 @@ import { useMemo } from 'react'; import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { BookmarkFolder } from '../../graphql/bookmarks'; import { - BookmarkFolder, deleteBookmarkFolder, updateBookmarkFolder, } from '../../graphql/bookmarks'; import { useBookmarkFolderList } from './useBookmarkFolderList'; import { useToastNotification } from '../useToastNotification'; import { generateQueryKey, RequestKey } from '../../lib/query'; -import { EmptyResponse } from '../../graphql/emptyResponse'; +import type { EmptyResponse } from '../../graphql/emptyResponse'; import { useLogContext } from '../../contexts/LogContext'; import { LogEvent } from '../../lib/log'; diff --git a/packages/shared/src/hooks/bookmark/useBookmarkFolderList.ts b/packages/shared/src/hooks/bookmark/useBookmarkFolderList.ts index 9c89a8da6e..1efe8c470c 100644 --- a/packages/shared/src/hooks/bookmark/useBookmarkFolderList.ts +++ b/packages/shared/src/hooks/bookmark/useBookmarkFolderList.ts @@ -1,5 +1,6 @@ import { useQuery } from '@tanstack/react-query'; -import { BookmarkFolder, getBookmarkFolders } from '../../graphql/bookmarks'; +import type { BookmarkFolder } from '../../graphql/bookmarks'; +import { getBookmarkFolders } from '../../graphql/bookmarks'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/hooks/bookmark/useBookmarkReminderCover.ts b/packages/shared/src/hooks/bookmark/useBookmarkReminderCover.ts index 804e1cd0ac..dde63afb46 100644 --- a/packages/shared/src/hooks/bookmark/useBookmarkReminderCover.ts +++ b/packages/shared/src/hooks/bookmark/useBookmarkReminderCover.ts @@ -1,5 +1,5 @@ import { useJustBookmarked } from './useJustBookmarked'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; export const useBookmarkReminderCover = (post: Post): boolean => { const { justBookmarked } = useJustBookmarked({ diff --git a/packages/shared/src/hooks/bookmark/useCreateBookmarkFolder.ts b/packages/shared/src/hooks/bookmark/useCreateBookmarkFolder.ts index e6911722b5..da59106927 100644 --- a/packages/shared/src/hooks/bookmark/useCreateBookmarkFolder.ts +++ b/packages/shared/src/hooks/bookmark/useCreateBookmarkFolder.ts @@ -1,5 +1,6 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { BookmarkFolder, createBookmarkFolder } from '../../graphql/bookmarks'; +import type { BookmarkFolder } from '../../graphql/bookmarks'; +import { createBookmarkFolder } from '../../graphql/bookmarks'; import { useLogContext } from '../../contexts/LogContext'; import { LogEvent } from '../../lib/log'; import { useToastNotification } from '../useToastNotification'; diff --git a/packages/shared/src/hooks/bookmark/useFeedBookmarkPost.ts b/packages/shared/src/hooks/bookmark/useFeedBookmarkPost.ts index a274a01101..56e3be75a6 100644 --- a/packages/shared/src/hooks/bookmark/useFeedBookmarkPost.ts +++ b/packages/shared/src/hooks/bookmark/useFeedBookmarkPost.ts @@ -1,15 +1,14 @@ import { useCallback } from 'react'; -import { MutationKey, useQueryClient } from '@tanstack/react-query'; -import { FeedItem, UpdateFeedPost } from '../useFeed'; +import type { MutationKey } from '@tanstack/react-query'; +import { useQueryClient } from '@tanstack/react-query'; +import type { FeedItem, UpdateFeedPost } from '../useFeed'; import { feedLogExtra } from '../../lib/feed'; -import { Origin } from '../../lib/log'; +import type { Origin } from '../../lib/log'; import { useMutationSubscription } from '../mutationSubscription/useMutationSubscription'; -import { - mutateBookmarkFeedPost, - UseBookmarkPost, - useBookmarkPost, -} from '../useBookmarkPost'; -import { bookmarkMutationMatcher, UseBookmarkMutationProps } from './types'; +import type { UseBookmarkPost } from '../useBookmarkPost'; +import { mutateBookmarkFeedPost, useBookmarkPost } from '../useBookmarkPost'; +import type { UseBookmarkMutationProps } from './types'; +import { bookmarkMutationMatcher } from './types'; import { updatePostCache } from '../usePostById'; export type UseFeedBookmarkPost = { diff --git a/packages/shared/src/hooks/bookmark/useJustBookmarked.ts b/packages/shared/src/hooks/bookmark/useJustBookmarked.ts index c250ac6ff2..2c6a0bcdd3 100644 --- a/packages/shared/src/hooks/bookmark/useJustBookmarked.ts +++ b/packages/shared/src/hooks/bookmark/useJustBookmarked.ts @@ -1,6 +1,6 @@ import { useEffect, useRef } from 'react'; import { isNullOrUndefined } from '../../lib/func'; -import { UseBookmarkProviderProps } from './common'; +import type { UseBookmarkProviderProps } from './common'; interface UseJustBookmarked { justBookmarked: boolean; diff --git a/packages/shared/src/hooks/bookmark/useMoveBookmarkToFolder.ts b/packages/shared/src/hooks/bookmark/useMoveBookmarkToFolder.ts index 95096d1119..8f59f043d8 100644 --- a/packages/shared/src/hooks/bookmark/useMoveBookmarkToFolder.ts +++ b/packages/shared/src/hooks/bookmark/useMoveBookmarkToFolder.ts @@ -1,9 +1,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { - moveBookmarkToFolder, - MoveBookmarkToFolderProps, -} from '../../graphql/bookmarks'; -import { EmptyResponse } from '../../graphql/emptyResponse'; +import type { MoveBookmarkToFolderProps } from '../../graphql/bookmarks'; +import { moveBookmarkToFolder } from '../../graphql/bookmarks'; +import type { EmptyResponse } from '../../graphql/emptyResponse'; import { getPostByIdKey } from '../usePostById'; import type { PostData } from '../../graphql/posts'; import { useToastNotification } from '../useToastNotification'; diff --git a/packages/shared/src/hooks/chat/types.ts b/packages/shared/src/hooks/chat/types.ts index 36edd85f3c..b48c4f53e5 100644 --- a/packages/shared/src/hooks/chat/types.ts +++ b/packages/shared/src/hooks/chat/types.ts @@ -1,6 +1,6 @@ -import { QueryKey } from '@tanstack/react-query'; -import { MouseEvent } from 'react'; -import { Search, SearchChunkSource } from '../../graphql/search'; +import type { QueryKey } from '@tanstack/react-query'; +import type { MouseEvent } from 'react'; +import type { Search, SearchChunkSource } from '../../graphql/search'; export interface UseChatProps { id?: string; diff --git a/packages/shared/src/hooks/chat/useChat.ts b/packages/shared/src/hooks/chat/useChat.ts index 0c0201ecfb..8f844c0f19 100644 --- a/packages/shared/src/hooks/chat/useChat.ts +++ b/packages/shared/src/hooks/chat/useChat.ts @@ -1,4 +1,4 @@ -import { UseChat, UseChatProps } from './types'; +import type { UseChat, UseChatProps } from './types'; import { useChatSession } from './useChatSession'; import { useChatStream } from './useChatStream'; diff --git a/packages/shared/src/hooks/chat/useChatSession.ts b/packages/shared/src/hooks/chat/useChatSession.ts index a76364d75e..eaceac35cf 100644 --- a/packages/shared/src/hooks/chat/useChatSession.ts +++ b/packages/shared/src/hooks/chat/useChatSession.ts @@ -1,9 +1,10 @@ import { useMemo } from 'react'; import { useQueryClient, useQuery } from '@tanstack/react-query'; import { useAuthContext } from '../../contexts/AuthContext'; -import { Search, getSearchSession } from '../../graphql/search'; +import type { Search } from '../../graphql/search'; +import { getSearchSession } from '../../graphql/search'; import { generateQueryKey, RequestKey } from '../../lib/query'; -import { UseChatSessionProps, UseChatSession } from './types'; +import type { UseChatSessionProps, UseChatSession } from './types'; export const useChatSession = ({ id, diff --git a/packages/shared/src/hooks/chat/useChatStream.ts b/packages/shared/src/hooks/chat/useChatStream.ts index ea88d148b6..13bc0bedfc 100644 --- a/packages/shared/src/hooks/chat/useChatStream.ts +++ b/packages/shared/src/hooks/chat/useChatStream.ts @@ -1,25 +1,27 @@ import { useCallback, useContext, useEffect, useRef, useState } from 'react'; import { useQueryClient } from '@tanstack/react-query'; import { useAuthContext } from '../../contexts/AuthContext'; -import { - initializeSearchSession, +import type { Search, SearchChunk, SearchChunkError, +} from '../../graphql/search'; +import { + initializeSearchSession, SearchChunkErrorCode, searchErrorCodeToMessage, sendSearchQuery, updateSearchData, } from '../../graphql/search'; import { generateQueryKey, RequestKey } from '../../lib/query'; -import { +import type { CreatePayload, SourcesMessage, TokenPayload, UseChatMessage, - UseChatMessageType, UseChatStream, } from './types'; +import { UseChatMessageType } from './types'; import LogContext from '../../contexts/LogContext'; import { LogEvent } from '../../lib/log'; diff --git a/packages/shared/src/hooks/comments/useCommentById.ts b/packages/shared/src/hooks/comments/useCommentById.ts index ca1645be5e..9e80d0a8c2 100644 --- a/packages/shared/src/hooks/comments/useCommentById.ts +++ b/packages/shared/src/hooks/comments/useCommentById.ts @@ -1,17 +1,13 @@ import { useCallback, useMemo } from 'react'; -import { +import type { QueryObserverOptions, - useQuery, - useQueryClient, UseQueryResult, } from '@tanstack/react-query'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useAuthContext } from '../../contexts/AuthContext'; import { generateQueryKey, RequestKey } from '../../lib/query'; -import { - Comment, - COMMENT_BY_ID_QUERY, - CommentOnData, -} from '../../graphql/comments'; +import type { Comment, CommentOnData } from '../../graphql/comments'; +import { COMMENT_BY_ID_QUERY } from '../../graphql/comments'; import { useRequestProtocol } from '../useRequestProtocol'; interface UseCommentByIdProps { diff --git a/packages/shared/src/hooks/comments/useDeleteComment.ts b/packages/shared/src/hooks/comments/useDeleteComment.ts index 7ce547707b..064915fd3c 100644 --- a/packages/shared/src/hooks/comments/useDeleteComment.ts +++ b/packages/shared/src/hooks/comments/useDeleteComment.ts @@ -1,6 +1,7 @@ import { useCallback, useContext } from 'react'; import { useQueryClient } from '@tanstack/react-query'; -import { PromptOptions, usePrompt } from '../usePrompt'; +import type { PromptOptions } from '../usePrompt'; +import { usePrompt } from '../usePrompt'; import { ButtonVariant } from '../../components/buttons/common'; import { ButtonColor } from '../../components/buttons/Button'; import { postLogEvent } from '../../lib/feed'; @@ -10,7 +11,7 @@ import { removePostComments } from '../usePostById'; import LogContext from '../../contexts/LogContext'; import { useToastNotification } from '../useToastNotification'; import { useRequestProtocol } from '../useRequestProtocol'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; type UseDeleteCommentRet = { deleteComment: ( diff --git a/packages/shared/src/hooks/companion/useBackgroundRequest.ts b/packages/shared/src/hooks/companion/useBackgroundRequest.ts index 3f0eb0a4da..d9da98935a 100644 --- a/packages/shared/src/hooks/companion/useBackgroundRequest.ts +++ b/packages/shared/src/hooks/companion/useBackgroundRequest.ts @@ -1,4 +1,5 @@ -import { QueryKey, useQueryClient } from '@tanstack/react-query'; +import type { QueryKey } from '@tanstack/react-query'; +import { useQueryClient } from '@tanstack/react-query'; import { isQueryKeySame } from '../../graphql/common'; import { useRawBackgroundRequest } from './useRawBackgroundRequest'; diff --git a/packages/shared/src/hooks/companion/useRawBackgroundRequest.ts b/packages/shared/src/hooks/companion/useRawBackgroundRequest.ts index ca844154f2..6cb9c11449 100644 --- a/packages/shared/src/hooks/companion/useRawBackgroundRequest.ts +++ b/packages/shared/src/hooks/companion/useRawBackgroundRequest.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; -import { Browser } from 'webextension-polyfill'; -import { EmptyObjectLiteral } from '../../lib/kratos'; +import type { Browser } from 'webextension-polyfill'; +import type { EmptyObjectLiteral } from '../../lib/kratos'; import { useRequestProtocol } from '../useRequestProtocol'; export const useRawBackgroundRequest = ( diff --git a/packages/shared/src/hooks/contentPreference/types.ts b/packages/shared/src/hooks/contentPreference/types.ts index 423aa4fc9f..f7f52c59de 100644 --- a/packages/shared/src/hooks/contentPreference/types.ts +++ b/packages/shared/src/hooks/contentPreference/types.ts @@ -1,11 +1,11 @@ -import { +import type { ContentPreference, - ContentPreferenceStatus, ContentPreferenceType, } from '../../graphql/contentPreference'; +import { ContentPreferenceStatus } from '../../graphql/contentPreference'; import { RequestKey } from '../../lib/query'; -import { PropsParameters } from '../../types'; -import { UseMutationMatcher } from '../mutationSubscription/types'; +import type { PropsParameters } from '../../types'; +import type { UseMutationMatcher } from '../mutationSubscription/types'; export type ContentPreferenceMutation = ({ id, diff --git a/packages/shared/src/hooks/contentPreference/useBlockedQuery.ts b/packages/shared/src/hooks/contentPreference/useBlockedQuery.ts index 55f0916a6f..298294eb3b 100644 --- a/packages/shared/src/hooks/contentPreference/useBlockedQuery.ts +++ b/packages/shared/src/hooks/contentPreference/useBlockedQuery.ts @@ -1,12 +1,14 @@ -import { +import type { InfiniteData, - useInfiniteQuery, UseInfiniteQueryOptions, UseInfiniteQueryResult, } from '@tanstack/react-query'; -import { +import { useInfiniteQuery } from '@tanstack/react-query'; +import type { ContentPreference, ContentPreferenceType, +} from '../../graphql/contentPreference'; +import { DEFAULT_BLOCKED_LIMIT, USER_BLOCKED_QUERY, } from '../../graphql/contentPreference'; @@ -17,7 +19,8 @@ import { StaleTime, } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; -import { Connection, gqlClient } from '../../graphql/common'; +import type { Connection } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; import { useFollowContentPreferenceMutationSubscription } from './useFollowContentPreferenceMutationSubscription'; export type UseBlockedQueryProps = { diff --git a/packages/shared/src/hooks/contentPreference/useContentPreference.ts b/packages/shared/src/hooks/contentPreference/useContentPreference.ts index 9aacd71941..ee91c903df 100644 --- a/packages/shared/src/hooks/contentPreference/useContentPreference.ts +++ b/packages/shared/src/hooks/contentPreference/useContentPreference.ts @@ -8,9 +8,9 @@ import { } from '../../graphql/contentPreference'; import { useAuthContext } from '../../contexts/AuthContext'; import { gqlClient } from '../../graphql/common'; -import { PropsParameters } from '../../types'; +import type { PropsParameters } from '../../types'; import { useToastNotification } from '../useToastNotification'; -import { ContentPreferenceMutation } from './types'; +import type { ContentPreferenceMutation } from './types'; import { useLogContext } from '../../contexts/LogContext'; import { LogEvent } from '../../lib/log'; import { AuthTriggers } from '../../lib/auth'; diff --git a/packages/shared/src/hooks/contentPreference/useContentPreferenceStatusQuery.ts b/packages/shared/src/hooks/contentPreference/useContentPreferenceStatusQuery.ts index de90662962..ed69dc60d6 100644 --- a/packages/shared/src/hooks/contentPreference/useContentPreferenceStatusQuery.ts +++ b/packages/shared/src/hooks/contentPreference/useContentPreferenceStatusQuery.ts @@ -1,23 +1,21 @@ -import { - useQuery, - UseQueryOptions, - UseQueryResult, -} from '@tanstack/react-query'; -import { - CONTENT_PREFERENCE_STATUS_QUERY, +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; +import type { ContentPreference, ContentPreferenceType, } from '../../graphql/contentPreference'; +import { CONTENT_PREFERENCE_STATUS_QUERY } from '../../graphql/contentPreference'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; -import { ApiError, ApiErrorResult, gqlClient } from '../../graphql/common'; +import type { ApiErrorResult } from '../../graphql/common'; +import { ApiError, gqlClient } from '../../graphql/common'; import { useMutationSubscription } from '../mutationSubscription/useMutationSubscription'; +import type { ContentPreferenceMutation } from './types'; import { - ContentPreferenceMutation, contentPreferenceMutationMatcher, mutationKeyToContentPreferenceStatusMap, } from './types'; -import { PropsParameters } from '../../types'; +import type { PropsParameters } from '../../types'; export type UseContentPreferenceStatusQueryProps = { id: string; diff --git a/packages/shared/src/hooks/contentPreference/useFollowContentPreferenceMutationSubscription.ts b/packages/shared/src/hooks/contentPreference/useFollowContentPreferenceMutationSubscription.ts index 7ffc4cff83..0752a11ea3 100644 --- a/packages/shared/src/hooks/contentPreference/useFollowContentPreferenceMutationSubscription.ts +++ b/packages/shared/src/hooks/contentPreference/useFollowContentPreferenceMutationSubscription.ts @@ -1,13 +1,13 @@ -import { InfiniteData } from '@tanstack/react-query'; -import { Connection } from '../../graphql/common'; -import { ContentPreference } from '../../graphql/contentPreference'; +import type { InfiniteData } from '@tanstack/react-query'; +import type { Connection } from '../../graphql/common'; +import type { ContentPreference } from '../../graphql/contentPreference'; import { RequestKey } from '../../lib/query'; -import { PropsParameters } from '../../types'; +import type { PropsParameters } from '../../types'; import { useMutationSubscription } from '../mutationSubscription'; +import type { ContentPreferenceMutation } from './types'; import { contentPreferenceMutationMatcher, mutationKeyToContentPreferenceStatusMap, - ContentPreferenceMutation, } from './types'; type UseFollowContentPreferenceMutationSubscriptionProps = { diff --git a/packages/shared/src/hooks/contentPreference/useFollowersQuery.ts b/packages/shared/src/hooks/contentPreference/useFollowersQuery.ts index 9b166d5f27..7dd07d916f 100644 --- a/packages/shared/src/hooks/contentPreference/useFollowersQuery.ts +++ b/packages/shared/src/hooks/contentPreference/useFollowersQuery.ts @@ -1,12 +1,14 @@ -import { +import type { InfiniteData, - useInfiniteQuery, UseInfiniteQueryOptions, } from '@tanstack/react-query'; -import { UseInfiniteQueryResult } from '@tanstack/react-query/build/legacy/types'; -import { +import { useInfiniteQuery } from '@tanstack/react-query'; +import type { UseInfiniteQueryResult } from '@tanstack/react-query/build/legacy/types'; +import type { ContentPreference, ContentPreferenceType, +} from '../../graphql/contentPreference'; +import { DEFAULT_FOLLOW_LIMIT, USER_FOLLOWERS_QUERY, } from '../../graphql/contentPreference'; @@ -17,7 +19,8 @@ import { StaleTime, } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; -import { Connection, gqlClient } from '../../graphql/common'; +import type { Connection } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; import { useFollowContentPreferenceMutationSubscription } from './useFollowContentPreferenceMutationSubscription'; export type UseFollowersQueryProps = { diff --git a/packages/shared/src/hooks/contentPreference/useFollowingQuery.ts b/packages/shared/src/hooks/contentPreference/useFollowingQuery.ts index 40de16d971..874cc56ad6 100644 --- a/packages/shared/src/hooks/contentPreference/useFollowingQuery.ts +++ b/packages/shared/src/hooks/contentPreference/useFollowingQuery.ts @@ -1,12 +1,14 @@ -import { +import type { InfiniteData, - useInfiniteQuery, UseInfiniteQueryOptions, UseInfiniteQueryResult, } from '@tanstack/react-query'; -import { +import { useInfiniteQuery } from '@tanstack/react-query'; +import type { ContentPreference, ContentPreferenceType, +} from '../../graphql/contentPreference'; +import { DEFAULT_FOLLOW_LIMIT, USER_FOLLOWING_QUERY, } from '../../graphql/contentPreference'; @@ -17,7 +19,8 @@ import { StaleTime, } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; -import { Connection, gqlClient } from '../../graphql/common'; +import type { Connection } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; import { useFollowContentPreferenceMutationSubscription } from './useFollowContentPreferenceMutationSubscription'; export type UseFollowingQueryProps = { diff --git a/packages/shared/src/hooks/contentPreference/useSearchSuggestionsContentPreferenceMutationSubscription.ts b/packages/shared/src/hooks/contentPreference/useSearchSuggestionsContentPreferenceMutationSubscription.ts index f0c392eb4d..f44cb07abb 100644 --- a/packages/shared/src/hooks/contentPreference/useSearchSuggestionsContentPreferenceMutationSubscription.ts +++ b/packages/shared/src/hooks/contentPreference/useSearchSuggestionsContentPreferenceMutationSubscription.ts @@ -1,9 +1,9 @@ -import { SearchSuggestionResult } from '../../graphql/search'; -import { RequestKey } from '../../lib/query'; -import { PropsParameters } from '../../types'; +import type { SearchSuggestionResult } from '../../graphql/search'; +import type { RequestKey } from '../../lib/query'; +import type { PropsParameters } from '../../types'; import { useMutationSubscription } from '../mutationSubscription'; +import type { ContentPreferenceMutation } from './types'; import { - ContentPreferenceMutation, contentPreferenceMutationMatcher, mutationKeyToContentPreferenceStatusMap, } from './types'; diff --git a/packages/shared/src/hooks/contentPreference/useSourceContentPreferenceMutationSubscription.ts b/packages/shared/src/hooks/contentPreference/useSourceContentPreferenceMutationSubscription.ts index fb14b6b01b..1bba9a16ca 100644 --- a/packages/shared/src/hooks/contentPreference/useSourceContentPreferenceMutationSubscription.ts +++ b/packages/shared/src/hooks/contentPreference/useSourceContentPreferenceMutationSubscription.ts @@ -1,11 +1,11 @@ -import { Squad } from '../../graphql/sources'; -import { RequestKey } from '../../lib/query'; -import { PropsParameters } from '../../types'; +import type { Squad } from '../../graphql/sources'; +import type { RequestKey } from '../../lib/query'; +import type { PropsParameters } from '../../types'; import { useMutationSubscription } from '../mutationSubscription'; +import type { ContentPreferenceMutation } from './types'; import { contentPreferenceMutationMatcher, mutationKeyToContentPreferenceStatusMap, - ContentPreferenceMutation, } from './types'; type UseSourceContentPreferenceMutationSubscriptionProps = { diff --git a/packages/shared/src/hooks/contentPreference/useUsersContentPreferenceMutationSubscription.ts b/packages/shared/src/hooks/contentPreference/useUsersContentPreferenceMutationSubscription.ts index 948b71cbf2..341a8310ed 100644 --- a/packages/shared/src/hooks/contentPreference/useUsersContentPreferenceMutationSubscription.ts +++ b/packages/shared/src/hooks/contentPreference/useUsersContentPreferenceMutationSubscription.ts @@ -1,11 +1,12 @@ -import { InfiniteData, QueryKey } from '@tanstack/react-query'; +import type { InfiniteData, QueryKey } from '@tanstack/react-query'; import { useMutationSubscription } from '../mutationSubscription/useMutationSubscription'; -import { RequestKey, updateAuthorContentPreference } from '../../lib/query'; -import { PropsParameters } from '../../types'; +import type { RequestKey } from '../../lib/query'; +import { updateAuthorContentPreference } from '../../lib/query'; +import type { PropsParameters } from '../../types'; +import type { ContentPreferenceMutation } from './types'; import { contentPreferenceMutationMatcher, mutationKeyToContentPreferenceStatusMap, - ContentPreferenceMutation, } from './types'; type UseUsersContentPreferenceMutationSubscriptionProps = { diff --git a/packages/shared/src/hooks/feed/useAdvancedSettings.ts b/packages/shared/src/hooks/feed/useAdvancedSettings.ts index 2b64f982e2..95403bf6a1 100644 --- a/packages/shared/src/hooks/feed/useAdvancedSettings.ts +++ b/packages/shared/src/hooks/feed/useAdvancedSettings.ts @@ -1,10 +1,11 @@ import { useCallback, useMemo } from 'react'; -import useFeedSettings, { UseFeedSettingsProps } from '../useFeedSettings'; +import type { UseFeedSettingsProps } from '../useFeedSettings'; +import useFeedSettings from '../useFeedSettings'; import { useAlertsContext } from '../../contexts/AlertContext'; import { useLogContext } from '../../contexts/LogContext'; import { useAuthContext } from '../../contexts/AuthContext'; import useMutateFilters from '../useMutateFilters'; -import { Source } from '../../graphql/sources'; +import type { Source } from '../../graphql/sources'; import useTagAndSource from '../useTagAndSource'; import { Origin } from '../../lib/log'; diff --git a/packages/shared/src/hooks/feed/useAutoRotatingAds.ts b/packages/shared/src/hooks/feed/useAutoRotatingAds.ts index aacb158e16..5c7348f5e9 100644 --- a/packages/shared/src/hooks/feed/useAutoRotatingAds.ts +++ b/packages/shared/src/hooks/feed/useAutoRotatingAds.ts @@ -1,15 +1,11 @@ import { useCallback, useContext, useEffect, useMemo } from 'react'; -import { - useQuery, - useQueryClient, - type InfiniteData, - focusManager, - type QueryObserverBaseResult, +import type { + InfiniteData, + QueryObserverBaseResult, } from '@tanstack/react-query'; -import { - useInView, - type InViewHookResponse, -} from 'react-intersection-observer'; +import { useQuery, useQueryClient, focusManager } from '@tanstack/react-query'; +import type { InViewHookResponse } from 'react-intersection-observer'; +import { useInView } from 'react-intersection-observer'; import { useLogContext } from '../../contexts/LogContext'; import { ActiveFeedContext } from '../../contexts'; import { useFeature } from '../../components/GrowthBookProvider'; diff --git a/packages/shared/src/hooks/feed/useCardCover.tsx b/packages/shared/src/hooks/feed/useCardCover.tsx index 3111ad456a..eb6b08e2da 100644 --- a/packages/shared/src/hooks/feed/useCardCover.tsx +++ b/packages/shared/src/hooks/feed/useCardCover.tsx @@ -1,5 +1,6 @@ -import React, { ReactNode, useMemo } from 'react'; -import { Post } from '../../graphql/posts'; +import type { ReactNode } from 'react'; +import React, { useMemo } from 'react'; +import type { Post } from '../../graphql/posts'; import { usePostShareLoop } from '../post/usePostShareLoop'; import { CardCoverShare } from '../../components/cards/common/CardCoverShare'; import { CardCoverContainer } from '../../components/cards/common/CardCoverContainer'; diff --git a/packages/shared/src/hooks/feed/useCommentPopup.ts b/packages/shared/src/hooks/feed/useCommentPopup.ts index 274f649e75..ea8dbf16c1 100644 --- a/packages/shared/src/hooks/feed/useCommentPopup.ts +++ b/packages/shared/src/hooks/feed/useCommentPopup.ts @@ -1,12 +1,10 @@ import { useContext, useState } from 'react'; import { useMutation } from '@tanstack/react-query'; -import { - COMMENT_ON_POST_MUTATION, - CommentOnData, -} from '../../graphql/comments'; +import type { CommentOnData } from '../../graphql/comments'; +import { COMMENT_ON_POST_MUTATION } from '../../graphql/comments'; import LogContext from '../../contexts/LogContext'; import { feedLogExtra, postLogEvent } from '../../lib/feed'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import { gqlClient } from '../../graphql/common'; export default function useCommentPopup( diff --git a/packages/shared/src/hooks/feed/useFeedContextMenu.ts b/packages/shared/src/hooks/feed/useFeedContextMenu.ts index 580962da42..2a67339903 100644 --- a/packages/shared/src/hooks/feed/useFeedContextMenu.ts +++ b/packages/shared/src/hooks/feed/useFeedContextMenu.ts @@ -1,6 +1,7 @@ -import React, { useState } from 'react'; +import type React from 'react'; +import { useState } from 'react'; import useContextMenu from '../useContextMenu'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import { ContextMenu } from '../constants'; import useReportPostMenu from '../useReportPostMenu'; diff --git a/packages/shared/src/hooks/feed/useFeedName.ts b/packages/shared/src/hooks/feed/useFeedName.ts index 4a25076fe3..cbad78209a 100644 --- a/packages/shared/src/hooks/feed/useFeedName.ts +++ b/packages/shared/src/hooks/feed/useFeedName.ts @@ -1,5 +1,6 @@ import { SharedFeedPage } from '../../components/utilities'; -import { AllFeedPages, OtherFeedPage } from '../../lib/query'; +import type { AllFeedPages } from '../../lib/query'; +import { OtherFeedPage } from '../../lib/query'; interface UseFeedNameProps { feedName: AllFeedPages; diff --git a/packages/shared/src/hooks/feed/useFeedOnPostClick.ts b/packages/shared/src/hooks/feed/useFeedOnPostClick.ts index 1c54026ca7..768ba8a94e 100644 --- a/packages/shared/src/hooks/feed/useFeedOnPostClick.ts +++ b/packages/shared/src/hooks/feed/useFeedOnPostClick.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react'; -import { Post } from '../../graphql/posts'; -import { FeedItem, PostItem } from '../useFeed'; +import type { Post } from '../../graphql/posts'; +import type { FeedItem, PostItem } from '../useFeed'; import useOnPostClick from '../useOnPostClick'; interface PostClickOptionalProps { diff --git a/packages/shared/src/hooks/feed/useFeeds.ts b/packages/shared/src/hooks/feed/useFeeds.ts index 2f2bcc3a8e..020e449d58 100644 --- a/packages/shared/src/hooks/feed/useFeeds.ts +++ b/packages/shared/src/hooks/feed/useFeeds.ts @@ -1,9 +1,8 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import type { FeedList, Feed } from '../../graphql/feed'; import { - FeedList, FEED_LIST_QUERY, CREATE_FEED_MUTATION, - Feed, UPDATE_FEED_MUTATION, DELETE_FEED_MUTATION, } from '../../graphql/feed'; diff --git a/packages/shared/src/hooks/feed/useLogImpression.ts b/packages/shared/src/hooks/feed/useLogImpression.ts index 381792cfb7..dd35c8994b 100644 --- a/packages/shared/src/hooks/feed/useLogImpression.ts +++ b/packages/shared/src/hooks/feed/useLogImpression.ts @@ -2,7 +2,7 @@ import { useInView } from 'react-intersection-observer'; import { useContext, useEffect } from 'react'; import { adLogEvent, feedLogExtra, postLogEvent } from '../../lib/feed'; import LogContext from '../../contexts/LogContext'; -import { FeedItem } from '../useFeed'; +import type { FeedItem } from '../useFeed'; import { PostType } from '../../graphql/posts'; export enum ImpressionStatus { diff --git a/packages/shared/src/hooks/input/useDebouncedUrl.ts b/packages/shared/src/hooks/input/useDebouncedUrl.ts index f3a63b2a57..50d291db50 100644 --- a/packages/shared/src/hooks/input/useDebouncedUrl.ts +++ b/packages/shared/src/hooks/input/useDebouncedUrl.ts @@ -1,4 +1,5 @@ -import useDebounceFn, { CancelEvent, StartFn } from '../useDebounceFn'; +import type { CancelEvent, StartFn } from '../useDebounceFn'; +import useDebounceFn from '../useDebounceFn'; import { isValidHttpUrl } from '../../lib/links'; export const useDebouncedUrl = ( diff --git a/packages/shared/src/hooks/input/useDiscardPost.ts b/packages/shared/src/hooks/input/useDiscardPost.ts index d7a0c8e996..aa2aa65dda 100644 --- a/packages/shared/src/hooks/input/useDiscardPost.ts +++ b/packages/shared/src/hooks/input/useDiscardPost.ts @@ -1,17 +1,20 @@ -import { MutableRefObject, useCallback, useRef } from 'react'; +import type { MutableRefObject } from 'react'; +import { useCallback, useRef } from 'react'; import { del as deleteCache } from 'idb-keyval'; import { formToJson } from '../../lib/form'; -import { EditPostProps } from '../../graphql/posts'; +import type { EditPostProps } from '../../graphql/posts'; import { checkSavedProperty, generateWritePostKey, } from '../../components/post/freeform'; -import { - UseExitConfirmation, - useExitConfirmation, -} from '../useExitConfirmation'; +import type { UseExitConfirmation } from '../useExitConfirmation'; +import { useExitConfirmation } from '../useExitConfirmation'; import usePersistentContext from '../usePersistentContext'; -import { MergedWriteObject, WriteForm, WritePostProps } from '../../contexts'; +import type { + MergedWriteObject, + WriteForm, + WritePostProps, +} from '../../contexts'; interface UseDiscardPostProps { post?: MergedWriteObject; diff --git a/packages/shared/src/hooks/input/useMarkdownInput.ts b/packages/shared/src/hooks/input/useMarkdownInput.ts index b15c93105e..b77ddfd5db 100644 --- a/packages/shared/src/hooks/input/useMarkdownInput.ts +++ b/packages/shared/src/hooks/input/useMarkdownInput.ts @@ -1,31 +1,25 @@ -import { +import type { ClipboardEventHandler, DragEventHandler, FormEventHandler, HTMLAttributes, KeyboardEventHandler, MutableRefObject, - useCallback, - useEffect, - useMemo, - useRef, - useState, } from 'react'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useQuery } from '@tanstack/react-query'; +import type { GetReplacementFn } from '../../lib/textarea'; import { CursorType, getCloseWord, getCursorType, - GetReplacementFn, getTemporaryUploadString, TextareaCommand, } from '../../lib/textarea'; import { useRequestProtocol } from '../useRequestProtocol'; import { useAuthContext } from '../../contexts/AuthContext'; -import { - RECOMMEND_MENTIONS_QUERY, - RecommendedMentionsData, -} from '../../graphql/comments'; +import type { RecommendedMentionsData } from '../../graphql/comments'; +import { RECOMMEND_MENTIONS_QUERY } from '../../graphql/comments'; import { isNullOrUndefined } from '../../lib/func'; import { ArrowKey, @@ -34,7 +28,7 @@ import { KeyboardCommand, Y_AXIS_KEYS, } from '../../lib/element'; -import { UserShortProfile } from '../../lib/user'; +import type { UserShortProfile } from '../../lib/user'; import { getLinkReplacement, getMentionReplacement } from '../../lib/markdown'; import { handleRegex } from '../../graphql/users'; import { UploadState, useSyncUploader } from './useSyncUploader'; diff --git a/packages/shared/src/hooks/integrations/slack/useSlackChannelsQuery.ts b/packages/shared/src/hooks/integrations/slack/useSlackChannelsQuery.ts index 00e1fbe26d..58f8f98321 100644 --- a/packages/shared/src/hooks/integrations/slack/useSlackChannelsQuery.ts +++ b/packages/shared/src/hooks/integrations/slack/useSlackChannelsQuery.ts @@ -1,12 +1,7 @@ -import { - useQuery, - UseQueryOptions, - UseQueryResult, -} from '@tanstack/react-query'; -import { - SLACK_CHANNELS_QUERY, - SlackChannel, -} from '../../../graphql/integrations'; +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; +import type { SlackChannel } from '../../../graphql/integrations'; +import { SLACK_CHANNELS_QUERY } from '../../../graphql/integrations'; import { generateQueryKey, RequestKey, StaleTime } from '../../../lib/query'; import { gqlClient } from '../../../graphql/common'; import { useAuthContext } from '../../../contexts/AuthContext'; diff --git a/packages/shared/src/hooks/integrations/useIntegration.ts b/packages/shared/src/hooks/integrations/useIntegration.ts index de6ea1f8c7..830e812f65 100644 --- a/packages/shared/src/hooks/integrations/useIntegration.ts +++ b/packages/shared/src/hooks/integrations/useIntegration.ts @@ -1,11 +1,13 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { - REMOVE_INTEGRATION_MUTATION, - REMOVE_SOURCE_INTEGRATION_MUTATION, +import type { UserIntegration, UserIntegrationType, UserSourceIntegration, } from '../../graphql/integrations'; +import { + REMOVE_INTEGRATION_MUTATION, + REMOVE_SOURCE_INTEGRATION_MUTATION, +} from '../../graphql/integrations'; import { generateQueryKey, RequestKey } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; import { usePrompt } from '../usePrompt'; diff --git a/packages/shared/src/hooks/integrations/useIntegrationQuery.ts b/packages/shared/src/hooks/integrations/useIntegrationQuery.ts index c91f58c668..cb3ec0b666 100644 --- a/packages/shared/src/hooks/integrations/useIntegrationQuery.ts +++ b/packages/shared/src/hooks/integrations/useIntegrationQuery.ts @@ -1,9 +1,6 @@ -import { - useQuery, - UseQueryOptions, - UseQueryResult, -} from '@tanstack/react-query'; -import { UserIntegration } from '../../graphql/integrations'; +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; +import type { UserIntegration } from '../../graphql/integrations'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; import { gqlClient } from '../../graphql/common'; import { USER_INTEGRATION_BY_ID } from '../../graphql/users'; diff --git a/packages/shared/src/hooks/integrations/useIntegrationsQuery.ts b/packages/shared/src/hooks/integrations/useIntegrationsQuery.ts index 8c2df72d47..03b3b9e198 100644 --- a/packages/shared/src/hooks/integrations/useIntegrationsQuery.ts +++ b/packages/shared/src/hooks/integrations/useIntegrationsQuery.ts @@ -1,11 +1,9 @@ -import { - useQuery, - UseQueryOptions, - UseQueryResult, -} from '@tanstack/react-query'; -import { UserIntegration } from '../../graphql/integrations'; +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; +import type { UserIntegration } from '../../graphql/integrations'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; -import { gqlClient, Connection } from '../../graphql/common'; +import type { Connection } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; import { USER_INTEGRATIONS } from '../../graphql/users'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/hooks/integrations/useSourceIntegrationQuery.ts b/packages/shared/src/hooks/integrations/useSourceIntegrationQuery.ts index 57344170e4..de62c1989b 100644 --- a/packages/shared/src/hooks/integrations/useSourceIntegrationQuery.ts +++ b/packages/shared/src/hooks/integrations/useSourceIntegrationQuery.ts @@ -1,15 +1,13 @@ -import { - useQuery, - UseQueryOptions, - UseQueryResult, -} from '@tanstack/react-query'; -import { - SOURCE_INTEGRATION_QUERY, +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; +import type { UserIntegrationType, UserSourceIntegration, } from '../../graphql/integrations'; +import { SOURCE_INTEGRATION_QUERY } from '../../graphql/integrations'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; -import { ApiError, ApiErrorResult, gqlClient } from '../../graphql/common'; +import type { ApiErrorResult } from '../../graphql/common'; +import { ApiError, gqlClient } from '../../graphql/common'; import { useAuthContext } from '../../contexts/AuthContext'; export type UseSourceIntegrationQueryProps = { diff --git a/packages/shared/src/hooks/integrations/useSourceIntegrationsQuery.ts b/packages/shared/src/hooks/integrations/useSourceIntegrationsQuery.ts index 7330d69e6c..7e1ad36ba7 100644 --- a/packages/shared/src/hooks/integrations/useSourceIntegrationsQuery.ts +++ b/packages/shared/src/hooks/integrations/useSourceIntegrationsQuery.ts @@ -1,15 +1,13 @@ -import { - useQuery, - UseQueryOptions, - UseQueryResult, -} from '@tanstack/react-query'; -import { - SOURCE_INTEGRATIONS_QUERY, +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; +import type { UserIntegrationType, UserSourceIntegration, } from '../../graphql/integrations'; +import { SOURCE_INTEGRATIONS_QUERY } from '../../graphql/integrations'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; -import { Connection, gqlClient } from '../../graphql/common'; +import type { Connection } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; import { useAuthContext } from '../../contexts/AuthContext'; export type UseSourceIntegrationsQueryProps = { diff --git a/packages/shared/src/hooks/log/useBackfillPendingLogs.ts b/packages/shared/src/hooks/log/useBackfillPendingLogs.ts index b1ac14fb33..481bde2833 100644 --- a/packages/shared/src/hooks/log/useBackfillPendingLogs.ts +++ b/packages/shared/src/hooks/log/useBackfillPendingLogs.ts @@ -1,5 +1,6 @@ -import { MutableRefObject, useEffect } from 'react'; -import { LogEvent } from './useLogQueue'; +import type { MutableRefObject } from 'react'; +import { useEffect } from 'react'; +import type { LogEvent } from './useLogQueue'; export default function useBackfillPendingLogs( sharedPropsRef: MutableRefObject>, diff --git a/packages/shared/src/hooks/log/useLogContextData.ts b/packages/shared/src/hooks/log/useLogContextData.ts index f67c7addd9..cd704528ee 100644 --- a/packages/shared/src/hooks/log/useLogContextData.ts +++ b/packages/shared/src/hooks/log/useLogContextData.ts @@ -1,7 +1,8 @@ -import { MutableRefObject, useMemo } from 'react'; -import { LogEvent, PushToQueueFunc } from './useLogQueue'; +import type { MutableRefObject } from 'react'; +import { useMemo } from 'react'; +import type { LogEvent, PushToQueueFunc } from './useLogQueue'; import { getCurrentLifecycleState } from '../../lib/lifecycle'; -import { Origin } from '../../lib/log'; +import type { Origin } from '../../lib/log'; export type LogContextData = { logEvent: (event: LogEvent) => void; diff --git a/packages/shared/src/hooks/log/useLogLifecycleEvents.ts b/packages/shared/src/hooks/log/useLogLifecycleEvents.ts index bad396ecec..c40d3d6b93 100644 --- a/packages/shared/src/hooks/log/useLogLifecycleEvents.ts +++ b/packages/shared/src/hooks/log/useLogLifecycleEvents.ts @@ -1,7 +1,8 @@ -import { MutableRefObject, useEffect, useRef } from 'react'; +import type { MutableRefObject } from 'react'; +import { useEffect, useRef } from 'react'; import listenToLifecycleEvents from '../../lib/lifecycle'; -import { LogContextData } from './useLogContextData'; -import { LogEvent } from './useLogQueue'; +import type { LogContextData } from './useLogContextData'; +import type { LogEvent } from './useLogQueue'; const ACTIVE_STATES = ['active', 'passive']; diff --git a/packages/shared/src/hooks/log/useLogPageView.ts b/packages/shared/src/hooks/log/useLogPageView.ts index 6f9868d471..fc0146e6a1 100644 --- a/packages/shared/src/hooks/log/useLogPageView.ts +++ b/packages/shared/src/hooks/log/useLogPageView.ts @@ -1,4 +1,5 @@ -import { MutableRefObject, useContext, useEffect, useRef } from 'react'; +import type { MutableRefObject } from 'react'; +import { useContext, useEffect, useRef } from 'react'; import { useRouter } from 'next/router'; import LogContext from '../../contexts/LogContext'; diff --git a/packages/shared/src/hooks/log/useLogQueue.ts b/packages/shared/src/hooks/log/useLogQueue.ts index 780e651871..e3ed3fba65 100644 --- a/packages/shared/src/hooks/log/useLogQueue.ts +++ b/packages/shared/src/hooks/log/useLogQueue.ts @@ -1,5 +1,6 @@ import { useMutation } from '@tanstack/react-query'; -import { MutableRefObject, useMemo, useRef } from 'react'; +import type { MutableRefObject } from 'react'; +import { useMemo, useRef } from 'react'; import { apiUrl } from '../../lib/config'; import useDebounceFn from '../useDebounceFn'; import { ExtensionMessageType } from '../../lib/extension'; diff --git a/packages/shared/src/hooks/log/useLogSharedProps.ts b/packages/shared/src/hooks/log/useLogSharedProps.ts index 2d632114f8..05be172d67 100644 --- a/packages/shared/src/hooks/log/useLogSharedProps.ts +++ b/packages/shared/src/hooks/log/useLogSharedProps.ts @@ -1,12 +1,7 @@ -import { - MutableRefObject, - useContext, - useEffect, - useRef, - useState, -} from 'react'; +import type { MutableRefObject } from 'react'; +import { useContext, useEffect, useRef, useState } from 'react'; import { useRouter } from 'next/router'; -import { LogEvent } from './useLogQueue'; +import type { LogEvent } from './useLogQueue'; import SettingsContext from '../../contexts/SettingsContext'; import AuthContext from '../../contexts/AuthContext'; import { getCookies } from '../../lib/cookie'; diff --git a/packages/shared/src/hooks/mutationSubscription/types.ts b/packages/shared/src/hooks/mutationSubscription/types.ts index c39f9a7cdf..924ee9ba98 100644 --- a/packages/shared/src/hooks/mutationSubscription/types.ts +++ b/packages/shared/src/hooks/mutationSubscription/types.ts @@ -1,4 +1,8 @@ -import { Mutation, MutationStatus, QueryClient } from '@tanstack/react-query'; +import type { + Mutation, + MutationStatus, + QueryClient, +} from '@tanstack/react-query'; export type UseMutationMatcherProps = { status: MutationStatus; diff --git a/packages/shared/src/hooks/mutationSubscription/useMutationSubscription.ts b/packages/shared/src/hooks/mutationSubscription/useMutationSubscription.ts index 532e149762..ce3e9d3741 100644 --- a/packages/shared/src/hooks/mutationSubscription/useMutationSubscription.ts +++ b/packages/shared/src/hooks/mutationSubscription/useMutationSubscription.ts @@ -1,7 +1,10 @@ import { useEffect, useRef } from 'react'; import { useQueryClient } from '@tanstack/react-query'; import { v4 as uuidv4 } from 'uuid'; -import { UseMutationSubscription, UseMutationSubscriptionProps } from './types'; +import type { + UseMutationSubscription, + UseMutationSubscriptionProps, +} from './types'; import { mutationSuccessSubscribers } from '../../lib/query'; export const useMutationSubscription = ({ diff --git a/packages/shared/src/hooks/notifications/useBookmarkReminder.ts b/packages/shared/src/hooks/notifications/useBookmarkReminder.ts index baa77dee12..fe1f69c722 100644 --- a/packages/shared/src/hooks/notifications/useBookmarkReminder.ts +++ b/packages/shared/src/hooks/notifications/useBookmarkReminder.ts @@ -1,20 +1,20 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; import { addDays, addHours, nextMonday, set } from 'date-fns'; -import { +import type { Bookmark, - setBookmarkReminder, SetBookmarkReminderProps, } from '../../graphql/bookmarks'; +import { setBookmarkReminder } from '../../graphql/bookmarks'; import { useToastNotification } from '../useToastNotification'; import { updatePostCache } from '../usePostById'; import { useActiveFeedContext } from '../../contexts'; import { updateCachedPagePost } from '../../lib/query'; import { optimisticPostUpdateInFeed, postLogEvent } from '../../lib/feed'; -import { EmptyResponse } from '../../graphql/emptyResponse'; +import type { EmptyResponse } from '../../graphql/emptyResponse'; import { useLogContext } from '../../contexts/LogContext'; import { LogEvent, NotificationPromptSource } from '../../lib/log'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import { usePushNotificationContext } from '../../contexts/PushNotificationContext'; import { usePushNotificationMutation } from './usePushNotificationMutation'; diff --git a/packages/shared/src/hooks/notifications/useNotificationPreference.ts b/packages/shared/src/hooks/notifications/useNotificationPreference.ts index b9ff6413da..6b8424a80b 100644 --- a/packages/shared/src/hooks/notifications/useNotificationPreference.ts +++ b/packages/shared/src/hooks/notifications/useNotificationPreference.ts @@ -1,11 +1,11 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; +import type { NotificationPreference } from '../../graphql/notifications'; import { clearNotificationPreference, getNotificationPreferences, hideSourceFeedPosts, muteNotification, - NotificationPreference, notificationPreferenceMap, NotificationPreferenceStatus, showSourceFeedPosts, @@ -13,8 +13,8 @@ import { } from '../../graphql/notifications'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; -import { NotificationType } from '../../components/notifications/utils'; -import { Squad } from '../../graphql/sources'; +import type { NotificationType } from '../../components/notifications/utils'; +import type { Squad } from '../../graphql/sources'; import { updateFlagsCache } from '../../graphql/source/common'; interface UseNotificationPreference { diff --git a/packages/shared/src/hooks/notifications/useNotificationPreferenceToggle.ts b/packages/shared/src/hooks/notifications/useNotificationPreferenceToggle.ts index c2eaf3b07a..d4e710c1eb 100644 --- a/packages/shared/src/hooks/notifications/useNotificationPreferenceToggle.ts +++ b/packages/shared/src/hooks/notifications/useNotificationPreferenceToggle.ts @@ -1,10 +1,10 @@ import { useMutation } from '@tanstack/react-query'; import { useMemo } from 'react'; import { NotificationPreferenceStatus } from '../../graphql/notifications'; +import type { UseNotificationPreferenceProps } from './useNotificationPreference'; import { useNotificationPreference, checkHasStatusPreference, - UseNotificationPreferenceProps, } from './useNotificationPreference'; export type UseNotificationPreferenceToggleProps = { diff --git a/packages/shared/src/hooks/notifications/usePushNotificationMutation.tsx b/packages/shared/src/hooks/notifications/usePushNotificationMutation.tsx index 4b99d7209c..2060ec9f0f 100644 --- a/packages/shared/src/hooks/notifications/usePushNotificationMutation.tsx +++ b/packages/shared/src/hooks/notifications/usePushNotificationMutation.tsx @@ -1,16 +1,15 @@ import { useCallback, useState } from 'react'; -import usePersistentContext, { - UserPersistentContextType, -} from '../usePersistentContext'; +import type { UserPersistentContextType } from '../usePersistentContext'; +import usePersistentContext from '../usePersistentContext'; import { ActionType } from '../../graphql/actions'; import { useActions } from '../useActions'; +import type { PermissionEvent } from '../useNotificationPermissionPopup'; import { ENABLE_NOTIFICATION_WINDOW_KEY, - PermissionEvent, useNotificationPermissionPopup, } from '../useNotificationPermissionPopup'; import { checkIsExtension } from '../../lib/func'; -import { NotificationPromptSource } from '../../lib/log'; +import type { NotificationPromptSource } from '../../lib/log'; import { useAuthContext } from '../../contexts/AuthContext'; import { usePushNotificationContext } from '../../contexts/PushNotificationContext'; import { useEventListener } from '../useEventListener'; diff --git a/packages/shared/src/hooks/post/common.ts b/packages/shared/src/hooks/post/common.ts index bbbf21fee5..0a74f31168 100644 --- a/packages/shared/src/hooks/post/common.ts +++ b/packages/shared/src/hooks/post/common.ts @@ -1,4 +1,4 @@ -import { CommentMarkdownInputProps } from '../../components/fields/MarkdownInput/CommentMarkdownInput'; +import type { CommentMarkdownInputProps } from '../../components/fields/MarkdownInput/CommentMarkdownInput'; export interface CommentWriteProps { commentId: string; diff --git a/packages/shared/src/hooks/post/useBlockPostPanel.ts b/packages/shared/src/hooks/post/useBlockPostPanel.ts index efee092e3b..20ef50f285 100644 --- a/packages/shared/src/hooks/post/useBlockPostPanel.ts +++ b/packages/shared/src/hooks/post/useBlockPostPanel.ts @@ -1,14 +1,16 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback, useMemo } from 'react'; -import { Post, ReadHistoryPost } from '../../graphql/posts'; +import type { Post, ReadHistoryPost } from '../../graphql/posts'; import { useAuthContext } from '../../contexts/AuthContext'; import { useActions } from '../useActions'; import { ActionType } from '../../graphql/actions'; import useTagAndSource from '../useTagAndSource'; import { Origin } from '../../lib/log'; -import { +import type { BlockTagSelection, DownvoteBlocked, +} from '../../components/post/block/common'; +import { getBlockedLength, getBlockedMessage, } from '../../components/post/block/common'; diff --git a/packages/shared/src/hooks/post/useComments.ts b/packages/shared/src/hooks/post/useComments.ts index 272d963585..6fbf42dbc6 100644 --- a/packages/shared/src/hooks/post/useComments.ts +++ b/packages/shared/src/hooks/post/useComments.ts @@ -4,9 +4,9 @@ import { isNullOrUndefined } from '../../lib/func'; import { useLogContext } from '../../contexts/LogContext'; import { postLogEvent } from '../../lib/feed'; import { LogEvent, Origin } from '../../lib/log'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import { AuthTriggers } from '../../lib/auth'; -import { CommentWrite, CommentWriteProps } from './common'; +import type { CommentWrite, CommentWriteProps } from './common'; interface ReplyTo extends CommentWriteProps { username: string; diff --git a/packages/shared/src/hooks/post/useEditCommentProps.ts b/packages/shared/src/hooks/post/useEditCommentProps.ts index 57695f764d..1f35c41571 100644 --- a/packages/shared/src/hooks/post/useEditCommentProps.ts +++ b/packages/shared/src/hooks/post/useEditCommentProps.ts @@ -1,5 +1,5 @@ import { useCallback, useMemo, useState } from 'react'; -import { CommentWrite, CommentWriteProps } from './common'; +import type { CommentWrite, CommentWriteProps } from './common'; import useCommentById from '../comments/useCommentById'; interface UseCommentEdit extends CommentWrite { diff --git a/packages/shared/src/hooks/post/useLoggedCopyPostLink.ts b/packages/shared/src/hooks/post/useLoggedCopyPostLink.ts index 6a99131e32..49c6bfe3cb 100644 --- a/packages/shared/src/hooks/post/useLoggedCopyPostLink.ts +++ b/packages/shared/src/hooks/post/useLoggedCopyPostLink.ts @@ -1,8 +1,8 @@ import { useCallback, useContext } from 'react'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; import { useCopyPostLink } from '../useCopyPostLink'; import LogContext from '../../contexts/LogContext'; -import { ShareProvider } from '../../lib/share'; +import type { ShareProvider } from '../../lib/share'; import { postLogEvent } from '../../lib/feed'; import { Origin } from '../../lib/log'; import { ReferralCampaignKey } from '../../lib'; diff --git a/packages/shared/src/hooks/post/useMutateComment.ts b/packages/shared/src/hooks/post/useMutateComment.ts index d0b42d2d95..957bf8a2ca 100644 --- a/packages/shared/src/hooks/post/useMutateComment.ts +++ b/packages/shared/src/hooks/post/useMutateComment.ts @@ -1,8 +1,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useCallback, useMemo } from 'react'; +import type { Comment, PostCommentsData } from '../../graphql/comments'; import { - Comment, - PostCommentsData, COMMENT_ON_COMMENT_MUTATION, COMMENT_ON_POST_MUTATION, EDIT_COMMENT_MUTATION, @@ -16,11 +15,11 @@ import { } from '../../lib/query'; import { useBackgroundRequest } from '../companion'; import { updatePostCache } from '../usePostById'; -import { Edge } from '../../graphql/common'; +import type { Edge } from '../../graphql/common'; import { useLogContext } from '../../contexts/LogContext'; import { useRequestProtocol } from '../useRequestProtocol'; import { useAuthContext } from '../../contexts/AuthContext'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; interface SubmitComment { id?: string; diff --git a/packages/shared/src/hooks/post/usePostCodeSnippets.ts b/packages/shared/src/hooks/post/usePostCodeSnippets.ts index 7ca4365638..29188dc64e 100644 --- a/packages/shared/src/hooks/post/usePostCodeSnippets.ts +++ b/packages/shared/src/hooks/post/usePostCodeSnippets.ts @@ -1,14 +1,14 @@ -import { +import type { InfiniteData, - useInfiniteQuery, UseInfiniteQueryOptions, UseInfiniteQueryResult, } from '@tanstack/react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { useCallback } from 'react'; +import type { PostCodeSnippet } from '../../graphql/posts'; import { POST_CODE_SNIPPETS_PER_PAGE_DEFAULT, POST_CODE_SNIPPETS_QUERY, - PostCodeSnippet, } from '../../graphql/posts'; import { generateQueryKey, @@ -16,7 +16,8 @@ import { RequestKey, StaleTime, } from '../../lib/query'; -import { Connection, gqlClient } from '../../graphql/common'; +import type { Connection } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; type UsePostCodeSnippetsData = Connection; diff --git a/packages/shared/src/hooks/post/usePostImage.ts b/packages/shared/src/hooks/post/usePostImage.ts index 6f7edd8171..4d1b11c717 100644 --- a/packages/shared/src/hooks/post/usePostImage.ts +++ b/packages/shared/src/hooks/post/usePostImage.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; export const usePostImage = (post: Post): string => useMemo(() => { diff --git a/packages/shared/src/hooks/post/usePostShareLoop.spec.ts b/packages/shared/src/hooks/post/usePostShareLoop.spec.ts index 607f268a72..2848d8631a 100644 --- a/packages/shared/src/hooks/post/usePostShareLoop.spec.ts +++ b/packages/shared/src/hooks/post/usePostShareLoop.spec.ts @@ -1,10 +1,9 @@ import { renderHook, act } from '@testing-library/react'; import { usePostShareLoop } from './usePostShareLoop'; -import { Post, UserVote } from '../../graphql/posts'; -import { - UseMutationSubscriptionProps, - useMutationSubscription, -} from '../mutationSubscription'; +import type { Post } from '../../graphql/posts'; +import { UserVote } from '../../graphql/posts'; +import type { UseMutationSubscriptionProps } from '../mutationSubscription'; +import { useMutationSubscription } from '../mutationSubscription'; const post = { id: '1' } as Post; const feedName = 'testFeed'; diff --git a/packages/shared/src/hooks/post/usePostShareLoop.ts b/packages/shared/src/hooks/post/usePostShareLoop.ts index 414667f827..d8b162ecdf 100644 --- a/packages/shared/src/hooks/post/usePostShareLoop.ts +++ b/packages/shared/src/hooks/post/usePostShareLoop.ts @@ -1,12 +1,10 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import { useActiveFeedNameContext } from '../../contexts'; import { useMutationSubscription } from '../mutationSubscription'; -import { - UseVoteMutationProps, - UserVoteEntity, - createVoteMutationKey, -} from '../vote'; -import { Post, UserVote } from '../../graphql/posts'; +import type { UseVoteMutationProps } from '../vote'; +import { UserVoteEntity, createVoteMutationKey } from '../vote'; +import type { Post } from '../../graphql/posts'; +import { UserVote } from '../../graphql/posts'; import { useBookmarkReminderCover } from '../bookmark/useBookmarkReminderCover'; interface UsePostShareLoop { diff --git a/packages/shared/src/hooks/post/usePublicReadingHistory.ts b/packages/shared/src/hooks/post/usePublicReadingHistory.ts index 01797f2afd..4237e43d62 100644 --- a/packages/shared/src/hooks/post/usePublicReadingHistory.ts +++ b/packages/shared/src/hooks/post/usePublicReadingHistory.ts @@ -1,9 +1,9 @@ import { useContext, useMemo } from 'react'; -import { UseInfiniteQueryResult } from '@tanstack/react-query'; +import type { UseInfiniteQueryResult } from '@tanstack/react-query'; import AuthContext from '../../contexts/AuthContext'; import { READING_HISTORY_QUERY } from '../../graphql/users'; import useInfiniteReadingHistory from '../useInfiniteReadingHistory'; -import { PostItem } from '../useFeed'; +import type { PostItem } from '../useFeed'; import { checkFetchMore } from '../../components/containers/InfiniteScrolling'; interface UseReadingHistory { diff --git a/packages/shared/src/hooks/post/useRelatedPosts.ts b/packages/shared/src/hooks/post/useRelatedPosts.ts index e837186438..030de6097c 100644 --- a/packages/shared/src/hooks/post/useRelatedPosts.ts +++ b/packages/shared/src/hooks/post/useRelatedPosts.ts @@ -1,16 +1,14 @@ -import { - useQueryClient, - useInfiniteQuery, +import type { InfiniteData, UseInfiniteQueryResult, } from '@tanstack/react-query'; +import { useQueryClient, useInfiniteQuery } from '@tanstack/react-query'; import { useCallback } from 'react'; -import { Connection } from '../../graphql/common'; +import type { Connection } from '../../graphql/common'; +import type { RelatedPost, PostData } from '../../graphql/posts'; import { - RelatedPost, RELATED_POSTS_QUERY, PostRelationType, - PostData, RELATED_POSTS_PER_PAGE_DEFAULT, } from '../../graphql/posts'; import { diff --git a/packages/shared/src/hooks/post/useSmartTitle.ts b/packages/shared/src/hooks/post/useSmartTitle.ts index 77407ebbc1..7b58ae742a 100644 --- a/packages/shared/src/hooks/post/useSmartTitle.ts +++ b/packages/shared/src/hooks/post/useSmartTitle.ts @@ -1,7 +1,8 @@ import { useCallback, useMemo } from 'react'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { gqlClient } from '../../graphql/common'; -import { POST_FETCH_SMART_TITLE_QUERY, type Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; +import { POST_FETCH_SMART_TITLE_QUERY } from '../../graphql/posts'; import { getPostByIdKey } from '../usePostById'; import { usePlusSubscription } from '../usePlusSubscription'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/hooks/post/useViewPost.ts b/packages/shared/src/hooks/post/useViewPost.ts index 134e09f765..78b1256846 100644 --- a/packages/shared/src/hooks/post/useViewPost.ts +++ b/packages/shared/src/hooks/post/useViewPost.ts @@ -1,13 +1,10 @@ -import { - UseMutateAsyncFunction, - useMutation, - useQueryClient, -} from '@tanstack/react-query'; +import type { UseMutateAsyncFunction } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { getDay } from 'date-fns'; import { sendViewPost } from '../../graphql/posts'; import { generateQueryKey, RequestKey } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; -import { ReadingDay, UserStreak } from '../../graphql/users'; +import type { ReadingDay, UserStreak } from '../../graphql/users'; export const useViewPost = (): UseMutateAsyncFunction< unknown, diff --git a/packages/shared/src/hooks/profile/useDevCard.ts b/packages/shared/src/hooks/profile/useDevCard.ts index b7b98a62b1..bebac7942a 100644 --- a/packages/shared/src/hooks/profile/useDevCard.ts +++ b/packages/shared/src/hooks/profile/useDevCard.ts @@ -1,10 +1,10 @@ import { useQuery } from '@tanstack/react-query'; -import { DevCardTheme } from '../../components/profile/devcard/common'; +import type { DevCardTheme } from '../../components/profile/devcard/common'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; import { DEV_CARD_QUERY } from '../../graphql/users'; import { useRequestProtocol } from '../useRequestProtocol'; -import { PublicProfile } from '../../lib/user'; -import { Source } from '../../graphql/sources'; +import type { PublicProfile } from '../../lib/user'; +import type { Source } from '../../graphql/sources'; import { cloudinaryDevcardDefaultCoverImage } from '../../lib/image'; export interface DevCardData { diff --git a/packages/shared/src/hooks/profile/useProfile.ts b/packages/shared/src/hooks/profile/useProfile.ts index b086a1155b..9f0d31aa18 100644 --- a/packages/shared/src/hooks/profile/useProfile.ts +++ b/packages/shared/src/hooks/profile/useProfile.ts @@ -1,5 +1,6 @@ import { useQuery } from '@tanstack/react-query'; -import { getProfile, PublicProfile } from '../../lib/user'; +import type { PublicProfile } from '../../lib/user'; +import { getProfile } from '../../lib/user'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; import { disabledRefetch } from '../../lib/func'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/hooks/profile/useProfileReadme.ts b/packages/shared/src/hooks/profile/useProfileReadme.ts index f145ef2e6c..6fee85d688 100644 --- a/packages/shared/src/hooks/profile/useProfileReadme.ts +++ b/packages/shared/src/hooks/profile/useProfileReadme.ts @@ -1,9 +1,9 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { ClientError } from 'graphql-request'; +import type { ClientError } from 'graphql-request'; import { useState } from 'react'; import { generateQueryKey, RequestKey } from '../../lib/query'; import { UPDATE_README_MUTATION, USER_README_QUERY } from '../../graphql/users'; -import { PublicProfile } from '../../lib/user'; +import type { PublicProfile } from '../../lib/user'; import { useToastNotification } from '../useToastNotification'; import { gqlClient } from '../../graphql/common'; diff --git a/packages/shared/src/hooks/referral/useJoinReferral.spec.tsx b/packages/shared/src/hooks/referral/useJoinReferral.spec.tsx index 0142e6d71a..dd6be4e54d 100644 --- a/packages/shared/src/hooks/referral/useJoinReferral.spec.tsx +++ b/packages/shared/src/hooks/referral/useJoinReferral.spec.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { renderHook, waitFor } from '@testing-library/react'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import { mocked } from 'ts-jest/utils'; import nock from 'nock'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; diff --git a/packages/shared/src/hooks/referral/useJoinReferral.ts b/packages/shared/src/hooks/referral/useJoinReferral.ts index dadfa6b67b..9f491256f1 100644 --- a/packages/shared/src/hooks/referral/useJoinReferral.ts +++ b/packages/shared/src/hooks/referral/useJoinReferral.ts @@ -3,7 +3,8 @@ import { useQuery } from '@tanstack/react-query'; import { expireCookie, setCookie } from '../../lib/cookie'; import { isDevelopment } from '../../lib/constants'; import { GET_REFERRING_USER_QUERY } from '../../graphql/users'; -import { ApiErrorResult, gqlClient } from '../../graphql/common'; +import type { ApiErrorResult } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; import { useAuthContext } from '../../contexts/AuthContext'; import { disabledRefetch } from '../../lib/func'; import { oneYear } from '../../lib/dateFormat'; diff --git a/packages/shared/src/hooks/referral/useReferralCampaign.ts b/packages/shared/src/hooks/referral/useReferralCampaign.ts index 11d9eab6f1..20d9960ee4 100644 --- a/packages/shared/src/hooks/referral/useReferralCampaign.ts +++ b/packages/shared/src/hooks/referral/useReferralCampaign.ts @@ -4,7 +4,7 @@ import { useRequestProtocol } from '../useRequestProtocol'; import { REFERRAL_CAMPAIGN_QUERY } from '../../graphql/users'; import { RequestKey, generateQueryKey, STALE_TIME } from '../../lib/query'; import AuthContext from '../../contexts/AuthContext'; -import { Feature } from '../../lib/featureManagement'; +import type { Feature } from '../../lib/featureManagement'; import { useFeatureIsOn } from '../../components/GrowthBookProvider'; import { isTesting } from '../../lib/constants'; import { ReferralCampaignKey } from '../../lib'; diff --git a/packages/shared/src/hooks/referral/useReferralConfig.ts b/packages/shared/src/hooks/referral/useReferralConfig.ts index e39320ab6a..37d36040dc 100644 --- a/packages/shared/src/hooks/referral/useReferralConfig.ts +++ b/packages/shared/src/hooks/referral/useReferralConfig.ts @@ -1,6 +1,6 @@ -import { Author } from '../../graphql/comments'; +import type { Author } from '../../graphql/comments'; import { ReferralCampaignKey } from './useReferralCampaign'; -import { CampaignConfig } from '../../graphql/features'; +import type { CampaignConfig } from '../../graphql/features'; interface UseReferralConfigProps { campaign: string; diff --git a/packages/shared/src/hooks/search/useSearchHistory.ts b/packages/shared/src/hooks/search/useSearchHistory.ts index 742d96d171..535c8e9b61 100644 --- a/packages/shared/src/hooks/search/useSearchHistory.ts +++ b/packages/shared/src/hooks/search/useSearchHistory.ts @@ -1,10 +1,11 @@ -import { +import type { InfiniteData, - useInfiniteQuery, UseInfiniteQueryResult, } from '@tanstack/react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { useMemo } from 'react'; -import { getSearchHistory, SearchHistoryData } from '../../graphql/search'; +import type { SearchHistoryData } from '../../graphql/search'; +import { getSearchHistory } from '../../graphql/search'; import { generateQueryKey, getNextPageParam, diff --git a/packages/shared/src/hooks/search/useSearchProvider.spec.tsx b/packages/shared/src/hooks/search/useSearchProvider.spec.tsx index dc907bf934..c09f81d5e7 100644 --- a/packages/shared/src/hooks/search/useSearchProvider.spec.tsx +++ b/packages/shared/src/hooks/search/useSearchProvider.spec.tsx @@ -1,11 +1,12 @@ import React from 'react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { renderHook } from '@testing-library/react'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import { mocked } from 'ts-jest/utils'; import { AlertContextProvider } from '../../contexts/AlertContext'; import { AuthContextProvider } from '../../contexts/AuthContext'; -import { Alerts } from '../../graphql/alerts'; +import type { Alerts } from '../../graphql/alerts'; import { useSearchProvider } from './useSearchProvider'; import { SEARCH_POST_SUGGESTIONS, diff --git a/packages/shared/src/hooks/search/useSearchProvider.ts b/packages/shared/src/hooks/search/useSearchProvider.ts index 962d2e54b8..cf0a0dc494 100644 --- a/packages/shared/src/hooks/search/useSearchProvider.ts +++ b/packages/shared/src/hooks/search/useSearchProvider.ts @@ -1,10 +1,10 @@ import { useRouter } from 'next/router'; import { useCallback } from 'react'; +import type { SearchSuggestionResult } from '../../graphql/search'; import { SEARCH_POST_SUGGESTIONS, SEARCH_TAG_SUGGESTIONS, SearchProviderEnum, - SearchSuggestionResult, defaultSearchSuggestionsLimit, getSearchUrl, SEARCH_SOURCE_SUGGESTIONS, diff --git a/packages/shared/src/hooks/search/useSearchProviderSuggestions.spec.tsx b/packages/shared/src/hooks/search/useSearchProviderSuggestions.spec.tsx index ebc2f16d95..d174fff02f 100644 --- a/packages/shared/src/hooks/search/useSearchProviderSuggestions.spec.tsx +++ b/packages/shared/src/hooks/search/useSearchProviderSuggestions.spec.tsx @@ -3,7 +3,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { renderHook, waitFor } from '@testing-library/react'; import { AlertContextProvider } from '../../contexts/AlertContext'; import { AuthContextProvider } from '../../contexts/AuthContext'; -import { Alerts } from '../../graphql/alerts'; +import type { Alerts } from '../../graphql/alerts'; import { SEARCH_POST_SUGGESTIONS, SearchProviderEnum, diff --git a/packages/shared/src/hooks/search/useSearchProviderSuggestions.ts b/packages/shared/src/hooks/search/useSearchProviderSuggestions.ts index 1f7325665f..f4f489716e 100644 --- a/packages/shared/src/hooks/search/useSearchProviderSuggestions.ts +++ b/packages/shared/src/hooks/search/useSearchProviderSuggestions.ts @@ -2,25 +2,25 @@ import { useQuery } from '@tanstack/react-query'; import { useCallback } from 'react'; import { useAuthContext } from '../../contexts/AuthContext'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; -import { +import type { UseSearchProvider, UseSearchProviderProps, - useSearchProvider, } from './useSearchProvider'; +import { useSearchProvider } from './useSearchProvider'; +import type { SearchSuggestionResult } from '../../graphql/search'; import { defaultSearchSuggestionsLimit, minSearchQueryLength, - SearchSuggestionResult, } from '../../graphql/search'; import useDebounce from '../useDebounce'; import { defaultSearchDebounceMs } from '../../lib/func'; import { useMutationSubscription } from '../mutationSubscription'; +import type { ContentPreferenceMutation } from '../contentPreference/types'; import { - ContentPreferenceMutation, contentPreferenceMutationMatcher, mutationKeyToContentPreferenceStatusMap, } from '../contentPreference/types'; -import { PropsParameters } from '../../types'; +import type { PropsParameters } from '../../types'; export type UseSearchProviderSuggestionsProps = { limit?: number; diff --git a/packages/shared/src/hooks/search/useSearchQuestionRecommendations.ts b/packages/shared/src/hooks/search/useSearchQuestionRecommendations.ts index 1f8502f276..60e1d3c39a 100644 --- a/packages/shared/src/hooks/search/useSearchQuestionRecommendations.ts +++ b/packages/shared/src/hooks/search/useSearchQuestionRecommendations.ts @@ -3,7 +3,7 @@ import { useQuery } from '@tanstack/react-query'; import { useAuthContext } from '../../contexts/AuthContext'; import { generateQueryKey, RequestKey } from '../../lib/query'; import { getSearchSuggestions } from '../../graphql/search'; -import { SearchBarSuggestionListProps } from '../../components/search/SearchBarSuggestionList'; +import type { SearchBarSuggestionListProps } from '../../components/search/SearchBarSuggestionList'; import { disabledRefetch } from '../../lib/func'; type UseSearchQuestionRecommendations = (data: { diff --git a/packages/shared/src/hooks/source/useSourceActions.ts b/packages/shared/src/hooks/source/useSourceActions.ts index 6041688b97..c887aa60f9 100644 --- a/packages/shared/src/hooks/source/useSourceActions.ts +++ b/packages/shared/src/hooks/source/useSourceActions.ts @@ -1,4 +1,4 @@ -import { Source } from '../../graphql/sources'; +import type { Source } from '../../graphql/sources'; import { useSourceActionsBlock } from './useSourceActionsBlock'; import { useSourceActionsNotify } from './useSourceActionsNotify'; import { useSourceActionsFollow } from './useSourceActionsFollow'; diff --git a/packages/shared/src/hooks/source/useSourceActionsBlock.ts b/packages/shared/src/hooks/source/useSourceActionsBlock.ts index a65ca44b78..5a1ebf75d5 100644 --- a/packages/shared/src/hooks/source/useSourceActionsBlock.ts +++ b/packages/shared/src/hooks/source/useSourceActionsBlock.ts @@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react'; import useTagAndSource from '../useTagAndSource'; import { Origin } from '../../lib/log'; import useFeedSettings from '../useFeedSettings'; -import { Source } from '../../graphql/sources'; +import type { Source } from '../../graphql/sources'; import { useToastNotification } from '../useToastNotification'; interface UseSourceActionsBlockProps { diff --git a/packages/shared/src/hooks/source/useSourceActionsFollow.ts b/packages/shared/src/hooks/source/useSourceActionsFollow.ts index d3ed9c7e5f..da305d6400 100644 --- a/packages/shared/src/hooks/source/useSourceActionsFollow.ts +++ b/packages/shared/src/hooks/source/useSourceActionsFollow.ts @@ -1,5 +1,5 @@ import { useCallback, useMemo } from 'react'; -import { Source } from '../../graphql/sources'; +import type { Source } from '../../graphql/sources'; import { Origin } from '../../lib/log'; import { useToastNotification } from '../useToastNotification'; import useTagAndSource from '../useTagAndSource'; diff --git a/packages/shared/src/hooks/source/useSourceActionsNotify.ts b/packages/shared/src/hooks/source/useSourceActionsNotify.ts index 48480c66f2..06ca9dbff9 100644 --- a/packages/shared/src/hooks/source/useSourceActionsNotify.ts +++ b/packages/shared/src/hooks/source/useSourceActionsNotify.ts @@ -2,7 +2,7 @@ import { useCallback } from 'react'; import { NotificationType } from '../../components/notifications/utils'; import { useLogContext } from '../../contexts/LogContext'; import { useAuthContext } from '../../contexts/AuthContext'; -import { Source } from '../../graphql/sources'; +import type { Source } from '../../graphql/sources'; import { LogEvent, NotificationPromptSource, TargetType } from '../../lib/log'; import { AuthTriggers } from '../../lib/auth'; import { diff --git a/packages/shared/src/hooks/source/useSourcePostModeration.ts b/packages/shared/src/hooks/source/useSourcePostModeration.ts index 2258f02b74..591d9c5388 100644 --- a/packages/shared/src/hooks/source/useSourcePostModeration.ts +++ b/packages/shared/src/hooks/source/useSourcePostModeration.ts @@ -1,8 +1,10 @@ import { useMutation } from '@tanstack/react-query'; -import { +import type { CreatePostModerationProps, - createSourcePostModeration, UpdatePostModerationProps, +} from '../../graphql/posts'; +import { + createSourcePostModeration, updateSourcePostModeration, } from '../../graphql/posts'; import { usePrompt } from '../usePrompt'; @@ -10,8 +12,8 @@ import { createModerationPromptProps, editModerationPromptProps, } from '../../components/squads/utils'; -import { ApiErrorResult } from '../../graphql/common'; -import { SourcePostModeration } from '../../graphql/squads'; +import type { ApiErrorResult } from '../../graphql/common'; +import type { SourcePostModeration } from '../../graphql/squads'; interface UseSourcePostModeration { isPending: boolean; diff --git a/packages/shared/src/hooks/source/useSourcePostModerationById.ts b/packages/shared/src/hooks/source/useSourcePostModerationById.ts index 3d2865bbcd..06ad511157 100644 --- a/packages/shared/src/hooks/source/useSourcePostModerationById.ts +++ b/packages/shared/src/hooks/source/useSourcePostModerationById.ts @@ -1,5 +1,5 @@ import { useQuery } from '@tanstack/react-query'; -import { SourcePostModeration } from '../../graphql/squads'; +import type { SourcePostModeration } from '../../graphql/squads'; import { generateQueryKey, RequestKey } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; import { getSourcePostModeration } from '../../graphql/posts'; diff --git a/packages/shared/src/hooks/source/useSources.ts b/packages/shared/src/hooks/source/useSources.ts index f52e0b2b68..f0ad3d5c75 100644 --- a/packages/shared/src/hooks/source/useSources.ts +++ b/packages/shared/src/hooks/source/useSources.ts @@ -1,17 +1,18 @@ -import { +import type { InfiniteData, - useInfiniteQuery, UseInfiniteQueryResult, } from '@tanstack/react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { SOURCES_QUERY } from '../../graphql/squads'; -import { Connection, gqlClient } from '../../graphql/common'; +import type { Connection } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; import { generateQueryKey, getNextPageParam, RequestKey, StaleTime, } from '../../lib/query'; -import { Source, Squad } from '../../graphql/sources'; +import type { Source, Squad } from '../../graphql/sources'; export interface SourcesQueryData { sources: Connection; diff --git a/packages/shared/src/hooks/squads/usePostToSquad.ts b/packages/shared/src/hooks/squads/usePostToSquad.ts index 96483cc582..e02e20e1f4 100644 --- a/packages/shared/src/hooks/squads/usePostToSquad.ts +++ b/packages/shared/src/hooks/squads/usePostToSquad.ts @@ -1,39 +1,32 @@ -import { - UseMutateAsyncFunction, - useMutation, - useQueryClient, -} from '@tanstack/react-query'; -import { BaseSyntheticEvent, useCallback, useState } from 'react'; -import { - createPost, +import type { UseMutateAsyncFunction } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { BaseSyntheticEvent } from 'react'; +import { useCallback, useState } from 'react'; +import type { CreatePostProps, - editPost, EditPostProps, ExternalLinkPreview, - getExternalLinkPreview, Post, - PostType, SubmitExternalLink, - submitExternalLink, } from '../../graphql/posts'; import { - ApiError, - ApiErrorResult, - DEFAULT_ERROR, - getApiError, -} from '../../graphql/common'; + createPost, + editPost, + getExternalLinkPreview, + PostType, + submitExternalLink, +} from '../../graphql/posts'; +import type { ApiErrorResult } from '../../graphql/common'; +import { ApiError, DEFAULT_ERROR, getApiError } from '../../graphql/common'; import { useToastNotification } from '../useToastNotification'; -import { - addPostToSquad, - SourcePostModeration, - updateSquadPost, -} from '../../graphql/squads'; +import type { SourcePostModeration } from '../../graphql/squads'; +import { addPostToSquad, updateSquadPost } from '../../graphql/squads'; import { ActionType } from '../../graphql/actions'; import { useAuthContext } from '../../contexts/AuthContext'; import { useActions } from '../useActions'; import { useRequestProtocol } from '../useRequestProtocol'; import useSourcePostModeration from '../source/useSourcePostModeration'; -import { Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; import { moderationRequired } from '../../components/squads/utils'; interface UsePostToSquad { diff --git a/packages/shared/src/hooks/squads/useSourceModerationList.ts b/packages/shared/src/hooks/squads/useSourceModerationList.ts index 06c15e782c..4b0380e64d 100644 --- a/packages/shared/src/hooks/squads/useSourceModerationList.ts +++ b/packages/shared/src/hooks/squads/useSourceModerationList.ts @@ -1,24 +1,27 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { MouseEventHandler, useCallback } from 'react'; +import type { MouseEventHandler } from 'react'; +import { useCallback } from 'react'; +import type { + SquadPostRejectionProps, + SquadPostModerationProps, + SourcePostModeration, +} from '../../graphql/squads'; import { PostModerationReason, - SquadPostRejectionProps, squadApproveMutation, squadRejectMutation, - SquadPostModerationProps, deletePendingPostMutation, - SourcePostModeration, } from '../../graphql/squads'; import { useLazyModal } from '../useLazyModal'; import { LazyModal } from '../../components/modals/common/types'; import { usePrompt } from '../usePrompt'; import { useToastNotification } from '../useToastNotification'; import { generateQueryKey, RequestKey } from '../../lib/query'; -import { Squad } from '../../graphql/sources'; +import type { Squad } from '../../graphql/sources'; import { LogEvent } from '../../lib/log'; import { useLogContext } from '../../contexts/LogContext'; import { postLogEvent } from '../../lib/feed'; -import { Post } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; export const rejectReasons: { value: PostModerationReason; label: string }[] = [ { diff --git a/packages/shared/src/hooks/squads/useSquad.ts b/packages/shared/src/hooks/squads/useSquad.ts index 367268189f..8390351336 100644 --- a/packages/shared/src/hooks/squads/useSquad.ts +++ b/packages/shared/src/hooks/squads/useSquad.ts @@ -1,9 +1,10 @@ import { useQuery } from '@tanstack/react-query'; import { useContext } from 'react'; -import { ClientError } from 'graphql-request'; -import { Squad } from '../../graphql/sources'; +import type { ClientError } from 'graphql-request'; +import type { Squad } from '../../graphql/sources'; import { getSquad } from '../../graphql/squads'; -import { ApiError, ApiErrorResult, getApiError } from '../../graphql/common'; +import type { ApiErrorResult } from '../../graphql/common'; +import { ApiError, getApiError } from '../../graphql/common'; import AuthContext from '../../contexts/AuthContext'; import { isNullOrUndefined } from '../../lib/func'; import { generateQueryKey, RequestKey } from '../../lib/query'; diff --git a/packages/shared/src/hooks/squads/useSquadActions.ts b/packages/shared/src/hooks/squads/useSquadActions.ts index d551adc1a1..885a24da5e 100644 --- a/packages/shared/src/hooks/squads/useSquadActions.ts +++ b/packages/shared/src/hooks/squads/useSquadActions.ts @@ -1,20 +1,26 @@ import { useContext, useMemo } from 'react'; -import { +import type { InfiniteData, - useInfiniteQuery, UseInfiniteQueryResult, +} from '@tanstack/react-query'; +import { + useInfiniteQuery, useMutation, useQueryClient, } from '@tanstack/react-query'; +import type { SquadEdgesData } from '../../graphql/squads'; import { collapsePinnedPosts, expandPinnedPosts, SQUAD_MEMBERS_QUERY, - SquadEdgesData, unblockSquadMember, updateSquadMemberRole, } from '../../graphql/squads'; -import { SourceMember, SourceMemberRole, Squad } from '../../graphql/sources'; +import type { + SourceMember, + SourceMemberRole, + Squad, +} from '../../graphql/sources'; import { generateQueryKey, getNextPageParam, diff --git a/packages/shared/src/hooks/squads/useSquadCategories.ts b/packages/shared/src/hooks/squads/useSquadCategories.ts index 207fa44450..986efe9b61 100644 --- a/packages/shared/src/hooks/squads/useSquadCategories.ts +++ b/packages/shared/src/hooks/squads/useSquadCategories.ts @@ -1,13 +1,11 @@ -import { +import type { InfiniteData, - useInfiniteQuery, UseInfiniteQueryResult, } from '@tanstack/react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { gqlClient } from '../../graphql/common'; -import { - SourceCategoryData, - SOURCE_CATEGORIES_QUERY, -} from '../../graphql/sources'; +import type { SourceCategoryData } from '../../graphql/sources'; +import { SOURCE_CATEGORIES_QUERY } from '../../graphql/sources'; import { generateQueryKey, getNextPageParam, diff --git a/packages/shared/src/hooks/squads/useSquadCreate.ts b/packages/shared/src/hooks/squads/useSquadCreate.ts index 627e12308d..def93076ec 100644 --- a/packages/shared/src/hooks/squads/useSquadCreate.ts +++ b/packages/shared/src/hooks/squads/useSquadCreate.ts @@ -1,15 +1,17 @@ -import { UseMutateAsyncFunction, useMutation } from '@tanstack/react-query'; +import type { UseMutateAsyncFunction } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import router from 'next/router'; import { useContext } from 'react'; -import { SquadForm, createSquad } from '../../graphql/squads'; +import type { SquadForm } from '../../graphql/squads'; +import { createSquad } from '../../graphql/squads'; import { LogEvent } from '../../lib/log'; import { ActionType } from '../../graphql/actions'; import LogContext from '../../contexts/LogContext'; import { useToastNotification } from '../useToastNotification'; import { useBoot } from '../useBoot'; import { useActions } from '../useActions'; -import { Squad } from '../../graphql/sources'; -import { ApiErrorResult } from '../../graphql/common'; +import type { Squad } from '../../graphql/sources'; +import type { ApiErrorResult } from '../../graphql/common'; import { parseOrDefault } from '../../lib/func'; import { getRandom4Digits } from '../../lib'; diff --git a/packages/shared/src/hooks/squads/useSquadPendingPosts.ts b/packages/shared/src/hooks/squads/useSquadPendingPosts.ts index 209ef8263f..bb5d50d84b 100644 --- a/packages/shared/src/hooks/squads/useSquadPendingPosts.ts +++ b/packages/shared/src/hooks/squads/useSquadPendingPosts.ts @@ -1,11 +1,11 @@ import { useCallback } from 'react'; -import { +import type { InfiniteData, - useInfiniteQuery, UseInfiniteQueryResult, } from '@tanstack/react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; +import type { SourcePostModeration } from '../../graphql/squads'; import { - SourcePostModeration, SourcePostModerationStatus, SQUAD_PENDING_POSTS_QUERY, } from '../../graphql/squads'; @@ -15,7 +15,8 @@ import { RequestKey, } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; -import { Connection, gqlClient } from '../../graphql/common'; +import type { Connection } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; type UseSquadPendingPosts = UseInfiniteQueryResult< InfiniteData> diff --git a/packages/shared/src/hooks/streaks/useReadingStreak.ts b/packages/shared/src/hooks/streaks/useReadingStreak.ts index 04d6be9882..4eeefb3c17 100644 --- a/packages/shared/src/hooks/streaks/useReadingStreak.ts +++ b/packages/shared/src/hooks/streaks/useReadingStreak.ts @@ -1,24 +1,21 @@ -import { - UseMutateFunction, - useMutation, - useQuery, - useQueryClient, -} from '@tanstack/react-query'; +import type { UseMutateFunction } from '@tanstack/react-query'; +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useContext } from 'react'; import { getDay } from 'date-fns'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; +import type { UserStreak } from '../../graphql/users'; import { getReadingStreak, UPDATE_STREAK_COUNT_MUTATION, - UserStreak, } from '../../graphql/users'; import { useAuthContext } from '../../contexts/AuthContext'; import { useActions } from '../useActions'; import { ActionType } from '../../graphql/actions'; import useDebounceFn from '../useDebounceFn'; import SettingsContext from '../../contexts/SettingsContext'; -import { gqlClient, ResponseError } from '../../graphql/common'; -import { DayOfWeek } from '../../lib/date'; +import type { ResponseError } from '../../graphql/common'; +import { gqlClient } from '../../graphql/common'; +import type { DayOfWeek } from '../../lib/date'; type UpdateReadingStreakConfig = { weekStart: DayOfWeek; diff --git a/packages/shared/src/hooks/streaks/useStreakRecover.ts b/packages/shared/src/hooks/streaks/useStreakRecover.ts index a8b80a60ed..c6c58cd2cf 100644 --- a/packages/shared/src/hooks/streaks/useStreakRecover.ts +++ b/packages/shared/src/hooks/streaks/useStreakRecover.ts @@ -3,9 +3,9 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useRouter } from 'next/router'; import { useToggle } from '../useToggle'; import { useActions } from '../useActions'; +import type { UserStreakRecoverData } from '../../graphql/users'; import { USER_STREAK_RECOVER_QUERY, - UserStreakRecoverData, USER_STREAK_RECOVER_MUTATION, } from '../../graphql/users'; import { generateQueryKey, RequestKey } from '../../lib/query'; diff --git a/packages/shared/src/hooks/useAccountEmailFlow.ts b/packages/shared/src/hooks/useAccountEmailFlow.ts index 66974d4a0d..06e7fdf96f 100644 --- a/packages/shared/src/hooks/useAccountEmailFlow.ts +++ b/packages/shared/src/hooks/useAccountEmailFlow.ts @@ -7,12 +7,8 @@ import { initializeKratosFlow, submitKratosFlow, } from '../lib/kratos'; -import { - getErrorMessage, - getNodeByKey, - getNodeValue, - VerifyEmail, -} from '../lib/auth'; +import type { VerifyEmail } from '../lib/auth'; +import { getErrorMessage, getNodeByKey, getNodeValue } from '../lib/auth'; import useTimer from './useTimer'; import { disabledRefetch } from '../lib/func'; import { authUrl } from '../lib/constants'; diff --git a/packages/shared/src/hooks/useActions.ts b/packages/shared/src/hooks/useActions.ts index 296e465bf6..6f263ee15a 100644 --- a/packages/shared/src/hooks/useActions.ts +++ b/packages/shared/src/hooks/useActions.ts @@ -1,12 +1,8 @@ import { useCallback, useMemo } from 'react'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useAuthContext } from '../contexts/AuthContext'; -import { - Action, - ActionType, - completeUserAction, - getUserActions, -} from '../graphql/actions'; +import type { Action, ActionType } from '../graphql/actions'; +import { completeUserAction, getUserActions } from '../graphql/actions'; import { generateQueryKey, RequestKey } from '../lib/query'; import { disabledRefetch } from '../lib/func'; diff --git a/packages/shared/src/hooks/useActiveNav.tsx b/packages/shared/src/hooks/useActiveNav.tsx index 985a1ec0f0..098abc5e47 100644 --- a/packages/shared/src/hooks/useActiveNav.tsx +++ b/packages/shared/src/hooks/useActiveNav.tsx @@ -1,6 +1,7 @@ import { useRouter } from 'next/router'; import { useMemo } from 'react'; -import { AllFeedPages, OtherFeedPage } from '../lib/query'; +import type { AllFeedPages } from '../lib/query'; +import { OtherFeedPage } from '../lib/query'; import { SharedFeedPage } from '../components/utilities'; import { useViewSize, ViewSize } from './useViewSize'; diff --git a/packages/shared/src/hooks/useAuthForms.ts b/packages/shared/src/hooks/useAuthForms.ts index bde111373d..404f207684 100644 --- a/packages/shared/src/hooks/useAuthForms.ts +++ b/packages/shared/src/hooks/useAuthForms.ts @@ -1,5 +1,8 @@ -import React, { MutableRefObject, useMemo, useRef, useState } from 'react'; -import { PromptOptions, usePrompt } from './usePrompt'; +import type { MutableRefObject } from 'react'; +import type React from 'react'; +import { useMemo, useRef, useState } from 'react'; +import type { PromptOptions } from './usePrompt'; +import { usePrompt } from './usePrompt'; import { ButtonColor } from '../components/buttons/Button'; export type CloseAuthModalFunc = ( diff --git a/packages/shared/src/hooks/useAuthVerificationRecovery.ts b/packages/shared/src/hooks/useAuthVerificationRecovery.ts index 679574899f..c12dbad50d 100644 --- a/packages/shared/src/hooks/useAuthVerificationRecovery.ts +++ b/packages/shared/src/hooks/useAuthVerificationRecovery.ts @@ -1,13 +1,8 @@ import { useQuery } from '@tanstack/react-query'; import { useRouter } from 'next/router'; import { useCallback, useContext, useEffect } from 'react'; -import { - AuthFlow, - ErrorData, - getKratosFlow, - InitializationData, - KRATOS_ERROR, -} from '../lib/kratos'; +import type { ErrorData, InitializationData } from '../lib/kratos'; +import { AuthFlow, getKratosFlow, KRATOS_ERROR } from '../lib/kratos'; import { useToastNotification } from './useToastNotification'; import { disabledRefetch } from '../lib/func'; import AuthContext from '../contexts/AuthContext'; diff --git a/packages/shared/src/hooks/useAutoComplete.ts b/packages/shared/src/hooks/useAutoComplete.ts index 85b4c1a3eb..7e67dfc327 100644 --- a/packages/shared/src/hooks/useAutoComplete.ts +++ b/packages/shared/src/hooks/useAutoComplete.ts @@ -1,4 +1,5 @@ -import React, { useEffect, useState } from 'react'; +import type React from 'react'; +import { useEffect, useState } from 'react'; export type UseAutoCompleteReturn = { selectedItemIndex: number; diff --git a/packages/shared/src/hooks/useAutomation.ts b/packages/shared/src/hooks/useAutomation.ts index 04d94e6c40..1346676981 100644 --- a/packages/shared/src/hooks/useAutomation.ts +++ b/packages/shared/src/hooks/useAutomation.ts @@ -1,8 +1,8 @@ -import { +import type { MutationOptions, UseMutateAsyncFunction, - useMutation, } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import { HttpError } from '../lib/errors'; export enum Automation { diff --git a/packages/shared/src/hooks/useBanner.ts b/packages/shared/src/hooks/useBanner.ts index c834a23fcb..ecc2279ed7 100644 --- a/packages/shared/src/hooks/useBanner.ts +++ b/packages/shared/src/hooks/useBanner.ts @@ -2,7 +2,8 @@ import { useCallback, useContext, useMemo } from 'react'; import { useMutation, useQuery } from '@tanstack/react-query'; import AlertContext from '../contexts/AlertContext'; import { generateQueryKey, RequestKey } from '../lib/query'; -import { Banner, BANNER_QUERY } from '../graphql/banner'; +import type { Banner } from '../graphql/banner'; +import { BANNER_QUERY } from '../graphql/banner'; import { gqlClient } from '../graphql/common'; type UseBanner = { diff --git a/packages/shared/src/hooks/useBookmarkPost.ts b/packages/shared/src/hooks/useBookmarkPost.ts index 2c65a8ce2a..3f1985c6c6 100644 --- a/packages/shared/src/hooks/useBookmarkPost.ts +++ b/packages/shared/src/hooks/useBookmarkPost.ts @@ -1,13 +1,9 @@ import { useCallback, useContext } from 'react'; -import { - MutationKey, - useMutation, - useQueryClient, -} from '@tanstack/react-query'; +import type { MutationKey } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { Post, ReadHistoryPost } from '../graphql/posts'; import { ADD_BOOKMARKS_MUTATION, - Post, - ReadHistoryPost, REMOVE_BOOKMARK_MUTATION, } from '../graphql/posts'; import LogContext from '../contexts/LogContext'; @@ -16,13 +12,11 @@ import { useRequestProtocol } from './useRequestProtocol'; import AuthContext from '../contexts/AuthContext'; import { updatePostCache } from './usePostById'; import { AuthTriggers } from '../lib/auth'; -import { LogEvent, Origin } from '../lib/log'; -import { - optimisticPostUpdateInFeed, - postLogEvent, - PostLogEventFnOptions, -} from '../lib/feed'; -import { FeedItem, PostItem, UpdateFeedPost } from './useFeed'; +import type { Origin } from '../lib/log'; +import { LogEvent } from '../lib/log'; +import type { PostLogEventFnOptions } from '../lib/feed'; +import { optimisticPostUpdateInFeed, postLogEvent } from '../lib/feed'; +import type { FeedItem, PostItem, UpdateFeedPost } from './useFeed'; import { ActionType } from '../graphql/actions'; import { useActions } from './useActions'; import { bookmarkMutationKey } from './bookmark/types'; diff --git a/packages/shared/src/hooks/useBookmarkProvider.ts b/packages/shared/src/hooks/useBookmarkProvider.ts index e3c954e716..7f9dee9c6d 100644 --- a/packages/shared/src/hooks/useBookmarkProvider.ts +++ b/packages/shared/src/hooks/useBookmarkProvider.ts @@ -1,6 +1,7 @@ import { useActiveFeedNameContext } from '../contexts/ActiveFeedNameContext'; import { SharedFeedPage } from '../components/utilities'; -import { UseBookmarkProviderProps, useJustBookmarked } from './bookmark'; +import type { UseBookmarkProviderProps } from './bookmark'; +import { useJustBookmarked } from './bookmark'; interface UseBookmarkProviderReturn { highlightBookmarkedPost: boolean; diff --git a/packages/shared/src/hooks/useBoot.ts b/packages/shared/src/hooks/useBoot.ts index f5c21766d1..d984bf914a 100644 --- a/packages/shared/src/hooks/useBoot.ts +++ b/packages/shared/src/hooks/useBoot.ts @@ -1,8 +1,8 @@ import { useQueryClient } from '@tanstack/react-query'; import { BOOT_QUERY_KEY } from '../contexts/common'; -import { Squad } from '../graphql/sources'; -import { Boot } from '../lib/boot'; -import { +import type { Squad } from '../graphql/sources'; +import type { Boot } from '../lib/boot'; +import type { MarketingCta, MarketingCtaVariant, } from '../components/marketingCta/common'; diff --git a/packages/shared/src/hooks/useChangelog.spec.tsx b/packages/shared/src/hooks/useChangelog.spec.tsx index 1163f393f7..f7a7b2d0cc 100644 --- a/packages/shared/src/hooks/useChangelog.spec.tsx +++ b/packages/shared/src/hooks/useChangelog.spec.tsx @@ -5,7 +5,7 @@ import Post from '../../__tests__/fixture/post'; import { useChangelog } from './useChangelog'; import { AlertContextProvider } from '../contexts/AlertContext'; import { AuthContextProvider } from '../contexts/AuthContext'; -import { Alerts } from '../graphql/alerts'; +import type { Alerts } from '../graphql/alerts'; import * as hooks from './vote/useVotePost'; import { Origin } from '../lib/log'; diff --git a/packages/shared/src/hooks/useChangelog.ts b/packages/shared/src/hooks/useChangelog.ts index 5f7c10458b..6e7454becc 100644 --- a/packages/shared/src/hooks/useChangelog.ts +++ b/packages/shared/src/hooks/useChangelog.ts @@ -1,9 +1,11 @@ import { useContext, useMemo } from 'react'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import AlertContext from '../contexts/AlertContext'; -import { getLatestChangelogPost, Post } from '../graphql/posts'; +import type { Post } from '../graphql/posts'; +import { getLatestChangelogPost } from '../graphql/posts'; import useSidebarRendered from './useSidebarRendered'; -import { UseVotePost, useVotePost, voteMutationHandlers } from './vote'; +import type { UseVotePost } from './vote'; +import { useVotePost, voteMutationHandlers } from './vote'; import { generateQueryKey, RequestKey } from '../lib/query'; import { useAuthContext } from '../contexts/AuthContext'; diff --git a/packages/shared/src/hooks/useChecklist.spec.tsx b/packages/shared/src/hooks/useChecklist.spec.tsx index c74942a956..50c4302b58 100644 --- a/packages/shared/src/hooks/useChecklist.spec.tsx +++ b/packages/shared/src/hooks/useChecklist.spec.tsx @@ -1,9 +1,10 @@ -import React, { ReactNode } from 'react'; +import type { ReactNode } from 'react'; +import React from 'react'; import { act, renderHook, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { useChecklist } from './useChecklist'; import { ActionType } from '../graphql/actions'; -import { ChecklistStepType } from '../lib/checklist'; +import type { ChecklistStepType } from '../lib/checklist'; export const updateStep = ( steps: ChecklistStepType[], diff --git a/packages/shared/src/hooks/useChecklist.ts b/packages/shared/src/hooks/useChecklist.ts index 080d85577a..bdf74885d3 100644 --- a/packages/shared/src/hooks/useChecklist.ts +++ b/packages/shared/src/hooks/useChecklist.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useMemo } from 'react'; import { useQuery, useQueryClient } from '@tanstack/react-query'; -import { ChecklistStepType } from '../lib/checklist'; -import { Action, ActionType } from '../graphql/actions'; +import type { ChecklistStepType } from '../lib/checklist'; +import type { Action, ActionType } from '../graphql/actions'; import { disabledRefetch } from '../lib/func'; const CHECKLIST_OPEN_STEP_KEY = ['checklistOpenStepKey']; diff --git a/packages/shared/src/hooks/useConditionalFeature.ts b/packages/shared/src/hooks/useConditionalFeature.ts index f3f2294991..33819a2fb8 100644 --- a/packages/shared/src/hooks/useConditionalFeature.ts +++ b/packages/shared/src/hooks/useConditionalFeature.ts @@ -1,8 +1,8 @@ import { useQuery } from '@tanstack/react-query'; -import { JSONValue, WidenPrimitives } from '@growthbook/growthbook'; +import type { JSONValue, WidenPrimitives } from '@growthbook/growthbook'; import { useContext } from 'react'; import { generateQueryKey, RequestKey } from '../lib/query'; -import { Feature } from '../lib/featureManagement'; +import type { Feature } from '../lib/featureManagement'; import { disabledRefetch } from '../lib/func'; import AuthContext from '../contexts/AuthContext'; import { diff --git a/packages/shared/src/hooks/useContextMenu.ts b/packages/shared/src/hooks/useContextMenu.ts index f3ebb4f305..5749f5a811 100644 --- a/packages/shared/src/hooks/useContextMenu.ts +++ b/packages/shared/src/hooks/useContextMenu.ts @@ -1,4 +1,5 @@ -import { MouseEventHandler, useCallback, useMemo } from 'react'; +import type { MouseEventHandler } from 'react'; +import { useCallback, useMemo } from 'react'; import { useContextMenu as useContexifyContextMenu } from '@dailydotdev/react-contexify'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { generateQueryKey, RequestKey } from '../lib/query'; diff --git a/packages/shared/src/hooks/useCookieBanner.ts b/packages/shared/src/hooks/useCookieBanner.ts index 192157c21a..3f8f68212a 100644 --- a/packages/shared/src/hooks/useCookieBanner.ts +++ b/packages/shared/src/hooks/useCookieBanner.ts @@ -1,5 +1,5 @@ import { useCallback, useState } from 'react'; -import { LoggedUser } from '../lib/user'; +import type { LoggedUser } from '../lib/user'; import { setCookie } from '../lib/cookie'; const consentCookieName = 'ilikecookies'; diff --git a/packages/shared/src/hooks/useCopy.ts b/packages/shared/src/hooks/useCopy.ts index 77d4ce96a9..91af362d45 100644 --- a/packages/shared/src/hooks/useCopy.ts +++ b/packages/shared/src/hooks/useCopy.ts @@ -1,8 +1,6 @@ import { useState } from 'react'; -import { - NotifyOptionalProps, - useToastNotification, -} from './useToastNotification'; +import type { NotifyOptionalProps } from './useToastNotification'; +import { useToastNotification } from './useToastNotification'; import { useGetShortUrl } from './utils/useGetShortUrl'; type CopyNotifyFunctionProps = NotifyOptionalProps & { diff --git a/packages/shared/src/hooks/useCopyPostLink.ts b/packages/shared/src/hooks/useCopyPostLink.ts index ed76926a75..a4219fd9c2 100644 --- a/packages/shared/src/hooks/useCopyPostLink.ts +++ b/packages/shared/src/hooks/useCopyPostLink.ts @@ -1,4 +1,5 @@ -import { CopyNotifyFunction, useCopyLink } from './useCopy'; +import type { CopyNotifyFunction } from './useCopy'; +import { useCopyLink } from './useCopy'; export function useCopyPostLink(link?: string): [boolean, CopyNotifyFunction] { const [copying, copy] = useCopyLink(link ? () => link : undefined); diff --git a/packages/shared/src/hooks/useDeleteSquad.ts b/packages/shared/src/hooks/useDeleteSquad.ts index 7b0c495060..8a86d77166 100644 --- a/packages/shared/src/hooks/useDeleteSquad.ts +++ b/packages/shared/src/hooks/useDeleteSquad.ts @@ -1,7 +1,8 @@ import { useContext, useMemo } from 'react'; import { deleteSquad } from '../graphql/squads'; -import { Squad } from '../graphql/sources'; -import { PromptOptions, usePrompt } from './usePrompt'; +import type { Squad } from '../graphql/sources'; +import type { PromptOptions } from './usePrompt'; +import { usePrompt } from './usePrompt'; import { useBoot } from './useBoot'; import LogContext from '../contexts/LogContext'; import { LogEvent } from '../lib/log'; diff --git a/packages/shared/src/hooks/useEventListener.ts b/packages/shared/src/hooks/useEventListener.ts index e4e701ace4..6aef740199 100644 --- a/packages/shared/src/hooks/useEventListener.ts +++ b/packages/shared/src/hooks/useEventListener.ts @@ -1,4 +1,5 @@ -import { RefObject, useEffect, useMemo, useRef } from 'react'; +import type { RefObject } from 'react'; +import { useEffect, useMemo, useRef } from 'react'; // List all `EventMap` types here. export type DOMEventMapDefinitions = [ diff --git a/packages/shared/src/hooks/useFeed.ts b/packages/shared/src/hooks/useFeed.ts index 8542168f3e..caa872d91d 100644 --- a/packages/shared/src/hooks/useFeed.ts +++ b/packages/shared/src/hooks/useFeed.ts @@ -1,20 +1,14 @@ import { useCallback, useContext, useMemo } from 'react'; -import { +import type { InfiniteData, QueryKey, - useInfiniteQuery, UseInfiniteQueryOptions, - useQueryClient, } from '@tanstack/react-query'; -import { ClientError } from 'graphql-request'; +import { useInfiniteQuery, useQueryClient } from '@tanstack/react-query'; +import type { ClientError } from 'graphql-request'; import { useRouter } from 'next/router'; -import { - Ad, - FeedData, - Post, - POSTS_ENGAGED_SUBSCRIPTION, - PostsEngaged, -} from '../graphql/posts'; +import type { Ad, FeedData, Post, PostsEngaged } from '../graphql/posts'; +import { POSTS_ENGAGED_SUBSCRIPTION } from '../graphql/posts'; import AuthContext from '../contexts/AuthContext'; import useSubscription from './useSubscription'; import { @@ -23,7 +17,7 @@ import { RequestKey, updateCachedPagePost, } from '../lib/query'; -import { MarketingCta } from '../components/marketingCta/common'; +import type { MarketingCta } from '../components/marketingCta/common'; import { FeedItemType } from '../components/cards/common/common'; import { GARMR_ERROR, gqlClient } from '../graphql/common'; import { usePlusSubscription } from './usePlusSubscription'; diff --git a/packages/shared/src/hooks/useFeedLayout.ts b/packages/shared/src/hooks/useFeedLayout.ts index a5da54321f..2900d64060 100644 --- a/packages/shared/src/hooks/useFeedLayout.ts +++ b/packages/shared/src/hooks/useFeedLayout.ts @@ -8,7 +8,8 @@ import { FeedPageLayoutMobile, SharedFeedPage, } from '../components/utilities'; -import { AllFeedPages, OtherFeedPage } from '../lib/query'; +import type { AllFeedPages } from '../lib/query'; +import { OtherFeedPage } from '../lib/query'; import SettingsContext from '../contexts/SettingsContext'; import { isNullOrUndefined } from '../lib/func'; import { useSearchResultsLayout } from './search/useSearchResultsLayout'; diff --git a/packages/shared/src/hooks/useFeedSettings.ts b/packages/shared/src/hooks/useFeedSettings.ts index e00dd9c79f..2725a0e112 100644 --- a/packages/shared/src/hooks/useFeedSettings.ts +++ b/packages/shared/src/hooks/useFeedSettings.ts @@ -1,14 +1,14 @@ import { useCallback, useContext } from 'react'; import { useQuery } from '@tanstack/react-query'; -import { +import type { AdvancedSettings, FeedSettings, - FEED_SETTINGS_QUERY, TagCategory, AllTagCategoriesData, } from '../graphql/feedSettings'; +import { FEED_SETTINGS_QUERY } from '../graphql/feedSettings'; import AuthContext from '../contexts/AuthContext'; -import { LoggedUser } from '../lib/user'; +import type { LoggedUser } from '../lib/user'; import { disabledRefetch } from '../lib/func'; import { RequestKey, StaleTime } from '../lib/query'; import { gqlClient } from '../graphql/common'; diff --git a/packages/shared/src/hooks/useFindSquadWelcomePost.ts b/packages/shared/src/hooks/useFindSquadWelcomePost.ts index 5bd556bb16..a3e8cb3b0c 100644 --- a/packages/shared/src/hooks/useFindSquadWelcomePost.ts +++ b/packages/shared/src/hooks/useFindSquadWelcomePost.ts @@ -1,7 +1,9 @@ import { useContext, useMemo } from 'react'; -import { InfiniteData, useQueryClient } from '@tanstack/react-query'; -import { FeedData, Post, PostType } from '../graphql/posts'; -import { Squad } from '../graphql/sources'; +import type { InfiniteData } from '@tanstack/react-query'; +import { useQueryClient } from '@tanstack/react-query'; +import type { FeedData, Post } from '../graphql/posts'; +import { PostType } from '../graphql/posts'; +import type { Squad } from '../graphql/sources'; import AuthContext from '../contexts/AuthContext'; import { supportedTypesForPrivateSources } from '../graphql/feed'; diff --git a/packages/shared/src/hooks/useInAppNotification.ts b/packages/shared/src/hooks/useInAppNotification.ts index 985b004fe2..16e591a248 100644 --- a/packages/shared/src/hooks/useInAppNotification.ts +++ b/packages/shared/src/hooks/useInAppNotification.ts @@ -1,10 +1,8 @@ import { useMemo } from 'react'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useNotificationContext } from '../contexts/NotificationsContext'; -import { - NewNotification, - NEW_NOTIFICATIONS_SUBSCRIPTION, -} from '../graphql/notifications'; +import type { NewNotification } from '../graphql/notifications'; +import { NEW_NOTIFICATIONS_SUBSCRIPTION } from '../graphql/notifications'; import useSubscription from './useSubscription'; interface UseInAppNotification { diff --git a/packages/shared/src/hooks/useInfiniteReadingHistory.ts b/packages/shared/src/hooks/useInfiniteReadingHistory.ts index 100dc4e3d7..b57d6e1103 100644 --- a/packages/shared/src/hooks/useInfiniteReadingHistory.ts +++ b/packages/shared/src/hooks/useInfiniteReadingHistory.ts @@ -1,13 +1,14 @@ -import { - useInfiniteQuery, +import type { InfiniteData, QueryKey, UseInfiniteQueryResult, } from '@tanstack/react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { useMemo } from 'react'; -import { RequestDataConnection, gqlClient } from '../graphql/common'; +import type { RequestDataConnection } from '../graphql/common'; +import { gqlClient } from '../graphql/common'; import useFeedInfiniteScroll from './feed/useFeedInfiniteScroll'; -import { PostItem } from '../graphql/posts'; +import type { PostItem } from '../graphql/posts'; import { getNextPageParam } from '../lib/query'; export type ReadHistoryData = RequestDataConnection; diff --git a/packages/shared/src/hooks/useInputField.ts b/packages/shared/src/hooks/useInputField.ts index 072a31918d..9c667a51c4 100644 --- a/packages/shared/src/hooks/useInputField.ts +++ b/packages/shared/src/hooks/useInputField.ts @@ -1,10 +1,5 @@ -import { - MutableRefObject, - SyntheticEvent, - useEffect, - useRef, - useState, -} from 'react'; +import type { MutableRefObject, SyntheticEvent } from 'react'; +import { useEffect, useRef, useState } from 'react'; export type ValidInputElement = HTMLInputElement | HTMLTextAreaElement; diff --git a/packages/shared/src/hooks/useInputFieldFunctions.ts b/packages/shared/src/hooks/useInputFieldFunctions.ts index 15bc50d7b7..edeb6324ba 100644 --- a/packages/shared/src/hooks/useInputFieldFunctions.ts +++ b/packages/shared/src/hooks/useInputFieldFunctions.ts @@ -1,10 +1,8 @@ -import { SyntheticEvent, useEffect, useRef, useState } from 'react'; +import type { SyntheticEvent } from 'react'; +import { useEffect, useRef, useState } from 'react'; import useDebounceFn from './useDebounceFn'; -import { - UseInputField, - useInputField, - ValidInputElement, -} from './useInputField'; +import type { UseInputField, ValidInputElement } from './useInputField'; +import { useInputField } from './useInputField'; export interface InputFieldFunctionsProps { value?: string | ReadonlyArray | number | undefined; diff --git a/packages/shared/src/hooks/useJoinSquad.ts b/packages/shared/src/hooks/useJoinSquad.ts index 6d234315cd..922da999f2 100644 --- a/packages/shared/src/hooks/useJoinSquad.ts +++ b/packages/shared/src/hooks/useJoinSquad.ts @@ -1,8 +1,9 @@ import { useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; -import { joinSquadInvitation, SquadInvitationProps } from '../graphql/squads'; +import type { SquadInvitationProps } from '../graphql/squads'; +import { joinSquadInvitation } from '../graphql/squads'; import { useLogContext } from '../contexts/LogContext'; -import { Squad } from '../graphql/sources'; +import type { Squad } from '../graphql/sources'; import { LogEvent } from '../lib/log'; import { useBoot } from './useBoot'; import { generateQueryKey, RequestKey } from '../lib/query'; diff --git a/packages/shared/src/hooks/useLanguage.ts b/packages/shared/src/hooks/useLanguage.ts index f0d6737503..847a76b4f4 100644 --- a/packages/shared/src/hooks/useLanguage.ts +++ b/packages/shared/src/hooks/useLanguage.ts @@ -1,5 +1,5 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { ContentLanguage } from '../lib/user'; +import type { ContentLanguage } from '../lib/user'; import { useAuthContext } from '../contexts/AuthContext'; import { UPDATE_USER_PROFILE_MUTATION } from '../graphql/users'; import { useLogContext } from '../contexts/LogContext'; diff --git a/packages/shared/src/hooks/useLeaveSquad.ts b/packages/shared/src/hooks/useLeaveSquad.ts index 2121a451fb..034f6976a2 100644 --- a/packages/shared/src/hooks/useLeaveSquad.ts +++ b/packages/shared/src/hooks/useLeaveSquad.ts @@ -1,7 +1,8 @@ import { useCallback, useContext } from 'react'; import { leaveSquad } from '../graphql/squads'; -import { Squad } from '../graphql/sources'; -import { PromptOptions, usePrompt } from './usePrompt'; +import type { Squad } from '../graphql/sources'; +import type { PromptOptions } from './usePrompt'; +import { usePrompt } from './usePrompt'; import { useBoot } from './useBoot'; import LogContext from '../contexts/LogContext'; import { LogEvent } from '../lib/log'; diff --git a/packages/shared/src/hooks/useLogin.ts b/packages/shared/src/hooks/useLogin.ts index 82be8b69d0..efd42d5575 100644 --- a/packages/shared/src/hooks/useLogin.ts +++ b/packages/shared/src/hooks/useLogin.ts @@ -1,28 +1,30 @@ import { useCallback, useContext, useState } from 'react'; import { useMutation, useQuery } from '@tanstack/react-query'; -import { LoginFormParams } from '../components/auth/LoginForm'; +import type { LoginFormParams } from '../components/auth/LoginForm'; import AuthContext from '../contexts/AuthContext'; -import { - AuthEventNames, - getNodeValue, +import type { LoginPasswordParameters, LoginSocialParameters, ValidateLoginParams, } from '../lib/auth'; +import { AuthEventNames, getNodeValue } from '../lib/auth'; +import type { + AuthSession, + EmptyObjectLiteral, + InitializationData, +} from '../lib/kratos'; import { AuthEvent, AuthFlow, - AuthSession, - EmptyObjectLiteral, getKratosSession, - InitializationData, initializeKratosFlow, submitKratosFlow, } from '../lib/kratos'; import LogContext from '../contexts/LogContext'; import { useToastNotification } from './useToastNotification'; -import { SignBackProvider, useSignBack } from './auth/useSignBack'; -import { LoggedUser } from '../lib/user'; +import type { SignBackProvider } from './auth/useSignBack'; +import { useSignBack } from './auth/useSignBack'; +import type { LoggedUser } from '../lib/user'; import { labels } from '../lib'; import { useEventListener } from './useEventListener'; diff --git a/packages/shared/src/hooks/useMemberRoleForSource.ts b/packages/shared/src/hooks/useMemberRoleForSource.ts index ada36ea96f..f3ab09ee86 100644 --- a/packages/shared/src/hooks/useMemberRoleForSource.ts +++ b/packages/shared/src/hooks/useMemberRoleForSource.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react'; -import { Source, SourceMemberRole } from '../graphql/sources'; -import { PublicProfile } from '../lib/user'; +import type { Source, SourceMemberRole } from '../graphql/sources'; +import type { PublicProfile } from '../lib/user'; export type UseMemberRoleForSourceProps = { source?: Source; diff --git a/packages/shared/src/hooks/useMutateFilters.ts b/packages/shared/src/hooks/useMutateFilters.ts index 92c34244d2..e8090ba9b5 100644 --- a/packages/shared/src/hooks/useMutateFilters.ts +++ b/packages/shared/src/hooks/useMutateFilters.ts @@ -1,20 +1,19 @@ import { useCallback, useMemo } from 'react'; -import { - QueryClient, - useMutation, - useQueryClient, -} from '@tanstack/react-query'; -import { LoggedUser } from '../lib/user'; -import { +import type { QueryClient } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { LoggedUser } from '../lib/user'; +import type { FeedAdvancedSettings, - ADD_FILTERS_TO_FEED_MUTATION, FeedSettings, FeedSettingsData, +} from '../graphql/feedSettings'; +import { + ADD_FILTERS_TO_FEED_MUTATION, REMOVE_FILTERS_FROM_FEED_MUTATION, UPDATE_ADVANCED_SETTINGS_FILTERS_MUTATION, FEED_FILTERS_FROM_REGISTRATION, } from '../graphql/feedSettings'; -import { Source } from '../graphql/sources'; +import type { Source } from '../graphql/sources'; import { getFeedSettingsQueryKey } from './useFeedSettings'; import { RequestKey, generateQueryKey } from '../lib/query'; import { gqlClient } from '../graphql/common'; diff --git a/packages/shared/src/hooks/useNotificationPermissionPopup.ts b/packages/shared/src/hooks/useNotificationPermissionPopup.ts index 0a40fe7d3e..8ea85eb7e1 100644 --- a/packages/shared/src/hooks/useNotificationPermissionPopup.ts +++ b/packages/shared/src/hooks/useNotificationPermissionPopup.ts @@ -1,7 +1,8 @@ import { useCallback } from 'react'; import { webappUrl } from '../lib/constants'; -import { NotificationPromptSource } from '../lib/log'; -import { useEventListener, MessageEventData } from './useEventListener'; +import type { NotificationPromptSource } from '../lib/log'; +import type { MessageEventData } from './useEventListener'; +import { useEventListener } from './useEventListener'; export interface PermissionEvent extends MessageEventData { permission: NotificationPermission; diff --git a/packages/shared/src/hooks/useOnPostClick.ts b/packages/shared/src/hooks/useOnPostClick.ts index c8210118f9..d3e00103e3 100644 --- a/packages/shared/src/hooks/useOnPostClick.ts +++ b/packages/shared/src/hooks/useOnPostClick.ts @@ -1,22 +1,23 @@ import { useContext, useMemo } from 'react'; -import { +import type { InfiniteData, QueryClient, QueryKey, - useQueryClient, } from '@tanstack/react-query'; +import { useQueryClient } from '@tanstack/react-query'; import LogContext from '../contexts/LogContext'; import { feedLogExtra, optimisticPostUpdateInFeed, postLogEvent, } from '../lib/feed'; -import { Post, PostType } from '../graphql/posts'; -import { Origin } from '../lib/log'; +import type { Post } from '../graphql/posts'; +import { PostType } from '../graphql/posts'; +import type { Origin } from '../lib/log'; import { ActiveFeedContext } from '../contexts'; import { updateCachedPagePost } from '../lib/query'; import { FeedLayoutMobileFeedPages, useFeedLayout } from './useFeedLayout'; -import { FeedData } from '../graphql/feed'; +import type { FeedData } from '../graphql/feed'; import { useReadingStreak } from './streaks'; interface PostClickOptionalProps { diff --git a/packages/shared/src/hooks/useOnboardingChecklist.tsx b/packages/shared/src/hooks/useOnboardingChecklist.tsx index 07cb1f73fa..71140410d9 100644 --- a/packages/shared/src/hooks/useOnboardingChecklist.tsx +++ b/packages/shared/src/hooks/useOnboardingChecklist.tsx @@ -3,7 +3,8 @@ import { useRouter } from 'next/router'; import { ActionType } from '../graphql/actions'; import { ChecklistViewState, createChecklistStep } from '../lib/checklist'; import { useActions } from './useActions'; -import { UseChecklist, useChecklist } from './useChecklist'; +import type { UseChecklist } from './useChecklist'; +import { useChecklist } from './useChecklist'; import { Button } from '../components/buttons/Button'; import { ButtonVariant, ButtonSize } from '../components/buttons/common'; import { ChecklistStep } from '../components/checklist/ChecklistStep'; diff --git a/packages/shared/src/hooks/usePersonalizedDigest.ts b/packages/shared/src/hooks/usePersonalizedDigest.ts index 7344b2bf85..b9c53d3b6b 100644 --- a/packages/shared/src/hooks/usePersonalizedDigest.ts +++ b/packages/shared/src/hooks/usePersonalizedDigest.ts @@ -1,11 +1,13 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; +import type { + UserPersonalizedDigest, + UserPersonalizedDigestSubscribe, +} from '../graphql/users'; import { GET_PERSONALIZED_DIGEST_SETTINGS, SUBSCRIBE_PERSONALIZED_DIGEST_MUTATION, UNSUBSCRIBE_PERSONALIZED_DIGEST_MUTATION, - UserPersonalizedDigest, - UserPersonalizedDigestSubscribe, UserPersonalizedDigestType, } from '../graphql/users'; import { RequestKey, StaleTime, generateQueryKey } from '../lib/query'; diff --git a/packages/shared/src/hooks/usePlusSubscription.ts b/packages/shared/src/hooks/usePlusSubscription.ts index a091c6ba12..d5cc66ee7b 100644 --- a/packages/shared/src/hooks/usePlusSubscription.ts +++ b/packages/shared/src/hooks/usePlusSubscription.ts @@ -2,7 +2,8 @@ import { useCallback, useMemo } from 'react'; import { useAuthContext } from '../contexts/AuthContext'; import { feature, plusImprovedEntryPoint } from '../lib/featureManagement'; import { useFeature } from '../components/GrowthBookProvider'; -import { TargetType, type LogEvent, type TargetId } from '../lib/log'; +import { TargetType } from '../lib/log'; +import type { LogEvent, TargetId } from '../lib/log'; import { useLogContext } from '../contexts/LogContext'; import { useConditionalFeature } from './useConditionalFeature'; diff --git a/packages/shared/src/hooks/usePostById.ts b/packages/shared/src/hooks/usePostById.ts index de4a5109f0..fc79efe755 100644 --- a/packages/shared/src/hooks/usePostById.ts +++ b/packages/shared/src/hooks/usePostById.ts @@ -1,33 +1,30 @@ import { useMemo } from 'react'; -import { +import type { QueryClient, QueryKey, QueryObserverOptions, - useQuery, UseQueryResult, } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import { useAuthContext } from '../contexts/AuthContext'; -import { - Post, - PostData, - POST_BY_ID_QUERY, - RelatedPost, -} from '../graphql/posts'; -import { PostCommentsData } from '../graphql/comments'; +import type { Post, PostData, RelatedPost } from '../graphql/posts'; +import { POST_BY_ID_QUERY } from '../graphql/posts'; +import type { PostCommentsData } from '../graphql/comments'; +import type { RequestKey } from '../lib/query'; import { getAllCommentsQuery, - RequestKey, StaleTime, updatePostContentPreference, } from '../lib/query'; -import { Connection, gqlClient } from '../graphql/common'; +import type { Connection } from '../graphql/common'; +import { gqlClient } from '../graphql/common'; import { useMutationSubscription } from './mutationSubscription/useMutationSubscription'; +import type { ContentPreferenceMutation } from './contentPreference/types'; import { - ContentPreferenceMutation, contentPreferenceMutationMatcher, mutationKeyToContentPreferenceStatusMap, } from './contentPreference/types'; -import { PropsParameters } from '../types'; +import type { PropsParameters } from '../types'; interface UsePostByIdProps { id: string; diff --git a/packages/shared/src/hooks/usePostContent.ts b/packages/shared/src/hooks/usePostContent.ts index a2817e7968..ee6fc3d6f3 100644 --- a/packages/shared/src/hooks/usePostContent.ts +++ b/packages/shared/src/hooks/usePostContent.ts @@ -1,24 +1,19 @@ import { useCallback, useEffect, useRef } from 'react'; import { useQueryClient } from '@tanstack/react-query'; -import { - Post, - PostsEngaged, - POSTS_ENGAGED_SUBSCRIPTION, - SharedPost, - PostType, -} from '../graphql/posts'; +import type { Post, PostsEngaged, SharedPost } from '../graphql/posts'; +import { POSTS_ENGAGED_SUBSCRIPTION, PostType } from '../graphql/posts'; import { useLogContext } from '../contexts/LogContext'; import { postLogEvent } from '../lib/feed'; import useOnPostClick from './useOnPostClick'; import useSubscription from './useSubscription'; -import { PostOrigin } from './log/useLogContextData'; +import type { PostOrigin } from './log/useLogContextData'; import { updatePostCache } from './usePostById'; import { ReferralCampaignKey } from '../lib'; import { useGetShortUrl } from './utils/useGetShortUrl'; import { ShareProvider } from '../lib/share'; import { useCopyPostLink } from './useCopyPostLink'; -import { EmptyPromise } from '../lib/func'; -import { Origin } from '../lib/log'; +import type { EmptyPromise } from '../lib/func'; +import type { Origin } from '../lib/log'; export interface UsePostContent { onCopyPostLink: () => void; diff --git a/packages/shared/src/hooks/usePostFeedback.ts b/packages/shared/src/hooks/usePostFeedback.ts index 8b75f0bef7..1dc7a59a7c 100644 --- a/packages/shared/src/hooks/usePostFeedback.ts +++ b/packages/shared/src/hooks/usePostFeedback.ts @@ -1,12 +1,13 @@ import { useContext, useMemo } from 'react'; import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { Post, dismissPostFeedback, UserVote } from '../graphql/posts'; +import type { Post } from '../graphql/posts'; +import { dismissPostFeedback, UserVote } from '../graphql/posts'; import { optimisticPostUpdateInFeed } from '../lib/feed'; import { updatePostCache } from './usePostById'; import { updateCachedPagePost } from '../lib/query'; import { ActiveFeedContext } from '../contexts/ActiveFeedContext'; import { SharedFeedPage } from '../components/utilities'; -import { EmptyResponse } from '../graphql/emptyResponse'; +import type { EmptyResponse } from '../graphql/emptyResponse'; import LogContext from '../contexts/LogContext'; import { LogEvent } from '../lib/log'; diff --git a/packages/shared/src/hooks/usePostMenuActions.ts b/packages/shared/src/hooks/usePostMenuActions.ts index e5a72d79bd..3d7bfd2c62 100644 --- a/packages/shared/src/hooks/usePostMenuActions.ts +++ b/packages/shared/src/hooks/usePostMenuActions.ts @@ -1,9 +1,10 @@ import { useMutation } from '@tanstack/react-query'; import { useCallback } from 'react'; -import { PromptOptions, usePrompt } from './usePrompt'; +import type { PromptOptions } from './usePrompt'; +import { usePrompt } from './usePrompt'; +import type { Post } from '../graphql/posts'; import { deletePost, - Post, swapPinnedPosts, updatePinnedPost, UserVote, @@ -12,7 +13,7 @@ import { SourcePermissions, SourceType } from '../graphql/sources'; import { Roles } from '../lib/user'; import { useAuthContext } from '../contexts/AuthContext'; import { useVotePost } from './vote/useVotePost'; -import { Origin } from '../lib/log'; +import type { Origin } from '../lib/log'; import { useBlockPostPanel } from './post/useBlockPostPanel'; import { ButtonColor, ButtonVariant } from '../components/buttons/Button'; diff --git a/packages/shared/src/hooks/usePostModalNavigation.ts b/packages/shared/src/hooks/usePostModalNavigation.ts index 4f08f7c103..c143298d15 100644 --- a/packages/shared/src/hooks/usePostModalNavigation.ts +++ b/packages/shared/src/hooks/usePostModalNavigation.ts @@ -8,9 +8,10 @@ import { } from 'react'; import { useRouter } from 'next/router'; import LogContext from '../contexts/LogContext'; -import { Post, PostType } from '../graphql/posts'; +import type { Post } from '../graphql/posts'; +import { PostType } from '../graphql/posts'; import { postLogEvent } from '../lib/feed'; -import { FeedItem, PostItem, UpdateFeedPost } from './useFeed'; +import type { FeedItem, PostItem, UpdateFeedPost } from './useFeed'; import { useKeyboardNavigation } from './useKeyboardNavigation'; import { Origin } from '../lib/log'; import { checkIsExtension } from '../lib/func'; diff --git a/packages/shared/src/hooks/usePostNavigationPosition.ts b/packages/shared/src/hooks/usePostNavigationPosition.ts index 5c5c429af7..92e8220ff0 100644 --- a/packages/shared/src/hooks/usePostNavigationPosition.ts +++ b/packages/shared/src/hooks/usePostNavigationPosition.ts @@ -1,4 +1,5 @@ -import { CSSProperties, useCallback, useState } from 'react'; +import type { CSSProperties } from 'react'; +import { useCallback, useState } from 'react'; import { SCROLL_OFFSET } from '../components/post/PostContent'; import { useHideOnModal } from './useHideOnModal'; import { useResetScrollForResponsiveModal } from './useResetScrollForResponsiveModal'; diff --git a/packages/shared/src/hooks/useProfileForm.ts b/packages/shared/src/hooks/useProfileForm.ts index 3daed96bc5..48aac6b05c 100644 --- a/packages/shared/src/hooks/useProfileForm.ts +++ b/packages/shared/src/hooks/useProfileForm.ts @@ -1,14 +1,16 @@ import { useCallback, useContext, useState } from 'react'; -import { UseMutateFunction, useMutation } from '@tanstack/react-query'; +import type { UseMutateFunction } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import AuthContext from '../contexts/AuthContext'; import { handleRegex, socialHandleRegex, UPDATE_USER_PROFILE_MUTATION, } from '../graphql/users'; -import { LoggedUser, UserProfile } from '../lib/user'; +import type { LoggedUser, UserProfile } from '../lib/user'; import { useToastNotification } from './useToastNotification'; -import { errorMessage, gqlClient, ResponseError } from '../graphql/common'; +import type { ResponseError } from '../graphql/common'; +import { errorMessage, gqlClient } from '../graphql/common'; export interface ProfileFormHint { portfolio?: string; diff --git a/packages/shared/src/hooks/usePrompt.ts b/packages/shared/src/hooks/usePrompt.ts index 23391db514..a4ddad05b4 100644 --- a/packages/shared/src/hooks/usePrompt.ts +++ b/packages/shared/src/hooks/usePrompt.ts @@ -1,7 +1,8 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'; -import { ReactNode, useCallback } from 'react'; -import { ButtonProps } from '../components/buttons/Button'; -import { ModalSize } from '../components/modals/common/types'; +import type { ReactNode } from 'react'; +import { useCallback } from 'react'; +import type { ButtonProps } from '../components/buttons/Button'; +import type { ModalSize } from '../components/modals/common/types'; import { generateQueryKey, RequestKey } from '../lib/query'; export const PROMPT_KEY = generateQueryKey(RequestKey.Prompt, null); diff --git a/packages/shared/src/hooks/useReadingHistory.ts b/packages/shared/src/hooks/useReadingHistory.ts index 601c5fcfd0..2889ff69f9 100644 --- a/packages/shared/src/hooks/useReadingHistory.ts +++ b/packages/shared/src/hooks/useReadingHistory.ts @@ -1,9 +1,8 @@ -import { useQueryClient, useMutation, QueryKey } from '@tanstack/react-query'; -import { - HidePostItemCardProps, - HIDE_READING_HISTORY_MUTATION, -} from '../graphql/users'; -import { ReadHistoryInfiniteData } from './useInfiniteReadingHistory'; +import type { QueryKey } from '@tanstack/react-query'; +import { useQueryClient, useMutation } from '@tanstack/react-query'; +import type { HidePostItemCardProps } from '../graphql/users'; +import { HIDE_READING_HISTORY_MUTATION } from '../graphql/users'; +import type { ReadHistoryInfiniteData } from './useInfiniteReadingHistory'; import { gqlClient } from '../graphql/common'; export type QueryIndexes = { page: number; edge: number }; diff --git a/packages/shared/src/hooks/useReadingHistoryContextMenu.ts b/packages/shared/src/hooks/useReadingHistoryContextMenu.ts index 5a910b98d6..a9bc81ada2 100644 --- a/packages/shared/src/hooks/useReadingHistoryContextMenu.ts +++ b/packages/shared/src/hooks/useReadingHistoryContextMenu.ts @@ -1,7 +1,9 @@ -import React, { Dispatch, useCallback, useState } from 'react'; +import type { Dispatch } from 'react'; +import type React from 'react'; +import { useCallback, useState } from 'react'; import useContextMenu from './useContextMenu'; -import { PostItem } from '../graphql/posts'; -import { QueryIndexes } from './useReadingHistory'; +import type { PostItem } from '../graphql/posts'; +import type { QueryIndexes } from './useReadingHistory'; import { ContextMenu } from './constants'; type ReadingOptionsFunc = ( diff --git a/packages/shared/src/hooks/useRefreshToken.ts b/packages/shared/src/hooks/useRefreshToken.ts index f16dd6b4c3..f2e078aaba 100644 --- a/packages/shared/src/hooks/useRefreshToken.ts +++ b/packages/shared/src/hooks/useRefreshToken.ts @@ -1,6 +1,6 @@ import { useEffect } from 'react'; import { differenceInMilliseconds } from 'date-fns'; -import { AccessToken } from '../lib/boot'; +import type { AccessToken } from '../lib/boot'; import useDebounceFn from './useDebounceFn'; export function useRefreshToken( diff --git a/packages/shared/src/hooks/useRegistration.ts b/packages/shared/src/hooks/useRegistration.ts index 25a7256d46..12fa882c91 100644 --- a/packages/shared/src/hooks/useRegistration.ts +++ b/packages/shared/src/hooks/useRegistration.ts @@ -1,23 +1,24 @@ import { useContext, useEffect, useMemo, useState } from 'react'; -import { QueryKey, useMutation, useQuery } from '@tanstack/react-query'; +import type { QueryKey } from '@tanstack/react-query'; +import { useMutation, useQuery } from '@tanstack/react-query'; import AuthContext from '../contexts/AuthContext'; -import { - AuthEventNames, - errorsToJson, - getNodeValue, +import type { RegistrationError, RegistrationParameters, ValidateRegistrationParams, } from '../lib/auth'; +import { AuthEventNames, errorsToJson, getNodeValue } from '../lib/auth'; +import type { + InitializationData, + SuccessfulRegistrationData, +} from '../lib/kratos'; import { AuthFlow, ContinueWithAction, - InitializationData, initializeKratosFlow, KRATOS_ERROR, KRATOS_ERROR_MESSAGE, submitKratosFlow, - SuccessfulRegistrationData, } from '../lib/kratos'; import { useToastNotification } from './useToastNotification'; import { getUserDefaultTimezone } from '../lib/timezones'; diff --git a/packages/shared/src/hooks/useReportComment.ts b/packages/shared/src/hooks/useReportComment.ts index 1f3594c79d..bcb18f426b 100644 --- a/packages/shared/src/hooks/useReportComment.ts +++ b/packages/shared/src/hooks/useReportComment.ts @@ -1,11 +1,11 @@ import { useContext } from 'react'; import { useMutation } from '@tanstack/react-query'; import AuthContext from '../contexts/AuthContext'; -import { BooleanPromise } from '../components/filters/common'; +import type { BooleanPromise } from '../components/filters/common'; import { AuthTriggers } from '../lib/auth'; import { useRequestProtocol } from './useRequestProtocol'; import { REPORT_COMMENT_MUTATION } from '../graphql/comments'; -import { ReportReason } from '../report'; +import type { ReportReason } from '../report'; type UseReportCommentRet = { reportComment: (variables: { diff --git a/packages/shared/src/hooks/useReportPost.ts b/packages/shared/src/hooks/useReportPost.ts index 8ec4f606e3..50d1e548ac 100644 --- a/packages/shared/src/hooks/useReportPost.ts +++ b/packages/shared/src/hooks/useReportPost.ts @@ -6,11 +6,11 @@ import { UNHIDE_POST_MUTATION, } from '../graphql/posts'; import AuthContext from '../contexts/AuthContext'; -import { BooleanPromise } from '../components/filters/common'; +import type { BooleanPromise } from '../components/filters/common'; import { AuthTriggers } from '../lib/auth'; import { useRequestProtocol } from './useRequestProtocol'; import { gqlClient } from '../graphql/common'; -import { ReportReason } from '../report'; +import type { ReportReason } from '../report'; type UseReportPostRet = { reportPost: (variables: { diff --git a/packages/shared/src/hooks/useReportPostMenu.ts b/packages/shared/src/hooks/useReportPostMenu.ts index 8bbfa0d4ed..121a10c226 100644 --- a/packages/shared/src/hooks/useReportPostMenu.ts +++ b/packages/shared/src/hooks/useReportPostMenu.ts @@ -1,5 +1,5 @@ -import { TriggerEvent } from '@dailydotdev/react-contexify'; -import { ContextMenuParams } from '@dailydotdev/react-contexify/dist/types'; +import type { TriggerEvent } from '@dailydotdev/react-contexify'; +import type { ContextMenuParams } from '@dailydotdev/react-contexify/dist/types'; import useContextMenu from './useContextMenu'; import { ContextMenu } from './constants'; diff --git a/packages/shared/src/hooks/useRequestProtocol.ts b/packages/shared/src/hooks/useRequestProtocol.ts index a0a9c264a5..d1a4389aaa 100644 --- a/packages/shared/src/hooks/useRequestProtocol.ts +++ b/packages/shared/src/hooks/useRequestProtocol.ts @@ -1,10 +1,7 @@ import { useMemo } from 'react'; import { useQueryClient } from '@tanstack/react-query'; -import { - RequestProtocol, - REQUEST_PROTOCOL_KEY, - gqlRequest, -} from '../graphql/common'; +import type { RequestProtocol } from '../graphql/common'; +import { REQUEST_PROTOCOL_KEY, gqlRequest } from '../graphql/common'; export const useRequestProtocol = (): RequestProtocol => { const client = useQueryClient(); diff --git a/packages/shared/src/hooks/useRequirePermissions.ts b/packages/shared/src/hooks/useRequirePermissions.ts index 23c7dd1adf..bffa66a786 100644 --- a/packages/shared/src/hooks/useRequirePermissions.ts +++ b/packages/shared/src/hooks/useRequirePermissions.ts @@ -1,6 +1,6 @@ import { useContext, useEffect } from 'react'; import { useRouter } from 'next/router'; -import { Roles } from '../lib/user'; +import type { Roles } from '../lib/user'; import AuthContext from '../contexts/AuthContext'; export default function useRequirePermissions(role: Roles): void { diff --git a/packages/shared/src/hooks/useShareComment.ts b/packages/shared/src/hooks/useShareComment.ts index fdfdd7bc98..d56c1e38ad 100644 --- a/packages/shared/src/hooks/useShareComment.ts +++ b/packages/shared/src/hooks/useShareComment.ts @@ -1,10 +1,11 @@ import { useCallback, useContext } from 'react'; -import { Post } from '../graphql/posts'; +import type { Post } from '../graphql/posts'; import { postLogEvent } from '../lib/feed'; import LogContext from '../contexts/LogContext'; import { ShareProvider } from '../lib/share'; -import { Origin } from '../lib/log'; -import { Comment, getCommentHash } from '../graphql/comments'; +import type { Origin } from '../lib/log'; +import type { Comment } from '../graphql/comments'; +import { getCommentHash } from '../graphql/comments'; import { useGetShortUrl } from './utils/useGetShortUrl'; import { ReferralCampaignKey } from '../lib'; import { useSharePost } from './useSharePost'; diff --git a/packages/shared/src/hooks/useShareOrCopyLink.ts b/packages/shared/src/hooks/useShareOrCopyLink.ts index 66c5b73475..bd4b89f247 100644 --- a/packages/shared/src/hooks/useShareOrCopyLink.ts +++ b/packages/shared/src/hooks/useShareOrCopyLink.ts @@ -1,10 +1,11 @@ import { useContext } from 'react'; import LogContext from '../contexts/LogContext'; -import { CopyNotifyFunction, useCopyLink } from './useCopy'; +import type { CopyNotifyFunction } from './useCopy'; +import { useCopyLink } from './useCopy'; import { ShareProvider } from '../lib/share'; -import { LogEvent } from './log/useLogQueue'; +import type { LogEvent } from './log/useLogQueue'; import { useGetShortUrl } from './utils/useGetShortUrl'; -import { ReferralCampaignKey } from '../lib'; +import type { ReferralCampaignKey } from '../lib'; import { shouldUseNativeShare } from '../lib/func'; export interface UseShareOrCopyLinkProps { diff --git a/packages/shared/src/hooks/useSharePost.ts b/packages/shared/src/hooks/useSharePost.ts index 20a2305db5..d7338e19a5 100644 --- a/packages/shared/src/hooks/useSharePost.ts +++ b/packages/shared/src/hooks/useSharePost.ts @@ -1,15 +1,15 @@ import { useCallback, useContext } from 'react'; -import { Post } from '../graphql/posts'; +import type { Post } from '../graphql/posts'; import { postLogEvent } from '../lib/feed'; import LogContext from '../contexts/LogContext'; import { ShareProvider } from '../lib/share'; -import { Origin } from '../lib/log'; +import type { Origin } from '../lib/log'; import { useCopyPostLink } from './useCopyPostLink'; import { useGetShortUrl } from './utils/useGetShortUrl'; import { ReferralCampaignKey } from '../lib'; import { useLazyModal } from './useLazyModal'; import { LazyModal } from '../components/modals/common/types'; -import { ShareProps } from '../components/modals/post/common'; +import type { ShareProps } from '../components/modals/post/common'; type FuncProps = Omit; diff --git a/packages/shared/src/hooks/useSourceSearch.ts b/packages/shared/src/hooks/useSourceSearch.ts index e14e4e5a9d..cf6a0ff296 100644 --- a/packages/shared/src/hooks/useSourceSearch.ts +++ b/packages/shared/src/hooks/useSourceSearch.ts @@ -1,6 +1,7 @@ import { useQuery } from '@tanstack/react-query'; import { gqlClient } from '../graphql/common'; -import { SEARCH_SOURCES_QUERY, Source } from '../graphql/sources'; +import type { Source } from '../graphql/sources'; +import { SEARCH_SOURCES_QUERY } from '../graphql/sources'; import { generateQueryKey, RequestKey } from '../lib/query'; export type UseSourceSearchProps = { diff --git a/packages/shared/src/hooks/useSquadChecklist.tsx b/packages/shared/src/hooks/useSquadChecklist.tsx index 492030d70c..50416de990 100644 --- a/packages/shared/src/hooks/useSquadChecklist.tsx +++ b/packages/shared/src/hooks/useSquadChecklist.tsx @@ -4,15 +4,17 @@ import { NotificationChecklistStep } from '../components/checklist/NotificationC import { SharePostChecklistStep } from '../components/checklist/SharePostChecklistStep'; import { SquadFirstCommentChecklistStep } from '../components/checklist/SquadFirstCommentChecklistStep'; import { ActionType } from '../graphql/actions'; -import { SourceMemberRole, SourcePermissions, Squad } from '../graphql/sources'; +import type { Squad } from '../graphql/sources'; +import { SourceMemberRole, SourcePermissions } from '../graphql/sources'; +import type { ChecklistStepType } from '../lib/checklist'; import { actionsPerRoleMap, - ChecklistStepType, createChecklistStep, SQUAD_CHECKLIST_VISIBLE_KEY, } from '../lib/checklist'; import { useActions } from './useActions'; -import { UseChecklist, useChecklist } from './useChecklist'; +import type { UseChecklist } from './useChecklist'; +import { useChecklist } from './useChecklist'; import usePersistentContext from './usePersistentContext'; import { InviteMemberChecklistStep } from '../components/checklist/InviteMemberChecklistStep'; import { verifyPermission } from '../graphql/squads'; diff --git a/packages/shared/src/hooks/useSquadInvitation.ts b/packages/shared/src/hooks/useSquadInvitation.ts index 0994291c8a..794d5a3f46 100644 --- a/packages/shared/src/hooks/useSquadInvitation.ts +++ b/packages/shared/src/hooks/useSquadInvitation.ts @@ -1,7 +1,8 @@ -import { CopyNotifyFunction, useCopyLink } from './useCopy'; +import type { CopyNotifyFunction } from './useCopy'; +import { useCopyLink } from './useCopy'; import { useLogContext } from '../contexts/LogContext'; import { LogEvent } from '../lib/log'; -import { Squad } from '../graphql/sources'; +import type { Squad } from '../graphql/sources'; import { useActions } from './useActions'; import { ActionType } from '../graphql/actions'; diff --git a/packages/shared/src/hooks/useSubscription.ts b/packages/shared/src/hooks/useSubscription.ts index 5347d7576d..af67801ea6 100644 --- a/packages/shared/src/hooks/useSubscription.ts +++ b/packages/shared/src/hooks/useSubscription.ts @@ -1,4 +1,5 @@ -import { DependencyList, useContext, useEffect, useRef } from 'react'; +import type { DependencyList } from 'react'; +import { useContext, useEffect, useRef } from 'react'; import SubscriptionContext from '../contexts/SubscriptionContext'; export interface SubscriptionCallbacks { diff --git a/packages/shared/src/hooks/useTagAndSource.ts b/packages/shared/src/hooks/useTagAndSource.ts index e92ea9376c..10969a9baa 100644 --- a/packages/shared/src/hooks/useTagAndSource.ts +++ b/packages/shared/src/hooks/useTagAndSource.ts @@ -3,14 +3,15 @@ import { useQueryClient } from '@tanstack/react-query'; import AuthContext from '../contexts/AuthContext'; import LogContext from '../contexts/LogContext'; import useMutateFilters from './useMutateFilters'; -import { Source } from '../graphql/sources'; +import type { Source } from '../graphql/sources'; import AlertContext from '../contexts/AlertContext'; -import { BooleanPromise } from '../components/filters/common'; +import type { BooleanPromise } from '../components/filters/common'; import { generateQueryKey } from '../lib/query'; import useDebounceFn from './useDebounceFn'; import { SharedFeedPage } from '../components/utilities'; -import { LogEvent, Origin } from '../lib/log'; -import { AuthTriggersType } from '../lib/auth'; +import type { Origin } from '../lib/log'; +import { LogEvent } from '../lib/log'; +import type { AuthTriggersType } from '../lib/auth'; export interface TagActionArguments { tags: Array; diff --git a/packages/shared/src/hooks/useTagContext.ts b/packages/shared/src/hooks/useTagContext.ts index 909afc59d6..96b77c77b0 100644 --- a/packages/shared/src/hooks/useTagContext.ts +++ b/packages/shared/src/hooks/useTagContext.ts @@ -1,6 +1,7 @@ -import React, { useState } from 'react'; +import type React from 'react'; +import { useState } from 'react'; import useContextMenu from './useContextMenu'; -import { Tag } from '../graphql/feedSettings'; +import type { Tag } from '../graphql/feedSettings'; import { ContextMenu } from './constants'; export default function useTagContext(): { diff --git a/packages/shared/src/hooks/useTagSearch.ts b/packages/shared/src/hooks/useTagSearch.ts index ff37955fec..2db0a884dd 100644 --- a/packages/shared/src/hooks/useTagSearch.ts +++ b/packages/shared/src/hooks/useTagSearch.ts @@ -1,7 +1,9 @@ import { useQuery } from '@tanstack/react-query'; import { useContext } from 'react'; -import { SearchTagsData, SEARCH_TAGS_QUERY } from '../graphql/feedSettings'; -import { LogEvent, Origin } from '../lib/log'; +import type { SearchTagsData } from '../graphql/feedSettings'; +import { SEARCH_TAGS_QUERY } from '../graphql/feedSettings'; +import type { Origin } from '../lib/log'; +import { LogEvent } from '../lib/log'; import { getSearchTagsQueryKey } from './useMutateFilters'; import LogContext from '../contexts/LogContext'; import { gqlClient } from '../graphql/common'; diff --git a/packages/shared/src/hooks/useTimer.ts b/packages/shared/src/hooks/useTimer.ts index 889ccaf0fb..6ab2a8d95c 100644 --- a/packages/shared/src/hooks/useTimer.ts +++ b/packages/shared/src/hooks/useTimer.ts @@ -1,4 +1,5 @@ -import { Dispatch, SetStateAction, useMemo, useState } from 'react'; +import type { Dispatch, SetStateAction } from 'react'; +import { useMemo, useState } from 'react'; import useDebounceFn from './useDebounceFn'; type CallbackFn = (params?: T) => void; diff --git a/packages/shared/src/hooks/useUpdatePost.ts b/packages/shared/src/hooks/useUpdatePost.ts index c48f13a4b2..5e2d43cf14 100644 --- a/packages/shared/src/hooks/useUpdatePost.ts +++ b/packages/shared/src/hooks/useUpdatePost.ts @@ -1,6 +1,6 @@ import { useQueryClient } from '@tanstack/react-query'; -import { Post, PostData } from '../graphql/posts'; -import { MutateFunc } from '../lib/query'; +import type { Post, PostData } from '../graphql/posts'; +import type { MutateFunc } from '../lib/query'; import { getPostByIdKey } from './usePostById'; type UpdateData = { id: string; update?: Partial }; diff --git a/packages/shared/src/hooks/useUpvoteQuery.ts b/packages/shared/src/hooks/useUpvoteQuery.ts index e5ea106fd8..3931d4f9c5 100644 --- a/packages/shared/src/hooks/useUpvoteQuery.ts +++ b/packages/shared/src/hooks/useUpvoteQuery.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react'; -import { QueryKey } from '@tanstack/react-query'; +import type { QueryKey } from '@tanstack/react-query'; import { LazyModal } from '../components/modals/common/types'; import { COMMENT_UPVOTES_BY_ID_QUERY } from '../graphql/comments'; import { POST_UPVOTES_BY_ID_QUERY } from '../graphql/posts'; diff --git a/packages/shared/src/hooks/user/useUserShortByIdQuery.ts b/packages/shared/src/hooks/user/useUserShortByIdQuery.ts index 8beaec42a6..bec5514325 100644 --- a/packages/shared/src/hooks/user/useUserShortByIdQuery.ts +++ b/packages/shared/src/hooks/user/useUserShortByIdQuery.ts @@ -1,4 +1,5 @@ -import { useQuery, UseQueryResult } from '@tanstack/react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import { USER_SHORT_BY_ID } from '../../graphql/users'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; import { gqlClient } from '../../graphql/common'; diff --git a/packages/shared/src/hooks/userCompany/useUserCompaniesQuery.tsx b/packages/shared/src/hooks/userCompany/useUserCompaniesQuery.tsx index 404b9a0286..138c75e231 100644 --- a/packages/shared/src/hooks/userCompany/useUserCompaniesQuery.tsx +++ b/packages/shared/src/hooks/userCompany/useUserCompaniesQuery.tsx @@ -1,5 +1,5 @@ import { useQuery } from '@tanstack/react-query'; -import { UserCompany } from '../../lib/userCompany'; +import type { UserCompany } from '../../lib/userCompany'; import { GET_USER_COMPANIES } from '../../graphql/users'; import { generateQueryKey, RequestKey, StaleTime } from '../../lib/query'; import { useAuthContext } from '../../contexts/AuthContext'; diff --git a/packages/shared/src/hooks/utils/useFeatureTheme.ts b/packages/shared/src/hooks/utils/useFeatureTheme.ts index 369c69ef41..1b5449708d 100644 --- a/packages/shared/src/hooks/utils/useFeatureTheme.ts +++ b/packages/shared/src/hooks/utils/useFeatureTheme.ts @@ -3,7 +3,10 @@ import { useRouter } from 'next/router'; import { ThemeMode, useSettingsContext } from '../../contexts/SettingsContext'; import { useFeature } from '../../components/GrowthBookProvider'; import { feature } from '../../lib/featureManagement'; -import { FeatureTheme, FeatureThemeVariant } from '../../lib/featureValues'; +import type { + FeatureTheme, + FeatureThemeVariant, +} from '../../lib/featureValues'; interface UseFeatureThemeResult extends Pick, diff --git a/packages/shared/src/hooks/utils/useGetShortUrl.ts b/packages/shared/src/hooks/utils/useGetShortUrl.ts index 539788cffd..8d8fe8f081 100644 --- a/packages/shared/src/hooks/utils/useGetShortUrl.ts +++ b/packages/shared/src/hooks/utils/useGetShortUrl.ts @@ -4,7 +4,7 @@ import { useAuthContext } from '../../contexts/AuthContext'; import { GET_SHORT_URL_QUERY } from '../../graphql/urlShortener'; import { addLogQueryParams } from '../../lib/share'; import { RequestKey, generateQueryKey } from '../../lib/query'; -import { ReferralCampaignKey } from '../../lib'; +import type { ReferralCampaignKey } from '../../lib'; import { disabledRefetch } from '../../lib/func'; import { gqlClient } from '../../graphql/common'; diff --git a/packages/shared/src/hooks/utils/useInteractivePopup.ts b/packages/shared/src/hooks/utils/useInteractivePopup.ts index d4bfb12d90..eaca123d4c 100644 --- a/packages/shared/src/hooks/utils/useInteractivePopup.ts +++ b/packages/shared/src/hooks/utils/useInteractivePopup.ts @@ -1,4 +1,5 @@ -import { MouseEvent, useCallback, useState } from 'react'; +import type { MouseEvent } from 'react'; +import { useCallback, useState } from 'react'; type Fn = (e: MouseEvent) => void; diff --git a/packages/shared/src/hooks/utils/useOutsideClick.ts b/packages/shared/src/hooks/utils/useOutsideClick.ts index 82448c451b..37d58ab067 100644 --- a/packages/shared/src/hooks/utils/useOutsideClick.ts +++ b/packages/shared/src/hooks/utils/useOutsideClick.ts @@ -1,4 +1,4 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { useEventListener } from '../useEventListener'; import { isNullOrUndefined } from '../../lib/func'; diff --git a/packages/shared/src/hooks/utils/usePagination.ts b/packages/shared/src/hooks/utils/usePagination.ts index dc16adca65..fc551c9335 100644 --- a/packages/shared/src/hooks/utils/usePagination.ts +++ b/packages/shared/src/hooks/utils/usePagination.ts @@ -1,4 +1,5 @@ -import { MouseEventHandler, useCallback, useMemo, useState } from 'react'; +import type { MouseEventHandler } from 'react'; +import { useCallback, useMemo, useState } from 'react'; export interface UsePagination { onNext: MouseEventHandler; diff --git a/packages/shared/src/hooks/utils/useQueryState.ts b/packages/shared/src/hooks/utils/useQueryState.ts index e213e6898a..3b697599c8 100644 --- a/packages/shared/src/hooks/utils/useQueryState.ts +++ b/packages/shared/src/hooks/utils/useQueryState.ts @@ -1,9 +1,5 @@ -import { - QueryKey, - useQuery, - useQueryClient, - UseQueryResult, -} from '@tanstack/react-query'; +import type { QueryKey, UseQueryResult } from '@tanstack/react-query'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; import { disabledRefetch } from '../../lib/func'; diff --git a/packages/shared/src/hooks/vote/types.ts b/packages/shared/src/hooks/vote/types.ts index f88413dda9..de70ca16d9 100644 --- a/packages/shared/src/hooks/vote/types.ts +++ b/packages/shared/src/hooks/vote/types.ts @@ -1,12 +1,9 @@ -import { MutationKey } from '@tanstack/react-query'; -import { - Post as PostEntity, - ReadHistoryPost, - UserVote, -} from '../../graphql/posts'; -import { Origin } from '../../lib/log'; -import { PostLogEventFnOptions } from '../../lib/feed'; -import { UseMutationMatcher } from '../mutationSubscription/types'; +import type { MutationKey } from '@tanstack/react-query'; +import type { Post as PostEntity, ReadHistoryPost } from '../../graphql/posts'; +import { UserVote } from '../../graphql/posts'; +import type { Origin } from '../../lib/log'; +import type { PostLogEventFnOptions } from '../../lib/feed'; +import type { UseMutationMatcher } from '../mutationSubscription/types'; export type VoteEntityPayload = { id: string; diff --git a/packages/shared/src/hooks/vote/useFeedVotePost.ts b/packages/shared/src/hooks/vote/useFeedVotePost.ts index 2e1a64c67b..76951f261c 100644 --- a/packages/shared/src/hooks/vote/useFeedVotePost.ts +++ b/packages/shared/src/hooks/vote/useFeedVotePost.ts @@ -1,15 +1,11 @@ import { useCallback } from 'react'; import { useQueryClient } from '@tanstack/react-query'; -import { FeedItem, UpdateFeedPost } from '../useFeed'; +import type { FeedItem, UpdateFeedPost } from '../useFeed'; import { feedLogExtra } from '../../lib/feed'; -import { Origin } from '../../lib/log'; +import type { Origin } from '../../lib/log'; import { useMutationSubscription } from '../mutationSubscription/useMutationSubscription'; -import { - UseVotePost, - UseVoteMutationProps, - voteMutationMatcher, - voteMutationHandlers, -} from './types'; +import type { UseVotePost, UseVoteMutationProps } from './types'; +import { voteMutationMatcher, voteMutationHandlers } from './types'; import { useVotePost } from './useVotePost'; import { mutateVoteFeedPost } from './utils'; import { updatePostCache } from '../usePostById'; diff --git a/packages/shared/src/hooks/vote/useReadHistoryVotePost.ts b/packages/shared/src/hooks/vote/useReadHistoryVotePost.ts index 2128399a9f..a5be9cf58b 100644 --- a/packages/shared/src/hooks/vote/useReadHistoryVotePost.ts +++ b/packages/shared/src/hooks/vote/useReadHistoryVotePost.ts @@ -2,8 +2,8 @@ import { useContext } from 'react'; import { useQueryClient } from '@tanstack/react-query'; import AuthContext from '../../contexts/AuthContext'; import { RequestKey, generateQueryKey } from '../../lib/query'; -import { ReadHistoryInfiniteData } from '../useInfiniteReadingHistory'; -import { UseVotePost } from './types'; +import type { ReadHistoryInfiniteData } from '../useInfiniteReadingHistory'; +import type { UseVotePost } from './types'; import { useVotePost } from './useVotePost'; import { mutateVoteReadHistoryPost } from './utils'; diff --git a/packages/shared/src/hooks/vote/useVote.ts b/packages/shared/src/hooks/vote/useVote.ts index 94ff90c541..18de8b47ea 100644 --- a/packages/shared/src/hooks/vote/useVote.ts +++ b/packages/shared/src/hooks/vote/useVote.ts @@ -4,14 +4,13 @@ import AuthContext from '../../contexts/AuthContext'; import { UserVote } from '../../graphql/posts'; import { AuthTriggers } from '../../lib/auth'; import { useRequestProtocol } from '../useRequestProtocol'; -import { +import type { UseVoteMutationProps, VoteProps, UseVote, UseVoteProps, - createVoteMutationKey, - UserVoteEntity, } from './types'; +import { createVoteMutationKey, UserVoteEntity } from './types'; import { VOTE_MUTATION } from '../../graphql/users'; import { useActions } from '../useActions'; import { ActionType } from '../../graphql/actions'; diff --git a/packages/shared/src/hooks/vote/useVoteComment.ts b/packages/shared/src/hooks/vote/useVoteComment.ts index e405a0008f..b470e4df01 100644 --- a/packages/shared/src/hooks/vote/useVoteComment.ts +++ b/packages/shared/src/hooks/vote/useVoteComment.ts @@ -1,16 +1,18 @@ import { useCallback, useContext } from 'react'; import LogContext from '../../contexts/LogContext'; import AuthContext from '../../contexts/AuthContext'; -import { Post, UserVote } from '../../graphql/posts'; +import type { Post } from '../../graphql/posts'; +import { UserVote } from '../../graphql/posts'; import { AuthTriggers } from '../../lib/auth'; -import { PostLogEventFnOptions, postLogEvent } from '../../lib/feed'; -import { - UserVoteEntity, +import type { PostLogEventFnOptions } from '../../lib/feed'; +import { postLogEvent } from '../../lib/feed'; +import type { UseVote, UseVoteProps, ToggleVoteProps, VoteEntityPayload, } from './types'; +import { UserVoteEntity } from './types'; import { useVote } from './useVote'; import { LogEvent } from '../../lib/log'; diff --git a/packages/shared/src/hooks/vote/useVotePost.ts b/packages/shared/src/hooks/vote/useVotePost.ts index c984dcd086..1a8545c60f 100644 --- a/packages/shared/src/hooks/vote/useVotePost.ts +++ b/packages/shared/src/hooks/vote/useVotePost.ts @@ -2,21 +2,18 @@ import { useContext, useCallback } from 'react'; import { useQueryClient } from '@tanstack/react-query'; import LogContext from '../../contexts/LogContext'; import AuthContext from '../../contexts/AuthContext'; -import { PostData, UserVote } from '../../graphql/posts'; +import type { PostData } from '../../graphql/posts'; +import { UserVote } from '../../graphql/posts'; import { LogEvent } from '../../lib/log'; import { AuthTriggers } from '../../lib/auth'; -import { PostLogEventFnOptions, postLogEvent } from '../../lib/feed'; +import type { PostLogEventFnOptions } from '../../lib/feed'; +import { postLogEvent } from '../../lib/feed'; import { getPostByIdKey, updatePostCache as updateSinglePostCache, } from '../usePostById'; -import { - UseVotePostProps, - UseVotePost, - voteMutationHandlers, - ToggleVoteProps, - UserVoteEntity, -} from './types'; +import type { UseVotePostProps, UseVotePost, ToggleVoteProps } from './types'; +import { voteMutationHandlers, UserVoteEntity } from './types'; import { useVote } from './useVote'; const prepareVotePostLogOptions = ({ diff --git a/packages/shared/src/hooks/vote/utils.ts b/packages/shared/src/hooks/vote/utils.ts index 1dddad74ed..604eb1e3aa 100644 --- a/packages/shared/src/hooks/vote/utils.ts +++ b/packages/shared/src/hooks/vote/utils.ts @@ -1,20 +1,17 @@ -import { QueryClient } from '@tanstack/react-query'; -import { Edge } from '../../graphql/common'; +import type { QueryClient } from '@tanstack/react-query'; +import type { Edge } from '../../graphql/common'; import { generateQueryKey, RequestKey, updateReadingHistoryListPost, } from '../../lib/query'; -import { LoggedUser } from '../../lib/user'; -import { ReadHistoryInfiniteData } from '../useInfiniteReadingHistory'; -import { - UseVoteMutationProps, - UseVotePostProps, - voteMutationHandlers, -} from './types'; -import { PostItem } from '../../graphql/posts'; +import type { LoggedUser } from '../../lib/user'; +import type { ReadHistoryInfiniteData } from '../useInfiniteReadingHistory'; +import type { UseVoteMutationProps, UseVotePostProps } from './types'; +import { voteMutationHandlers } from './types'; +import type { PostItem } from '../../graphql/posts'; import { optimisticPostUpdateInFeed } from '../../lib/feed'; -import { FeedItem, UpdateFeedPost } from '../useFeed'; +import type { FeedItem, UpdateFeedPost } from '../useFeed'; export const mutateVoteReadHistoryPost = ({ id, diff --git a/packages/shared/src/lib/auth.ts b/packages/shared/src/lib/auth.ts index abf2f184b3..20b03358a4 100644 --- a/packages/shared/src/lib/auth.ts +++ b/packages/shared/src/lib/auth.ts @@ -1,4 +1,4 @@ -import { +import type { AuthenticationType, AuthPostParams, InitializationData, @@ -6,9 +6,9 @@ import { KratosFormParams, KratosMessage, KratosMethod, - MessageType, } from './kratos'; -import { Origin } from './log'; +import { MessageType } from './kratos'; +import type { Origin } from './log'; export enum AuthEventNames { OpenSignup = 'open signup', diff --git a/packages/shared/src/lib/boot.ts b/packages/shared/src/lib/boot.ts index bcbc651c8f..2b8ebd5c20 100644 --- a/packages/shared/src/lib/boot.ts +++ b/packages/shared/src/lib/boot.ts @@ -1,13 +1,13 @@ -import { FeatureDefinition } from '@growthbook/growthbook'; -import { AnonymousUser, ContentLanguage, LoggedUser } from './user'; +import type { FeatureDefinition } from '@growthbook/growthbook'; +import type { AnonymousUser, ContentLanguage, LoggedUser } from './user'; import { apiUrl } from './config'; -import { Alerts } from '../graphql/alerts'; -import { RemoteSettings } from '../graphql/settings'; -import { Post } from '../graphql/posts'; -import { Squad } from '../graphql/sources'; +import type { Alerts } from '../graphql/alerts'; +import type { RemoteSettings } from '../graphql/settings'; +import type { Post } from '../graphql/posts'; +import type { Squad } from '../graphql/sources'; import { decrypt } from '../components/crypto'; -import { MarketingCta } from '../components/marketingCta/common'; -import { Feed } from '../graphql/feed'; +import type { MarketingCta } from '../components/marketingCta/common'; +import type { Feed } from '../graphql/feed'; interface NotificationsBootData { unreadNotificationsCount: number; diff --git a/packages/shared/src/lib/canonical.ts b/packages/shared/src/lib/canonical.ts index f2872df591..ff48226636 100644 --- a/packages/shared/src/lib/canonical.ts +++ b/packages/shared/src/lib/canonical.ts @@ -1,6 +1,6 @@ -import { ParsedUrlQuery } from 'querystring'; -import { BaseRouter } from 'next/dist/shared/lib/router/router'; -import { NextRouter } from 'next/router'; +import type { ParsedUrlQuery } from 'querystring'; +import type { BaseRouter } from 'next/dist/shared/lib/router/router'; +import type { NextRouter } from 'next/router'; export const parsedQueryToString = (query: ParsedUrlQuery): string => { const keys = Object.keys(query); diff --git a/packages/shared/src/lib/checklist.ts b/packages/shared/src/lib/checklist.ts index 9fa9b94a68..b05aa787ce 100644 --- a/packages/shared/src/lib/checklist.ts +++ b/packages/shared/src/lib/checklist.ts @@ -1,6 +1,8 @@ -import { ReactElement, ReactNode } from 'react'; -import { SourceMemberRole, Squad } from '../graphql/sources'; -import { Action, ActionType } from '../graphql/actions'; +import type { ReactElement, ReactNode } from 'react'; +import type { Squad } from '../graphql/sources'; +import { SourceMemberRole } from '../graphql/sources'; +import type { Action } from '../graphql/actions'; +import { ActionType } from '../graphql/actions'; import { generateStorageKey, StorageTopic } from './storage'; export enum ChecklistCardVariant { diff --git a/packages/shared/src/lib/classed.ts b/packages/shared/src/lib/classed.ts index b310f96c2b..8b1bbab842 100644 --- a/packages/shared/src/lib/classed.ts +++ b/packages/shared/src/lib/classed.ts @@ -1,11 +1,10 @@ -import React, { +import type { AnchorHTMLAttributes, ClassAttributes, Component, ComponentType, DetailsHTMLAttributes, ElementType, - forwardRef, ForwardRefExoticComponent, FunctionComponent, HTMLAttributes, @@ -18,6 +17,7 @@ import React, { SVGAttributes, TimeHTMLAttributes, } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; import { isNullOrUndefined } from './func'; diff --git a/packages/shared/src/lib/click.ts b/packages/shared/src/lib/click.ts index 044e03cd2d..0cc34b1266 100644 --- a/packages/shared/src/lib/click.ts +++ b/packages/shared/src/lib/click.ts @@ -1,5 +1,5 @@ -import React from 'react'; -import { Post } from '../graphql/posts'; +import type React from 'react'; +import type { Post } from '../graphql/posts'; export interface CombinedClicks { onAuxClick: React.MouseEventHandler; diff --git a/packages/shared/src/lib/constants.ts b/packages/shared/src/lib/constants.ts index 18093c63f3..0053c191c5 100644 --- a/packages/shared/src/lib/constants.ts +++ b/packages/shared/src/lib/constants.ts @@ -1,4 +1,4 @@ -import { RadioItemProps } from '../components/fields/RadioItem'; +import type { RadioItemProps } from '../components/fields/RadioItem'; declare const navigator: Navigator & { brave?: { isBrave: unknown } }; diff --git a/packages/shared/src/lib/dynamicParent.tsx b/packages/shared/src/lib/dynamicParent.tsx index ab94ab9644..e4439a892d 100644 --- a/packages/shared/src/lib/dynamicParent.tsx +++ b/packages/shared/src/lib/dynamicParent.tsx @@ -1,11 +1,12 @@ -import React, { +import type { ComponentClass, FunctionComponent, PropsWithChildren, ReactHTML, ReactNode, } from 'react'; -import { ReactElement } from 'react-markdown/lib/react-markdown'; +import React from 'react'; +import type { ReactElement } from 'react-markdown/lib/react-markdown'; type LoaderResult

= ComponentClass

| FunctionComponent

; diff --git a/packages/shared/src/lib/errors.ts b/packages/shared/src/lib/errors.ts index 1636f62cc8..548328882b 100644 --- a/packages/shared/src/lib/errors.ts +++ b/packages/shared/src/lib/errors.ts @@ -1,4 +1,4 @@ -import { ApiError } from '../graphql/common'; +import type { ApiError } from '../graphql/common'; export class HttpError extends Error { public url: string; diff --git a/packages/shared/src/lib/featureManagement.ts b/packages/shared/src/lib/featureManagement.ts index 06b4dd99fe..7f56bd6b8d 100644 --- a/packages/shared/src/lib/featureManagement.ts +++ b/packages/shared/src/lib/featureManagement.ts @@ -1,4 +1,4 @@ -import { JSONValue } from '@growthbook/growthbook'; +import type { JSONValue } from '@growthbook/growthbook'; import { cloudinaryOnboardingFullBackgroundDesktop, cloudinaryOnboardingFullBackgroundMobile, diff --git a/packages/shared/src/lib/feed.ts b/packages/shared/src/lib/feed.ts index 94e4c67a05..affae7e036 100644 --- a/packages/shared/src/lib/feed.ts +++ b/packages/shared/src/lib/feed.ts @@ -1,10 +1,11 @@ -import { FeedItem, PostItem } from '../hooks/useFeed'; -import { Ad, Post, ReadHistoryPost } from '../graphql/posts'; -import { LogEvent } from '../hooks/log/useLogQueue'; -import { PostBootData } from './boot'; +import type { FeedItem, PostItem } from '../hooks/useFeed'; +import type { Ad, Post, ReadHistoryPost } from '../graphql/posts'; +import type { LogEvent } from '../hooks/log/useLogQueue'; +import type { PostBootData } from './boot'; import { Origin } from './log'; import { SharedFeedPage } from '../components/utilities'; -import { AllFeedPages, OtherFeedPage } from './query'; +import type { AllFeedPages } from './query'; +import { OtherFeedPage } from './query'; export function optimisticPostUpdateInFeed( items: FeedItem[], diff --git a/packages/shared/src/lib/func.ts b/packages/shared/src/lib/func.ts index effc36b336..6f15467924 100644 --- a/packages/shared/src/lib/func.ts +++ b/packages/shared/src/lib/func.ts @@ -1,6 +1,6 @@ -import { MouseEvent } from 'react'; +import type { MouseEvent } from 'react'; import type ReactModal from 'react-modal'; -import { EmptyObjectLiteral } from './kratos'; +import type { EmptyObjectLiteral } from './kratos'; import { isTesting } from './constants'; export type EmptyFunction = () => void; diff --git a/packages/shared/src/lib/integrations.ts b/packages/shared/src/lib/integrations.ts index 4b91d1bb5f..4334a9b930 100644 --- a/packages/shared/src/lib/integrations.ts +++ b/packages/shared/src/lib/integrations.ts @@ -1,8 +1,8 @@ -import { FunctionComponent } from 'react'; -import { IconProps } from '../components/Icon'; +import type { FunctionComponent } from 'react'; +import type { IconProps } from '../components/Icon'; import { AppIcon, SlackIcon } from '../components/icons'; import { UserIntegrationType } from '../graphql/integrations'; -import { PromptOptions } from '../hooks/usePrompt'; +import type { PromptOptions } from '../hooks/usePrompt'; import { labels } from './labels'; import { ButtonColor } from '../components/buttons/Button'; diff --git a/packages/shared/src/lib/markdown.ts b/packages/shared/src/lib/markdown.ts index 2b4e46b655..333bd853c7 100644 --- a/packages/shared/src/lib/markdown.ts +++ b/packages/shared/src/lib/markdown.ts @@ -1,4 +1,5 @@ -import { CursorType, GetReplacementFn, isFalsyOrSpace } from './textarea'; +import type { GetReplacementFn } from './textarea'; +import { CursorType, isFalsyOrSpace } from './textarea'; const urlText = 'url'; const getUrlText = (content = '') => `[${content}](${urlText})`; diff --git a/packages/shared/src/lib/query.ts b/packages/shared/src/lib/query.ts index d1f2419f6c..4945f159f2 100644 --- a/packages/shared/src/lib/query.ts +++ b/packages/shared/src/lib/query.ts @@ -1,25 +1,25 @@ -import { +import type { InfiniteData, - MutationCache, QueryClient, QueryClientConfig, QueryKey, } from '@tanstack/react-query'; -import { ClientError } from 'graphql-request'; - -import { Connection, GARMR_ERROR } from '../graphql/common'; -import type { PageInfo } from '../graphql/common'; -import { EmptyObjectLiteral } from './kratos'; -import { LoggedUser } from './user'; -import { FeedData, Post, ReadHistoryPost } from '../graphql/posts'; +import { MutationCache } from '@tanstack/react-query'; +import type { ClientError } from 'graphql-request'; + +import { GARMR_ERROR } from '../graphql/common'; +import type { PageInfo, Connection } from '../graphql/common'; +import type { EmptyObjectLiteral } from './kratos'; +import type { LoggedUser } from './user'; +import type { FeedData, Post, ReadHistoryPost } from '../graphql/posts'; import type { ReadHistoryInfiniteData } from '../hooks/useInfiniteReadingHistory'; -import { SharedFeedPage } from '../components/utilities'; -import { +import type { SharedFeedPage } from '../components/utilities'; +import type { Comment as PostComment, Author as UserAuthor, - SortCommentsBy, } from '../graphql/comments'; -import { +import { SortCommentsBy } from '../graphql/comments'; +import type { ContentPreferenceStatus, ContentPreferenceType, } from '../graphql/contentPreference'; diff --git a/packages/shared/src/lib/share.spec.ts b/packages/shared/src/lib/share.spec.ts index 2655e7f7e1..6e3a2d2caf 100644 --- a/packages/shared/src/lib/share.spec.ts +++ b/packages/shared/src/lib/share.spec.ts @@ -1,10 +1,6 @@ import { ReferralCampaignKey } from './referral'; -import { - AddLinkShareLogQueryParams, - ShareProvider, - addLogQueryParams, - getShareLink, -} from './share'; +import type { AddLinkShareLogQueryParams } from './share'; +import { ShareProvider, addLogQueryParams, getShareLink } from './share'; describe('getShareLink tests', () => { const link = 'https://foo.bar'; diff --git a/packages/shared/src/lib/share.ts b/packages/shared/src/lib/share.ts index 53b45cc590..97e27af680 100644 --- a/packages/shared/src/lib/share.ts +++ b/packages/shared/src/lib/share.ts @@ -1,4 +1,4 @@ -import { ReferralCampaignKey } from './referral'; +import type { ReferralCampaignKey } from './referral'; export enum ShareProvider { Native = 'native', diff --git a/packages/shared/src/lib/socialMedia.ts b/packages/shared/src/lib/socialMedia.ts index 7b41d11ddd..48e99137d7 100644 --- a/packages/shared/src/lib/socialMedia.ts +++ b/packages/shared/src/lib/socialMedia.ts @@ -1,4 +1,4 @@ -import { type ComponentType } from 'react'; +import type { ComponentType } from 'react'; import { RedditIcon } from '../components/icons'; import { TwitterIcon } from '../components/icons/Twitter'; import type { IconProps } from '../components/Icon'; diff --git a/packages/shared/src/lib/textarea.ts b/packages/shared/src/lib/textarea.ts index 1ac98b2192..3f168a3a3d 100644 --- a/packages/shared/src/lib/textarea.ts +++ b/packages/shared/src/lib/textarea.ts @@ -1,4 +1,4 @@ -import { MutableRefObject } from 'react'; +import type { MutableRefObject } from 'react'; import { nextTick } from './func'; export const isFalsyOrSpace = (value: string): boolean => diff --git a/packages/shared/src/lib/user.ts b/packages/shared/src/lib/user.ts index ec31b5c25b..e400b6d1fe 100644 --- a/packages/shared/src/lib/user.ts +++ b/packages/shared/src/lib/user.ts @@ -1,7 +1,7 @@ import { apiUrl, graphqlUrl } from './config'; +import type { ProfileV2 } from '../graphql/users'; import { PROFILE_V2_EXTRA_QUERY, - ProfileV2, USER_BY_ID_STATIC_FIELDS_QUERY, } from '../graphql/users'; import type { Company } from './userCompany'; diff --git a/packages/shared/src/report.ts b/packages/shared/src/report.ts index c4dcd6b378..e9cb1c23ac 100644 --- a/packages/shared/src/report.ts +++ b/packages/shared/src/report.ts @@ -1,5 +1,5 @@ import { gql } from 'graphql-request'; -import { EmptyResponse } from './graphql/emptyResponse'; +import type { EmptyResponse } from './graphql/emptyResponse'; import { gqlClient } from './graphql/common'; export enum ReportEntity { diff --git a/packages/shared/src/svg/BetaBadge.tsx b/packages/shared/src/svg/BetaBadge.tsx index b075032205..8e172abd25 100644 --- a/packages/shared/src/svg/BetaBadge.tsx +++ b/packages/shared/src/svg/BetaBadge.tsx @@ -1,4 +1,5 @@ -import React, { HTMLAttributes, ReactElement } from 'react'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React from 'react'; export default function BetaBadge({ className, diff --git a/packages/shared/src/svg/ConfettiSvg.tsx b/packages/shared/src/svg/ConfettiSvg.tsx index 980a10ad25..bc7b615838 100644 --- a/packages/shared/src/svg/ConfettiSvg.tsx +++ b/packages/shared/src/svg/ConfettiSvg.tsx @@ -1,4 +1,5 @@ -import React, { HTMLAttributes, ReactElement } from 'react'; +import type { HTMLAttributes, ReactElement } from 'react'; +import React from 'react'; export default function ConfettiSvg( props: HTMLAttributes, diff --git a/packages/shared/src/svg/LogoIcon.tsx b/packages/shared/src/svg/LogoIcon.tsx index e655db1220..0d6ddc0c0e 100644 --- a/packages/shared/src/svg/LogoIcon.tsx +++ b/packages/shared/src/svg/LogoIcon.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; interface LogoIconProps { className?: { diff --git a/packages/shared/src/svg/LogoText.tsx b/packages/shared/src/svg/LogoText.tsx index 5134a2d584..670468422c 100644 --- a/packages/shared/src/svg/LogoText.tsx +++ b/packages/shared/src/svg/LogoText.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; interface LogoTextProps { isPlus?: boolean; diff --git a/packages/shared/src/svg/SquadReady.tsx b/packages/shared/src/svg/SquadReady.tsx index 763d2ef34e..0b5e7ac955 100644 --- a/packages/shared/src/svg/SquadReady.tsx +++ b/packages/shared/src/svg/SquadReady.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; export default function SquadsInviteMembersSvg( props: React.SVGProps, diff --git a/packages/shared/src/useDynamicHeader.ts b/packages/shared/src/useDynamicHeader.ts index cc1955792e..7237ad94c2 100644 --- a/packages/shared/src/useDynamicHeader.ts +++ b/packages/shared/src/useDynamicHeader.ts @@ -1,4 +1,5 @@ -import { Ref, useEffect, useRef, useState } from 'react'; +import type { Ref } from 'react'; +import { useEffect, useRef, useState } from 'react'; export type UseDynamicHeaderRet = { ref: Ref; diff --git a/packages/shared/tailwind.config.ts b/packages/shared/tailwind.config.ts index 1e9c93cb80..d8422c192c 100644 --- a/packages/shared/tailwind.config.ts +++ b/packages/shared/tailwind.config.ts @@ -1,4 +1,5 @@ -import type { Config } from 'tailwindcss'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { type Config } from 'tailwindcss'; import colors from './tailwind/colors'; import boxShadow from './tailwind/boxShadow'; import caret from './tailwind/caret'; diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json index eef3e18e4a..db9a698343 100644 --- a/packages/shared/tsconfig.json +++ b/packages/shared/tsconfig.json @@ -9,6 +9,7 @@ "allowJs": true, "skipLibCheck": true, "strict": false, + "verbatimModuleSyntax": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, diff --git a/packages/webapp/__mocks__/reactMarkdownMock.tsx b/packages/webapp/__mocks__/reactMarkdownMock.tsx index 58bcbffe1c..dedbd84a56 100644 --- a/packages/webapp/__mocks__/reactMarkdownMock.tsx +++ b/packages/webapp/__mocks__/reactMarkdownMock.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; const ReactMarkdown = ({ children, diff --git a/packages/webapp/__tests__/AccountNotificationsPage.tsx b/packages/webapp/__tests__/AccountNotificationsPage.tsx index d38458dd88..86a02d0a1c 100644 --- a/packages/webapp/__tests__/AccountNotificationsPage.tsx +++ b/packages/webapp/__tests__/AccountNotificationsPage.tsx @@ -1,25 +1,24 @@ import React from 'react'; import nock from 'nock'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import loggedUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; +import type { RenderResult } from '@testing-library/react'; import { act, fireEvent, render, - RenderResult, screen, waitFor, } from '@testing-library/react'; import { AuthContextProvider } from '@dailydotdev/shared/src/contexts/AuthContext'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; -import { BootApp, Visit } from '@dailydotdev/shared/src/lib/boot'; +import type { Visit } from '@dailydotdev/shared/src/lib/boot'; +import { BootApp } from '@dailydotdev/shared/src/lib/boot'; import { NotificationsContextProvider } from '@dailydotdev/shared/src/contexts/NotificationsContext'; -import { UpdateProfileParameters } from '@dailydotdev/shared/src/hooks/useProfileForm'; +import type { UpdateProfileParameters } from '@dailydotdev/shared/src/hooks/useProfileForm'; import { GET_PERSONALIZED_DIGEST_SETTINGS, SUBSCRIBE_PERSONALIZED_DIGEST_MUTATION, diff --git a/packages/webapp/__tests__/AccountProfilePage.tsx b/packages/webapp/__tests__/AccountProfilePage.tsx index 4e60b7bb75..dd5eb4c111 100644 --- a/packages/webapp/__tests__/AccountProfilePage.tsx +++ b/packages/webapp/__tests__/AccountProfilePage.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import loggedUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import { AuthContextProvider } from '@dailydotdev/shared/src/contexts/AuthContext'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import AccountProfilePage from '../pages/account/profile'; diff --git a/packages/webapp/__tests__/AccountSecurityPage.tsx b/packages/webapp/__tests__/AccountSecurityPage.tsx index 01810fdad3..5c7b559666 100644 --- a/packages/webapp/__tests__/AccountSecurityPage.tsx +++ b/packages/webapp/__tests__/AccountSecurityPage.tsx @@ -1,5 +1,5 @@ import React, { act } from 'react'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import loggedUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import { loginVerificationMockData, @@ -17,12 +17,8 @@ import { socialProviderRedirectMock, verifiedLoginData, } from '@dailydotdev/shared/__tests__/fixture/auth'; -import { - fireEvent, - render, - RenderResult, - screen, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen } from '@testing-library/react'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import { AuthContextProvider } from '@dailydotdev/shared/src/contexts/AuthContext'; import { getNodeValue } from '@dailydotdev/shared/src/lib/auth'; diff --git a/packages/webapp/__tests__/BookmarksPage.tsx b/packages/webapp/__tests__/BookmarksPage.tsx index a58aba3a39..fa90aaf417 100644 --- a/packages/webapp/__tests__/BookmarksPage.tsx +++ b/packages/webapp/__tests__/BookmarksPage.tsx @@ -1,28 +1,22 @@ -import { FeedData } from '@dailydotdev/shared/src/graphql/posts'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/posts'; import { BOOKMARKS_FEED_QUERY, supportedTypesForPrivateSources, } from '@dailydotdev/shared/src/graphql/feed'; import nock from 'nock'; import React, { act } from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; -import { NextRouter, useRouter } from 'next/router'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import { mocked } from 'ts-jest/utils'; import ad from '@dailydotdev/shared/__tests__/fixture/ad'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import defaultFeedPage from '@dailydotdev/shared/__tests__/fixture/feed'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import { TestBootProvider } from '@dailydotdev/shared/__tests__/helpers/boot'; import BookmarksPage from '../pages/bookmarks'; diff --git a/packages/webapp/__tests__/HistoryPage.spec.tsx b/packages/webapp/__tests__/HistoryPage.spec.tsx index 00f7b4581b..671c6d69f4 100644 --- a/packages/webapp/__tests__/HistoryPage.spec.tsx +++ b/packages/webapp/__tests__/HistoryPage.spec.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import nock from 'nock'; -import { ReadHistoryData } from '@dailydotdev/shared/src/hooks/useInfiniteReadingHistory'; +import type { ReadHistoryData } from '@dailydotdev/shared/src/hooks/useInfiniteReadingHistory'; import { READING_HISTORY_QUERY } from '@dailydotdev/shared/src/graphql/users'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import user from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import HistoryPage from '../pages/history'; diff --git a/packages/webapp/__tests__/KeywordPage.tsx b/packages/webapp/__tests__/KeywordPage.tsx index d4afb6bd93..d2849066bf 100644 --- a/packages/webapp/__tests__/KeywordPage.tsx +++ b/packages/webapp/__tests__/KeywordPage.tsx @@ -1,20 +1,21 @@ import React from 'react'; import nock from 'nock'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; -import { LoggedUser, Roles } from '@dailydotdev/shared/src/lib/user'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import { Roles } from '@dailydotdev/shared/src/lib/user'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; -import { +import type { Keyword, - KEYWORD_QUERY, KeywordData, } from '@dailydotdev/shared/src/graphql/keywords'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { KEYWORD_QUERY } from '@dailydotdev/shared/src/graphql/keywords'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import user from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import SettingsContext, { ThemeMode, diff --git a/packages/webapp/__tests__/MainLayout.tsx b/packages/webapp/__tests__/MainLayout.tsx index 31dcf48f78..d2f4b8406e 100644 --- a/packages/webapp/__tests__/MainLayout.tsx +++ b/packages/webapp/__tests__/MainLayout.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import { TestBootProvider } from '@dailydotdev/shared/__tests__/helpers/boot'; import * as hooks from '@dailydotdev/shared/src/hooks/useViewSize'; import MainLayout from '../components/layouts/MainLayout'; diff --git a/packages/webapp/__tests__/MostDiscussedPage.tsx b/packages/webapp/__tests__/MostDiscussedPage.tsx index cc120dcea2..75122db61e 100644 --- a/packages/webapp/__tests__/MostDiscussedPage.tsx +++ b/packages/webapp/__tests__/MostDiscussedPage.tsx @@ -1,24 +1,22 @@ -import { FeedData } from '@dailydotdev/shared/src/graphql/posts'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/posts'; import { MOST_DISCUSSED_FEED_QUERY } from '@dailydotdev/shared/src/graphql/feed'; import nock from 'nock'; import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import ad from '@dailydotdev/shared/__tests__/fixture/ad'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import defaultFeedPage from '@dailydotdev/shared/__tests__/fixture/feed'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { TestBootProvider } from '@dailydotdev/shared/__tests__/helpers/boot'; -import { - COMMENT_FEED_QUERY, - CommentFeedData, -} from '@dailydotdev/shared/src/graphql/comments'; +import type { CommentFeedData } from '@dailydotdev/shared/src/graphql/comments'; +import { COMMENT_FEED_QUERY } from '@dailydotdev/shared/src/graphql/comments'; import Discussed from '../pages/discussed'; import { defaultCommentsPage } from './ProfileRepliesPage'; diff --git a/packages/webapp/__tests__/MostUpvotedPage.tsx b/packages/webapp/__tests__/MostUpvotedPage.tsx index 9389f4d2cf..85bf5c5cc2 100644 --- a/packages/webapp/__tests__/MostUpvotedPage.tsx +++ b/packages/webapp/__tests__/MostUpvotedPage.tsx @@ -1,19 +1,19 @@ -import { FeedData } from '@dailydotdev/shared/src/graphql/posts'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/posts'; import { MOST_UPVOTED_FEED_QUERY } from '@dailydotdev/shared/src/graphql/feed'; import nock from 'nock'; import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import ad from '@dailydotdev/shared/__tests__/fixture/ad'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import defaultFeedPage from '@dailydotdev/shared/__tests__/fixture/feed'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { TestBootProvider } from '@dailydotdev/shared/__tests__/helpers/boot'; import Upvoted from '../pages/upvoted'; diff --git a/packages/webapp/__tests__/MyFeedPage.tsx b/packages/webapp/__tests__/MyFeedPage.tsx index d2941f2d47..5863de33eb 100644 --- a/packages/webapp/__tests__/MyFeedPage.tsx +++ b/packages/webapp/__tests__/MyFeedPage.tsx @@ -1,4 +1,4 @@ -import { FeedData } from '@dailydotdev/shared/src/graphql/posts'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/posts'; import { ANONYMOUS_FEED_QUERY, FEED_QUERY, @@ -6,20 +6,20 @@ import { } from '@dailydotdev/shared/src/graphql/feed'; import nock from 'nock'; import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import ad from '@dailydotdev/shared/__tests__/fixture/ad'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import defaultFeedPage from '@dailydotdev/shared/__tests__/fixture/feed'; -import { Alerts } from '@dailydotdev/shared/src/graphql/alerts'; +import type { Alerts } from '@dailydotdev/shared/src/graphql/alerts'; import { TestBootProvider } from '@dailydotdev/shared/__tests__/helpers/boot'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import MyFeed from '../pages/my-feed'; jest.mock('next/router', () => ({ diff --git a/packages/webapp/__tests__/NotificationsPage.tsx b/packages/webapp/__tests__/NotificationsPage.tsx index 7e200addc9..d7ccf30ac3 100644 --- a/packages/webapp/__tests__/NotificationsPage.tsx +++ b/packages/webapp/__tests__/NotificationsPage.tsx @@ -1,17 +1,17 @@ import React from 'react'; import nock from 'nock'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { +import type { Notification, NotificationsData, +} from '@dailydotdev/shared/src/graphql/notifications'; +import { NOTIFICATIONS_QUERY, READ_NOTIFICATIONS_MUTATION, } from '@dailydotdev/shared/src/graphql/notifications'; import loggedUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { render, screen } from '@testing-library/react'; import { NotificationsContextProvider } from '@dailydotdev/shared/src/contexts/NotificationsContext'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; @@ -22,7 +22,8 @@ import { } from '@dailydotdev/shared/src/components/notifications/utils'; import { BootApp } from '@dailydotdev/shared/src/lib/boot'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import NotificationsPage from '../pages/notifications'; jest.mock('next/router', () => ({ diff --git a/packages/webapp/__tests__/PendingKeywords.tsx b/packages/webapp/__tests__/PendingKeywords.tsx index b63156e77d..110edecb3b 100644 --- a/packages/webapp/__tests__/PendingKeywords.tsx +++ b/packages/webapp/__tests__/PendingKeywords.tsx @@ -1,21 +1,22 @@ import React from 'react'; import nock from 'nock'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; -import { LoggedUser, Roles } from '@dailydotdev/shared/src/lib/user'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import { Roles } from '@dailydotdev/shared/src/lib/user'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; -import { +import type { CountPendingKeywordsData, Keyword, KeywordData, - RANDOM_PENDING_KEYWORD_QUERY, } from '@dailydotdev/shared/src/graphql/keywords'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { RANDOM_PENDING_KEYWORD_QUERY } from '@dailydotdev/shared/src/graphql/keywords'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import user from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import PendingKeywords from '../pages/backoffice/pendingKeywords'; diff --git a/packages/webapp/__tests__/PopularPage.tsx b/packages/webapp/__tests__/PopularPage.tsx index dbd2eb5757..85340163ce 100644 --- a/packages/webapp/__tests__/PopularPage.tsx +++ b/packages/webapp/__tests__/PopularPage.tsx @@ -1,22 +1,22 @@ -import { FeedData } from '@dailydotdev/shared/src/graphql/posts'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/posts'; import { ANONYMOUS_FEED_QUERY, RankingAlgorithm, } from '@dailydotdev/shared/src/graphql/feed'; import nock from 'nock'; import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import ad from '@dailydotdev/shared/__tests__/fixture/ad'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import defaultFeedPage from '@dailydotdev/shared/__tests__/fixture/feed'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { TestBootProvider } from '@dailydotdev/shared/__tests__/helpers/boot'; import Popular from '../pages/popular'; diff --git a/packages/webapp/__tests__/PostPage.tsx b/packages/webapp/__tests__/PostPage.tsx index fb26be671f..2453025ddd 100644 --- a/packages/webapp/__tests__/PostPage.tsx +++ b/packages/webapp/__tests__/PostPage.tsx @@ -1,50 +1,48 @@ import React from 'react'; +import type { RenderResult } from '@testing-library/react'; import { act, fireEvent, queryByText, render, - RenderResult, screen, waitFor, } from '@testing-library/react'; +import type { Post, PostData } from '@dailydotdev/shared/src/graphql/posts'; import { ADD_BOOKMARKS_MUTATION, - Post, POST_BY_ID_QUERY, - PostData, PostType, REMOVE_BOOKMARK_MUTATION, UserVote, VIEW_POST_MUTATION, } from '@dailydotdev/shared/src/graphql/posts'; +import type { PostCommentsData } from '@dailydotdev/shared/src/graphql/comments'; +import { POST_COMMENTS_QUERY } from '@dailydotdev/shared/src/graphql/comments'; +import type { Action } from '@dailydotdev/shared/src/graphql/actions'; import { - POST_COMMENTS_QUERY, - PostCommentsData, -} from '@dailydotdev/shared/src/graphql/comments'; -import { - Action, ActionType, COMPLETE_ACTION_MUTATION, COMPLETED_USER_ACTIONS, } from '@dailydotdev/shared/src/graphql/actions'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import nock from 'nock'; import { QueryClient } from '@tanstack/react-query'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { completeActionMock, - MockedGraphQLResponse, mockGraphQL, } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { SourceType } from '@dailydotdev/shared/src/graphql/sources'; import { createTestSettings } from '@dailydotdev/shared/__tests__/fixture/settings'; +import type { AllTagCategoriesData } from '@dailydotdev/shared/src/graphql/feedSettings'; import { ADD_FILTERS_TO_FEED_MUTATION, - AllTagCategoriesData, FEED_SETTINGS_QUERY, REMOVE_FILTERS_FROM_FEED_MUTATION, } from '@dailydotdev/shared/src/graphql/feedSettings'; @@ -53,7 +51,8 @@ import * as hooks from '@dailydotdev/shared/src/hooks/useViewSize'; import { UserVoteEntity } from '@dailydotdev/shared/src/hooks'; import { VOTE_MUTATION } from '@dailydotdev/shared/src/graphql/users'; import LogContext from '@dailydotdev/shared/src/contexts/LogContext'; -import { PostPage, Props } from '../pages/posts/[id]'; +import type { Props } from '../pages/posts/[id]'; +import { PostPage } from '../pages/posts/[id]'; import { getSeoDescription } from '../components/PostSEOSchema'; import { getLayout as getMainLayout } from '../components/layouts/MainLayout'; diff --git a/packages/webapp/__tests__/ProfileIndexPage.tsx b/packages/webapp/__tests__/ProfileIndexPage.tsx index 8da43f6086..b17312757b 100644 --- a/packages/webapp/__tests__/ProfileIndexPage.tsx +++ b/packages/webapp/__tests__/ProfileIndexPage.tsx @@ -1,19 +1,18 @@ import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; -import { PublicProfile } from '@dailydotdev/shared/src/lib/user'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; +import type { PublicProfile } from '@dailydotdev/shared/src/lib/user'; import nock from 'nock'; -import { - USER_READING_HISTORY_QUERY, +import type { UserReadingRankHistory, MostReadTag, ProfileReadingData, } from '@dailydotdev/shared/src/graphql/users'; +import { USER_READING_HISTORY_QUERY } from '@dailydotdev/shared/src/graphql/users'; import { QueryClient } from '@tanstack/react-query'; import { startOfTomorrow, subDays, subYears } from 'date-fns'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import { TestBootProvider } from '@dailydotdev/shared/__tests__/helpers/boot'; import * as hooks from '@dailydotdev/shared/src/hooks/useViewSize'; diff --git a/packages/webapp/__tests__/ProfilePostsPage.tsx b/packages/webapp/__tests__/ProfilePostsPage.tsx index 0c99a39a85..533e5a8f0b 100644 --- a/packages/webapp/__tests__/ProfilePostsPage.tsx +++ b/packages/webapp/__tests__/ProfilePostsPage.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; -import { LoggedUser, PublicProfile } from '@dailydotdev/shared/src/lib/user'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; +import type { + LoggedUser, + PublicProfile, +} from '@dailydotdev/shared/src/lib/user'; import nock from 'nock'; -import { - AUTHOR_FEED_QUERY, - FeedData, -} from '@dailydotdev/shared/src/graphql/feed'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/feed'; +import { AUTHOR_FEED_QUERY } from '@dailydotdev/shared/src/graphql/feed'; import { QueryClient } from '@tanstack/react-query'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import { TestBootProvider } from '@dailydotdev/shared/__tests__/helpers/boot'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; diff --git a/packages/webapp/__tests__/ProfileRepliesPage.tsx b/packages/webapp/__tests__/ProfileRepliesPage.tsx index 6435c67edb..0bee95947b 100644 --- a/packages/webapp/__tests__/ProfileRepliesPage.tsx +++ b/packages/webapp/__tests__/ProfileRepliesPage.tsx @@ -1,23 +1,25 @@ import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; -import { LoggedUser, PublicProfile } from '@dailydotdev/shared/src/lib/user'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; +import type { + LoggedUser, + PublicProfile, +} from '@dailydotdev/shared/src/lib/user'; import nock from 'nock'; import { QueryClient } from '@tanstack/react-query'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import { TestBootProvider } from '@dailydotdev/shared/__tests__/helpers/boot'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import defaultPost from '@dailydotdev/shared/__tests__/fixture/post'; -import { Connection } from '@dailydotdev/shared/src/graphql/common'; -import { +import type { Connection } from '@dailydotdev/shared/src/graphql/common'; +import type { Comment, - USER_COMMENTS_QUERY, UserCommentsData, Author, } from '@dailydotdev/shared/src/graphql/comments'; +import { USER_COMMENTS_QUERY } from '@dailydotdev/shared/src/graphql/comments'; import ProfilePage from '../pages/[userId]/replies'; beforeEach(() => { diff --git a/packages/webapp/__tests__/ProfileUpvotedPage.tsx b/packages/webapp/__tests__/ProfileUpvotedPage.tsx index 7815590739..813f50fac7 100644 --- a/packages/webapp/__tests__/ProfileUpvotedPage.tsx +++ b/packages/webapp/__tests__/ProfileUpvotedPage.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; -import { LoggedUser, PublicProfile } from '@dailydotdev/shared/src/lib/user'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; +import type { + LoggedUser, + PublicProfile, +} from '@dailydotdev/shared/src/lib/user'; import nock from 'nock'; -import { - FeedData, - USER_UPVOTED_FEED_QUERY, -} from '@dailydotdev/shared/src/graphql/feed'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/feed'; +import { USER_UPVOTED_FEED_QUERY } from '@dailydotdev/shared/src/graphql/feed'; import { QueryClient } from '@tanstack/react-query'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import { TestBootProvider } from '@dailydotdev/shared/__tests__/helpers/boot'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; diff --git a/packages/webapp/__tests__/SearchPage.tsx b/packages/webapp/__tests__/SearchPage.tsx index 42eea30c20..2d15a39cf9 100644 --- a/packages/webapp/__tests__/SearchPage.tsx +++ b/packages/webapp/__tests__/SearchPage.tsx @@ -1,9 +1,11 @@ import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import { TestBootProvider } from '../../shared/__tests__/helpers/boot'; import SearchPageV1 from '../pages/search/chat'; import { getLayout } from '../components/layouts/MainLayout'; diff --git a/packages/webapp/__tests__/SearchResultsPage.tsx b/packages/webapp/__tests__/SearchResultsPage.tsx index 4ec637d3f6..8280a14836 100644 --- a/packages/webapp/__tests__/SearchResultsPage.tsx +++ b/packages/webapp/__tests__/SearchResultsPage.tsx @@ -1,9 +1,11 @@ import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import { mocked } from 'ts-jest/utils'; -import { NextRouter, useRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; +import { useRouter } from 'next/router'; import * as hooks from '@dailydotdev/shared/src/hooks/useViewSize'; import * as contexts from '@dailydotdev/shared/src/contexts/ActiveFeedNameContext'; import MainFeedLayout from '@dailydotdev/shared/src/components/MainFeedLayout'; diff --git a/packages/webapp/__tests__/SourcePage.tsx b/packages/webapp/__tests__/SourcePage.tsx index 2dba2b830d..4779b90e07 100644 --- a/packages/webapp/__tests__/SourcePage.tsx +++ b/packages/webapp/__tests__/SourcePage.tsx @@ -1,29 +1,31 @@ -import { FeedData, PostType } from '@dailydotdev/shared/src/graphql/posts'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/posts'; +import { PostType } from '@dailydotdev/shared/src/graphql/posts'; import { SOURCE_FEED_QUERY } from '@dailydotdev/shared/src/graphql/feed'; import nock from 'nock'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; -import { NextRouter } from 'next/router'; -import { Source, SourceType } from '@dailydotdev/shared/src/graphql/sources'; -import SettingsContext, { - SettingsContextData, -} from '@dailydotdev/shared/src/contexts/SettingsContext'; -import { - ADD_FILTERS_TO_FEED_MUTATION, +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { NextRouter } from 'next/router'; +import type { Source } from '@dailydotdev/shared/src/graphql/sources'; +import { SourceType } from '@dailydotdev/shared/src/graphql/sources'; +import type { SettingsContextData } from '@dailydotdev/shared/src/contexts/SettingsContext'; +import SettingsContext from '@dailydotdev/shared/src/contexts/SettingsContext'; +import type { AllTagCategoriesData, FeedSettings, +} from '@dailydotdev/shared/src/graphql/feedSettings'; +import { + ADD_FILTERS_TO_FEED_MUTATION, REMOVE_FILTERS_FROM_FEED_MUTATION, } from '@dailydotdev/shared/src/graphql/feedSettings'; import { getFeedSettingsQueryKey } from '@dailydotdev/shared/src/hooks/useFeedSettings'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import defaultFeedPage from '@dailydotdev/shared/__tests__/fixture/feed'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import ad from '@dailydotdev/shared/__tests__/fixture/ad'; import SourcePage from '../pages/sources/[source]'; diff --git a/packages/webapp/__tests__/SquadFeedPage.tsx b/packages/webapp/__tests__/SquadFeedPage.tsx index e11f228201..bc26ee7935 100644 --- a/packages/webapp/__tests__/SquadFeedPage.tsx +++ b/packages/webapp/__tests__/SquadFeedPage.tsx @@ -1,28 +1,23 @@ -import { FeedData } from '@dailydotdev/shared/src/graphql/posts'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/posts'; import { SOURCE_FEED_QUERY, supportedTypesForPrivateSources, } from '@dailydotdev/shared/src/graphql/feed'; import nock from 'nock'; import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; -import { NextRouter } from 'next/router'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { NextRouter } from 'next/router'; import ad from '@dailydotdev/shared/__tests__/fixture/ad'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import defaultFeedPage from '@dailydotdev/shared/__tests__/fixture/feed'; -import { +import type { GraphQLResult, MockedGraphQLResponse, - mockGraphQL, } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import { generateBasicMembersResult, @@ -32,18 +27,20 @@ import { generateNotFoundSquadResult, generateTestSquad, } from '@dailydotdev/shared/__tests__/fixture/squads'; +import type { + BasicSourceMembersData, + SquadData, + SquadEdgesData, +} from '@dailydotdev/shared/src/graphql/squads'; import { BASIC_SQUAD_MEMBERS_QUERY, - BasicSourceMembersData, SQUAD_MEMBERS_QUERY, SQUAD_QUERY, - SquadData, - SquadEdgesData, } from '@dailydotdev/shared/src/graphql/squads'; +import type { Squad } from '@dailydotdev/shared/src/graphql/sources'; import { SourceMemberRole, SourcePermissions, - Squad, } from '@dailydotdev/shared/src/graphql/sources'; import { BootApp } from '@dailydotdev/shared/src/lib/boot'; import { diff --git a/packages/webapp/__tests__/SquadTokenPage.tsx b/packages/webapp/__tests__/SquadTokenPage.tsx index 7c8594e64f..b44f7a4265 100644 --- a/packages/webapp/__tests__/SquadTokenPage.tsx +++ b/packages/webapp/__tests__/SquadTokenPage.tsx @@ -1,39 +1,30 @@ import nock from 'nock'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import React from 'react'; -import { - fireEvent, - render, - RenderResult, - screen, - waitFor, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { defaultTestSettings } from '@dailydotdev/shared/__tests__/fixture/settings'; -import { NextRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; import SettingsContext from '@dailydotdev/shared/src/contexts/SettingsContext'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import { defaultSquadToken, generateTestMember, generateTestAdmin, } from '@dailydotdev/shared/__tests__/fixture/squads'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import { webappUrl } from '@dailydotdev/shared/src/lib/constants'; +import type { SquadInvitation } from '@dailydotdev/shared/src/graphql/squads'; import { SQUAD_INVITATION_QUERY, SQUAD_JOIN_MUTATION, - SquadInvitation, } from '@dailydotdev/shared/src/graphql/squads'; -import { - SourceMember, - SourceMemberRole, -} from '@dailydotdev/shared/src/graphql/sources'; +import type { SourceMember } from '@dailydotdev/shared/src/graphql/sources'; +import { SourceMemberRole } from '@dailydotdev/shared/src/graphql/sources'; import { BOOT_QUERY_KEY } from '@dailydotdev/shared/src/contexts/common'; import Toast from '@dailydotdev/shared/src/components/notifications/Toast'; import { labels } from '@dailydotdev/shared/src/lib'; @@ -41,9 +32,8 @@ import { ActionType, COMPLETE_ACTION_MUTATION, } from '@dailydotdev/shared/src/graphql/actions'; -import SquadPage, { - SquadReferralProps, -} from '../pages/squads/[handle]/[token]'; +import type { SquadReferralProps } from '../pages/squads/[handle]/[token]'; +import SquadPage from '../pages/squads/[handle]/[token]'; const showLogin = jest.fn(); let replaced = ''; diff --git a/packages/webapp/__tests__/TagPage.tsx b/packages/webapp/__tests__/TagPage.tsx index 42088540bf..4e5915b00f 100644 --- a/packages/webapp/__tests__/TagPage.tsx +++ b/packages/webapp/__tests__/TagPage.tsx @@ -1,32 +1,32 @@ -import { FeedData } from '@dailydotdev/shared/src/graphql/posts'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/posts'; import { TAG_FEED_QUERY } from '@dailydotdev/shared/src/graphql/feed'; import nock from 'nock'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import React from 'react'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; -import { NextRouter } from 'next/router'; -import { - ADD_FILTERS_TO_FEED_MUTATION, +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { NextRouter } from 'next/router'; +import type { AllTagCategoriesData, FeedSettings, +} from '@dailydotdev/shared/src/graphql/feedSettings'; +import { + ADD_FILTERS_TO_FEED_MUTATION, REMOVE_FILTERS_FROM_FEED_MUTATION, } from '@dailydotdev/shared/src/graphql/feedSettings'; import { getFeedSettingsQueryKey } from '@dailydotdev/shared/src/hooks/useFeedSettings'; -import SettingsContext, { - SettingsContextData, -} from '@dailydotdev/shared/src/contexts/SettingsContext'; +import type { SettingsContextData } from '@dailydotdev/shared/src/contexts/SettingsContext'; +import SettingsContext from '@dailydotdev/shared/src/contexts/SettingsContext'; import ad from '@dailydotdev/shared/__tests__/fixture/ad'; import defaultUser from '@dailydotdev/shared/__tests__/fixture/loggedUser'; import defaultFeedPage from '@dailydotdev/shared/__tests__/fixture/feed'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import { waitForNock } from '@dailydotdev/shared/__tests__/helpers/utilities'; import { AlertContextProvider } from '@dailydotdev/shared/src/contexts/AlertContext'; -import { Keyword } from '@dailydotdev/shared/src/graphql/keywords'; +import type { Keyword } from '@dailydotdev/shared/src/graphql/keywords'; import TagPage from '../pages/tags/[tag]'; import { FEED_SETTINGS_QUERY } from '../../shared/src/graphql/feedSettings'; diff --git a/packages/webapp/__tests__/setup.ts b/packages/webapp/__tests__/setup.ts index 1091dfc00a..6074bf1fab 100644 --- a/packages/webapp/__tests__/setup.ts +++ b/packages/webapp/__tests__/setup.ts @@ -1,7 +1,7 @@ import '@testing-library/jest-dom'; import 'fake-indexeddb/auto'; import nodeFetch from 'node-fetch'; -import { NextRouter } from 'next/router'; +import type { NextRouter } from 'next/router'; import { structuredCloneJsonPolyfill } from '@dailydotdev/shared/src/lib/structuredClone'; process.env.NEXT_PUBLIC_API_URL = 'http://localhost:3000'; diff --git a/packages/webapp/components/CookieBanner.tsx b/packages/webapp/components/CookieBanner.tsx index 85cdb5fc06..063d71ade5 100644 --- a/packages/webapp/components/CookieBanner.tsx +++ b/packages/webapp/components/CookieBanner.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { cookiePolicy } from '@dailydotdev/shared/src/lib/constants'; import { CookieIcon } from '@dailydotdev/shared/src/components/icons'; import { diff --git a/packages/webapp/components/KeywordManagement.spec.tsx b/packages/webapp/components/KeywordManagement.spec.tsx index 4d3998ebce..7daa81fbc0 100644 --- a/packages/webapp/components/KeywordManagement.spec.tsx +++ b/packages/webapp/components/KeywordManagement.spec.tsx @@ -1,22 +1,19 @@ import React from 'react'; import nock from 'nock'; -import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import type { Keyword } from '@dailydotdev/shared/src/graphql/keywords'; import { ALLOW_KEYWORD_MUTATION, DENY_KEYWORD_MUTATION, - Keyword, } from '@dailydotdev/shared/src/graphql/keywords'; -import { - FeedData, - KEYWORD_FEED_QUERY, -} from '@dailydotdev/shared/src/graphql/feed'; -import { Post } from '@dailydotdev/shared/src/graphql/posts'; -import { Connection } from '@dailydotdev/shared/src/graphql/common'; -import { - MockedGraphQLResponse, - mockGraphQL, -} from '@dailydotdev/shared/__tests__/helpers/graphql'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/feed'; +import { KEYWORD_FEED_QUERY } from '@dailydotdev/shared/src/graphql/feed'; +import type { Post } from '@dailydotdev/shared/src/graphql/posts'; +import type { Connection } from '@dailydotdev/shared/src/graphql/common'; +import type { MockedGraphQLResponse } from '@dailydotdev/shared/__tests__/helpers/graphql'; +import { mockGraphQL } from '@dailydotdev/shared/__tests__/helpers/graphql'; import KeywordManagement from './KeywordManagement'; const onOperationCompleted = jest.fn(); diff --git a/packages/webapp/components/KeywordManagement.tsx b/packages/webapp/components/KeywordManagement.tsx index 8d84592e69..f6afeecee6 100644 --- a/packages/webapp/components/KeywordManagement.tsx +++ b/packages/webapp/components/KeywordManagement.tsx @@ -1,14 +1,13 @@ -import React, { ReactElement, useContext, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useState } from 'react'; +import type { Keyword } from '@dailydotdev/shared/src/graphql/keywords'; import { ALLOW_KEYWORD_MUTATION, DENY_KEYWORD_MUTATION, - Keyword, } from '@dailydotdev/shared/src/graphql/keywords'; import { useInfiniteQuery, useMutation } from '@tanstack/react-query'; -import { - FeedData, - KEYWORD_FEED_QUERY, -} from '@dailydotdev/shared/src/graphql/feed'; +import type { FeedData } from '@dailydotdev/shared/src/graphql/feed'; +import { KEYWORD_FEED_QUERY } from '@dailydotdev/shared/src/graphql/feed'; import { NextSeo } from 'next-seo'; import ActivitySection from '@dailydotdev/shared/src/components/profile/ActivitySection'; import { smallPostImage } from '@dailydotdev/shared/src/lib/image'; @@ -24,8 +23,8 @@ import ProgressiveEnhancementContext from '@dailydotdev/shared/src/contexts/Prog import classNames from 'classnames'; import { gqlClient } from '@dailydotdev/shared/src/graphql/common'; import Link from '@dailydotdev/shared/src/components/utilities/Link'; -import { Post } from '@dailydotdev/shared/src/graphql/posts'; -import { GraphQLError } from 'graphql/error'; +import type { Post } from '@dailydotdev/shared/src/graphql/posts'; +import type { GraphQLError } from 'graphql/error'; import { getNextPageParam } from '@dailydotdev/shared/src/lib/query'; import styles from './KeywordManagement.module.css'; diff --git a/packages/webapp/components/PostSEOSchema.tsx b/packages/webapp/components/PostSEOSchema.tsx index 5c61b56fe9..0c89ab080c 100644 --- a/packages/webapp/components/PostSEOSchema.tsx +++ b/packages/webapp/components/PostSEOSchema.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement } from 'react'; -import { Post, PostType } from '@dailydotdev/shared/src/graphql/posts'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { Post } from '@dailydotdev/shared/src/graphql/posts'; +import { PostType } from '@dailydotdev/shared/src/graphql/posts'; export const getSeoDescription = (post: Post): string => { if (post?.summary) { diff --git a/packages/webapp/components/ProtectedPage.tsx b/packages/webapp/components/ProtectedPage.tsx index bf9ae55dd4..e7b3b27797 100644 --- a/packages/webapp/components/ProtectedPage.tsx +++ b/packages/webapp/components/ProtectedPage.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode, useContext, useEffect } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useEffect } from 'react'; import { useRouter } from 'next/router'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; diff --git a/packages/webapp/components/RouterPostsSearch.tsx b/packages/webapp/components/RouterPostsSearch.tsx index f292d8e030..bc5c50705d 100644 --- a/packages/webapp/components/RouterPostsSearch.tsx +++ b/packages/webapp/components/RouterPostsSearch.tsx @@ -1,7 +1,7 @@ -import React, { ReactElement } from 'react'; -import PostsSearch, { - PostsSearchProps, -} from '@dailydotdev/shared/src/components/PostsSearch'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { PostsSearchProps } from '@dailydotdev/shared/src/components/PostsSearch'; +import PostsSearch from '@dailydotdev/shared/src/components/PostsSearch'; import { useRouter } from 'next/router'; import { useLogContext } from '@dailydotdev/shared/src/contexts/LogContext'; import { LogEvent } from '@dailydotdev/shared/src/lib/log'; diff --git a/packages/webapp/components/common.ts b/packages/webapp/components/common.ts index b943c5e987..503378a05a 100644 --- a/packages/webapp/components/common.ts +++ b/packages/webapp/components/common.ts @@ -1,4 +1,4 @@ -import { NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; export interface DynamicSeoProps { seo?: NextSeoProps; diff --git a/packages/webapp/components/footer/FooterNavBarItem.tsx b/packages/webapp/components/footer/FooterNavBarItem.tsx index 9725451757..04fd8414d4 100644 --- a/packages/webapp/components/footer/FooterNavBarItem.tsx +++ b/packages/webapp/components/footer/FooterNavBarItem.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { ActiveTabIndicator } from '@dailydotdev/shared/src/components/utilities'; import { Flipped } from 'react-flip-toolkit'; import classNames from 'classnames'; diff --git a/packages/webapp/components/footer/FooterNavBarTabs.tsx b/packages/webapp/components/footer/FooterNavBarTabs.tsx index 1c1563abf6..e6b795bc9e 100644 --- a/packages/webapp/components/footer/FooterNavBarTabs.tsx +++ b/packages/webapp/components/footer/FooterNavBarTabs.tsx @@ -1,9 +1,12 @@ -import React, { isValidElement, ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React, { isValidElement } from 'react'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import classNames from 'classnames'; import Link from '@dailydotdev/shared/src/components/utilities/Link'; -import { FooterNavBarContainerProps, FooterTab, getNavPath } from './common'; -import { FooterNavBarItem, FooterNavBarItemProps } from './FooterNavBarItem'; +import type { FooterNavBarContainerProps, FooterTab } from './common'; +import { getNavPath } from './common'; +import type { FooterNavBarItemProps } from './FooterNavBarItem'; +import { FooterNavBarItem } from './FooterNavBarItem'; interface TabProps extends Pick { tab: FooterTab; diff --git a/packages/webapp/components/footer/FooterPlusButton.tsx b/packages/webapp/components/footer/FooterPlusButton.tsx index aef71900d1..dd552331ec 100644 --- a/packages/webapp/components/footer/FooterPlusButton.tsx +++ b/packages/webapp/components/footer/FooterPlusButton.tsx @@ -1,9 +1,13 @@ -import React, { ReactElement, useRef, useState } from 'react'; -import { Drawer, DrawerRef } from '@dailydotdev/shared/src/components/drawers'; -import { +import type { ReactElement } from 'react'; +import React, { useRef, useState } from 'react'; +import type { DrawerRef } from '@dailydotdev/shared/src/components/drawers'; +import { Drawer } from '@dailydotdev/shared/src/components/drawers'; +import type { AllowedTags, - Button, ButtonProps, +} from '@dailydotdev/shared/src/components/buttons/Button'; +import { + Button, ButtonSize, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; diff --git a/packages/webapp/components/footer/FooterWrapper.tsx b/packages/webapp/components/footer/FooterWrapper.tsx index fd66b084b4..5af5ee6518 100644 --- a/packages/webapp/components/footer/FooterWrapper.tsx +++ b/packages/webapp/components/footer/FooterWrapper.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; -import { Post } from '@dailydotdev/shared/src/graphql/posts'; +import type { Post } from '@dailydotdev/shared/src/graphql/posts'; import dynamic from 'next/dynamic'; import { blurClasses } from './common'; diff --git a/packages/webapp/components/footer/MobileFooterNavbar.tsx b/packages/webapp/components/footer/MobileFooterNavbar.tsx index 6612d6e8c1..a3f88deaf1 100644 --- a/packages/webapp/components/footer/MobileFooterNavbar.tsx +++ b/packages/webapp/components/footer/MobileFooterNavbar.tsx @@ -1,10 +1,5 @@ -import React, { - isValidElement, - ReactElement, - ReactNode, - useContext, - useMemo, -} from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { isValidElement, useContext, useMemo } from 'react'; import classNames from 'classnames'; import { Flipper } from 'react-flip-toolkit'; import { @@ -14,9 +9,8 @@ import { SourceIcon, } from '@dailydotdev/shared/src/components/icons'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; -import useActiveNav, { - UseActiveNav, -} from '@dailydotdev/shared/src/hooks/useActiveNav'; +import type { UseActiveNav } from '@dailydotdev/shared/src/hooks/useActiveNav'; +import useActiveNav from '@dailydotdev/shared/src/hooks/useActiveNav'; import { squadCategoriesPaths } from '@dailydotdev/shared/src/lib/constants'; import { useRouter } from 'next/router'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; @@ -24,7 +18,8 @@ import { getFeedName } from '@dailydotdev/shared/src/lib/feed'; import { useNotificationContext } from '@dailydotdev/shared/src/contexts/NotificationsContext'; import { Bubble } from '@dailydotdev/shared/src/components/tooltips/utils'; import { getUnreadText } from '@dailydotdev/shared/src/components/notifications/utils'; -import { blurClasses, FooterTab } from './common'; +import type { FooterTab } from './common'; +import { blurClasses } from './common'; import { FooterPlusButton } from './FooterPlusButton'; import { FooterNavBarTabs } from './FooterNavBarTabs'; diff --git a/packages/webapp/components/footer/common.ts b/packages/webapp/components/footer/common.ts index 03bf74d193..559fc30ff7 100644 --- a/packages/webapp/components/footer/common.ts +++ b/packages/webapp/components/footer/common.ts @@ -1,5 +1,5 @@ -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; -import { ReactElement, ReactNode } from 'react'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { ReactElement, ReactNode } from 'react'; export interface FooterTab { path?: string | ((user: LoggedUser) => string); diff --git a/packages/webapp/components/history/reading.tsx b/packages/webapp/components/history/reading.tsx index 0f58016112..cf0ac79fba 100644 --- a/packages/webapp/components/history/reading.tsx +++ b/packages/webapp/components/history/reading.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext, useMemo } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; import { useRouter } from 'next/router'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { diff --git a/packages/webapp/components/invite/AISearchInvite.tsx b/packages/webapp/components/invite/AISearchInvite.tsx index 4020224d99..80bb8ca155 100644 --- a/packages/webapp/components/invite/AISearchInvite.tsx +++ b/packages/webapp/components/invite/AISearchInvite.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; import { Button, ButtonVariant, @@ -17,15 +18,14 @@ import { cloudinaryReferralCampaignSearchBgPopupMobile, cloudinaryReferralCampaignSearchBgMobile, } from '@dailydotdev/shared/src/lib/image'; -import { - ApiErrorResult, - DEFAULT_ERROR, -} from '@dailydotdev/shared/src/graphql/common'; +import type { ApiErrorResult } from '@dailydotdev/shared/src/graphql/common'; +import { DEFAULT_ERROR } from '@dailydotdev/shared/src/graphql/common'; import { useToastNotification } from '@dailydotdev/shared/src/hooks/useToastNotification'; import { useLogContext } from '@dailydotdev/shared/src/contexts/LogContext'; import { LogEvent } from '@dailydotdev/shared/src/lib/log'; import { ReferralCampaignKey } from '@dailydotdev/shared/src/hooks'; -import { DailyDevLogo, JoinPageProps } from './common'; +import type { JoinPageProps } from './common'; +import { DailyDevLogo } from './common'; export function AISearchInvite({ referringUser, diff --git a/packages/webapp/components/invite/Referral.tsx b/packages/webapp/components/invite/Referral.tsx index c9ec784b78..8e4b19ba55 100644 --- a/packages/webapp/components/invite/Referral.tsx +++ b/packages/webapp/components/invite/Referral.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; import { Button, ButtonSize, @@ -23,7 +24,8 @@ import { useLazyModal } from '@dailydotdev/shared/src/hooks/useLazyModal'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import router from 'next/router'; import { ProfileImageSize } from '@dailydotdev/shared/src/components/ProfilePicture'; -import { DailyDevLogo, JoinPageProps } from './common'; +import type { JoinPageProps } from './common'; +import { DailyDevLogo } from './common'; export function Referral({ referringUser, diff --git a/packages/webapp/components/invite/common.tsx b/packages/webapp/components/invite/common.tsx index 658c08b839..f41fb0761b 100644 --- a/packages/webapp/components/invite/common.tsx +++ b/packages/webapp/components/invite/common.tsx @@ -1,7 +1,8 @@ -import { ReferralCampaignKey } from '@dailydotdev/shared/src/hooks'; -import { Author } from '@dailydotdev/shared/src/graphql/comments'; +import type { ReferralCampaignKey } from '@dailydotdev/shared/src/hooks'; +import type { Author } from '@dailydotdev/shared/src/graphql/comments'; import Logo, { LogoPosition } from '@dailydotdev/shared/src/components/Logo'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; export interface JoinPageProps { token?: string; diff --git a/packages/webapp/components/layouts/AccountLayout/AccountContentSection.tsx b/packages/webapp/components/layouts/AccountLayout/AccountContentSection.tsx index ee0db3a57b..258159c78a 100644 --- a/packages/webapp/components/layouts/AccountLayout/AccountContentSection.tsx +++ b/packages/webapp/components/layouts/AccountLayout/AccountContentSection.tsx @@ -1,5 +1,6 @@ import classed from '@dailydotdev/shared/src/lib/classed'; -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; interface ClassName { container?: string; diff --git a/packages/webapp/components/layouts/AccountLayout/AccountPageContainer.tsx b/packages/webapp/components/layouts/AccountLayout/AccountPageContainer.tsx index 32b047e531..8f8f2fa87b 100644 --- a/packages/webapp/components/layouts/AccountLayout/AccountPageContainer.tsx +++ b/packages/webapp/components/layouts/AccountLayout/AccountPageContainer.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import { Button, diff --git a/packages/webapp/components/layouts/AccountLayout/EmailForm.tsx b/packages/webapp/components/layouts/AccountLayout/EmailForm.tsx index c6c769dd3e..4f44268af8 100644 --- a/packages/webapp/components/layouts/AccountLayout/EmailForm.tsx +++ b/packages/webapp/components/layouts/AccountLayout/EmailForm.tsx @@ -2,22 +2,13 @@ import { Button, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; -import { - PasswordField, - PasswordFieldProps, -} from '@dailydotdev/shared/src/components/fields/PasswordField'; -import { - TextField, - TextFieldProps, -} from '@dailydotdev/shared/src/components/fields/TextField'; +import type { PasswordFieldProps } from '@dailydotdev/shared/src/components/fields/PasswordField'; +import { PasswordField } from '@dailydotdev/shared/src/components/fields/PasswordField'; +import type { TextFieldProps } from '@dailydotdev/shared/src/components/fields/TextField'; +import { TextField } from '@dailydotdev/shared/src/components/fields/TextField'; import classNames from 'classnames'; -import React, { - Dispatch, - ReactElement, - SetStateAction, - useContext, - useState, -} from 'react'; +import type { Dispatch, ReactElement, SetStateAction } from 'react'; +import React, { useContext, useState } from 'react'; import useAccountEmailFlow from '@dailydotdev/shared/src/hooks/useAccountEmailFlow'; import { AuthFlow } from '@dailydotdev/shared/src/lib/kratos'; import useTimer from '@dailydotdev/shared/src/hooks/useTimer'; diff --git a/packages/webapp/components/layouts/AccountLayout/EmailSentSection.tsx b/packages/webapp/components/layouts/AccountLayout/EmailSentSection.tsx index 664f47d249..ac169e5227 100644 --- a/packages/webapp/components/layouts/AccountLayout/EmailSentSection.tsx +++ b/packages/webapp/components/layouts/AccountLayout/EmailSentSection.tsx @@ -4,7 +4,8 @@ import { ButtonSize, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import classNames from 'classnames'; import useAccountEmailFlow from '@dailydotdev/shared/src/hooks/useAccountEmailFlow'; import { AuthFlow } from '@dailydotdev/shared/src/lib/kratos'; diff --git a/packages/webapp/components/layouts/AccountLayout/Profile/VerifiedCompanyBadge/VerifiedCompanyBadgeSection.tsx b/packages/webapp/components/layouts/AccountLayout/Profile/VerifiedCompanyBadge/VerifiedCompanyBadgeSection.tsx index 9b110d9a6d..5d44350f50 100644 --- a/packages/webapp/components/layouts/AccountLayout/Profile/VerifiedCompanyBadge/VerifiedCompanyBadgeSection.tsx +++ b/packages/webapp/components/layouts/AccountLayout/Profile/VerifiedCompanyBadge/VerifiedCompanyBadgeSection.tsx @@ -19,16 +19,17 @@ import Alert, { AlertParagraph, AlertType, } from '@dailydotdev/shared/src/components/widgets/Alert'; -import React, { ReactElement, useContext, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useState } from 'react'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { gqlClient } from '@dailydotdev/shared/src/graphql/common'; import { ADD_USER_COMPANY_MUTATION, REMOVE_USER_COMPANY_MUTATION, } from '@dailydotdev/shared/src/graphql/users'; -import { ClientError } from 'graphql-request'; +import type { ClientError } from 'graphql-request'; import { labels } from '@dailydotdev/shared/src/lib'; -import { UserCompany } from '@dailydotdev/shared/src/lib/userCompany'; +import type { UserCompany } from '@dailydotdev/shared/src/lib/userCompany'; import { generateQueryKey, RequestKey, diff --git a/packages/webapp/components/layouts/AccountLayout/Profile/VerifyWorkEmail.tsx b/packages/webapp/components/layouts/AccountLayout/Profile/VerifyWorkEmail.tsx index 3364a2e3eb..c5cc4a5fef 100644 --- a/packages/webapp/components/layouts/AccountLayout/Profile/VerifyWorkEmail.tsx +++ b/packages/webapp/components/layouts/AccountLayout/Profile/VerifyWorkEmail.tsx @@ -5,7 +5,8 @@ import { Button, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; -import React, { ReactElement, useContext, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import useTimer from '@dailydotdev/shared/src/hooks/useTimer'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { gqlClient } from '@dailydotdev/shared/src/graphql/common'; @@ -13,7 +14,7 @@ import { ADD_USER_COMPANY_MUTATION, VERIFY_USER_COMPANY_CODE_MUTATION, } from '@dailydotdev/shared/src/graphql/users'; -import { UserCompany } from '@dailydotdev/shared/src/lib/userCompany'; +import type { UserCompany } from '@dailydotdev/shared/src/lib/userCompany'; import { generateQueryKey, RequestKey, diff --git a/packages/webapp/components/layouts/AccountLayout/Profile/index.tsx b/packages/webapp/components/layouts/AccountLayout/Profile/index.tsx index 4cce838091..fe7b07c03c 100644 --- a/packages/webapp/components/layouts/AccountLayout/Profile/index.tsx +++ b/packages/webapp/components/layouts/AccountLayout/Profile/index.tsx @@ -3,13 +3,8 @@ import { ButtonColor, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; -import React, { - ReactElement, - useCallback, - useContext, - useRef, - useState, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useContext, useRef, useState } from 'react'; import { AtIcon, CameraIcon, @@ -37,17 +32,14 @@ import { useViewSize, ViewSize, } from '@dailydotdev/shared/src/hooks'; -import useProfileForm, { - UpdateProfileParameters, -} from '@dailydotdev/shared/src/hooks/useProfileForm'; +import type { UpdateProfileParameters } from '@dailydotdev/shared/src/hooks/useProfileForm'; +import useProfileForm from '@dailydotdev/shared/src/hooks/useProfileForm'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { formToJson } from '@dailydotdev/shared/src/lib/form'; import { useMutation } from '@tanstack/react-query'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; -import { - gqlClient, - ResponseError, -} from '@dailydotdev/shared/src/graphql/common'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { ResponseError } from '@dailydotdev/shared/src/graphql/common'; +import { gqlClient } from '@dailydotdev/shared/src/graphql/common'; import { clearImage, UPLOAD_COVER_MUTATION, diff --git a/packages/webapp/components/layouts/AccountLayout/Security/AccountLoginSection.tsx b/packages/webapp/components/layouts/AccountLayout/Security/AccountLoginSection.tsx index a9c4de164d..4c7a3cfdbd 100644 --- a/packages/webapp/components/layouts/AccountLayout/Security/AccountLoginSection.tsx +++ b/packages/webapp/components/layouts/AccountLayout/Security/AccountLoginSection.tsx @@ -1,12 +1,13 @@ -import { Provider } from '@dailydotdev/shared/src/components/auth/common'; +import type { Provider } from '@dailydotdev/shared/src/components/auth/common'; import { Button, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import classNames from 'classnames'; import AccountContentSection from '../AccountContentSection'; -import { +import type { ManageSocialProviderTypes, ManageSocialProvidersProps, } from '../common'; diff --git a/packages/webapp/components/layouts/AccountLayout/Security/EmailFormPage.tsx b/packages/webapp/components/layouts/AccountLayout/Security/EmailFormPage.tsx index 143f4d869e..016aa6da2a 100644 --- a/packages/webapp/components/layouts/AccountLayout/Security/EmailFormPage.tsx +++ b/packages/webapp/components/layouts/AccountLayout/Security/EmailFormPage.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { AccountPageContainer } from '../AccountPageContainer'; import { AccountSecurityDisplay as Display } from '../common'; -import EmailForm, { EmailFormProps } from '../EmailForm'; +import type { EmailFormProps } from '../EmailForm'; +import EmailForm from '../EmailForm'; interface EmailFormPageProps extends EmailFormProps { onSwitchDisplay: (display: Display) => void; diff --git a/packages/webapp/components/layouts/AccountLayout/Security/index.tsx b/packages/webapp/components/layouts/AccountLayout/Security/index.tsx index 42267372d8..fdc1a2312c 100644 --- a/packages/webapp/components/layouts/AccountLayout/Security/index.tsx +++ b/packages/webapp/components/layouts/AccountLayout/Security/index.tsx @@ -8,39 +8,31 @@ import { import { LockIcon, MailIcon } from '@dailydotdev/shared/src/components/icons'; import AccountDangerZone from '@dailydotdev/shared/src/components/profile/AccountDangerZone'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; -import React, { - FormEvent, - MutableRefObject, - ReactElement, - useContext, - useState, -} from 'react'; +import type { FormEvent, MutableRefObject, ReactElement } from 'react'; +import React, { useContext, useState } from 'react'; +import type { + AuthSession, + KratosProviderData, +} from '@dailydotdev/shared/src/lib/kratos'; import { AuthEvent, AuthFlow, - AuthSession, getKratosSettingsFlow, KRATOS_ERROR, - KratosProviderData, } from '@dailydotdev/shared/src/lib/kratos'; import { PasswordField } from '@dailydotdev/shared/src/components/fields/PasswordField'; import { formToJson } from '@dailydotdev/shared/src/lib/form'; import SimpleTooltip from '@dailydotdev/shared/src/components/tooltips/SimpleTooltip'; -import { - PromptOptions, - usePrompt, -} from '@dailydotdev/shared/src/hooks/usePrompt'; +import type { PromptOptions } from '@dailydotdev/shared/src/hooks/usePrompt'; +import { usePrompt } from '@dailydotdev/shared/src/hooks/usePrompt'; import { useSignBack } from '@dailydotdev/shared/src/hooks/auth/useSignBack'; import { useEventListener } from '@dailydotdev/shared/src/hooks'; import { capitalize } from '@dailydotdev/shared/src/lib/strings'; import { BOOT_LOCAL_KEY } from '@dailydotdev/shared/src/contexts/common'; import AccountContentSection from '../AccountContentSection'; import { AccountPageContainer } from '../AccountPageContainer'; -import { - AccountSecurityDisplay as Display, - AccountTextField, - ManageSocialProvidersProps, -} from '../common'; +import type { ManageSocialProvidersProps } from '../common'; +import { AccountSecurityDisplay as Display, AccountTextField } from '../common'; import EmailSentSection from '../EmailSentSection'; import AccountLoginSection from './AccountLoginSection'; diff --git a/packages/webapp/components/layouts/AccountLayout/SidebarNav.tsx b/packages/webapp/components/layouts/AccountLayout/SidebarNav.tsx index 6a6d7940fa..81492909cd 100644 --- a/packages/webapp/components/layouts/AccountLayout/SidebarNav.tsx +++ b/packages/webapp/components/layouts/AccountLayout/SidebarNav.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useCallback, useContext, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useContext, useEffect } from 'react'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import classNames from 'classnames'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; @@ -8,8 +9,8 @@ import { useRouter } from 'next/router'; import { isTouchDevice } from '@dailydotdev/shared/src/lib/tooltip'; import Link from '@dailydotdev/shared/src/components/utilities/Link'; import SidebarNavItem from './SidebarNavItem'; +import type { AccountPage } from './common'; import { - AccountPage, accountPage, accountSidebarPages, AccountSidebarPagesSection, diff --git a/packages/webapp/components/layouts/AccountLayout/SidebarNavItem.tsx b/packages/webapp/components/layouts/AccountLayout/SidebarNavItem.tsx index 4f74348120..eaeae350b1 100644 --- a/packages/webapp/components/layouts/AccountLayout/SidebarNavItem.tsx +++ b/packages/webapp/components/layouts/AccountLayout/SidebarNavItem.tsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; import { ArrowIcon } from '@dailydotdev/shared/src/components/icons'; import Link from '@dailydotdev/shared/src/components/utilities/Link'; diff --git a/packages/webapp/components/layouts/AccountLayout/common.tsx b/packages/webapp/components/layouts/AccountLayout/common.tsx index 50716f1081..b45281bb7c 100644 --- a/packages/webapp/components/layouts/AccountLayout/common.tsx +++ b/packages/webapp/components/layouts/AccountLayout/common.tsx @@ -11,8 +11,9 @@ import { } from '@dailydotdev/shared/src/components/ProfilePicture'; import { pageBorders } from '@dailydotdev/shared/src/components/utilities'; import classed from '@dailydotdev/shared/src/lib/classed'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; -import React, { ReactNode } from 'react'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { ReactNode } from 'react'; +import React from 'react'; import { faq, privacyPolicy, diff --git a/packages/webapp/components/layouts/AccountLayout/index.tsx b/packages/webapp/components/layouts/AccountLayout/index.tsx index b9ff391691..3682993f00 100644 --- a/packages/webapp/components/layouts/AccountLayout/index.tsx +++ b/packages/webapp/components/layouts/AccountLayout/index.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement, ReactNode, useContext, useEffect } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useEffect } from 'react'; import classNames from 'classnames'; -import { PublicProfile } from '@dailydotdev/shared/src/lib/user'; +import type { PublicProfile } from '@dailydotdev/shared/src/lib/user'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { generateQueryKey, diff --git a/packages/webapp/components/layouts/BookmarkFeedPage.tsx b/packages/webapp/components/layouts/BookmarkFeedPage.tsx index c3cd58d224..bb6bf1dbc2 100644 --- a/packages/webapp/components/layouts/BookmarkFeedPage.tsx +++ b/packages/webapp/components/layouts/BookmarkFeedPage.tsx @@ -1,13 +1,13 @@ -import React, { ReactElement, ReactNode, useEffect, useContext } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useEffect, useContext } from 'react'; import dynamic from 'next/dynamic'; import { useRouter } from 'next/router'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; -import { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; -import BookmarkFeedLayout, { - BookmarkFeedLayoutProps, -} from '@dailydotdev/shared/src/components/BookmarkFeedLayout'; +import type { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; +import type { BookmarkFeedLayoutProps } from '@dailydotdev/shared/src/components/BookmarkFeedLayout'; +import BookmarkFeedLayout from '@dailydotdev/shared/src/components/BookmarkFeedLayout'; import { getLayout } from './FeedLayout'; -import { MainFeedPageProps } from './MainFeedPage'; +import type { MainFeedPageProps } from './MainFeedPage'; const PostsSearch = dynamic( () => diff --git a/packages/webapp/components/layouts/FeedByIds/FeedByIdsLayout.tsx b/packages/webapp/components/layouts/FeedByIds/FeedByIdsLayout.tsx index 726f04e0d0..dd73bee3be 100644 --- a/packages/webapp/components/layouts/FeedByIds/FeedByIdsLayout.tsx +++ b/packages/webapp/components/layouts/FeedByIds/FeedByIdsLayout.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode, useMemo, useState } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useMemo, useState } from 'react'; import { useFeedLayout } from '@dailydotdev/shared/src/hooks'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import { @@ -6,7 +7,8 @@ import { OtherFeedPage, RequestKey, } from '@dailydotdev/shared/src/lib/query'; -import Feed, { FeedProps } from '@dailydotdev/shared/src/components/Feed'; +import type { FeedProps } from '@dailydotdev/shared/src/components/Feed'; +import Feed from '@dailydotdev/shared/src/components/Feed'; import { FEED_BY_IDS_QUERY, supportedTypesForPrivateSources, diff --git a/packages/webapp/components/layouts/FeedByIds/FeedByIdsPage.tsx b/packages/webapp/components/layouts/FeedByIds/FeedByIdsPage.tsx index 86a8051bd8..0360c2d4be 100644 --- a/packages/webapp/components/layouts/FeedByIds/FeedByIdsPage.tsx +++ b/packages/webapp/components/layouts/FeedByIds/FeedByIdsPage.tsx @@ -1,9 +1,10 @@ -import React, { ReactElement, ReactNode, useEffect, useContext } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useEffect, useContext } from 'react'; import { useRouter } from 'next/router'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; -import { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; +import type { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; import { getLayout } from '../FeedLayout'; -import { MainFeedPageProps } from '../MainFeedPage'; +import type { MainFeedPageProps } from '../MainFeedPage'; import FeedByIdsLayout from './FeedByIdsLayout'; export default function FeedByIdsPage({ diff --git a/packages/webapp/components/layouts/FeedLayout.tsx b/packages/webapp/components/layouts/FeedLayout.tsx index c1f7ffcc20..7087dd8486 100644 --- a/packages/webapp/components/layouts/FeedLayout.tsx +++ b/packages/webapp/components/layouts/FeedLayout.tsx @@ -1,8 +1,8 @@ -import React, { ReactNode } from 'react'; +import type { ReactNode } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; -import MainLayout, { - MainLayoutProps, -} from '@dailydotdev/shared/src/components/MainLayout'; +import type { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; +import MainLayout from '@dailydotdev/shared/src/components/MainLayout'; import { FeedLayoutProvider } from '@dailydotdev/shared/src/contexts/FeedContext'; import { getLayout as getFooterNavBarLayout } from './FooterNavBarLayout'; diff --git a/packages/webapp/components/layouts/FooterNavBarLayout.tsx b/packages/webapp/components/layouts/FooterNavBarLayout.tsx index 00c2e74d0c..54eed12552 100644 --- a/packages/webapp/components/layouts/FooterNavBarLayout.tsx +++ b/packages/webapp/components/layouts/FooterNavBarLayout.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement, ReactNode, useContext } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext } from 'react'; import dynamic from 'next/dynamic'; import ProgressiveEnhancementContext from '@dailydotdev/shared/src/contexts/ProgressiveEnhancementContext'; import { useViewSize, ViewSize } from '@dailydotdev/shared/src/hooks'; -import { Post } from '@dailydotdev/shared/src/graphql/posts'; +import type { Post } from '@dailydotdev/shared/src/graphql/posts'; const FooterWrapper = dynamic( () => diff --git a/packages/webapp/components/layouts/MainFeedPage.tsx b/packages/webapp/components/layouts/MainFeedPage.tsx index 8275095670..273dcfac90 100644 --- a/packages/webapp/components/layouts/MainFeedPage.tsx +++ b/packages/webapp/components/layouts/MainFeedPage.tsx @@ -1,19 +1,12 @@ -import React, { - ReactElement, - ReactNode, - useContext, - useEffect, - useState, -} from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { useRouter } from 'next/router'; -import { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; +import type { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; import type { MainFeedLayoutProps } from '@dailydotdev/shared/src/components/MainFeedLayout'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { getShouldRedirect } from '@dailydotdev/shared/src/components/utilities'; -import { - type GetDefaultFeedProps, - getFeedName, -} from '@dailydotdev/shared/src/lib/feed'; +import type { GetDefaultFeedProps } from '@dailydotdev/shared/src/lib/feed'; +import { getFeedName } from '@dailydotdev/shared/src/lib/feed'; import dynamic from 'next/dynamic'; import { getLayout } from './FeedLayout'; diff --git a/packages/webapp/components/layouts/MainFooterLayout.tsx b/packages/webapp/components/layouts/MainFooterLayout.tsx index 78b4c84b55..4553bb732c 100644 --- a/packages/webapp/components/layouts/MainFooterLayout.tsx +++ b/packages/webapp/components/layouts/MainFooterLayout.tsx @@ -1,8 +1,8 @@ -import React, { ReactNode } from 'react'; +import type { ReactNode } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; -import MainLayout, { - MainLayoutProps, -} from '@dailydotdev/shared/src/components/MainLayout'; +import type { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; +import MainLayout from '@dailydotdev/shared/src/components/MainLayout'; import { getLayout as getFooterNavBarLayout } from './FooterNavBarLayout'; export const getLayout = ( diff --git a/packages/webapp/components/layouts/MainLayout.tsx b/packages/webapp/components/layouts/MainLayout.tsx index a72838d716..8243706a6c 100644 --- a/packages/webapp/components/layouts/MainLayout.tsx +++ b/packages/webapp/components/layouts/MainLayout.tsx @@ -1,8 +1,8 @@ -import React, { ReactNode } from 'react'; +import type { ReactNode } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; -import MainLayout, { - MainLayoutProps, -} from '@dailydotdev/shared/src/components/MainLayout'; +import type { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; +import MainLayout from '@dailydotdev/shared/src/components/MainLayout'; export default MainLayout; diff --git a/packages/webapp/components/layouts/PlusLayout/PlusHeader.tsx b/packages/webapp/components/layouts/PlusLayout/PlusHeader.tsx index a90bf00ac5..49e7c4e10b 100644 --- a/packages/webapp/components/layouts/PlusLayout/PlusHeader.tsx +++ b/packages/webapp/components/layouts/PlusLayout/PlusHeader.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useCallback } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback } from 'react'; import HeaderLogo from '@dailydotdev/shared/src/components/layout/HeaderLogo'; import { Button, diff --git a/packages/webapp/components/layouts/PlusLayout/PlusLayout.tsx b/packages/webapp/components/layouts/PlusLayout/PlusLayout.tsx index b71b038fe4..62b2329b29 100644 --- a/packages/webapp/components/layouts/PlusLayout/PlusLayout.tsx +++ b/packages/webapp/components/layouts/PlusLayout/PlusLayout.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode, useEffect } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useEffect } from 'react'; import { cloudinaryPlusBackground } from '@dailydotdev/shared/src/lib/image'; import { PaymentContextProvider } from '@dailydotdev/shared/src/contexts/PaymentContext'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; @@ -10,7 +11,7 @@ import { ThemeMode, useSettingsContext, } from '@dailydotdev/shared/src/contexts/SettingsContext'; -import { MainFeedPageProps } from '../MainFeedPage'; +import type { MainFeedPageProps } from '../MainFeedPage'; import { PlusHeader } from './PlusHeader'; export default function PlusLayout({ diff --git a/packages/webapp/components/layouts/ProfileLayout/NavBar.tsx b/packages/webapp/components/layouts/ProfileLayout/NavBar.tsx index cd9623c544..68128db5ca 100644 --- a/packages/webapp/components/layouts/ProfileLayout/NavBar.tsx +++ b/packages/webapp/components/layouts/ProfileLayout/NavBar.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { PublicProfile } from '@dailydotdev/shared/src/lib/user'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { PublicProfile } from '@dailydotdev/shared/src/lib/user'; import { ActiveTabIndicator } from '@dailydotdev/shared/src/components/utilities'; import { Button, diff --git a/packages/webapp/components/layouts/ProfileLayout/index.tsx b/packages/webapp/components/layouts/ProfileLayout/index.tsx index cfc2a818df..a98a4e4019 100644 --- a/packages/webapp/components/layouts/ProfileLayout/index.tsx +++ b/packages/webapp/components/layouts/ProfileLayout/index.tsx @@ -1,21 +1,22 @@ -import React, { ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; +import type { PublicProfile } from '@dailydotdev/shared/src/lib/user'; import { getProfile, getProfileV2Extra, - PublicProfile, } from '@dailydotdev/shared/src/lib/user'; import dynamic from 'next/dynamic'; import { useRouter } from 'next/router'; -import { +import type { GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult, } from 'next'; -import { ParsedUrlQuery } from 'querystring'; -import { ClientError } from 'graphql-request'; -import { ProfileV2 } from '@dailydotdev/shared/src/graphql/users'; +import type { ParsedUrlQuery } from 'querystring'; +import type { ClientError } from 'graphql-request'; +import type { ProfileV2 } from '@dailydotdev/shared/src/graphql/users'; import Head from 'next/head'; -import { NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; import { PageWidgets } from '@dailydotdev/shared/src/components/utilities'; import { useProfile } from '@dailydotdev/shared/src/hooks/profile/useProfile'; import CustomAuthBanner from '@dailydotdev/shared/src/components/auth/CustomAuthBanner'; diff --git a/packages/webapp/components/layouts/SearchLayout.tsx b/packages/webapp/components/layouts/SearchLayout.tsx index 5893567eec..d6e5efbc27 100644 --- a/packages/webapp/components/layouts/SearchLayout.tsx +++ b/packages/webapp/components/layouts/SearchLayout.tsx @@ -1,5 +1,5 @@ -import { ReactNode } from 'react'; -import { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; +import type { ReactNode } from 'react'; +import type { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; import { getLayout as getMainLayout } from './MainLayout'; import { getLayout as getFooterNavBarLayout } from './FooterNavBarLayout'; diff --git a/packages/webapp/components/search/SearchChatPage.tsx b/packages/webapp/components/search/SearchChatPage.tsx index b10e49c956..79889df8b6 100644 --- a/packages/webapp/components/search/SearchChatPage.tsx +++ b/packages/webapp/components/search/SearchChatPage.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement, useEffect } from 'react'; -import { NextSeo, NextSeoProps } from 'next-seo'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; +import type { NextSeoProps } from 'next-seo'; +import { NextSeo } from 'next-seo'; import { SearchProviderButton, SearchResult, diff --git a/packages/webapp/components/search/SearchPostFinderPage.tsx b/packages/webapp/components/search/SearchPostFinderPage.tsx index 6a828dc91d..133139604f 100644 --- a/packages/webapp/components/search/SearchPostFinderPage.tsx +++ b/packages/webapp/components/search/SearchPostFinderPage.tsx @@ -1,5 +1,6 @@ -import React, { CSSProperties, ReactElement, useContext, useMemo } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { CSSProperties, ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { NextSeo } from 'next-seo'; import { useRouter } from 'next/router'; import { diff --git a/packages/webapp/graphql/devcard.ts b/packages/webapp/graphql/devcard.ts index b39e4ed35d..9d99174173 100644 --- a/packages/webapp/graphql/devcard.ts +++ b/packages/webapp/graphql/devcard.ts @@ -1,6 +1,6 @@ import { gql } from 'graphql-request'; -import { DevCardData } from '@dailydotdev/shared/src/hooks/profile/useDevCard'; -import { DevCardType } from '@dailydotdev/shared/src/components/profile/devcard'; +import type { DevCardData } from '@dailydotdev/shared/src/hooks/profile/useDevCard'; +import type { DevCardType } from '@dailydotdev/shared/src/components/profile/devcard'; export interface GenerateDevCardParams extends Pick { diff --git a/packages/webapp/hooks/useWebappVersion.ts b/packages/webapp/hooks/useWebappVersion.ts index bdc3d6fdcc..634a0b0145 100644 --- a/packages/webapp/hooks/useWebappVersion.ts +++ b/packages/webapp/hooks/useWebappVersion.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; import { useRouter } from 'next/router'; -import { ParsedUrlQuery } from 'querystring'; +import type { ParsedUrlQuery } from 'querystring'; const getVersion = (query: ParsedUrlQuery): string | undefined => { if (query.android) { diff --git a/packages/webapp/next-seo.ts b/packages/webapp/next-seo.ts index 9d120b279b..8d30d6a2ee 100644 --- a/packages/webapp/next-seo.ts +++ b/packages/webapp/next-seo.ts @@ -1,6 +1,10 @@ -import { Source } from '@dailydotdev/shared/src/graphql/sources'; +import type { Source } from '@dailydotdev/shared/src/graphql/sources'; import { cloudinarySquadsImageFallback } from '@dailydotdev/shared/src/lib/image'; -import { DefaultSeoProps, NextSeoProps, OpenGraph } from 'next-seo/lib/types'; +import type { + DefaultSeoProps, + NextSeoProps, + OpenGraph, +} from 'next-seo/lib/types'; const config: DefaultSeoProps = { openGraph: { diff --git a/packages/webapp/next.config.ts b/packages/webapp/next.config.ts index c57da88c2f..fd751723f9 100644 --- a/packages/webapp/next.config.ts +++ b/packages/webapp/next.config.ts @@ -2,8 +2,8 @@ import withSerwistInit from '@serwist/next'; // eslint-disable-next-line import/no-extraneous-dependencies import withBundleAnalyzerInit from '@next/bundle-analyzer'; import { readFileSync } from 'fs'; -import { NextConfig } from 'next'; -import { Rewrite } from 'next/dist/lib/load-custom-routes'; +import type { NextConfig } from 'next'; +import type { Rewrite } from 'next/dist/lib/load-custom-routes'; const { version } = JSON.parse( readFileSync('../extension/package.json', 'utf8'), diff --git a/packages/webapp/pages/404.tsx b/packages/webapp/pages/404.tsx index 29eb36c749..e2b1206b3f 100644 --- a/packages/webapp/pages/404.tsx +++ b/packages/webapp/pages/404.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext, useEffect, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useRef } from 'react'; import Custom404 from '@dailydotdev/shared/src/components/Custom404'; import { NextSeo } from 'next-seo'; import { LogEvent } from '@dailydotdev/shared/src/lib/log'; diff --git a/packages/webapp/pages/[userId]/index.tsx b/packages/webapp/pages/[userId]/index.tsx index cfe824251d..e4e9127343 100644 --- a/packages/webapp/pages/[userId]/index.tsx +++ b/packages/webapp/pages/[userId]/index.tsx @@ -1,9 +1,8 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { useQuery } from '@tanstack/react-query'; -import { - ProfileReadingData, - USER_READING_HISTORY_QUERY, -} from '@dailydotdev/shared/src/graphql/users'; +import type { ProfileReadingData } from '@dailydotdev/shared/src/graphql/users'; +import { USER_READING_HISTORY_QUERY } from '@dailydotdev/shared/src/graphql/users'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { useActivityTimeFilter } from '@dailydotdev/shared/src/hooks/profile/useActivityTimeFilter'; import { ReadingTagsWidget } from '@dailydotdev/shared/src/components/profile/ReadingTagsWidget'; @@ -18,13 +17,13 @@ import { useJoinReferral } from '@dailydotdev/shared/src/hooks'; import { useReadingStreak } from '@dailydotdev/shared/src/hooks/streaks'; import { gqlClient } from '@dailydotdev/shared/src/graphql/common'; import { NextSeo } from 'next-seo'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { NextSeoProps } from 'next-seo/lib/types'; +import type { ProfileLayoutProps } from '../../components/layouts/ProfileLayout'; import { getLayout as getProfileLayout, getProfileSeoDefaults, getStaticPaths as getProfileStaticPaths, getStaticProps as getProfileStaticProps, - ProfileLayoutProps, } from '../../components/layouts/ProfileLayout'; import { ReadingStreaksWidget } from '../../../shared/src/components/profile/ReadingStreaksWidget'; import { TopReaderWidget } from '../../../shared/src/components/profile/TopReaderWidget'; diff --git a/packages/webapp/pages/[userId]/posts.tsx b/packages/webapp/pages/[userId]/posts.tsx index 8a4235c933..8ddbe85d58 100644 --- a/packages/webapp/pages/[userId]/posts.tsx +++ b/packages/webapp/pages/[userId]/posts.tsx @@ -1,7 +1,9 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { link } from '@dailydotdev/shared/src/lib/links'; import { AUTHOR_FEED_QUERY } from '@dailydotdev/shared/src/graphql/feed'; -import Feed, { FeedProps } from '@dailydotdev/shared/src/components/Feed'; +import type { FeedProps } from '@dailydotdev/shared/src/components/Feed'; +import Feed from '@dailydotdev/shared/src/components/Feed'; import { OtherFeedPage } from '@dailydotdev/shared/src/lib/query'; import { MyProfileEmptyScreen } from '@dailydotdev/shared/src/components/profile/MyProfileEmptyScreen'; import { ProfileEmptyScreen } from '@dailydotdev/shared/src/components/profile/ProfileEmptyScreen'; @@ -9,13 +11,13 @@ import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { useFeedLayout } from '@dailydotdev/shared/src/hooks'; import classNames from 'classnames'; import { NextSeo } from 'next-seo'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { NextSeoProps } from 'next-seo/lib/types'; +import type { ProfileLayoutProps } from '../../components/layouts/ProfileLayout'; import { getLayout as getProfileLayout, getProfileSeoDefaults, getStaticPaths as getProfileStaticPaths, getStaticProps as getProfileStaticProps, - ProfileLayoutProps, } from '../../components/layouts/ProfileLayout'; import { getTemplatedTitle } from '../../components/layouts/utils'; diff --git a/packages/webapp/pages/[userId]/replies.tsx b/packages/webapp/pages/[userId]/replies.tsx index c9aa127418..26106f7912 100644 --- a/packages/webapp/pages/[userId]/replies.tsx +++ b/packages/webapp/pages/[userId]/replies.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import { USER_COMMENTS_QUERY } from '@dailydotdev/shared/src/graphql/comments'; import { Origin } from '@dailydotdev/shared/src/lib/log'; import { @@ -9,10 +10,10 @@ import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { MyProfileEmptyScreen } from '@dailydotdev/shared/src/components/profile/MyProfileEmptyScreen'; import { ProfileEmptyScreen } from '@dailydotdev/shared/src/components/profile/ProfileEmptyScreen'; import CommentFeed from '@dailydotdev/shared/src/components/CommentFeed'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { NextSeo } from 'next-seo'; +import type { ProfileLayoutProps } from '../../components/layouts/ProfileLayout'; import { - ProfileLayoutProps, getStaticPaths as getProfileStaticPaths, getStaticProps as getProfileStaticProps, getLayout as getProfileLayout, diff --git a/packages/webapp/pages/[userId]/upvoted.tsx b/packages/webapp/pages/[userId]/upvoted.tsx index ff6aea85c5..e89f5258f6 100644 --- a/packages/webapp/pages/[userId]/upvoted.tsx +++ b/packages/webapp/pages/[userId]/upvoted.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement, useContext } from 'react'; -import Feed, { FeedProps } from '@dailydotdev/shared/src/components/Feed'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; +import type { FeedProps } from '@dailydotdev/shared/src/components/Feed'; +import Feed from '@dailydotdev/shared/src/components/Feed'; import { OtherFeedPage } from '@dailydotdev/shared/src/lib/query'; import { USER_UPVOTED_FEED_QUERY } from '@dailydotdev/shared/src/graphql/feed'; import { MyProfileEmptyScreen } from '@dailydotdev/shared/src/components/profile/MyProfileEmptyScreen'; @@ -7,10 +9,10 @@ import { ProfileEmptyScreen } from '@dailydotdev/shared/src/components/profile/P import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { useFeedLayout } from '@dailydotdev/shared/src/hooks'; import classNames from 'classnames'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { NextSeo } from 'next-seo'; +import type { ProfileLayoutProps } from '../../components/layouts/ProfileLayout'; import { - ProfileLayoutProps, getStaticPaths as getProfileStaticPaths, getStaticProps as getProfileStaticProps, getLayout as getProfileLayout, diff --git a/packages/webapp/pages/_app.tsx b/packages/webapp/pages/_app.tsx index fbd10ea43e..ebe518eaf0 100644 --- a/packages/webapp/pages/_app.tsx +++ b/packages/webapp/pages/_app.tsx @@ -1,12 +1,6 @@ -import React, { - ReactElement, - ReactNode, - useContext, - useEffect, - useRef, - useState, -} from 'react'; -import { AppProps } from 'next/app'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useEffect, useRef, useState } from 'react'; +import type { AppProps } from 'next/app'; import dynamic from 'next/dynamic'; import Head from 'next/head'; import 'focus-visible'; diff --git a/packages/webapp/pages/account/integrations/index.tsx b/packages/webapp/pages/account/integrations/index.tsx index 2ec59ff9e0..847831a62c 100644 --- a/packages/webapp/pages/account/integrations/index.tsx +++ b/packages/webapp/pages/account/integrations/index.tsx @@ -1,14 +1,13 @@ -import React, { ReactElement, useCallback, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useState } from 'react'; import { useIntegrationsQuery } from '@dailydotdev/shared/src/hooks/integrations/useIntegrationsQuery'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; import { PlusIcon, SlackIcon } from '@dailydotdev/shared/src/components/icons'; -import { - UserIntegration, - UserIntegrationType, -} from '@dailydotdev/shared/src/graphql/integrations'; +import type { UserIntegration } from '@dailydotdev/shared/src/graphql/integrations'; +import { UserIntegrationType } from '@dailydotdev/shared/src/graphql/integrations'; import { useSlack } from '@dailydotdev/shared/src/hooks/integrations/slack/useSlack'; import { webappUrl } from '@dailydotdev/shared/src/lib/constants'; import { UserIntegrationItem } from '@dailydotdev/shared/src/components/integrations/UserIntegrationItem'; diff --git a/packages/webapp/pages/account/invite.tsx b/packages/webapp/pages/account/invite.tsx index 899ef17626..6b8b511fc8 100644 --- a/packages/webapp/pages/account/invite.tsx +++ b/packages/webapp/pages/account/invite.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useMemo, useRef } from 'react'; +import type { ReactElement } from 'react'; +import React, { useMemo, useRef } from 'react'; import { ReferralCampaignKey, useReferralCampaign, @@ -14,13 +15,11 @@ import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import { REFERRED_USERS_QUERY } from '@dailydotdev/shared/src/graphql/users'; import UserList from '@dailydotdev/shared/src/components/profile/UserList'; import { checkFetchMore } from '@dailydotdev/shared/src/components/containers/InfiniteScrolling'; -import { - ReferredUsersData, - gqlClient, -} from '@dailydotdev/shared/src/graphql/common'; +import type { ReferredUsersData } from '@dailydotdev/shared/src/graphql/common'; +import { gqlClient } from '@dailydotdev/shared/src/graphql/common'; import { SocialShareList } from '@dailydotdev/shared/src/components/widgets/SocialShareList'; import { Separator } from '@dailydotdev/shared/src/components/cards/common/common'; -import { UserShortProfile } from '@dailydotdev/shared/src/lib/user'; +import type { UserShortProfile } from '@dailydotdev/shared/src/lib/user'; import { format } from 'date-fns'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; import { useInfiniteQuery } from '@tanstack/react-query'; @@ -30,11 +29,11 @@ import { TargetId, TargetType, } from '@dailydotdev/shared/src/lib/log'; -import { ShareProvider } from '@dailydotdev/shared/src/lib/share'; +import type { ShareProvider } from '@dailydotdev/shared/src/lib/share'; import { useShareOrCopyLink } from '@dailydotdev/shared/src/hooks/useShareOrCopyLink'; import { InviteLinkInput } from '@dailydotdev/shared/src/components/referral'; import { TruncateText } from '@dailydotdev/shared/src/components/utilities'; -import { NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; import AccountContentSection from '../../components/layouts/AccountLayout/AccountContentSection'; import { AccountPageContainer } from '../../components/layouts/AccountLayout/AccountPageContainer'; import { getAccountLayout } from '../../components/layouts/AccountLayout'; diff --git a/packages/webapp/pages/account/notifications.tsx b/packages/webapp/pages/account/notifications.tsx index 3e364dd7c4..a2b26cf907 100644 --- a/packages/webapp/pages/account/notifications.tsx +++ b/packages/webapp/pages/account/notifications.tsx @@ -1,6 +1,7 @@ import { Checkbox } from '@dailydotdev/shared/src/components/fields/Checkbox'; import { Switch } from '@dailydotdev/shared/src/components/fields/Switch'; -import React, { ReactElement, SetStateAction, useState } from 'react'; +import type { ReactElement, SetStateAction } from 'react'; +import React, { useState } from 'react'; import { cloudinaryNotificationsBrowser } from '@dailydotdev/shared/src/lib/image'; import CloseButton from '@dailydotdev/shared/src/components/CloseButton'; import Pointer, { @@ -32,7 +33,7 @@ import { TimezoneDropdown } from '@dailydotdev/shared/src/components/widgets/Tim import { ToggleWeekStart } from '@dailydotdev/shared/src/components/widgets/ToggleWeekStart'; import { getUserInitialTimezone } from '@dailydotdev/shared/src/lib/timezones'; -import { NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; import { getAccountLayout } from '../../components/layouts/AccountLayout'; import { AccountPageContainer } from '../../components/layouts/AccountLayout/AccountPageContainer'; import AccountContentSection, { diff --git a/packages/webapp/pages/account/profile.tsx b/packages/webapp/pages/account/profile.tsx index 03f9bbcec0..7b40bb4bda 100644 --- a/packages/webapp/pages/account/profile.tsx +++ b/packages/webapp/pages/account/profile.tsx @@ -1,8 +1,9 @@ -import React, { ReactElement, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; import TabContainer, { Tab, } from '@dailydotdev/shared/src/components/tabs/TabContainer'; -import { NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; import { AccountSecurityDisplay as Display } from '../../components/layouts/AccountLayout/common'; import { getAccountLayout } from '../../components/layouts/AccountLayout'; import VerifyWorkEmail from '../../components/layouts/AccountLayout/Profile/VerifyWorkEmail'; diff --git a/packages/webapp/pages/account/security.tsx b/packages/webapp/pages/account/security.tsx index ff04799a86..ded33d1ce0 100644 --- a/packages/webapp/pages/account/security.tsx +++ b/packages/webapp/pages/account/security.tsx @@ -2,8 +2,10 @@ import TabContainer, { Tab, } from '@dailydotdev/shared/src/components/tabs/TabContainer'; import usePrivilegedSession from '@dailydotdev/shared/src/hooks/usePrivilegedSession'; -import React, { ReactElement, useRef, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useRef, useState } from 'react'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import type { SuccessfulRegistrationData } from '@dailydotdev/shared/src/lib/kratos'; import { AuthFlow, ContinueWithAction, @@ -12,31 +14,29 @@ import { initializeKratosFlow, KRATOS_ERROR, submitKratosFlow, - SuccessfulRegistrationData, } from '@dailydotdev/shared/src/lib/kratos'; -import { - getNodeValue, +import type { SettingsParams, ValidateChangeEmail, ValidateResetPassword, } from '@dailydotdev/shared/src/lib/auth'; +import { getNodeValue } from '@dailydotdev/shared/src/lib/auth'; import { useToastNotification } from '@dailydotdev/shared/src/hooks/useToastNotification'; -import { - SignBackProvider, - useSignBack, -} from '@dailydotdev/shared/src/hooks/auth/useSignBack'; +import type { SignBackProvider } from '@dailydotdev/shared/src/hooks/auth/useSignBack'; +import { useSignBack } from '@dailydotdev/shared/src/hooks/auth/useSignBack'; import { generateQueryKey, RequestKey, } from '@dailydotdev/shared/src/lib/query'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; -import { NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; import { AccountSecurityDisplay as Display } from '../../components/layouts/AccountLayout/common'; import { getAccountLayout } from '../../components/layouts/AccountLayout'; -import AccountSecurityDefault, { +import type { ChangePasswordParams, UpdateProvidersParams, } from '../../components/layouts/AccountLayout/Security'; +import AccountSecurityDefault from '../../components/layouts/AccountLayout/Security'; import EmailFormPage from '../../components/layouts/AccountLayout/Security/EmailFormPage'; import { defaultSeo } from '../../next-seo'; import { getTemplatedTitle } from '../../components/layouts/utils'; diff --git a/packages/webapp/pages/backoffice/keywords/[value].tsx b/packages/webapp/pages/backoffice/keywords/[value].tsx index ebe71f6332..a0dcb997e8 100644 --- a/packages/webapp/pages/backoffice/keywords/[value].tsx +++ b/packages/webapp/pages/backoffice/keywords/[value].tsx @@ -1,10 +1,11 @@ -import React, { ReactElement, useContext } from 'react'; -import { +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; +import type { GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult, } from 'next'; -import { ParsedUrlQuery } from 'querystring'; +import type { ParsedUrlQuery } from 'querystring'; import { KEYWORD_QUERY } from '@dailydotdev/shared/src/graphql/keywords'; import { useQuery } from '@tanstack/react-query'; import useRequirePermissions from '@dailydotdev/shared/src/hooks/useRequirePermissions'; diff --git a/packages/webapp/pages/backoffice/pendingKeywords.tsx b/packages/webapp/pages/backoffice/pendingKeywords.tsx index 4f93c486e1..f8fb8231ac 100644 --- a/packages/webapp/pages/backoffice/pendingKeywords.tsx +++ b/packages/webapp/pages/backoffice/pendingKeywords.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useContext } from 'react'; +import type { ReactElement } from 'react'; +import React, { useContext } from 'react'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { Roles } from '@dailydotdev/shared/src/lib/user'; import { useQuery } from '@tanstack/react-query'; diff --git a/packages/webapp/pages/bookmarks/[folderId].tsx b/packages/webapp/pages/bookmarks/[folderId].tsx index fd7da611a2..6947d638c5 100644 --- a/packages/webapp/pages/bookmarks/[folderId].tsx +++ b/packages/webapp/pages/bookmarks/[folderId].tsx @@ -1,5 +1,6 @@ -import React, { ReactElement, useLayoutEffect, useMemo } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React, { useLayoutEffect, useMemo } from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { useBookmarkFolder } from '@dailydotdev/shared/src/hooks/bookmark/useBookmarkFolder'; import { useRouter } from 'next/router'; import { usePlusSubscription } from '@dailydotdev/shared/src/hooks'; diff --git a/packages/webapp/pages/bookmarks/index.tsx b/packages/webapp/pages/bookmarks/index.tsx index e86f194503..c5ab4b204c 100644 --- a/packages/webapp/pages/bookmarks/index.tsx +++ b/packages/webapp/pages/bookmarks/index.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { getBookmarkFeedLayout, bookmarkFeedLayoutProps, diff --git a/packages/webapp/pages/bookmarks/later.tsx b/packages/webapp/pages/bookmarks/later.tsx index 38dd81a366..d6ced1329a 100644 --- a/packages/webapp/pages/bookmarks/later.tsx +++ b/packages/webapp/pages/bookmarks/later.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { getBookmarkFeedLayout, bookmarkFeedLayoutProps, diff --git a/packages/webapp/pages/callback.tsx b/packages/webapp/pages/callback.tsx index 4832162df6..9de9e63f89 100644 --- a/packages/webapp/pages/callback.tsx +++ b/packages/webapp/pages/callback.tsx @@ -1,6 +1,7 @@ import { postWindowMessage } from '@dailydotdev/shared/src/lib/func'; import { AuthEvent } from '@dailydotdev/shared/src/lib/kratos'; -import { ReactElement, useContext, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import { useContext, useEffect } from 'react'; import LogContext from '@dailydotdev/shared/src/contexts/LogContext'; function CallbackPage(): ReactElement { diff --git a/packages/webapp/pages/devcard.tsx b/packages/webapp/pages/devcard.tsx index db3c4a65bc..786533782e 100644 --- a/packages/webapp/pages/devcard.tsx +++ b/packages/webapp/pages/devcard.tsx @@ -1,10 +1,5 @@ -import React, { - ReactElement, - useCallback, - useContext, - useMemo, - useState, -} from 'react'; +import type { ReactElement } from 'react'; +import React, { useCallback, useContext, useMemo, useState } from 'react'; import Tilt from 'react-parallax-tilt'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { @@ -22,7 +17,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; import classNames from 'classnames'; import { useCopyLink } from '@dailydotdev/shared/src/hooks/useCopy'; import { ActiveTabIndicator } from '@dailydotdev/shared/src/components/utilities'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { NextSeoProps } from 'next-seo/lib/types'; import DevCardPlaceholder from '@dailydotdev/shared/src/components/DevCardPlaceholder'; import { AuthTriggers } from '@dailydotdev/shared/src/lib/auth'; import { devCard } from '@dailydotdev/shared/src/lib/constants'; @@ -47,10 +42,8 @@ import { ViewSize, } from '@dailydotdev/shared/src/hooks'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; -import { - DevCardQueryData, - useDevCard, -} from '@dailydotdev/shared/src/hooks/profile/useDevCard'; +import type { DevCardQueryData } from '@dailydotdev/shared/src/hooks/profile/useDevCard'; +import { useDevCard } from '@dailydotdev/shared/src/hooks/profile/useDevCard'; import { SimpleTooltip } from '@dailydotdev/shared/src/components/tooltips'; import { ClickableText } from '@dailydotdev/shared/src/components/buttons/ClickableText'; import { LogEvent } from '@dailydotdev/shared/src/lib/log'; @@ -63,11 +56,11 @@ import { getLayout } from '../components/layouts/MainLayout'; import { defaultOpenGraph } from '../next-seo'; import { getTemplatedTitle } from '../components/layouts/utils'; import styles from '../components/layouts/ProfileLayout/NavBar.module.css'; -import { +import type { DevCardMutation, - GENERATE_DEVCARD_MUTATION, GenerateDevCardParams, } from '../graphql/devcard'; +import { GENERATE_DEVCARD_MUTATION } from '../graphql/devcard'; import { getLayout as getFooterNavBarLayout } from '../components/layouts/FooterNavBarLayout'; interface Step1Props { diff --git a/packages/webapp/pages/discussed.tsx b/packages/webapp/pages/discussed.tsx index 178258590d..3c71efb592 100644 --- a/packages/webapp/pages/discussed.tsx +++ b/packages/webapp/pages/discussed.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { getMainFeedLayout, mainFeedLayoutProps, diff --git a/packages/webapp/pages/error.tsx b/packages/webapp/pages/error.tsx index 93888ad3a9..0f0c93fd14 100644 --- a/packages/webapp/pages/error.tsx +++ b/packages/webapp/pages/error.tsx @@ -1,6 +1,7 @@ import { postWindowMessage } from '@dailydotdev/shared/src/lib/func'; import { AuthEvent } from '@dailydotdev/shared/src/lib/kratos'; -import { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import { useEffect } from 'react'; function ErrorPage(): ReactElement { useEffect(() => { diff --git a/packages/webapp/pages/feed-by-ids.tsx b/packages/webapp/pages/feed-by-ids.tsx index c7bb7a34bb..8ab99c9999 100644 --- a/packages/webapp/pages/feed-by-ids.tsx +++ b/packages/webapp/pages/feed-by-ids.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { defaultOpenGraph, defaultSeo } from '../next-seo'; import { feedbyIdsLayoutProps, diff --git a/packages/webapp/pages/feeds/[slugOrId]/edit.tsx b/packages/webapp/pages/feeds/[slugOrId]/edit.tsx index 8548bc12d9..cdbba5bdd0 100644 --- a/packages/webapp/pages/feeds/[slugOrId]/edit.tsx +++ b/packages/webapp/pages/feeds/[slugOrId]/edit.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo'; import { useFeedLayout } from '@dailydotdev/shared/src/hooks/useFeedLayout'; import { FeedSettingsEdit } from '@dailydotdev/shared/src/components/feeds/FeedSettings/FeedSettingsEdit'; import { useRouter } from 'next/router'; diff --git a/packages/webapp/pages/feeds/[slugOrId]/index.tsx b/packages/webapp/pages/feeds/[slugOrId]/index.tsx index 620a79cc83..6e354e6512 100644 --- a/packages/webapp/pages/feeds/[slugOrId]/index.tsx +++ b/packages/webapp/pages/feeds/[slugOrId]/index.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement, useEffect, useMemo } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React, { useEffect, useMemo } from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { NextSeo } from 'next-seo'; import { useFeeds, usePlusSubscription } from '@dailydotdev/shared/src/hooks'; import { useRouter } from 'next/router'; diff --git a/packages/webapp/pages/feeds/new.tsx b/packages/webapp/pages/feeds/new.tsx index e646d6310b..2ef73754e5 100644 --- a/packages/webapp/pages/feeds/new.tsx +++ b/packages/webapp/pages/feeds/new.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo'; import { useFeedLayout } from '@dailydotdev/shared/src/hooks/useFeedLayout'; import { FeedSettingsCreate } from '@dailydotdev/shared/src/components/feeds/FeedSettings/FeedSettingsCreate'; diff --git a/packages/webapp/pages/following.tsx b/packages/webapp/pages/following.tsx index be0609e80b..746ffc95e0 100644 --- a/packages/webapp/pages/following.tsx +++ b/packages/webapp/pages/following.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { getMainFeedLayout, mainFeedLayoutProps, diff --git a/packages/webapp/pages/history.tsx b/packages/webapp/pages/history.tsx index 509daff644..efe86d85b3 100644 --- a/packages/webapp/pages/history.tsx +++ b/packages/webapp/pages/history.tsx @@ -1,11 +1,6 @@ -import React, { - ReactElement, - useCallback, - useContext, - useEffect, - useState, -} from 'react'; -import { NextSeoProps } from 'next-seo'; +import type { ReactElement } from 'react'; +import React, { useCallback, useContext, useEffect, useState } from 'react'; +import type { NextSeoProps } from 'next-seo'; import { ResponsivePageContainer } from '@dailydotdev/shared/src/components/utilities'; import { useRouter } from 'next/router'; import { diff --git a/packages/webapp/pages/image-generator/badges/[badgeId].tsx b/packages/webapp/pages/image-generator/badges/[badgeId].tsx index 8e8bbbb633..d3ff64148b 100644 --- a/packages/webapp/pages/image-generator/badges/[badgeId].tsx +++ b/packages/webapp/pages/image-generator/badges/[badgeId].tsx @@ -1,13 +1,12 @@ -import React, { ReactElement } from 'react'; -import { +import type { ReactElement } from 'react'; +import React from 'react'; +import type { GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult, } from 'next'; -import { - TopReaderBadge, - type TopReader, -} from '@dailydotdev/shared/src/components/badges/TopReaderBadge'; +import type { TopReader } from '@dailydotdev/shared/src/components/badges/TopReaderBadge'; +import { TopReaderBadge } from '@dailydotdev/shared/src/components/badges/TopReaderBadge'; import { fetchTopReaderById } from '@dailydotdev/shared/src/lib/topReader'; export async function getStaticPaths(): Promise { diff --git a/packages/webapp/pages/image-generator/devcards/[userId].tsx b/packages/webapp/pages/image-generator/devcards/[userId].tsx index 639040186a..0c70186816 100644 --- a/packages/webapp/pages/image-generator/devcards/[userId].tsx +++ b/packages/webapp/pages/image-generator/devcards/[userId].tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { DevCardType } from '@dailydotdev/shared/src/components/profile/devcard'; -import { +import type { GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult, diff --git a/packages/webapp/pages/index.tsx b/packages/webapp/pages/index.tsx index ca511067ac..9db57f3fd9 100644 --- a/packages/webapp/pages/index.tsx +++ b/packages/webapp/pages/index.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { SiteLinksSearchBoxJsonLd } from 'next-seo'; import { getMainFeedLayout, diff --git a/packages/webapp/pages/join.tsx b/packages/webapp/pages/join.tsx index 8aa7178067..ace16f4e82 100644 --- a/packages/webapp/pages/join.tsx +++ b/packages/webapp/pages/join.tsx @@ -1,15 +1,17 @@ import { GET_REFERRING_USER_QUERY } from '@dailydotdev/shared/src/graphql/users'; import { ReferralCampaignKey } from '@dailydotdev/shared/src/hooks'; import { isDevelopment } from '@dailydotdev/shared/src/lib/constants'; -import React, { FunctionComponent, ReactElement, useEffect } from 'react'; -import { GetServerSideProps } from 'next'; -import { NextSeo, NextSeoProps } from 'next-seo'; +import type { FunctionComponent, ReactElement } from 'react'; +import React, { useEffect } from 'react'; +import type { GetServerSideProps } from 'next'; +import type { NextSeoProps } from 'next-seo'; +import { NextSeo } from 'next-seo'; import { setCookie } from '@dailydotdev/shared/src/lib/cookie'; import { oneYear } from '@dailydotdev/shared/src/lib/dateFormat'; import { useReferralConfig } from '@dailydotdev/shared/src/hooks/referral/useReferralConfig'; import { gqlClient } from '@dailydotdev/shared/src/graphql/common'; import { defaultOpenGraph } from '../next-seo'; -import { JoinPageProps } from '../components/invite/common'; +import type { JoinPageProps } from '../components/invite/common'; import { AISearchInvite } from '../components/invite/AISearchInvite'; import Custom404Seo from './404'; import { Referral } from '../components/invite/Referral'; diff --git a/packages/webapp/pages/my-feed.tsx b/packages/webapp/pages/my-feed.tsx index 3d642aa501..e6182fefd2 100644 --- a/packages/webapp/pages/my-feed.tsx +++ b/packages/webapp/pages/my-feed.tsx @@ -1,5 +1,6 @@ -import { NextSeoProps } from 'next-seo'; -import React, { ReactElement } from 'react'; +import type { NextSeoProps } from 'next-seo'; +import type { ReactElement } from 'react'; +import React from 'react'; import { getMainFeedLayout, mainFeedLayoutProps, diff --git a/packages/webapp/pages/notifications.tsx b/packages/webapp/pages/notifications.tsx index 7823f8f8c3..7339f74a06 100644 --- a/packages/webapp/pages/notifications.tsx +++ b/packages/webapp/pages/notifications.tsx @@ -1,15 +1,15 @@ -import React, { ReactElement, useEffect, useState } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect, useState } from 'react'; import classNames from 'classnames'; -import { NextSeoProps } from 'next-seo'; -import { - InfiniteData, - useInfiniteQuery, - useMutation, -} from '@tanstack/react-query'; -import { +import type { NextSeoProps } from 'next-seo'; +import type { InfiniteData } from '@tanstack/react-query'; +import { useInfiniteQuery, useMutation } from '@tanstack/react-query'; +import type { Notification, - NOTIFICATIONS_QUERY, NotificationsData, +} from '@dailydotdev/shared/src/graphql/notifications'; +import { + NOTIFICATIONS_QUERY, READ_NOTIFICATIONS_MUTATION, } from '@dailydotdev/shared/src/graphql/notifications'; import { diff --git a/packages/webapp/pages/onboarding.tsx b/packages/webapp/pages/onboarding.tsx index bdaaf6dce2..5d982f414c 100644 --- a/packages/webapp/pages/onboarding.tsx +++ b/packages/webapp/pages/onboarding.tsx @@ -1,5 +1,5 @@ +import type { ReactElement } from 'react'; import React, { - ReactElement, useCallback, useEffect, useMemo, @@ -7,11 +7,13 @@ import React, { useState, } from 'react'; import classNames from 'classnames'; -import AuthOptions, { - AuthDisplay, +import type { AuthOptionsProps, AuthProps, } from '@dailydotdev/shared/src/components/auth/AuthOptions'; +import AuthOptions, { + AuthDisplay, +} from '@dailydotdev/shared/src/components/auth/AuthOptions'; import { AuthTriggers } from '@dailydotdev/shared/src/lib/auth'; import { OnboardingHeader } from '@dailydotdev/shared/src/components/onboarding'; import { @@ -28,7 +30,7 @@ import { wrapperMaxWidth, } from '@dailydotdev/shared/src/components/onboarding/common'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; -import { NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; import { SIGNIN_METHOD_KEY } from '@dailydotdev/shared/src/hooks/auth/useSignBack'; import { useFeature, @@ -57,7 +59,7 @@ import { ViewSize, } from '@dailydotdev/shared/src/hooks'; import { GenericLoader } from '@dailydotdev/shared/src/components/utilities/loaders'; -import { LoggedUser } from '@dailydotdev/shared/src/lib/user'; +import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import { useSettingsContext } from '@dailydotdev/shared/src/contexts/SettingsContext'; import { ChecklistViewState } from '@dailydotdev/shared/src/lib/checklist'; import { getPathnameWithQuery } from '@dailydotdev/shared/src/lib'; diff --git a/packages/webapp/pages/plus/index.tsx b/packages/webapp/pages/plus/index.tsx index 4a82e544fe..0c5ec99d3a 100644 --- a/packages/webapp/pages/plus/index.tsx +++ b/packages/webapp/pages/plus/index.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import dynamic from 'next/dynamic'; import { useViewSize, ViewSize } from '@dailydotdev/shared/src/hooks'; diff --git a/packages/webapp/pages/plus/payment.tsx b/packages/webapp/pages/plus/payment.tsx index a412065ce6..5c2872d7f4 100644 --- a/packages/webapp/pages/plus/payment.tsx +++ b/packages/webapp/pages/plus/payment.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; import { usePaymentContext } from '@dailydotdev/shared/src/contexts/PaymentContext'; import { useRouter } from 'next/router'; diff --git a/packages/webapp/pages/plus/success.tsx b/packages/webapp/pages/plus/success.tsx index 81ee86ed19..365e63edef 100644 --- a/packages/webapp/pages/plus/success.tsx +++ b/packages/webapp/pages/plus/success.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { Typography, TypographyColor, diff --git a/packages/webapp/pages/popular.tsx b/packages/webapp/pages/popular.tsx index ec309b7472..7e82cf4c2f 100644 --- a/packages/webapp/pages/popular.tsx +++ b/packages/webapp/pages/popular.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { getMainFeedLayout, mainFeedLayoutProps, diff --git a/packages/webapp/pages/popup/notifications/enable.tsx b/packages/webapp/pages/popup/notifications/enable.tsx index bcdfb07113..18d826a253 100644 --- a/packages/webapp/pages/popup/notifications/enable.tsx +++ b/packages/webapp/pages/popup/notifications/enable.tsx @@ -1,11 +1,12 @@ -import React, { ComponentType, useEffect } from 'react'; +import type { ComponentType } from 'react'; +import React, { useEffect } from 'react'; import classNames from 'classnames'; import NotificationToggleIcon from '@dailydotdev/shared/src/components/icons/NotificationToggle/primary.svg'; import classed from '@dailydotdev/shared/src/lib/classed'; import { postWindowMessage } from '@dailydotdev/shared/src/lib/func'; import { ENABLE_NOTIFICATION_WINDOW_KEY } from '@dailydotdev/shared/src/hooks/useNotificationPermissionPopup'; import { useRouter } from 'next/router'; -import { NotificationPromptSource } from '@dailydotdev/shared/src/lib/log'; +import type { NotificationPromptSource } from '@dailydotdev/shared/src/lib/log'; import { useLogContext } from '@dailydotdev/shared/src/contexts/LogContext'; import { usePushNotificationContext } from '@dailydotdev/shared/src/contexts/PushNotificationContext'; import { usePushNotificationMutation } from '@dailydotdev/shared/src/hooks/notifications'; diff --git a/packages/webapp/pages/posts/[id]/edit.tsx b/packages/webapp/pages/posts/[id]/edit.tsx index 9b601154ae..3d4d68fa2a 100644 --- a/packages/webapp/pages/posts/[id]/edit.tsx +++ b/packages/webapp/pages/posts/[id]/edit.tsx @@ -1,17 +1,20 @@ -import React, { FormEvent, ReactElement } from 'react'; +import type { FormEvent, ReactElement } from 'react'; +import React from 'react'; import { useRouter } from 'next/router'; import { WriteFreeformContent, WritePage, WritePostHeader, } from '@dailydotdev/shared/src/components/post/freeform'; -import { EditPostProps, PostType } from '@dailydotdev/shared/src/graphql/posts'; +import type { EditPostProps } from '@dailydotdev/shared/src/graphql/posts'; +import { PostType } from '@dailydotdev/shared/src/graphql/posts'; import usePostById from '@dailydotdev/shared/src/hooks/usePostById'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import { useToastNotification } from '@dailydotdev/shared/src/hooks/useToastNotification'; -import { ApiErrorResult } from '@dailydotdev/shared/src/graphql/common'; +import type { ApiErrorResult } from '@dailydotdev/shared/src/graphql/common'; import { useDiscardPost } from '@dailydotdev/shared/src/hooks/input/useDiscardPost'; -import { NextSeo, NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; +import { NextSeo } from 'next-seo'; import { WritePostContextProvider } from '@dailydotdev/shared/src/contexts'; import { verifyPermission } from '@dailydotdev/shared/src/graphql/squads'; import { SourcePermissions } from '@dailydotdev/shared/src/graphql/sources'; diff --git a/packages/webapp/pages/posts/[id]/index.tsx b/packages/webapp/pages/posts/[id]/index.tsx index 8b31550fa3..d2bcaa5f19 100644 --- a/packages/webapp/pages/posts/[id]/index.tsx +++ b/packages/webapp/pages/posts/[id]/index.tsx @@ -1,21 +1,21 @@ -import React, { CSSProperties, ReactElement, useState } from 'react'; +import type { CSSProperties, ReactElement } from 'react'; +import React, { useState } from 'react'; import { useRouter } from 'next/router'; import dynamic from 'next/dynamic'; -import { +import type { GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult, } from 'next'; -import { ParsedUrlQuery } from 'querystring'; +import type { ParsedUrlQuery } from 'querystring'; +import type { Post, PostData } from '@dailydotdev/shared/src/graphql/posts'; import { - Post, POST_BY_ID_STATIC_FIELDS_QUERY, - PostData, PostType, } from '@dailydotdev/shared/src/graphql/posts'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { NextSeoProps } from 'next-seo/lib/types'; import Head from 'next/head'; -import { ClientError } from 'graphql-request'; +import type { ClientError } from 'graphql-request'; import { SCROLL_OFFSET } from '@dailydotdev/shared/src/components/post/PostContent'; import { useScrollTopOffset } from '@dailydotdev/shared/src/hooks/useScrollTopOffset'; import { Origin } from '@dailydotdev/shared/src/lib/log'; @@ -41,7 +41,7 @@ import { getSeoDescription, PostSEOSchema, } from '../../../components/PostSEOSchema'; -import { DynamicSeoProps } from '../../../components/common'; +import type { DynamicSeoProps } from '../../../components/common'; const Custom404 = dynamic( () => import(/* webpackChunkName: "404" */ '../../404'), diff --git a/packages/webapp/pages/posts/[id]/share/index.tsx b/packages/webapp/pages/posts/[id]/share/index.tsx index 03da798440..2f0b22b2ba 100644 --- a/packages/webapp/pages/posts/[id]/share/index.tsx +++ b/packages/webapp/pages/posts/[id]/share/index.tsx @@ -1,22 +1,21 @@ -import React, { GetServerSideProps } from 'next'; -import { - Post, - POST_BY_ID_STATIC_FIELDS_QUERY, - PostData, -} from '@dailydotdev/shared/src/graphql/posts'; +import type { GetServerSideProps } from 'next'; +import React from 'next'; +import type { Post, PostData } from '@dailydotdev/shared/src/graphql/posts'; +import { POST_BY_ID_STATIC_FIELDS_QUERY } from '@dailydotdev/shared/src/graphql/posts'; import { ApiError, gqlClient } from '@dailydotdev/shared/src/graphql/common'; -import { ClientError } from 'graphql-request'; -import { NextSeoProps } from 'next-seo'; +import type { ClientError } from 'graphql-request'; +import type { NextSeoProps } from 'next-seo'; import { webappUrl } from '@dailydotdev/shared/src/lib/constants'; -import { ReactElement } from 'react'; +import type { ReactElement } from 'react'; import CustomAuthBanner from '@dailydotdev/shared/src/components/auth/CustomAuthBanner'; -import { PublicProfile } from '@dailydotdev/shared/src/lib/user'; +import type { PublicProfile } from '@dailydotdev/shared/src/lib/user'; import { useUserShortByIdQuery } from '@dailydotdev/shared/src/hooks/user/useUserShortByIdQuery'; import { USER_SHORT_BY_ID } from '@dailydotdev/shared/src/graphql/users'; import { getPathnameWithQuery } from '@dailydotdev/shared/src/lib'; import { getTemplatedTitle } from '../../../../components/layouts/utils'; import { getSeoDescription } from '../../../../components/PostSEOSchema'; -import { PostPage, Props, seoTitle } from '../index'; +import type { Props } from '../index'; +import { PostPage, seoTitle } from '../index'; import { getLayout } from '../../../../components/layouts/MainLayout'; export type SharePostPageProps = Props & { diff --git a/packages/webapp/pages/posts/discussed.tsx b/packages/webapp/pages/posts/discussed.tsx index f061c41d6b..c60380baba 100644 --- a/packages/webapp/pages/posts/discussed.tsx +++ b/packages/webapp/pages/posts/discussed.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { NextSeo } from 'next-seo'; import { getMainFeedLayout, diff --git a/packages/webapp/pages/posts/index.tsx b/packages/webapp/pages/posts/index.tsx index 61e37e67ac..24ba82b33c 100644 --- a/packages/webapp/pages/posts/index.tsx +++ b/packages/webapp/pages/posts/index.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { NextSeo } from 'next-seo'; import { getMainFeedLayout, diff --git a/packages/webapp/pages/posts/latest.tsx b/packages/webapp/pages/posts/latest.tsx index dd19eba9cc..3b5692f3a9 100644 --- a/packages/webapp/pages/posts/latest.tsx +++ b/packages/webapp/pages/posts/latest.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { NextSeo } from 'next-seo'; import { getMainFeedLayout, diff --git a/packages/webapp/pages/posts/upvoted.tsx b/packages/webapp/pages/posts/upvoted.tsx index 74ca1062aa..f1b0118739 100644 --- a/packages/webapp/pages/posts/upvoted.tsx +++ b/packages/webapp/pages/posts/upvoted.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { NextSeo } from 'next-seo'; import { getMainFeedLayout, diff --git a/packages/webapp/pages/roast.tsx b/packages/webapp/pages/roast.tsx index a9d601c12a..11977eb90a 100644 --- a/packages/webapp/pages/roast.tsx +++ b/packages/webapp/pages/roast.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, ReactNode, useContext, useState } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useContext, useState } from 'react'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; import { Button, @@ -8,14 +9,14 @@ import { import { LazyImage } from '@dailydotdev/shared/src/components/LazyImage'; import classNames from 'classnames'; import { FormErrorMessage } from '@dailydotdev/shared/src/components/utilities'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { AuthTriggers } from '@dailydotdev/shared/src/lib/auth'; import { labels } from '@dailydotdev/shared/src/lib'; import { Automation, useAutomation, } from '@dailydotdev/shared/src/hooks/useAutomation'; -import { HttpError } from '@dailydotdev/shared/src/lib/errors'; +import type { HttpError } from '@dailydotdev/shared/src/lib/errors'; import { Dropdown } from '@dailydotdev/shared/src/components/fields/Dropdown'; import { useMutation } from '@tanstack/react-query'; import { downloadUrl } from '@dailydotdev/shared/src/lib/blob'; diff --git a/packages/webapp/pages/search/chat/index.tsx b/packages/webapp/pages/search/chat/index.tsx index e5ad96ce55..1c5f53a46f 100644 --- a/packages/webapp/pages/search/chat/index.tsx +++ b/packages/webapp/pages/search/chat/index.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { withFeaturesBoundary } from '@dailydotdev/shared/src/components'; -import { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; +import type { MainLayoutProps } from '@dailydotdev/shared/src/components/MainLayout'; import SearchPage from '../../../components/search/SearchChatPage'; import { GetSearchLayout } from '../../../components/layouts/SearchLayout'; diff --git a/packages/webapp/pages/search/posts/index.tsx b/packages/webapp/pages/search/posts/index.tsx index b2ee5d9787..ad20b39707 100644 --- a/packages/webapp/pages/search/posts/index.tsx +++ b/packages/webapp/pages/search/posts/index.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement, useEffect } from 'react'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; import { useRouter } from 'next/router'; import { SearchProviderEnum, diff --git a/packages/webapp/pages/sources/[source].tsx b/packages/webapp/pages/sources/[source].tsx index 37c28ba749..6fcd1861da 100644 --- a/packages/webapp/pages/sources/[source].tsx +++ b/packages/webapp/pages/sources/[source].tsx @@ -1,24 +1,27 @@ -import { +import type { GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult, } from 'next'; -import { ParsedUrlQuery } from 'querystring'; -import React, { ReactElement, useContext, useMemo } from 'react'; +import type { ParsedUrlQuery } from 'querystring'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; import { useRouter } from 'next/router'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { NextSeoProps } from 'next-seo/lib/types'; import Feed from '@dailydotdev/shared/src/components/Feed'; import { MOST_DISCUSSED_FEED_QUERY, MOST_UPVOTED_FEED_QUERY, SOURCE_FEED_QUERY, } from '@dailydotdev/shared/src/graphql/feed'; +import type { + Source, + SourceData, +} from '@dailydotdev/shared/src/graphql/sources'; import { SIMILAR_SOURCES_QUERY, - Source, SOURCE_QUERY, SOURCE_RELATED_TAGS_QUERY, - SourceData, } from '@dailydotdev/shared/src/graphql/sources'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; @@ -27,11 +30,8 @@ import { DiscussIcon, UpvoteIcon, } from '@dailydotdev/shared/src/components/icons'; -import { - ApiError, - Connection, - gqlClient, -} from '@dailydotdev/shared/src/graphql/common'; +import type { Connection } from '@dailydotdev/shared/src/graphql/common'; +import { ApiError, gqlClient } from '@dailydotdev/shared/src/graphql/common'; import { OtherFeedPage, RequestKey, @@ -59,7 +59,7 @@ import { defaultOpenGraph, defaultSeo } from '../../next-seo'; import { mainFeedLayoutProps } from '../../components/layouts/MainFeedPage'; import { getLayout } from '../../components/layouts/FeedLayout'; import { SourceActions } from '../../../shared/src/components/sources/SourceActions'; -import { DynamicSeoProps } from '../../components/common'; +import type { DynamicSeoProps } from '../../components/common'; interface SourcePageProps extends DynamicSeoProps { source?: Source; diff --git a/packages/webapp/pages/sources/index.tsx b/packages/webapp/pages/sources/index.tsx index 22a8e684dd..2dab1badd6 100644 --- a/packages/webapp/pages/sources/index.tsx +++ b/packages/webapp/pages/sources/index.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; -import { GetStaticPropsResult } from 'next'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { GetStaticPropsResult } from 'next'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { Button, @@ -10,10 +11,8 @@ import { PlusIcon, SitesIcon } from '@dailydotdev/shared/src/components/icons'; import { LazyModal } from '@dailydotdev/shared/src/components/modals/common/types'; import { useLazyModal } from '@dailydotdev/shared/src/hooks/useLazyModal'; import { useViewSize, ViewSize } from '@dailydotdev/shared/src/hooks'; -import { - Source, - SOURCE_DIRECTORY_QUERY, -} from '@dailydotdev/shared/src/graphql/sources'; +import type { Source } from '@dailydotdev/shared/src/graphql/sources'; +import { SOURCE_DIRECTORY_QUERY } from '@dailydotdev/shared/src/graphql/sources'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; import { ApiError, gqlClient } from '@dailydotdev/shared/src/graphql/common'; import { useRouter } from 'next/router'; diff --git a/packages/webapp/pages/squads/[handle]/[token].tsx b/packages/webapp/pages/squads/[handle]/[token].tsx index 1f9205b1e3..2b92bd3b19 100644 --- a/packages/webapp/pages/squads/[handle]/[token].tsx +++ b/packages/webapp/pages/squads/[handle]/[token].tsx @@ -5,15 +5,13 @@ import { getSquadInvitation, validateSourceHandle, } from '@dailydotdev/shared/src/graphql/squads'; -import { - SourceMember, - SourceMemberRole, -} from '@dailydotdev/shared/src/graphql/sources'; -import { - ApiErrorMessage, +import type { SourceMember } from '@dailydotdev/shared/src/graphql/sources'; +import { SourceMemberRole } from '@dailydotdev/shared/src/graphql/sources'; +import type { ApiErrorResult, Edge, } from '@dailydotdev/shared/src/graphql/common'; +import { ApiErrorMessage } from '@dailydotdev/shared/src/graphql/common'; import { ProfileImageLink } from '@dailydotdev/shared/src/components/profile/ProfileImageLink'; import classed from '@dailydotdev/shared/src/lib/classed'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; @@ -22,15 +20,10 @@ import { ButtonSize, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; -import React, { - ReactElement, - useContext, - useEffect, - useRef, - useState, -} from 'react'; -import { ParsedUrlQuery } from 'querystring'; -import { +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useRef, useState } from 'react'; +import type { ParsedUrlQuery } from 'querystring'; +import type { GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult, @@ -39,7 +32,7 @@ import { webappUrl } from '@dailydotdev/shared/src/lib/constants'; import { disabledRefetch } from '@dailydotdev/shared/src/lib/func'; import LogContext from '@dailydotdev/shared/src/contexts/LogContext'; import { LogEvent, Origin } from '@dailydotdev/shared/src/lib/log'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { useToastNotification } from '@dailydotdev/shared/src/hooks/useToastNotification'; import { ReferralOriginKey } from '@dailydotdev/shared/src/lib/user'; import { useJoinSquad } from '@dailydotdev/shared/src/hooks'; @@ -50,7 +43,7 @@ import { ProfileImageSize } from '@dailydotdev/shared/src/components/ProfilePict import Link from '@dailydotdev/shared/src/components/utilities/Link'; import { getLayout } from '../../../components/layouts/MainLayout'; import { getSquadOpenGraph } from '../../../next-seo'; -import { DynamicSeoProps } from '../../../components/common'; +import type { DynamicSeoProps } from '../../../components/common'; const getOthers = (others: Edge[], total: number) => { const { length } = others; diff --git a/packages/webapp/pages/squads/[handle]/edit.tsx b/packages/webapp/pages/squads/[handle]/edit.tsx index 143f2d22c1..085290e429 100644 --- a/packages/webapp/pages/squads/[handle]/edit.tsx +++ b/packages/webapp/pages/squads/[handle]/edit.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo'; import { useRouter } from 'next/router'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import Unauthorized from '@dailydotdev/shared/src/components/errors/Unauthorized'; @@ -8,25 +9,23 @@ import { DefaultSquadHeader } from '@dailydotdev/shared/src/components/layout/De import { editSquad } from '@dailydotdev/shared/src/graphql/squads'; import { useBoot } from '@dailydotdev/shared/src/hooks/useBoot'; import { useToastNotification } from '@dailydotdev/shared/src/hooks/useToastNotification'; -import { - ManageSquadPageContainer, - SquadSettingsProps, -} from '@dailydotdev/shared/src/components/squads/utils'; +import type { SquadSettingsProps } from '@dailydotdev/shared/src/components/squads/utils'; +import { ManageSquadPageContainer } from '@dailydotdev/shared/src/components/squads/utils'; import { MangeSquadPageSkeleton } from '@dailydotdev/shared/src/components/squads/MangeSquadPageSkeleton'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useSquad } from '@dailydotdev/shared/src/hooks'; -import { +import type { GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult, } from 'next'; -import { ParsedUrlQuery } from 'querystring'; +import type { ParsedUrlQuery } from 'querystring'; import { generateQueryKey, RequestKey, } from '@dailydotdev/shared/src/lib/query'; import { parseOrDefault } from '@dailydotdev/shared/src/lib/func'; -import { ApiErrorResult } from '@dailydotdev/shared/src/graphql/common'; +import type { ApiErrorResult } from '@dailydotdev/shared/src/graphql/common'; import { SquadTab, SquadTabs, diff --git a/packages/webapp/pages/squads/[handle]/index.tsx b/packages/webapp/pages/squads/[handle]/index.tsx index bcf8b96042..17ff28bd08 100644 --- a/packages/webapp/pages/squads/[handle]/index.tsx +++ b/packages/webapp/pages/squads/[handle]/index.tsx @@ -1,13 +1,8 @@ -import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'; -import { ParsedUrlQuery } from 'querystring'; -import React, { - ReactElement, - useContext, - useEffect, - useMemo, - useState, -} from 'react'; -import { NextSeoProps } from 'next-seo'; +import type { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'; +import type { ParsedUrlQuery } from 'querystring'; +import type { ReactElement } from 'react'; +import React, { useContext, useEffect, useMemo, useState } from 'react'; +import type { NextSeoProps } from 'next-seo'; import Feed from '@dailydotdev/shared/src/components/Feed'; import { SOURCE_FEED_QUERY, @@ -20,12 +15,12 @@ import { BaseFeedPage, FeedPageLayoutList, } from '@dailydotdev/shared/src/components/utilities'; +import type { SquadStaticData } from '@dailydotdev/shared/src/graphql/squads'; import { getSquadMembers, getSquadStaticFields, - SquadStaticData, } from '@dailydotdev/shared/src/graphql/squads'; -import { +import type { BasicSourceMember, Squad, Source, @@ -43,7 +38,7 @@ import { useSquad, } from '@dailydotdev/shared/src/hooks'; import { oneHour } from '@dailydotdev/shared/src/lib/dateFormat'; -import { ClientError } from 'graphql-request'; +import type { ClientError } from 'graphql-request'; import { ApiError, gqlClient } from '@dailydotdev/shared/src/graphql/common'; import { OtherFeedPage, StaleTime } from '@dailydotdev/shared/src/lib/query'; import { useRouter } from 'next/router'; @@ -53,15 +48,14 @@ import { getPathnameWithQuery } from '@dailydotdev/shared/src/lib'; import { webappUrl } from '@dailydotdev/shared/src/lib/constants'; import { usePrivateSourceJoin } from '@dailydotdev/shared/src/hooks/source/usePrivateSourceJoin'; import { GET_REFERRING_USER_QUERY } from '@dailydotdev/shared/src/graphql/users'; -import { PublicProfile } from '@dailydotdev/shared/src/lib/user'; +import type { PublicProfile } from '@dailydotdev/shared/src/lib/user'; import { mainFeedLayoutProps } from '../../../components/layouts/MainFeedPage'; import { getLayout } from '../../../components/layouts/FeedLayout'; -import ProtectedPage, { - ProtectedPageProps, -} from '../../../components/ProtectedPage'; +import type { ProtectedPageProps } from '../../../components/ProtectedPage'; +import ProtectedPage from '../../../components/ProtectedPage'; import { getSquadOpenGraph } from '../../../next-seo'; import { getTemplatedTitle } from '../../../components/layouts/utils'; -import { DynamicSeoProps } from '../../../components/common'; +import type { DynamicSeoProps } from '../../../components/common'; const Custom404 = dynamic( () => import(/* webpackChunkName: "404" */ '../../404'), diff --git a/packages/webapp/pages/squads/[handle]/moderate.tsx b/packages/webapp/pages/squads/[handle]/moderate.tsx index 2625dee253..e7ae7d779b 100644 --- a/packages/webapp/pages/squads/[handle]/moderate.tsx +++ b/packages/webapp/pages/squads/[handle]/moderate.tsx @@ -1,8 +1,7 @@ -import React, { ReactElement, useEffect } from 'react'; -import { - ManageSquadPageContainer, - SquadSettingsProps, -} from '@dailydotdev/shared/src/components/squads/utils'; +import type { ReactElement } from 'react'; +import React, { useEffect } from 'react'; +import type { SquadSettingsProps } from '@dailydotdev/shared/src/components/squads/utils'; +import { ManageSquadPageContainer } from '@dailydotdev/shared/src/components/squads/utils'; import { SquadTab, SquadTabs, @@ -19,12 +18,12 @@ import { import { ArrowIcon } from '@dailydotdev/shared/src/components/icons'; import { useSquad } from '@dailydotdev/shared/src/hooks'; import { useRouter } from 'next/router'; -import { +import type { GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult, } from 'next'; -import { ParsedUrlQuery } from 'querystring'; +import type { ParsedUrlQuery } from 'querystring'; import { verifyPermission } from '@dailydotdev/shared/src/graphql/squads'; import { SourcePermissions } from '@dailydotdev/shared/src/graphql/sources'; import { TypographyType } from '@dailydotdev/shared/src/components/typography/Typography'; diff --git a/packages/webapp/pages/squads/create.tsx b/packages/webapp/pages/squads/create.tsx index 0b8c55712d..3d83f0f14e 100644 --- a/packages/webapp/pages/squads/create.tsx +++ b/packages/webapp/pages/squads/create.tsx @@ -1,20 +1,15 @@ -import React, { - FormEvent, - ReactElement, - useEffect, - useMemo, - useState, -} from 'react'; -import { NextSeoProps } from 'next-seo'; +import type { FormEvent, ReactElement } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; +import type { NextSeoProps } from 'next-seo'; import { useRouter } from 'next/router'; import { WriteFreeformContent, WriteFreeFormSkeleton, WritePageContainer, } from '@dailydotdev/shared/src/components/post/freeform'; -import { CreatePostProps } from '@dailydotdev/shared/src/graphql/posts'; +import type { CreatePostProps } from '@dailydotdev/shared/src/graphql/posts'; import { useToastNotification } from '@dailydotdev/shared/src/hooks/useToastNotification'; -import { ApiErrorResult } from '@dailydotdev/shared/src/graphql/common'; +import type { ApiErrorResult } from '@dailydotdev/shared/src/graphql/common'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import { useDiscardPost } from '@dailydotdev/shared/src/hooks/input/useDiscardPost'; import { WritePostContextProvider } from '@dailydotdev/shared/src/contexts'; diff --git a/packages/webapp/pages/squads/discover/[id].tsx b/packages/webapp/pages/squads/discover/[id].tsx index 115f47e0ca..878b9ce716 100644 --- a/packages/webapp/pages/squads/discover/[id].tsx +++ b/packages/webapp/pages/squads/discover/[id].tsx @@ -1,18 +1,17 @@ import { oneHour } from '@dailydotdev/shared/src/lib/dateFormat'; -import { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'; -import { ParsedUrlQuery } from 'querystring'; -import React, { ReactElement } from 'react'; -import { - getSourceCategory, - SourceCategory, -} from '@dailydotdev/shared/src/graphql/source/categories'; +import type { GetServerSidePropsContext, GetServerSidePropsResult } from 'next'; +import type { ParsedUrlQuery } from 'querystring'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { SourceCategory } from '@dailydotdev/shared/src/graphql/source/categories'; +import { getSourceCategory } from '@dailydotdev/shared/src/graphql/source/categories'; import { useSources } from '@dailydotdev/shared/src/hooks/source/useSources'; import InfiniteScrolling, { checkFetchMore, } from '@dailydotdev/shared/src/components/containers/InfiniteScrolling'; import { FeedContainer } from '@dailydotdev/shared/src/components'; import { UnfeaturedSquadGrid } from '@dailydotdev/shared/src/components/cards/squad/UnfeaturedSquadGrid'; -import { Squad } from '@dailydotdev/shared/src/graphql/sources'; +import type { Squad } from '@dailydotdev/shared/src/graphql/sources'; import { SquadDirectoryLayout } from '@dailydotdev/shared/src/components/squads/layout/SquadDirectoryLayout'; import { PlaceholderSquadGridList } from '@dailydotdev/shared/src/components/cards/squad/PlaceholderSquadGrid'; import { PlaceholderSquadListList } from '@dailydotdev/shared/src/components/cards/squad/PlaceholderSquadList'; @@ -21,7 +20,7 @@ import { useViewSize, ViewSize } from '@dailydotdev/shared/src/hooks'; import { getLayout } from '../../../components/layouts/FeedLayout'; import { mainFeedLayoutProps } from '../../../components/layouts/MainFeedPage'; import { getTemplatedTitle } from '../../../components/layouts/utils'; -import { DynamicSeoProps } from '../../../components/common'; +import type { DynamicSeoProps } from '../../../components/common'; interface SquadCategoryPageProps extends DynamicSeoProps { category: SourceCategory; diff --git a/packages/webapp/pages/squads/discover/featured.tsx b/packages/webapp/pages/squads/discover/featured.tsx index 1eaf01b88e..8833dd914d 100644 --- a/packages/webapp/pages/squads/discover/featured.tsx +++ b/packages/webapp/pages/squads/discover/featured.tsx @@ -1,16 +1,15 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import InfiniteScrolling, { checkFetchMore, } from '@dailydotdev/shared/src/components/containers/InfiniteScrolling'; -import { InfiniteData } from '@tanstack/react-query'; +import type { InfiniteData } from '@tanstack/react-query'; import { FeedContainer, SquadGrid } from '@dailydotdev/shared/src/components'; -import { Squad } from '@dailydotdev/shared/src/graphql/sources'; +import type { Squad } from '@dailydotdev/shared/src/graphql/sources'; import CustomAuthBanner from '@dailydotdev/shared/src/components/auth/CustomAuthBanner'; -import { - SourcesQueryData, - useSources, -} from '@dailydotdev/shared/src/hooks/source/useSources'; +import type { SourcesQueryData } from '@dailydotdev/shared/src/hooks/source/useSources'; +import { useSources } from '@dailydotdev/shared/src/hooks/source/useSources'; import { useViewSize, ViewSize } from '@dailydotdev/shared/src/hooks'; import { SquadList } from '@dailydotdev/shared/src/components/cards/squad/SquadList'; import { PlaceholderSquadGridList } from '@dailydotdev/shared/src/components/cards/squad/PlaceholderSquadGrid'; diff --git a/packages/webapp/pages/squads/discover/index.tsx b/packages/webapp/pages/squads/discover/index.tsx index 2eab533024..ebdc8bb992 100644 --- a/packages/webapp/pages/squads/discover/index.tsx +++ b/packages/webapp/pages/squads/discover/index.tsx @@ -1,11 +1,12 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useSquadCategories } from '@dailydotdev/shared/src/hooks/squads/useSquadCategories'; import { SquadsDirectoryFeed } from '@dailydotdev/shared/src/components/cards/squad/SquadsDirectoryFeed'; import { useViewSize, ViewSize } from '@dailydotdev/shared/src/hooks'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; import { SourceIcon } from '@dailydotdev/shared/src/components/icons'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { getLayout } from '../../../components/layouts/FeedLayout'; import { mainFeedLayoutProps } from '../../../components/layouts/MainFeedPage'; import { SquadDirectoryLayout } from '../../../../shared/src/components/squads/layout/SquadDirectoryLayout'; diff --git a/packages/webapp/pages/squads/discover/my.tsx b/packages/webapp/pages/squads/discover/my.tsx index 7ef5ceb854..68cc919055 100644 --- a/packages/webapp/pages/squads/discover/my.tsx +++ b/packages/webapp/pages/squads/discover/my.tsx @@ -1,9 +1,10 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import { SquadList } from '@dailydotdev/shared/src/components/cards/squad/SquadList'; import { useRouter } from 'next/router'; import { squadCategoriesPaths } from '@dailydotdev/shared/src/lib/constants'; -import { NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; import { getLayout } from '../../../components/layouts/FeedLayout'; import { mainFeedLayoutProps } from '../../../components/layouts/MainFeedPage'; import { SquadDirectoryLayout } from '../../../../shared/src/components/squads/layout/SquadDirectoryLayout'; diff --git a/packages/webapp/pages/squads/index.tsx b/packages/webapp/pages/squads/index.tsx index 60cb767e2c..9461a1a1d7 100644 --- a/packages/webapp/pages/squads/index.tsx +++ b/packages/webapp/pages/squads/index.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { GetServerSidePropsResult } from 'next'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { GetServerSidePropsResult } from 'next'; import { squadCategoriesPaths } from '@dailydotdev/shared/src/lib/constants'; const SquadsPage = (): ReactElement => { diff --git a/packages/webapp/pages/squads/new.tsx b/packages/webapp/pages/squads/new.tsx index dd9efdc020..710d550f3c 100644 --- a/packages/webapp/pages/squads/new.tsx +++ b/packages/webapp/pages/squads/new.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement, useState } from 'react'; -import { NextSeoProps } from 'next-seo'; +import type { ReactElement } from 'react'; +import React, { useState } from 'react'; +import type { NextSeoProps } from 'next-seo'; import router, { useRouter } from 'next/router'; import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import Unauthorized from '@dailydotdev/shared/src/components/errors/Unauthorized'; diff --git a/packages/webapp/pages/tags/[tag].tsx b/packages/webapp/pages/tags/[tag].tsx index 221a69368f..7a70229e34 100644 --- a/packages/webapp/pages/tags/[tag].tsx +++ b/packages/webapp/pages/tags/[tag].tsx @@ -1,10 +1,11 @@ -import { +import type { GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult, } from 'next'; -import { ParsedUrlQuery } from 'querystring'; -import React, { ReactElement, useContext, useMemo } from 'react'; +import type { ParsedUrlQuery } from 'querystring'; +import type { ReactElement } from 'react'; +import React, { useContext, useMemo } from 'react'; import { BlockIcon, DiscussIcon, @@ -16,7 +17,7 @@ import { } from '@dailydotdev/shared/src/components/icons'; import useFeedSettings from '@dailydotdev/shared/src/hooks/useFeedSettings'; import { useRouter } from 'next/router'; -import { NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; import Feed from '@dailydotdev/shared/src/components/Feed'; import { MOST_DISCUSSED_FEED_QUERY, @@ -24,9 +25,9 @@ import { TAG_FEED_QUERY, } from '@dailydotdev/shared/src/graphql/feed'; import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; +import type { ButtonProps } from '@dailydotdev/shared/src/components/buttons/Button'; import { Button, - ButtonProps, ButtonSize, ButtonVariant, } from '@dailydotdev/shared/src/components/buttons/Button'; @@ -39,26 +40,21 @@ import { StaleTime, } from '@dailydotdev/shared/src/lib/query'; import { LogEvent, Origin } from '@dailydotdev/shared/src/lib/log'; -import { - KEYWORD_QUERY, - Keyword, -} from '@dailydotdev/shared/src/graphql/keywords'; +import type { Keyword } from '@dailydotdev/shared/src/graphql/keywords'; +import { KEYWORD_QUERY } from '@dailydotdev/shared/src/graphql/keywords'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; import { useQuery } from '@tanstack/react-query'; -import { - GET_RECOMMENDED_TAGS_QUERY, - TagsData, -} from '@dailydotdev/shared/src/graphql/feedSettings'; +import type { TagsData } from '@dailydotdev/shared/src/graphql/feedSettings'; +import { GET_RECOMMENDED_TAGS_QUERY } from '@dailydotdev/shared/src/graphql/feedSettings'; import { ReferralCampaignKey, useFeedLayout, } from '@dailydotdev/shared/src/hooks'; import { RecommendedTags } from '@dailydotdev/shared/src/components/RecommendedTags'; -import { - SOURCES_BY_TAG_QUERY, - Source, -} from '@dailydotdev/shared/src/graphql/sources'; -import { Connection, gqlClient } from '@dailydotdev/shared/src/graphql/common'; +import type { Source } from '@dailydotdev/shared/src/graphql/sources'; +import { SOURCES_BY_TAG_QUERY } from '@dailydotdev/shared/src/graphql/sources'; +import type { Connection } from '@dailydotdev/shared/src/graphql/common'; +import { gqlClient } from '@dailydotdev/shared/src/graphql/common'; import { RelatedSources } from '@dailydotdev/shared/src/components/RelatedSources'; import { ActiveFeedNameContext } from '@dailydotdev/shared/src/contexts'; import HorizontalFeed from '@dailydotdev/shared/src/components/feeds/HorizontalFeed'; @@ -73,7 +69,7 @@ import { useContentPreference } from '@dailydotdev/shared/src/hooks/contentPrefe import { ContentPreferenceType } from '@dailydotdev/shared/src/graphql/contentPreference'; import { getLayout } from '../../components/layouts/FeedLayout'; import { mainFeedLayoutProps } from '../../components/layouts/MainFeedPage'; -import { DynamicSeoProps } from '../../components/common'; +import type { DynamicSeoProps } from '../../components/common'; import { defaultOpenGraph, defaultSeo } from '../../next-seo'; interface TagPageProps extends DynamicSeoProps { diff --git a/packages/webapp/pages/tags/index.tsx b/packages/webapp/pages/tags/index.tsx index 722c54fab1..70b5b0fd8f 100644 --- a/packages/webapp/pages/tags/index.tsx +++ b/packages/webapp/pages/tags/index.tsx @@ -1,10 +1,9 @@ -import React, { ReactElement, useMemo } from 'react'; -import { GetStaticPropsResult } from 'next'; -import { NextSeoProps } from 'next-seo/lib/types'; -import { - Keyword, - TAG_DIRECTORY_QUERY, -} from '@dailydotdev/shared/src/graphql/keywords'; +import type { ReactElement } from 'react'; +import React, { useMemo } from 'react'; +import type { GetStaticPropsResult } from 'next'; +import type { NextSeoProps } from 'next-seo/lib/types'; +import type { Keyword } from '@dailydotdev/shared/src/graphql/keywords'; +import { TAG_DIRECTORY_QUERY } from '@dailydotdev/shared/src/graphql/keywords'; import { TagLink } from '@dailydotdev/shared/src/components/TagLinks'; import { HashtagIcon } from '@dailydotdev/shared/src/components/icons'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; diff --git a/packages/webapp/pages/upvoted.tsx b/packages/webapp/pages/upvoted.tsx index ca2b531f5c..70040735ec 100644 --- a/packages/webapp/pages/upvoted.tsx +++ b/packages/webapp/pages/upvoted.tsx @@ -1,5 +1,6 @@ -import React, { ReactElement } from 'react'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { getMainFeedLayout, mainFeedLayoutProps, diff --git a/packages/webapp/pages/users.tsx b/packages/webapp/pages/users.tsx index be69834950..07aa4d101a 100644 --- a/packages/webapp/pages/users.tsx +++ b/packages/webapp/pages/users.tsx @@ -1,6 +1,7 @@ -import React, { ReactElement } from 'react'; -import { GetStaticPropsResult } from 'next'; -import { NextSeoProps } from 'next-seo/lib/types'; +import type { ReactElement } from 'react'; +import React from 'react'; +import type { GetStaticPropsResult } from 'next'; +import type { NextSeoProps } from 'next-seo/lib/types'; import { ApiError, gqlClient } from '@dailydotdev/shared/src/graphql/common'; import { LEADERBOARD_QUERY } from '@dailydotdev/shared/src/graphql/leaderboard'; import { useRouter } from 'next/router'; @@ -9,14 +10,10 @@ import { SquadIcon } from '@dailydotdev/shared/src/components/icons'; import { IconSize } from '@dailydotdev/shared/src/components/Icon'; import type { GraphQLError } from '@dailydotdev/shared/src/lib/errors'; import { PageWrapperLayout } from '@dailydotdev/shared/src/components/layout/PageWrapperLayout'; -import { - UserLeaderboard, - UserTopList, -} from '@dailydotdev/shared/src/components/cards/Leaderboard'; -import { - CompanyLeaderboard, - CompanyTopList, -} from '@dailydotdev/shared/src/components/cards/Leaderboard/CompanyTopList'; +import type { UserLeaderboard } from '@dailydotdev/shared/src/components/cards/Leaderboard'; +import { UserTopList } from '@dailydotdev/shared/src/components/cards/Leaderboard'; +import type { CompanyLeaderboard } from '@dailydotdev/shared/src/components/cards/Leaderboard/CompanyTopList'; +import { CompanyTopList } from '@dailydotdev/shared/src/components/cards/Leaderboard/CompanyTopList'; import { getLayout as getFooterNavBarLayout } from '../components/layouts/FooterNavBarLayout'; import { getLayout } from '../components/layouts/MainLayout'; import { defaultOpenGraph } from '../next-seo'; diff --git a/packages/webapp/pages/verification.tsx b/packages/webapp/pages/verification.tsx index 86ca8ee610..9ef2fdff36 100644 --- a/packages/webapp/pages/verification.tsx +++ b/packages/webapp/pages/verification.tsx @@ -1,4 +1,5 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import React from 'react'; import EmailCodeVerification from '@dailydotdev/shared/src/components/auth/EmailCodeVerification'; import { useRouter } from 'next/router'; import AuthHeader from '@dailydotdev/shared/src/components/auth/AuthHeader'; diff --git a/packages/webapp/pages/welcome/index.tsx b/packages/webapp/pages/welcome/index.tsx index 94a495769b..7922012494 100644 --- a/packages/webapp/pages/welcome/index.tsx +++ b/packages/webapp/pages/welcome/index.tsx @@ -1,5 +1,7 @@ -import React, { ReactElement, useEffect, useState } from 'react'; -import Feed, { FeedProps } from '@dailydotdev/shared/src/components/Feed'; +import type { ReactElement } from 'react'; +import React, { useEffect, useState } from 'react'; +import type { FeedProps } from '@dailydotdev/shared/src/components/Feed'; +import Feed from '@dailydotdev/shared/src/components/Feed'; import { ANONYMOUS_FEED_QUERY, RankingAlgorithm, @@ -32,7 +34,7 @@ import { import { AuthTriggers } from '@dailydotdev/shared/src/lib/auth'; import { cloudinaryWelcomePageHeaderMainImage } from '@dailydotdev/shared/src/lib/image'; import classNames from 'classnames'; -import { NextSeoProps } from 'next-seo'; +import type { NextSeoProps } from 'next-seo'; import { useQueryClient } from '@tanstack/react-query'; import { getPathnameWithQuery } from '@dailydotdev/shared/src/lib'; import { Pixels } from '@dailydotdev/shared/src/components/Pixels'; diff --git a/packages/webapp/tailwind.config.ts b/packages/webapp/tailwind.config.ts index a268b43384..263aba3571 100644 --- a/packages/webapp/tailwind.config.ts +++ b/packages/webapp/tailwind.config.ts @@ -1,4 +1,5 @@ -import type { Config } from 'tailwindcss'; +// eslint-disable-next-line import/no-extraneous-dependencies +import { type Config } from 'tailwindcss'; import config from '@dailydotdev/shared/tailwind.config'; import path from 'path'; import * as fs from 'fs'; diff --git a/packages/webapp/tsconfig.json b/packages/webapp/tsconfig.json index 2d870ac809..ee78bf7d44 100644 --- a/packages/webapp/tsconfig.json +++ b/packages/webapp/tsconfig.json @@ -10,6 +10,7 @@ "allowJs": true, "skipLibCheck": true, "strict": false, + "verbatimModuleSyntax": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43990a33e2..a0b64f3945 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14290,11 +14290,7 @@ snapshots: pretty-format: 26.6.2 throat: 5.0.0 transitivePeerDependencies: - - bufferutil - - canvas - supports-color - - ts-node - - utf-8-validate jest-junit@12.3.0: dependencies: