Skip to content

Commit

Permalink
chore: Format imports for auto-ordering (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrossy authored Nov 8, 2024
1 parent 0c62ad6 commit 6b05b45
Show file tree
Hide file tree
Showing 66 changed files with 37 additions and 144 deletions.
1 change: 0 additions & 1 deletion src/components/banner/FormWarningBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ComponentProps } from 'react';

import { WarningBanner } from '../../components/banner/WarningBanner';
import { cardStyles } from '../layout/Card';

Expand Down
1 change: 0 additions & 1 deletion src/components/banner/WarningBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Image from 'next/image';
import { PropsWithChildren, ReactNode } from 'react';

import WarningIcon from '../../images/icons/warning.svg';

export function WarningBanner({
Expand Down
5 changes: 1 addition & 4 deletions src/components/buttons/ConnectAwareSubmitButton.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { ProtocolType } from '@hyperlane-xyz/utils';
import { useFormikContext } from 'formik';
import { useCallback } from 'react';

import { ProtocolType } from '@hyperlane-xyz/utils';

import { tryGetChainProtocol } from '../../features/chains/utils';
import { useAccountForChain, useConnectFns } from '../../features/wallet/hooks/multiProtocol';
import { useTimeout } from '../../utils/timeout';

import { SolidButton } from './SolidButton';

interface Props {
Expand Down
1 change: 0 additions & 1 deletion src/components/buttons/CopyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Image from 'next/image';
import { useState } from 'react';

import CheckmarkIcon from '../../images/icons/checkmark.svg';
import CopyIcon from '../../images/icons/copy-stack.svg';
import { tryClipboardSet } from '../../utils/clipboard';
Expand Down
1 change: 0 additions & 1 deletion src/components/errors/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Image from 'next/image';
import { Component } from 'react';

import { links } from '../../consts/links';
import ErrorIcon from '../../images/icons/error-circle.svg';
import { logger } from '../../utils/logger';
Expand Down
4 changes: 1 addition & 3 deletions src/components/icons/ChainLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { ChainLogo as ChainLogoInner } from '@hyperlane-xyz/widgets';
import Image from 'next/image';
import { useMemo } from 'react';

import { ChainLogo as ChainLogoInner } from '@hyperlane-xyz/widgets';

import { getRegistry } from '../../context/context';
import { tryGetChainMetadata } from '../../features/chains/utils';

Expand Down
1 change: 0 additions & 1 deletion src/components/icons/Chevron.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { memo } from 'react';

import { Color } from '../../styles/Color';

interface Props {
Expand Down
1 change: 0 additions & 1 deletion src/components/icons/Docs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { memo } from 'react';

import { Color } from '../../styles/Color';
import { IconProps } from './types';

Expand Down
1 change: 0 additions & 1 deletion src/components/icons/HelpIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { memo } from 'react';
import { toast } from 'react-toastify';

import Question from '../../images/icons/question-circle.svg';
import { IconButton } from '../buttons/IconButton';

Expand Down
1 change: 0 additions & 1 deletion src/components/icons/History.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { memo } from 'react';

import { Color } from '../../styles/Color';
import { IconProps } from './types';

Expand Down
5 changes: 2 additions & 3 deletions src/components/icons/Identicon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import jazzicon from '@metamask/jazzicon';
import { memo } from 'react';

import { isValidAddressEvm, normalizeAddressEvm } from '@hyperlane-xyz/utils';
import { Circle } from '@hyperlane-xyz/widgets';
import jazzicon from '@metamask/jazzicon';
import { memo } from 'react';

type Props = {
address?: string;
Expand Down
4 changes: 1 addition & 3 deletions src/components/icons/TokenIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { memo } from 'react';

import { IToken } from '@hyperlane-xyz/sdk';
import { Circle } from '@hyperlane-xyz/widgets';

import { memo } from 'react';
import { getRegistry } from '../../context/context';
import { isValidHttpsUrl, isValidRelativeUrl } from '../../utils/url';
import { ErrorBoundary } from '../errors/ErrorBoundary';
Expand Down
1 change: 0 additions & 1 deletion src/components/icons/Wallet.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { memo } from 'react';

import { Color } from '../../styles/Color';
import { IconProps } from './types';

Expand Down
1 change: 0 additions & 1 deletion src/components/icons/WalletLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Image from 'next/image';

import { WalletDetails } from '../../features/wallet/hooks/types';
import Wallet from '../../images/icons/wallet.svg';
import WalletConnect from '../../images/logos/wallet-connect.svg';
Expand Down
1 change: 0 additions & 1 deletion src/components/icons/WideChevron.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { WideChevronIcon } from '@hyperlane-xyz/widgets';

import { Color } from '../../styles/Color';

export function WideChevron({ className }: { className?: string }) {
Expand Down
1 change: 0 additions & 1 deletion src/components/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Head from 'next/head';
import { PropsWithChildren } from 'react';

import { APP_NAME, BACKGROUND_COLOR, BACKGROUND_IMAGE } from '../../consts/app';
import { useStore } from '../../features/store';
import { SideBarMenu } from '../../features/wallet/SideBarMenu';
Expand Down
1 change: 0 additions & 1 deletion src/components/layout/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Dialog, Transition } from '@headlessui/react';
import { Fragment, PropsWithChildren } from 'react';

import XCircle from '../../images/icons/x-circle.svg';
import { IconButton } from '../buttons/IconButton';

Expand Down
1 change: 0 additions & 1 deletion src/components/nav/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Link from 'next/link';
import { ReactNode } from 'react';

import { links } from '../../consts/links';
import { Color } from '../../styles/Color';
import { Discord } from '../icons/Discord';
Expand Down
1 change: 0 additions & 1 deletion src/components/nav/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Image from 'next/image';
import Link from 'next/link';

import { WalletControlBar } from '../../features/wallet/WalletControlBar';
import Logo from '../../images/logos/app-logo.svg';
import Name from '../../images/logos/app-name.svg';
Expand Down
1 change: 0 additions & 1 deletion src/components/tip/TipCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Image from 'next/image';
import { useState } from 'react';

import { IconButton } from '../../components/buttons/IconButton';
import { config } from '../../consts/config';
import { links } from '../../consts/links';
Expand Down
1 change: 0 additions & 1 deletion src/components/toast/IgpDetailsToast.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { toast } from 'react-toastify';

import { links } from '../../consts/links';

export function toastIgpDetails(igpFee: string, tokenName = 'native token') {
Expand Down
1 change: 0 additions & 1 deletion src/components/toast/TxSuccessToast.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useMemo } from 'react';
import { toast } from 'react-toastify';

import { getMultiProvider } from '../../context/context';

export function toastTxSuccess(msg: string, txHash: string, chain: ChainName) {
Expand Down
4 changes: 1 addition & 3 deletions src/components/toast/useToastError.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { errorToString } from '@hyperlane-xyz/utils';
import { useEffect } from 'react';
import { toast } from 'react-toastify';

import { errorToString } from '@hyperlane-xyz/utils';

import { logger } from '../../utils/logger';

export function useToastError(error: any, errorMsg?: string) {
Expand Down
1 change: 0 additions & 1 deletion src/consts/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Space_Grotesk } from 'next/font/google';

import { Color } from '../styles/Color';

export const MAIN_FONT = Space_Grotesk({
Expand Down
1 change: 0 additions & 1 deletion src/consts/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ChainMap } from '@hyperlane-xyz/sdk';

import { ADDRESS_BLACKLIST } from './blacklist';

const isDevMode = process?.env?.NODE_ENV === 'development';
Expand Down
2 changes: 0 additions & 2 deletions src/context/WarpContext.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import { PropsWithChildren } from 'react';

import { Spinner } from '../components/animation/Spinner';

import { initWarpContext } from './context';

export function WarpContext({ children }: PropsWithChildren<unknown>) {
Expand Down
4 changes: 1 addition & 3 deletions src/context/chains.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { z } from 'zod';

import { GithubRegistry, chainMetadata } from '@hyperlane-xyz/registry';
import { ChainMap, ChainMetadata, ChainMetadataSchema } from '@hyperlane-xyz/sdk';

import { z } from 'zod';
import { PROXY_DEPLOYED_URL } from '../consts/app.ts';
import { chains as ChainsTS } from '../consts/chains.ts';
import ChainsYaml from '../consts/chains.yaml';
Expand Down
1 change: 0 additions & 1 deletion src/context/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
WarpCore,
} from '@hyperlane-xyz/sdk';
import { isNullish } from '@hyperlane-xyz/utils';

import { assembleChainMetadata } from './chains';
import { assembleWarpCoreConfig } from './warpCoreConfig';

Expand Down
1 change: 0 additions & 1 deletion src/context/warpCoreConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { warpRouteConfigs } from '@hyperlane-xyz/registry';
import { WarpCoreConfig, WarpCoreConfigSchema } from '@hyperlane-xyz/sdk';
import { objFilter, objMerge } from '@hyperlane-xyz/utils';

import { warpRouteWhitelist } from '../consts/warpRouteWhitelist.ts';
import { warpRouteConfigs as WarpRoutesTs } from '../consts/warpRoutes.ts';
import WarpRoutesYaml from '../consts/warpRoutes.yaml';
Expand Down
2 changes: 0 additions & 2 deletions src/features/chains/ChainSelectField.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { useField, useFormikContext } from 'formik';
import Image from 'next/image';
import { useState } from 'react';

import { ChainLogo } from '../../components/icons/ChainLogo';
import ChevronIcon from '../../images/icons/chevron-down.svg';
import { TransferFormValues } from '../transfer/types';

import { ChainSelectListModal } from './ChainSelectModal';
import { getChainDisplayName } from './utils';

Expand Down
2 changes: 0 additions & 2 deletions src/features/chains/ChainSelectModal.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { useMemo } from 'react';

import { ChainLogo } from '../../components/icons/ChainLogo';
import { Modal } from '../../components/layout/Modal';

import { getChainDisplayName } from './utils';

export function ChainSelectListModal({
Expand Down
5 changes: 1 addition & 4 deletions src/features/chains/ChainWalletWarning.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { useMemo } from 'react';

import { toTitleCase } from '@hyperlane-xyz/utils';

import { useMemo } from 'react';
import { FormWarningBanner } from '../../components/banner/FormWarningBanner';
import { config } from '../../consts/config';
import { logger } from '../../utils/logger';
import { useConnectFns, useDisconnectFns, useWalletDetails } from '../wallet/hooks/multiProtocol';

import { getChainDisplayName, tryGetChainProtocol } from './utils';

export function ChainWalletWarning({ originChain }: { originChain: ChainName }) {
Expand Down
1 change: 0 additions & 1 deletion src/features/chains/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ChainNameOrId } from '@hyperlane-xyz/sdk';
import { ProtocolType, toTitleCase } from '@hyperlane-xyz/utils';

import { getMultiProvider } from '../../context/context';

const ABACUS_WORKS_DEPLOYER_NAME = 'abacus works';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isAddress } from 'viem';
import { useReadContract } from 'wagmi';

import { useEvmAccount } from '../../wallet/hooks/evm';

// https://go.chainalysis.com/chainalysis-oracle-docs.html
Expand Down
4 changes: 1 addition & 3 deletions src/features/sanctions/hooks/useIsAccountOfacSanctioned.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useQuery } from '@tanstack/react-query';

import { eqAddress } from '@hyperlane-xyz/utils';

import { useQuery } from '@tanstack/react-query';
import { useEvmAccount } from '../../wallet/hooks/evm';

const OFAC_SANCTIONED_ADDRESSES_ENDPOINT =
Expand Down
1 change: 0 additions & 1 deletion src/features/store.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { create } from 'zustand';
import { persist } from 'zustand/middleware';

import { FinalTransferStatuses, TransferContext, TransferStatus } from './transfer/types';

// Increment this when persist state has breaking changes
Expand Down
2 changes: 0 additions & 2 deletions src/features/tokens/SelectOrInputTokenIds.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { useFormikContext } from 'formik';

import { TextField } from '../../components/input/TextField';
import { TransferFormValues } from '../transfer/types';

import { SelectTokenIdField } from './SelectTokenIdField';

// import { useContractSupportsTokenByOwner, useIsSenderNftOwner } from './balances';
Expand Down
1 change: 0 additions & 1 deletion src/features/tokens/SelectTokenIdField.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useField } from 'formik';
import Image from 'next/image';
import { useState } from 'react';

import { Spinner } from '../../components/animation/Spinner';
import { Modal } from '../../components/layout/Modal';
import ChevronIcon from '../../images/icons/chevron-down.svg';
Expand Down
4 changes: 1 addition & 3 deletions src/features/tokens/TokenListModal.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { IToken } from '@hyperlane-xyz/sdk';
import Image from 'next/image';
import { useMemo, useState } from 'react';

import { IToken } from '@hyperlane-xyz/sdk';

import { TokenIcon } from '../../components/icons/TokenIcon';
import { TextInput } from '../../components/input/TextField';
import { Modal } from '../../components/layout/Modal';
Expand Down
5 changes: 1 addition & 4 deletions src/features/tokens/TokenSelectField.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { IToken } from '@hyperlane-xyz/sdk';
import { useField, useFormikContext } from 'formik';
import Image from 'next/image';
import { useEffect, useState } from 'react';

import { IToken } from '@hyperlane-xyz/sdk';

import { TokenIcon } from '../../components/icons/TokenIcon';
import { getIndexForToken, getTokenByIndex, getWarpCore } from '../../context/context';
import ChevronIcon from '../../images/icons/chevron-down.svg';
import { TransferFormValues } from '../transfer/types';

import { TokenListModal } from './TokenListModal';

type Props = {
Expand Down
4 changes: 1 addition & 3 deletions src/features/tokens/approval.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { useQuery } from '@tanstack/react-query';

import { IToken } from '@hyperlane-xyz/sdk';

import { useQuery } from '@tanstack/react-query';
import { useToastError } from '../../components/toast/useToastError';
import { getWarpCore } from '../../context/context';
import { useAccountAddressForChain } from '../wallet/hooks/multiProtocol';
Expand Down
4 changes: 1 addition & 3 deletions src/features/tokens/balances.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { useQuery } from '@tanstack/react-query';

import { IToken } from '@hyperlane-xyz/sdk';
import { isValidAddress } from '@hyperlane-xyz/utils';

import { useQuery } from '@tanstack/react-query';
import { useToastError } from '../../components/toast/useToastError';
import { getMultiProvider, getTokenByIndex } from '../../context/context';
import { TransferFormValues } from '../transfer/types';
Expand Down
1 change: 0 additions & 1 deletion src/features/transfer/TransferTokenCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Card } from '../../components/layout/Card';

import { TransferTokenForm } from './TransferTokenForm';

export function TransferTokenCard() {
Expand Down
7 changes: 2 additions & 5 deletions src/features/transfer/TransferTokenForm.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { TokenAmount } from '@hyperlane-xyz/sdk';
import { ProtocolType, errorToString, isNullish, toWei } from '@hyperlane-xyz/utils';
import BigNumber from 'bignumber.js';
import { Form, Formik, useFormikContext } from 'formik';
import { useMemo, useState } from 'react';
import { toast } from 'react-toastify';

import { TokenAmount } from '@hyperlane-xyz/sdk';
import { ProtocolType, errorToString, isNullish, toWei } from '@hyperlane-xyz/utils';

import { SmallSpinner } from '../../components/animation/SmallSpinner';
import { ConnectAwareSubmitButton } from '../../components/buttons/ConnectAwareSubmitButton';
import { IconButton } from '../../components/buttons/IconButton';
Expand All @@ -31,7 +29,6 @@ import {
useAccounts,
} from '../wallet/hooks/multiProtocol';
import { AccountInfo } from '../wallet/hooks/types';

import { useFetchMaxAmount } from './maxAmount';
import { TransferFormValues } from './types';
import { useRecipientBalanceWatcher } from './useBalanceWatcher';
Expand Down
7 changes: 2 additions & 5 deletions src/features/transfer/TransfersDetailsModal.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import Image from 'next/image';
import { useCallback, useEffect, useMemo, useState } from 'react';

import { ProtocolType } from '@hyperlane-xyz/utils';
import { MessageStatus, MessageTimeline, useMessageTimeline } from '@hyperlane-xyz/widgets';

import Image from 'next/image';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { Spinner } from '../../components/animation/Spinner';
import { CopyButton } from '../../components/buttons/CopyButton';
import { ChainLogo } from '../../components/icons/ChainLogo';
Expand All @@ -24,7 +22,6 @@ import {
} from '../../utils/transfer';
import { getChainDisplayName, hasPermissionlessChain } from '../chains/utils';
import { useAccountForChain, useWalletDetails } from '../wallet/hooks/multiProtocol';

import { TransferContext, TransferStatus } from './types';

export function TransfersDetailsModal({
Expand Down
Loading

0 comments on commit 6b05b45

Please sign in to comment.