From 6c2963587db0878d4d2156b9fa53df2c630b93a8 Mon Sep 17 00:00:00 2001 From: ioay Date: Thu, 11 Jan 2024 14:28:14 +0100 Subject: [PATCH] Update imports --- dapp/package.json | 1 - dapp/src/components/DocsDrawer/index.tsx | 4 ++-- dapp/src/components/GlobalStyles/index.tsx | 10 +++++----- dapp/src/components/Header/ConnectWallet.tsx | 10 +++++----- dapp/src/components/Header/index.tsx | 2 +- dapp/src/components/Modals/ActionForm/index.tsx | 2 +- dapp/src/components/Modals/Staking/DepositBTC.tsx | 6 +++--- dapp/src/components/Modals/Staking/Overview/index.tsx | 4 ++-- dapp/src/components/Modals/Staking/Overview/steps.tsx | 2 +- dapp/src/components/Modals/Staking/SignMessage.tsx | 6 +++--- .../components/Modals/Staking/StakeForm/Details.tsx | 8 ++++---- dapp/src/components/Modals/Staking/StakeForm/index.tsx | 10 +++++----- .../Modals/Staking/components/StakingSteps.tsx | 6 +++--- dapp/src/components/Modals/Staking/index.tsx | 4 ++-- dapp/src/components/Modals/Support/MissingAccount.tsx | 8 ++++---- dapp/src/components/Modals/Support/index.tsx | 4 ++-- dapp/src/components/Overview/PositionDetails.tsx | 6 +++--- dapp/src/components/Overview/Statistics.tsx | 2 +- dapp/src/components/Overview/TransactionHistory.tsx | 2 +- dapp/src/components/Overview/index.tsx | 8 ++++---- dapp/src/components/Sidebar/index.tsx | 2 +- dapp/src/components/shared/Alert/index.tsx | 2 +- dapp/src/components/shared/CurrencyBalance/index.tsx | 4 ++-- dapp/src/components/shared/ModalBase/index.tsx | 4 ++-- .../shared/TokenAmountForm/TokenAmountFormBase.tsx | 2 +- dapp/src/components/shared/TokenAmountForm/index.tsx | 2 +- dapp/src/components/shared/TokenBalanceInput/index.tsx | 6 +++--- dapp/src/constants/currency.ts | 2 +- dapp/src/contexts/TransactionContext.tsx | 2 +- dapp/src/hooks/useDepositBTCTransaction.ts | 2 +- dapp/src/hooks/useDocsDrawer.ts | 2 +- dapp/src/hooks/useModalFlowContext.ts | 2 +- dapp/src/hooks/useRequestBitcoinAccount.ts | 6 +++--- dapp/src/hooks/useRequestEthereumAccount.ts | 6 +++--- dapp/src/hooks/useSidebar.ts | 2 +- dapp/src/hooks/useSignMessage.ts | 2 +- dapp/src/hooks/useTransactionContext.ts | 2 +- dapp/src/hooks/useWalletContext.ts | 2 +- dapp/src/utils/currency.ts | 4 ++-- dapp/src/utils/forms.ts | 2 +- dapp/vite.config.ts | 3 +-- 41 files changed, 82 insertions(+), 84 deletions(-) diff --git a/dapp/package.json b/dapp/package.json index 439201a1c..9abe245b2 100644 --- a/dapp/package.json +++ b/dapp/package.json @@ -39,7 +39,6 @@ "prettier": "^3.1.0", "typescript": "^5.3.2", "vite": "^5.0.2", - "vite-plugin-eslint": "^1.8.1", "vite-plugin-node-polyfills": "^0.19.0", "vite-tsconfig-paths": "^4.2.3" } diff --git a/dapp/src/components/DocsDrawer/index.tsx b/dapp/src/components/DocsDrawer/index.tsx index 5082af57b..35e49647c 100644 --- a/dapp/src/components/DocsDrawer/index.tsx +++ b/dapp/src/components/DocsDrawer/index.tsx @@ -5,8 +5,8 @@ import { DrawerContent, DrawerOverlay, } from "@chakra-ui/react" -import { useDocsDrawer } from "../../hooks" -import { TextMd } from "../shared/Typography" +import { useDocsDrawer } from "~/hooks" +import { TextMd } from "~/components/shared/Typography" export default function DocsDrawer() { const { isOpen, onClose } = useDocsDrawer() diff --git a/dapp/src/components/GlobalStyles/index.tsx b/dapp/src/components/GlobalStyles/index.tsx index 80b36e6e8..d316cead6 100644 --- a/dapp/src/components/GlobalStyles/index.tsx +++ b/dapp/src/components/GlobalStyles/index.tsx @@ -1,11 +1,11 @@ import React from "react" import { Global } from "@emotion/react" -import SegmentRegular from "../../fonts/Segment-Regular.otf" -import SegmentMedium from "../../fonts/Segment-Medium.otf" -import SegmentSemiBold from "../../fonts/Segment-SemiBold.otf" -import SegmentBold from "../../fonts/Segment-Bold.otf" -import SegmentBlack from "../../fonts/Segment-Black.otf" +import SegmentRegular from "~/fonts/Segment-Regular.otf" +import SegmentMedium from "~/fonts/Segment-Medium.otf" +import SegmentSemiBold from "~/fonts/Segment-SemiBold.otf" +import SegmentBold from "~/fonts/Segment-Bold.otf" +import SegmentBlack from "~/fonts/Segment-Black.otf" export default function GlobalStyles() { return ( diff --git a/dapp/src/components/Header/ConnectWallet.tsx b/dapp/src/components/Header/ConnectWallet.tsx index 90069b4e7..28bad070d 100644 --- a/dapp/src/components/Header/ConnectWallet.tsx +++ b/dapp/src/components/Header/ConnectWallet.tsx @@ -1,15 +1,15 @@ import React from "react" import { Button, HStack, Icon } from "@chakra-ui/react" import { Account } from "@ledgerhq/wallet-api-client" -import { Bitcoin, Ethereum } from "../../static/icons" import { useRequestBitcoinAccount, useRequestEthereumAccount, useWalletContext, -} from "../../hooks" -import { truncateAddress } from "../../utils" -import { CurrencyBalance } from "../shared/CurrencyBalance" -import { TextMd } from "../shared/Typography" +} from "~/hooks" +import { CurrencyBalance } from "~/components/shared/CurrencyBalance" +import { TextMd } from "~/components/shared/Typography" +import { Bitcoin, Ethereum } from "~/static/icons" +import { truncateAddress } from "~/utils" export type ConnectButtonsProps = { leftIcon: typeof Icon diff --git a/dapp/src/components/Header/index.tsx b/dapp/src/components/Header/index.tsx index 544fbdee9..b0d47f2ab 100644 --- a/dapp/src/components/Header/index.tsx +++ b/dapp/src/components/Header/index.tsx @@ -1,7 +1,7 @@ import React from "react" import { Flex, HStack, Icon } from "@chakra-ui/react" +import { AcreLogo } from "~/static/icons" import ConnectWallet from "./ConnectWallet" -import { AcreLogo } from "../../static/icons" export default function Header() { return ( diff --git a/dapp/src/components/Modals/ActionForm/index.tsx b/dapp/src/components/Modals/ActionForm/index.tsx index 0eae3fe5b..d6a595d5d 100644 --- a/dapp/src/components/Modals/ActionForm/index.tsx +++ b/dapp/src/components/Modals/ActionForm/index.tsx @@ -7,8 +7,8 @@ import { TabPanels, TabPanel, } from "@chakra-ui/react" +import { useModalFlowContext } from "~/hooks" import StakeForm from "../Staking/StakeForm" -import { useModalFlowContext } from "../../../hooks" const TABS = ["stake", "unstake"] as const diff --git a/dapp/src/components/Modals/Staking/DepositBTC.tsx b/dapp/src/components/Modals/Staking/DepositBTC.tsx index 853159262..20e649956 100644 --- a/dapp/src/components/Modals/Staking/DepositBTC.tsx +++ b/dapp/src/components/Modals/Staking/DepositBTC.tsx @@ -1,7 +1,7 @@ import React from "react" -import Alert from "../../shared/Alert" -import { useDepositBTCTransaction, useModalFlowContext } from "../../../hooks" -import { TextMd } from "../../shared/Typography" +import { useDepositBTCTransaction, useModalFlowContext } from "~/hooks" +import Alert from "~/components/shared/Alert" +import { TextMd } from "~/components/shared/Typography" import StakingSteps from "./components/StakingSteps" export default function DepositBTC() { diff --git a/dapp/src/components/Modals/Staking/Overview/index.tsx b/dapp/src/components/Modals/Staking/Overview/index.tsx index ecb2c310a..330bb7289 100644 --- a/dapp/src/components/Modals/Staking/Overview/index.tsx +++ b/dapp/src/components/Modals/Staking/Overview/index.tsx @@ -6,8 +6,8 @@ import { ModalHeader, StepNumber, } from "@chakra-ui/react" -import { useModalFlowContext } from "../../../../hooks" -import StepperBase from "../../../shared/StepperBase" +import StepperBase from "~/components/shared/StepperBase" +import { useModalFlowContext } from "~/hooks" import { STEPS } from "./steps" export default function Overview() { diff --git a/dapp/src/components/Modals/Staking/Overview/steps.tsx b/dapp/src/components/Modals/Staking/Overview/steps.tsx index 257c671fa..532e35e50 100644 --- a/dapp/src/components/Modals/Staking/Overview/steps.tsx +++ b/dapp/src/components/Modals/Staking/Overview/steps.tsx @@ -1,5 +1,5 @@ import React from "react" -import { StepBase } from "../../../shared/StepperBase" +import { StepBase } from "~/components/shared/StepperBase" import { Description, Title } from "../components/StakingSteps" export const STEPS: StepBase[] = [ diff --git a/dapp/src/components/Modals/Staking/SignMessage.tsx b/dapp/src/components/Modals/Staking/SignMessage.tsx index 3c6442676..dfe7d2dc1 100644 --- a/dapp/src/components/Modals/Staking/SignMessage.tsx +++ b/dapp/src/components/Modals/Staking/SignMessage.tsx @@ -1,8 +1,8 @@ import React from "react" import { Highlight } from "@chakra-ui/react" -import Alert from "../../shared/Alert" -import { useModalFlowContext, useSignMessage } from "../../../hooks" -import { TextMd } from "../../shared/Typography" +import { useModalFlowContext, useSignMessage } from "~/hooks" +import Alert from "~/components/shared/Alert" +import { TextMd } from "~/components/shared/Typography" import StakingSteps from "./components/StakingSteps" export default function SignMessage() { diff --git a/dapp/src/components/Modals/Staking/StakeForm/Details.tsx b/dapp/src/components/Modals/Staking/StakeForm/Details.tsx index efa0f70a3..5d16cd8e2 100644 --- a/dapp/src/components/Modals/Staking/StakeForm/Details.tsx +++ b/dapp/src/components/Modals/Staking/StakeForm/Details.tsx @@ -1,9 +1,9 @@ import React from "react" import { List } from "@chakra-ui/react" -import { useTransactionDetails } from "../../../../hooks" -import TransactionDetailsAmountItem from "../../../shared/TransactionDetails/AmountItem" -import { CurrencyType } from "../../../../types" -import { useTokenAmountFormValue } from "../../../shared/TokenAmountForm/TokenAmountFormBase" +import TransactionDetailsAmountItem from "~/components/shared/TransactionDetails/AmountItem" +import { useTokenAmountFormValue } from "~/components/shared/TokenAmountForm/TokenAmountFormBase" +import { useTransactionDetails } from "~/hooks" +import { CurrencyType } from "~/types" function Details({ currency }: { currency: CurrencyType }) { const value = useTokenAmountFormValue() diff --git a/dapp/src/components/Modals/Staking/StakeForm/index.tsx b/dapp/src/components/Modals/Staking/StakeForm/index.tsx index 635e17e23..5f9b57bf0 100644 --- a/dapp/src/components/Modals/Staking/StakeForm/index.tsx +++ b/dapp/src/components/Modals/Staking/StakeForm/index.tsx @@ -1,10 +1,10 @@ import React, { useCallback } from "react" import { Button } from "@chakra-ui/react" -import { BITCOIN_MIN_AMOUNT } from "../../../../constants" -import { ModalStep } from "../../../../contexts" -import { useWalletContext, useTransactionContext } from "../../../../hooks" -import TokenAmountForm from "../../../shared/TokenAmountForm" -import { TokenAmountFormValues } from "../../../shared/TokenAmountForm/TokenAmountFormBase" +import { BITCOIN_MIN_AMOUNT } from "~/constants" +import { ModalStep } from "~/contexts" +import TokenAmountForm from "~/components/shared/TokenAmountForm" +import { TokenAmountFormValues } from "~/components/shared/TokenAmountForm/TokenAmountFormBase" +import { useWalletContext, useTransactionContext } from "~/hooks" import Details from "./Details" function StakeForm({ goNext }: ModalStep) { diff --git a/dapp/src/components/Modals/Staking/components/StakingSteps.tsx b/dapp/src/components/Modals/Staking/components/StakingSteps.tsx index a0ebfd4cb..4f0a11d06 100644 --- a/dapp/src/components/Modals/Staking/components/StakingSteps.tsx +++ b/dapp/src/components/Modals/Staking/components/StakingSteps.tsx @@ -6,9 +6,9 @@ import { ModalFooter, ModalHeader, } from "@chakra-ui/react" -import { TextLg, TextMd } from "../../../shared/Typography" -import StepperBase, { StepBase } from "../../../shared/StepperBase" -import Spinner from "../../../shared/Spinner" +import { TextLg, TextMd } from "~/components/shared/Typography" +import StepperBase, { StepBase } from "~/components/shared/StepperBase" +import Spinner from "~/components/shared/Spinner" export function Title({ children }: { children: React.ReactNode }) { return {children} diff --git a/dapp/src/components/Modals/Staking/index.tsx b/dapp/src/components/Modals/Staking/index.tsx index 78d04706c..8bad1b0c4 100644 --- a/dapp/src/components/Modals/Staking/index.tsx +++ b/dapp/src/components/Modals/Staking/index.tsx @@ -1,7 +1,7 @@ import React from "react" -import { useModalFlowContext } from "../../../hooks" +import { useModalFlowContext } from "~/hooks" +import ModalBase from "~/components/shared/ModalBase" import Overview from "./Overview" -import ModalBase from "../../shared/ModalBase" import ActionForm from "../ActionForm" import SignMessage from "./SignMessage" import DepositBTC from "./DepositBTC" diff --git a/dapp/src/components/Modals/Support/MissingAccount.tsx b/dapp/src/components/Modals/Support/MissingAccount.tsx index 2c32b354e..df879d260 100644 --- a/dapp/src/components/Modals/Support/MissingAccount.tsx +++ b/dapp/src/components/Modals/Support/MissingAccount.tsx @@ -7,10 +7,10 @@ import { ModalFooter, ModalHeader, } from "@chakra-ui/react" -import { CurrencyType, RequestAccountParams } from "../../../types" -import { TextMd } from "../../shared/Typography" -import Alert from "../../shared/Alert" -import { getCurrencyByType } from "../../../utils" +import { TextMd } from "~/components/shared/Typography" +import Alert from "~/components/shared/Alert" +import { getCurrencyByType } from "~/utils" +import { CurrencyType, RequestAccountParams } from "~/types" type MissingAccountProps = { currency: CurrencyType diff --git a/dapp/src/components/Modals/Support/index.tsx b/dapp/src/components/Modals/Support/index.tsx index c6784fff4..ca6e51453 100644 --- a/dapp/src/components/Modals/Support/index.tsx +++ b/dapp/src/components/Modals/Support/index.tsx @@ -3,9 +3,9 @@ import { useRequestBitcoinAccount, useRequestEthereumAccount, useWalletContext, -} from "../../../hooks" +} from "~/hooks" +import { ConnectBTCAccount, ConnectETHAccount } from "~/static/icons" import MissingAccount from "./MissingAccount" -import { ConnectBTCAccount, ConnectETHAccount } from "../../../static/icons" export default function SupportWrapper({ children, diff --git a/dapp/src/components/Overview/PositionDetails.tsx b/dapp/src/components/Overview/PositionDetails.tsx index c1de13f71..907be66f1 100644 --- a/dapp/src/components/Overview/PositionDetails.tsx +++ b/dapp/src/components/Overview/PositionDetails.tsx @@ -10,10 +10,10 @@ import { CardProps, useBoolean, } from "@chakra-ui/react" -import { Info } from "../../static/icons" +import { CurrencyBalanceWithConversion } from "~/components/shared/CurrencyBalanceWithConversion" +import { TextMd } from "~/components/shared/Typography" +import { Info } from "~/static/icons" import StakingModal from "../Modals/Staking" -import { CurrencyBalanceWithConversion } from "../shared/CurrencyBalanceWithConversion" -import { TextMd } from "../shared/Typography" export default function PositionDetails(props: CardProps) { const [isOpenStakingModal, stakingModal] = useBoolean() diff --git a/dapp/src/components/Overview/Statistics.tsx b/dapp/src/components/Overview/Statistics.tsx index 8b9c5979e..e8a5df0c5 100644 --- a/dapp/src/components/Overview/Statistics.tsx +++ b/dapp/src/components/Overview/Statistics.tsx @@ -1,6 +1,6 @@ import React from "react" import { CardBody, Card, CardProps } from "@chakra-ui/react" -import { TextMd } from "../shared/Typography" +import { TextMd } from "~/components/shared/Typography" export default function Statistics(props: CardProps) { return ( diff --git a/dapp/src/components/Overview/TransactionHistory.tsx b/dapp/src/components/Overview/TransactionHistory.tsx index e0ff1fb26..557556bd4 100644 --- a/dapp/src/components/Overview/TransactionHistory.tsx +++ b/dapp/src/components/Overview/TransactionHistory.tsx @@ -1,6 +1,6 @@ import React from "react" import { CardBody, Card, CardProps } from "@chakra-ui/react" -import { TextMd } from "../shared/Typography" +import { TextMd } from "~/components/shared/Typography" export default function TransactionHistory(props: CardProps) { return ( diff --git a/dapp/src/components/Overview/index.tsx b/dapp/src/components/Overview/index.tsx index 0ac2b4041..1bee1a175 100644 --- a/dapp/src/components/Overview/index.tsx +++ b/dapp/src/components/Overview/index.tsx @@ -1,12 +1,12 @@ import React from "react" import { Button, Flex, Grid, HStack, Icon, Switch } from "@chakra-ui/react" +import { useDocsDrawer } from "~/hooks" +import { TextSm } from "~/components/shared/Typography" +import { ArrowUpRight } from "~/static/icons" +import { USD } from "~/constants" import PositionDetails from "./PositionDetails" import Statistics from "./Statistics" import TransactionHistory from "./TransactionHistory" -import { USD } from "../../constants" -import { ArrowUpRight } from "../../static/icons" -import { TextSm } from "../shared/Typography" -import { useDocsDrawer } from "../../hooks" export default function Overview() { const { onOpen } = useDocsDrawer() diff --git a/dapp/src/components/Sidebar/index.tsx b/dapp/src/components/Sidebar/index.tsx index a7625698f..2217cfe7c 100644 --- a/dapp/src/components/Sidebar/index.tsx +++ b/dapp/src/components/Sidebar/index.tsx @@ -1,6 +1,6 @@ import React from "react" import { Box, Button, useMultiStyleConfig } from "@chakra-ui/react" -import { useDocsDrawer, useSidebar } from "../../hooks" +import { useDocsDrawer, useSidebar } from "~/hooks" export default function Sidebar() { const { isOpen } = useSidebar() diff --git a/dapp/src/components/shared/Alert/index.tsx b/dapp/src/components/shared/Alert/index.tsx index 2ab05a8f2..cb3d94fd1 100644 --- a/dapp/src/components/shared/Alert/index.tsx +++ b/dapp/src/components/shared/Alert/index.tsx @@ -7,7 +7,7 @@ import { Icon, useMultiStyleConfig, } from "@chakra-ui/react" -import { AlertInfo, ArrowUpRight } from "../../../static/icons" +import { AlertInfo, ArrowUpRight } from "~/static/icons" const ICONS = { info: AlertInfo, diff --git a/dapp/src/components/shared/CurrencyBalance/index.tsx b/dapp/src/components/shared/CurrencyBalance/index.tsx index f44f7505e..65991979a 100644 --- a/dapp/src/components/shared/CurrencyBalance/index.tsx +++ b/dapp/src/components/shared/CurrencyBalance/index.tsx @@ -4,8 +4,8 @@ import { formatTokenAmount, getCurrencyByType, numberToLocaleString, -} from "../../../utils" -import { CurrencyType } from "../../../types" +} from "~/utils" +import { CurrencyType } from "~/types" export type CurrencyBalanceProps = { currency: CurrencyType diff --git a/dapp/src/components/shared/ModalBase/index.tsx b/dapp/src/components/shared/ModalBase/index.tsx index cfeb34472..034527614 100644 --- a/dapp/src/components/shared/ModalBase/index.tsx +++ b/dapp/src/components/shared/ModalBase/index.tsx @@ -5,12 +5,12 @@ import { ModalContent, ModalOverlay, } from "@chakra-ui/react" +import { useSidebar } from "~/hooks" import { ModalFlowContext, ModalFlowContextValue, TransactionContextProvider, -} from "../../../contexts" -import { useSidebar } from "../../../hooks" +} from "~/contexts" import SupportWrapper from "../../Modals/Support" export default function ModalBase({ diff --git a/dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx b/dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx index 7324f2251..3f07bfe45 100644 --- a/dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx +++ b/dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx @@ -1,7 +1,7 @@ import React from "react" import { FormikProps, useField } from "formik" +import { CurrencyType } from "~/types" import { Form, FormTokenBalanceInput } from "../Form" -import { CurrencyType } from "../../../types" const TOKEN_AMOUNT_FIELD_NAME = "amount" diff --git a/dapp/src/components/shared/TokenAmountForm/index.tsx b/dapp/src/components/shared/TokenAmountForm/index.tsx index d6d0716c1..50a792af8 100644 --- a/dapp/src/components/shared/TokenAmountForm/index.tsx +++ b/dapp/src/components/shared/TokenAmountForm/index.tsx @@ -1,5 +1,5 @@ import { FormikErrors, withFormik } from "formik" -import { getErrorsObj, validateTokenAmount } from "../../../utils" +import { getErrorsObj, validateTokenAmount } from "~/utils" import TokenAmountFormBase, { TokenAmountFormBaseProps, TokenAmountFormValues, diff --git a/dapp/src/components/shared/TokenBalanceInput/index.tsx b/dapp/src/components/shared/TokenBalanceInput/index.tsx index 82aa75fee..289451c11 100644 --- a/dapp/src/components/shared/TokenBalanceInput/index.tsx +++ b/dapp/src/components/shared/TokenBalanceInput/index.tsx @@ -16,13 +16,13 @@ import { fixedPointNumberToString, getCurrencyByType, userAmountToBigInt, -} from "../../../utils" -import { CurrencyType } from "../../../types" +} from "~/utils" +import { AlertInfo } from "~/static/icons" +import { CurrencyType } from "~/types" import NumberFormatInput, { NumberFormatInputValues, } from "../NumberFormatInput" import { CurrencyBalance } from "../CurrencyBalance" -import { AlertInfo } from "../../../static/icons" const VARIANT = "balance" diff --git a/dapp/src/constants/currency.ts b/dapp/src/constants/currency.ts index 420adb8b6..75b1c572b 100644 --- a/dapp/src/constants/currency.ts +++ b/dapp/src/constants/currency.ts @@ -1,4 +1,4 @@ -import { Currency, CurrencyType } from "../types" +import { Currency, CurrencyType } from "~/types" export const BITCOIN: Currency = { name: "Bitcoin", diff --git a/dapp/src/contexts/TransactionContext.tsx b/dapp/src/contexts/TransactionContext.tsx index 384bfb2e5..47bb3b801 100644 --- a/dapp/src/contexts/TransactionContext.tsx +++ b/dapp/src/contexts/TransactionContext.tsx @@ -1,5 +1,5 @@ import React, { createContext, useMemo, useState } from "react" -import { TokenAmount } from "../types" +import { TokenAmount } from "~/types" type TransactionContextValue = { tokenAmount?: TokenAmount diff --git a/dapp/src/hooks/useDepositBTCTransaction.ts b/dapp/src/hooks/useDepositBTCTransaction.ts index a629e6485..861e55870 100644 --- a/dapp/src/hooks/useDepositBTCTransaction.ts +++ b/dapp/src/hooks/useDepositBTCTransaction.ts @@ -1,5 +1,5 @@ import { useCallback } from "react" -import { OnSuccessCallback } from "../types" +import { OnSuccessCallback } from "~/types" export function useDepositBTCTransaction(onSuccess?: OnSuccessCallback) { // TODO: sending transactions using the SDK diff --git a/dapp/src/hooks/useDocsDrawer.ts b/dapp/src/hooks/useDocsDrawer.ts index 4ce8bba3e..e560afa83 100644 --- a/dapp/src/hooks/useDocsDrawer.ts +++ b/dapp/src/hooks/useDocsDrawer.ts @@ -1,5 +1,5 @@ import { useContext } from "react" -import { DocsDrawerContext } from "../contexts" +import { DocsDrawerContext } from "~/contexts" export function useDocsDrawer() { const context = useContext(DocsDrawerContext) diff --git a/dapp/src/hooks/useModalFlowContext.ts b/dapp/src/hooks/useModalFlowContext.ts index 48882c561..fafb6a565 100644 --- a/dapp/src/hooks/useModalFlowContext.ts +++ b/dapp/src/hooks/useModalFlowContext.ts @@ -1,5 +1,5 @@ import { useContext } from "react" -import { ModalFlowContext } from "../contexts" +import { ModalFlowContext } from "~/contexts" export function useModalFlowContext() { const context = useContext(ModalFlowContext) diff --git a/dapp/src/hooks/useRequestBitcoinAccount.ts b/dapp/src/hooks/useRequestBitcoinAccount.ts index 036db196d..d780eb016 100644 --- a/dapp/src/hooks/useRequestBitcoinAccount.ts +++ b/dapp/src/hooks/useRequestBitcoinAccount.ts @@ -1,8 +1,8 @@ import { useRequestAccount } from "@ledgerhq/wallet-api-client-react" import { useCallback, useContext, useEffect } from "react" -import { CURRENCY_ID_BITCOIN } from "../constants" -import { UseRequestAccountReturn } from "../types" -import { WalletContext } from "../contexts" +import { WalletContext } from "~/contexts" +import { UseRequestAccountReturn } from "~/types" +import { CURRENCY_ID_BITCOIN } from "~/constants" export function useRequestBitcoinAccount(): UseRequestAccountReturn { const { setBtcAccount } = useContext(WalletContext) diff --git a/dapp/src/hooks/useRequestEthereumAccount.ts b/dapp/src/hooks/useRequestEthereumAccount.ts index 5c3cad1f1..d1dd87ad7 100644 --- a/dapp/src/hooks/useRequestEthereumAccount.ts +++ b/dapp/src/hooks/useRequestEthereumAccount.ts @@ -1,8 +1,8 @@ import { useRequestAccount } from "@ledgerhq/wallet-api-client-react" import { useCallback, useContext, useEffect } from "react" -import { CURRENCY_ID_ETHEREUM } from "../constants" -import { UseRequestAccountReturn } from "../types" -import { WalletContext } from "../contexts" +import { WalletContext } from "~/contexts" +import { UseRequestAccountReturn } from "~/types" +import { CURRENCY_ID_ETHEREUM } from "~/constants" export function useRequestEthereumAccount(): UseRequestAccountReturn { const { setEthAccount } = useContext(WalletContext) diff --git a/dapp/src/hooks/useSidebar.ts b/dapp/src/hooks/useSidebar.ts index 986143a89..714330b48 100644 --- a/dapp/src/hooks/useSidebar.ts +++ b/dapp/src/hooks/useSidebar.ts @@ -1,5 +1,5 @@ import { useContext } from "react" -import { SidebarContext } from "../contexts" +import { SidebarContext } from "~/contexts" export function useSidebar() { const context = useContext(SidebarContext) diff --git a/dapp/src/hooks/useSignMessage.ts b/dapp/src/hooks/useSignMessage.ts index cc3cadc3e..21ef804b0 100644 --- a/dapp/src/hooks/useSignMessage.ts +++ b/dapp/src/hooks/useSignMessage.ts @@ -1,7 +1,7 @@ import { useSignMessage as useSignMessageLedgerLive } from "@ledgerhq/wallet-api-client-react" import { useCallback, useEffect } from "react" +import { OnSuccessCallback } from "~/types" import { useWalletContext } from "./useWalletContext" -import { OnSuccessCallback } from "../types" const SIGN_MESSAGE = "Test message" diff --git a/dapp/src/hooks/useTransactionContext.ts b/dapp/src/hooks/useTransactionContext.ts index d28c8bf1b..85b663a51 100644 --- a/dapp/src/hooks/useTransactionContext.ts +++ b/dapp/src/hooks/useTransactionContext.ts @@ -1,5 +1,5 @@ import { useContext } from "react" -import { TransactionContext } from "../contexts" +import { TransactionContext } from "~/contexts" export function useTransactionContext() { const context = useContext(TransactionContext) diff --git a/dapp/src/hooks/useWalletContext.ts b/dapp/src/hooks/useWalletContext.ts index 0da19204b..c786a76dd 100644 --- a/dapp/src/hooks/useWalletContext.ts +++ b/dapp/src/hooks/useWalletContext.ts @@ -1,5 +1,5 @@ import { useContext } from "react" -import { WalletContext } from "../contexts" +import { WalletContext } from "~/contexts" export function useWalletContext() { const context = useContext(WalletContext) diff --git a/dapp/src/utils/currency.ts b/dapp/src/utils/currency.ts index 39eda0651..99d93710a 100644 --- a/dapp/src/utils/currency.ts +++ b/dapp/src/utils/currency.ts @@ -1,5 +1,5 @@ -import { CURRENCIES_BY_TYPE } from "../constants" -import { Currency, CurrencyType } from "../types" +import { Currency, CurrencyType } from "~/types" +import { CURRENCIES_BY_TYPE } from "~/constants" export const getCurrencyByType = (currency: CurrencyType): Currency => CURRENCIES_BY_TYPE[currency] diff --git a/dapp/src/utils/forms.ts b/dapp/src/utils/forms.ts index 9f7f34759..a2fc7b8c4 100644 --- a/dapp/src/utils/forms.ts +++ b/dapp/src/utils/forms.ts @@ -1,4 +1,4 @@ -import { CurrencyType } from "../types" +import { CurrencyType } from "~/types" import { getCurrencyByType } from "./currency" import { formatTokenAmount } from "./numbers" diff --git a/dapp/vite.config.ts b/dapp/vite.config.ts index 14ad46477..71034c086 100644 --- a/dapp/vite.config.ts +++ b/dapp/vite.config.ts @@ -1,7 +1,6 @@ import { defineConfig } from "vite" import react from "@vitejs/plugin-react" import { nodePolyfills } from "vite-plugin-node-polyfills" -import eslint from "vite-plugin-eslint" import { resolve } from "path" @@ -11,5 +10,5 @@ export default defineConfig({ "~": resolve(__dirname, "./src"), }, }, - plugins: [nodePolyfills(), react(), eslint()], + plugins: [nodePolyfills(), react()], })