From 27cac2201485c7fb1aa6218e5b4e9fde9858de22 Mon Sep 17 00:00:00 2001 From: ioay Date: Tue, 16 Jan 2024 15:08:00 +0100 Subject: [PATCH 1/9] Eslint config: fix unbound-method rule --- dapp/.eslintrc | 8 -------- dapp/src/theme/Alert.ts | 15 ++++++++------- dapp/src/theme/CurrencyBalance.ts | 25 ++++++++++++++----------- dapp/src/theme/Drawer.ts | 9 ++++----- dapp/src/theme/Form.ts | 9 ++++----- dapp/src/theme/FormError.ts | 9 ++++----- dapp/src/theme/Input.ts | 9 ++++----- dapp/src/theme/Modal.ts | 9 ++++----- dapp/src/theme/Sidebar.ts | 9 ++++----- dapp/src/theme/Stepper.ts | 9 ++++----- dapp/src/theme/Tabs.ts | 23 +++++++++++------------ dapp/src/theme/TokenBalanceInput.ts | 9 ++++----- 12 files changed, 65 insertions(+), 78 deletions(-) diff --git a/dapp/.eslintrc b/dapp/.eslintrc index 35437e4ed..7cd958b53 100644 --- a/dapp/.eslintrc +++ b/dapp/.eslintrc @@ -41,14 +41,6 @@ "@typescript-eslint/no-floating-promises": "off" } }, - { - "files": [ - "src/theme/*" - ], - "rules": { - "@typescript-eslint/unbound-method": "off" - } - }, { "files": [ "src/theme/Alert.ts" diff --git a/dapp/src/theme/Alert.ts b/dapp/src/theme/Alert.ts index d03592cc0..ff1e53192 100644 --- a/dapp/src/theme/Alert.ts +++ b/dapp/src/theme/Alert.ts @@ -8,9 +8,6 @@ import { const KEYS = [...parts.keys, "rightIconContainer"] as const -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(KEYS) - const baseStyleDialog = defineStyle({ py: 5, pl: 5, @@ -39,13 +36,15 @@ const baseStyleRightIconContainer = defineStyle({ w: 14, }) -const baseStyle = definePartsStyle({ +const multiStyleConfig = createMultiStyleConfigHelpers(KEYS) + +const baseStyle = multiStyleConfig.definePartsStyle({ container: baseStyleDialog, icon: baseStyleIcon, rightIconContainer: baseStyleRightIconContainer, }) -const statusInfo = definePartsStyle({ +const statusInfo = multiStyleConfig.definePartsStyle({ container: { bg: "gold.200", }, @@ -66,12 +65,14 @@ const statusStyles = (props: StyleFunctionProps) => { return styleMap[status] || {} } -const variantSubtle = definePartsStyle((props) => statusStyles(props)) +const variantSubtle = multiStyleConfig.definePartsStyle((props) => + statusStyles(props), +) const variants = { subtle: variantSubtle, } -const Alert = defineMultiStyleConfig({ baseStyle, variants }) +const Alert = multiStyleConfig.defineMultiStyleConfig({ baseStyle, variants }) export default Alert diff --git a/dapp/src/theme/CurrencyBalance.ts b/dapp/src/theme/CurrencyBalance.ts index 05d674e24..109b931b3 100644 --- a/dapp/src/theme/CurrencyBalance.ts +++ b/dapp/src/theme/CurrencyBalance.ts @@ -2,9 +2,6 @@ import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react" const PARTS = ["balance", "symbol"] -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(PARTS) - const baseStyleBalance = defineStyle({ fontWeight: "bold", fontSize: "md", @@ -18,12 +15,14 @@ const baseStyleSymbol = defineStyle({ lineHeight: "md", }) -const baseStyle = definePartsStyle({ +const multiStyleConfig = createMultiStyleConfigHelpers(PARTS) + +const baseStyle = multiStyleConfig.definePartsStyle({ balance: baseStyleBalance, symbol: baseStyleSymbol, }) -const variantGreaterBalance = definePartsStyle({ +const variantGreaterBalance = multiStyleConfig.definePartsStyle({ balance: { fontSize: "4xl", lineHeight: "4xl", @@ -38,7 +37,7 @@ const variants = { "greater-balance": variantGreaterBalance, } -const sizeXs = definePartsStyle({ +const sizeXs = multiStyleConfig.definePartsStyle({ balance: { fontSize: "xs", lineHeight: "xs", @@ -49,7 +48,7 @@ const sizeXs = definePartsStyle({ }, }) -const sizeSm = definePartsStyle({ +const sizeSm = multiStyleConfig.definePartsStyle({ balance: { fontSize: "sm", lineHeight: "sm", @@ -60,7 +59,7 @@ const sizeSm = definePartsStyle({ }, }) -const sizeMd = definePartsStyle({ +const sizeMd = multiStyleConfig.definePartsStyle({ balance: { fontSize: "md", lineHeight: "md", @@ -71,7 +70,7 @@ const sizeMd = definePartsStyle({ }, }) -const sizeLg = definePartsStyle({ +const sizeLg = multiStyleConfig.definePartsStyle({ balance: { fontSize: "lg", lineHeight: "lg", @@ -82,7 +81,7 @@ const sizeLg = definePartsStyle({ }, }) -const sizeXl = definePartsStyle({ +const sizeXl = multiStyleConfig.definePartsStyle({ balance: { fontSize: "xl", lineHeight: "xl", @@ -101,6 +100,10 @@ const sizes = { xl: sizeXl, } -const CurrencyBalance = defineMultiStyleConfig({ baseStyle, variants, sizes }) +const CurrencyBalance = multiStyleConfig.defineMultiStyleConfig({ + baseStyle, + variants, + sizes, +}) export default CurrencyBalance diff --git a/dapp/src/theme/Drawer.ts b/dapp/src/theme/Drawer.ts index 144fe4c05..4e38a608d 100644 --- a/dapp/src/theme/Drawer.ts +++ b/dapp/src/theme/Drawer.ts @@ -1,9 +1,6 @@ import { drawerAnatomy as parts } from "@chakra-ui/anatomy" import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react" -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys) - const baseStyleDialogContainer = defineStyle({ zIndex: "drawer", }) @@ -23,12 +20,14 @@ const baseStyleOverlay = defineStyle({ backdropBlur: "8px", }) -const baseStyle = definePartsStyle({ +const multiStyleConfig = createMultiStyleConfigHelpers(parts.keys) + +const baseStyle = multiStyleConfig.definePartsStyle({ dialogContainer: baseStyleDialogContainer, dialog: baseStyleDialog, overlay: baseStyleOverlay, }) -const Drawer = defineMultiStyleConfig({ baseStyle }) +const Drawer = multiStyleConfig.defineMultiStyleConfig({ baseStyle }) export default Drawer diff --git a/dapp/src/theme/Form.ts b/dapp/src/theme/Form.ts index 42a4a7165..9029ca83f 100644 --- a/dapp/src/theme/Form.ts +++ b/dapp/src/theme/Form.ts @@ -1,9 +1,6 @@ import { formAnatomy as parts } from "@chakra-ui/anatomy" import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react" -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys) - const baseStyleHelperText = defineStyle({ display: "flex", alignItems: "center", @@ -12,10 +9,12 @@ const baseStyleHelperText = defineStyle({ color: "grey.500", }) -const baseStyle = definePartsStyle({ +const multiStyleConfig = createMultiStyleConfigHelpers(parts.keys) + +const baseStyle = multiStyleConfig.definePartsStyle({ helperText: baseStyleHelperText, }) -const Form = defineMultiStyleConfig({ baseStyle }) +const Form = multiStyleConfig.defineMultiStyleConfig({ baseStyle }) export default Form diff --git a/dapp/src/theme/FormError.ts b/dapp/src/theme/FormError.ts index f9b8dd9b3..2fc3e5509 100644 --- a/dapp/src/theme/FormError.ts +++ b/dapp/src/theme/FormError.ts @@ -2,18 +2,17 @@ import { defineStyle, createMultiStyleConfigHelpers } from "@chakra-ui/react" import { formErrorAnatomy as parts } from "@chakra-ui/anatomy" -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys) - const baseStyleText = defineStyle({ fontWeight: "medium", color: "red.400", }) -const baseStyle = definePartsStyle({ +const multiStyleConfig = createMultiStyleConfigHelpers(parts.keys) + +const baseStyle = multiStyleConfig.definePartsStyle({ text: baseStyleText, }) -const FormError = defineMultiStyleConfig({ baseStyle }) +const FormError = multiStyleConfig.defineMultiStyleConfig({ baseStyle }) export default FormError diff --git a/dapp/src/theme/Input.ts b/dapp/src/theme/Input.ts index cccff7c7c..31529b03a 100644 --- a/dapp/src/theme/Input.ts +++ b/dapp/src/theme/Input.ts @@ -1,9 +1,6 @@ import { inputAnatomy as parts } from "@chakra-ui/anatomy" import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react" -const { definePartsStyle, defineMultiStyleConfig } = - createMultiStyleConfigHelpers(parts.keys) - const variantBalanceField = defineStyle({ border: "1px solid", borderColor: "gold.300", @@ -30,7 +27,9 @@ const variantBalanceElement = defineStyle({ mr: 2, }) -const variantBalance = definePartsStyle({ +const multiStyleConfig = createMultiStyleConfigHelpers(parts.keys) + +const variantBalance = multiStyleConfig.definePartsStyle({ field: variantBalanceField, element: variantBalanceElement, }) @@ -39,6 +38,6 @@ const variants = { balance: variantBalance, } -const Input = defineMultiStyleConfig({ variants }) +const Input = multiStyleConfig.defineMultiStyleConfig({ variants }) export default Input diff --git a/dapp/src/theme/Modal.ts b/dapp/src/theme/Modal.ts index c0140007e..c6a0e7e70 100644 --- a/dapp/src/theme/Modal.ts +++ b/dapp/src/theme/Modal.ts @@ -1,9 +1,6 @@ import { modalAnatomy as parts } from "@chakra-ui/anatomy" import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react" -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys) - const baseStyleDialog = defineStyle({ p: 4, border: "2px", @@ -43,7 +40,9 @@ const baseStyleBody = defineStyle({ gap: 6, }) -const baseStyle = definePartsStyle({ +const multiStyleConfig = createMultiStyleConfigHelpers(parts.keys) + +const baseStyle = multiStyleConfig.definePartsStyle({ dialog: baseStyleDialog, closeButton: baseCloseButton, overlay: baseStyleOverlay, @@ -51,6 +50,6 @@ const baseStyle = definePartsStyle({ body: baseStyleBody, }) -const Modal = defineMultiStyleConfig({ baseStyle }) +const Modal = multiStyleConfig.defineMultiStyleConfig({ baseStyle }) export default Modal diff --git a/dapp/src/theme/Sidebar.ts b/dapp/src/theme/Sidebar.ts index 5e496522b..6b654aec0 100644 --- a/dapp/src/theme/Sidebar.ts +++ b/dapp/src/theme/Sidebar.ts @@ -2,9 +2,6 @@ import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react" const PARTS = ["sidebarContainer", "sidebar"] -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(PARTS) - const baseStyleSidebarContainer = defineStyle({ top: 0, right: 0, @@ -25,11 +22,13 @@ const baseStyleSidebar = defineStyle({ borderTopLeftRadius: "xl", }) -const baseStyle = definePartsStyle({ +const multiStyleConfig = createMultiStyleConfigHelpers(PARTS) + +const baseStyle = multiStyleConfig.definePartsStyle({ sidebarContainer: baseStyleSidebarContainer, sidebar: baseStyleSidebar, }) -const Sidebar = defineMultiStyleConfig({ baseStyle }) +const Sidebar = multiStyleConfig.defineMultiStyleConfig({ baseStyle }) export default Sidebar diff --git a/dapp/src/theme/Stepper.ts b/dapp/src/theme/Stepper.ts index 64a3a9f32..37cd3e9c1 100644 --- a/dapp/src/theme/Stepper.ts +++ b/dapp/src/theme/Stepper.ts @@ -1,9 +1,6 @@ import { stepperAnatomy as parts } from "@chakra-ui/anatomy" import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react" -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(parts.keys) - const baseStyleStepper = defineStyle({ _vertical: { gap: 0, @@ -64,7 +61,9 @@ const baseStyleSeparator = defineStyle(({ colorScheme }) => ({ }, })) -const baseStyle = definePartsStyle((props) => ({ +const multiStyleConfig = createMultiStyleConfigHelpers(parts.keys) + +const baseStyle = multiStyleConfig.definePartsStyle((props) => ({ stepper: baseStyleStepper, step: baseStyleStep, title: baseStyleTitle, @@ -73,6 +72,6 @@ const baseStyle = definePartsStyle((props) => ({ separator: baseStyleSeparator(props), })) -const Stepper = defineMultiStyleConfig({ baseStyle }) +const Stepper = multiStyleConfig.defineMultiStyleConfig({ baseStyle }) export default Stepper diff --git a/dapp/src/theme/Tabs.ts b/dapp/src/theme/Tabs.ts index 4f48860fa..e3d8fc074 100644 --- a/dapp/src/theme/Tabs.ts +++ b/dapp/src/theme/Tabs.ts @@ -1,16 +1,6 @@ import { tabsAnatomy as parts } from "@chakra-ui/anatomy" import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react" -const { definePartsStyle, defineMultiStyleConfig } = - createMultiStyleConfigHelpers(parts.keys) - -const baseStyle = definePartsStyle({ - tab: { - fontWeight: "bold", - color: "grey.400", - }, -}) - const variantUnderlineTab = defineStyle({ pb: 4, borderBottom: "2px solid", @@ -36,7 +26,9 @@ const variantUnderlineTabPanel = defineStyle({ px: 0, }) -const variantUnderline = definePartsStyle({ +const multiStyleConfig = createMultiStyleConfigHelpers(parts.keys) + +const variantUnderline = multiStyleConfig.definePartsStyle({ tab: variantUnderlineTab, tablist: variantUnderlineTabList, tabpanel: variantUnderlineTabPanel, @@ -46,6 +38,13 @@ const variants = { underline: variantUnderline, } -const Tabs = defineMultiStyleConfig({ baseStyle, variants }) +const baseStyle = multiStyleConfig.definePartsStyle({ + tab: { + fontWeight: "bold", + color: "grey.400", + }, +}) + +const Tabs = multiStyleConfig.defineMultiStyleConfig({ baseStyle, variants }) export default Tabs diff --git a/dapp/src/theme/TokenBalanceInput.ts b/dapp/src/theme/TokenBalanceInput.ts index 8c662a769..9236de5a6 100644 --- a/dapp/src/theme/TokenBalanceInput.ts +++ b/dapp/src/theme/TokenBalanceInput.ts @@ -2,9 +2,6 @@ import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react" const PARTS = ["labelContainer", "balanceContainer", "balance"] -const { defineMultiStyleConfig, definePartsStyle } = - createMultiStyleConfigHelpers(PARTS) - const baseStyleLabelContainer = defineStyle({ display: "flex", justifyContent: "space-between", @@ -20,12 +17,14 @@ const baseStyleBalance = defineStyle({ color: "grey.500", }) -const baseStyle = definePartsStyle({ +const multiStyleConfig = createMultiStyleConfigHelpers(PARTS) + +const baseStyle = multiStyleConfig.definePartsStyle({ labelContainer: baseStyleLabelContainer, balanceContainer: baseStyleBalanceContainer, balance: baseStyleBalance, }) -const TokenBalanceInput = defineMultiStyleConfig({ baseStyle }) +const TokenBalanceInput = multiStyleConfig.defineMultiStyleConfig({ baseStyle }) export default TokenBalanceInput From d3154a794f00ac50d04d595eae7a80b257d6fe6f Mon Sep 17 00:00:00 2001 From: ioay Date: Tue, 16 Jan 2024 15:13:42 +0100 Subject: [PATCH 2/9] Eslint config: fix no-unsafe-member-access rule --- dapp/.eslintrc | 8 -------- dapp/src/theme/Alert.ts | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dapp/.eslintrc b/dapp/.eslintrc index 7cd958b53..342bac5c4 100644 --- a/dapp/.eslintrc +++ b/dapp/.eslintrc @@ -41,14 +41,6 @@ "@typescript-eslint/no-floating-promises": "off" } }, - { - "files": [ - "src/theme/Alert.ts" - ], - "rules": { - "@typescript-eslint/no-unsafe-member-access": "off" - } - }, { "files": [ "src/components/shared/Form/FormTokenBalanceInput.tsx" diff --git a/dapp/src/theme/Alert.ts b/dapp/src/theme/Alert.ts index ff1e53192..0d41126f4 100644 --- a/dapp/src/theme/Alert.ts +++ b/dapp/src/theme/Alert.ts @@ -62,7 +62,7 @@ const statusStyles = (props: StyleFunctionProps) => { info: statusInfo, } - return styleMap[status] || {} + return styleMap[status as string] || {} } const variantSubtle = multiStyleConfig.definePartsStyle((props) => From 669e6d080eb967473e574350c1c8774872a64de4 Mon Sep 17 00:00:00 2001 From: ioay Date: Tue, 16 Jan 2024 15:16:23 +0100 Subject: [PATCH 3/9] Eslint config: fix no-unsafe-assignment rule --- dapp/.eslintrc | 8 -------- dapp/src/components/shared/Form/FormTokenBalanceInput.tsx | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dapp/.eslintrc b/dapp/.eslintrc index 342bac5c4..8d26854f9 100644 --- a/dapp/.eslintrc +++ b/dapp/.eslintrc @@ -41,14 +41,6 @@ "@typescript-eslint/no-floating-promises": "off" } }, - { - "files": [ - "src/components/shared/Form/FormTokenBalanceInput.tsx" - ], - "rules": { - "@typescript-eslint/no-unsafe-assignment": "off" - } - }, { "files": [ "src/components/shared/TokenAmountForm/index.tsx" diff --git a/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx b/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx index 5f88f8bec..8571ed27e 100644 --- a/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx +++ b/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx @@ -15,7 +15,7 @@ export function FormTokenBalanceInput({ Date: Tue, 16 Jan 2024 15:21:22 +0100 Subject: [PATCH 4/9] Eslint config: fix require-await rule --- dapp/.eslintrc | 8 -------- dapp/src/components/shared/TokenAmountForm/index.tsx | 5 +---- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/dapp/.eslintrc b/dapp/.eslintrc index 8d26854f9..091b6b126 100644 --- a/dapp/.eslintrc +++ b/dapp/.eslintrc @@ -41,14 +41,6 @@ "@typescript-eslint/no-floating-promises": "off" } }, - { - "files": [ - "src/components/shared/TokenAmountForm/index.tsx" - ], - "rules": { - "@typescript-eslint/require-await": "off" - } - } ], "settings": { "import/resolver": { diff --git a/dapp/src/components/shared/TokenAmountForm/index.tsx b/dapp/src/components/shared/TokenAmountForm/index.tsx index c4b8dfec7..d8c6fabf0 100644 --- a/dapp/src/components/shared/TokenAmountForm/index.tsx +++ b/dapp/src/components/shared/TokenAmountForm/index.tsx @@ -15,10 +15,7 @@ const TokenAmountForm = withFormik( mapPropsToValues: () => ({ amount: undefined, }), - validate: async ( - { amount }, - { tokenBalance, currency, minTokenAmount }, - ) => { + validate: ({ amount }, { tokenBalance, currency, minTokenAmount }) => { const errors: FormikErrors = {} errors.amount = validateTokenAmount( From 2eabd86d1679b11c32f217802ee58d87ce8f34b6 Mon Sep 17 00:00:00 2001 From: ioay Date: Tue, 16 Jan 2024 17:44:45 +0100 Subject: [PATCH 5/9] Eslint config: fix no-misused-promises rule --- dapp/.eslintrc | 12 ------------ dapp/src/components/Header/ConnectWallet.tsx | 8 +++++++- dapp/src/components/Modals/Staking/SignMessage.tsx | 8 +++++++- .../components/Modals/Support/MissingAccount.tsx | 14 +++++++------- .../shared/Form/FormTokenBalanceInput.tsx | 8 +++++++- dapp/src/hooks/useDepositBTCTransaction.ts | 2 ++ 6 files changed, 30 insertions(+), 22 deletions(-) diff --git a/dapp/.eslintrc b/dapp/.eslintrc index 091b6b126..e0ec22303 100644 --- a/dapp/.eslintrc +++ b/dapp/.eslintrc @@ -21,18 +21,6 @@ // This is temporary solution after changes of the eslint-config version: @thesis-co/eslint-config: "github:thesis/eslint-config#7b9bc8c" // Overrides rules should be fixed file by file. "overrides": [ - { - "files": [ - "src/components/Header/ConnectWallet.tsx", - "src/components/Modals/Support/MissingAccount.tsx", - "src/components/Modals/Staking/SignMessage.tsx", - "src/hooks/useDepositBTCTransaction.ts", - "src/components/shared/Form/FormTokenBalanceInput.tsx" - ], - "rules": { - "@typescript-eslint/no-misused-promises": "off" - } - }, { "files": [ "src/hooks/useSignMessage.ts" diff --git a/dapp/src/components/Header/ConnectWallet.tsx b/dapp/src/components/Header/ConnectWallet.tsx index 5319a04ca..41be77ac0 100644 --- a/dapp/src/components/Header/ConnectWallet.tsx +++ b/dapp/src/components/Header/ConnectWallet.tsx @@ -24,12 +24,18 @@ function ConnectButton({ }: ConnectButtonsProps) { const colorScheme = !account ? "error" : undefined + const handleClick = () => { + requestAccount().catch((error) => { + throw error + }) + } + return ( diff --git a/dapp/src/components/Modals/Staking/SignMessage.tsx b/dapp/src/components/Modals/Staking/SignMessage.tsx index e3cda7886..4bc8f7554 100644 --- a/dapp/src/components/Modals/Staking/SignMessage.tsx +++ b/dapp/src/components/Modals/Staking/SignMessage.tsx @@ -9,8 +9,14 @@ export default function SignMessage() { const { goNext } = useModalFlowContext() const { signMessage } = useSignMessage(goNext) + const handleClick = () => { + signMessage().catch((error) => { + throw error + }) + } + return ( - + {/* TODO: Add the correct action after click */} {}}> diff --git a/dapp/src/components/Modals/Support/MissingAccount.tsx b/dapp/src/components/Modals/Support/MissingAccount.tsx index 89ca3effd..b859f3cc8 100644 --- a/dapp/src/components/Modals/Support/MissingAccount.tsx +++ b/dapp/src/components/Modals/Support/MissingAccount.tsx @@ -25,6 +25,12 @@ export default function MissingAccount({ }: MissingAccountProps) { const { name, symbol } = getCurrencyByType(currency) + const handleClick = () => { + requestAccount().catch((error) => { + throw error + }) + } + return ( <> {name} account not installed @@ -44,13 +50,7 @@ export default function MissingAccount({ - diff --git a/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx b/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx index 8571ed27e..817f840d0 100644 --- a/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx +++ b/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx @@ -11,12 +11,18 @@ export function FormTokenBalanceInput({ }: FormTokenBalanceInputProps) { const [field, meta, helpers] = useField(name) + const setAmount = (value?: bigint) => { + helpers.setValue(value).catch((error) => { + throw error + }) + } + return ( diff --git a/dapp/src/hooks/useDepositBTCTransaction.ts b/dapp/src/hooks/useDepositBTCTransaction.ts index 0bef0c4be..a3feb0507 100644 --- a/dapp/src/hooks/useDepositBTCTransaction.ts +++ b/dapp/src/hooks/useDepositBTCTransaction.ts @@ -5,6 +5,8 @@ export function useDepositBTCTransaction(onSuccess?: OnSuccessCallback) { // TODO: sending transactions using the SDK const depositBTC = useCallback(() => { if (onSuccess) { + // FIXME: enable eslint rule when SDK ready + // eslint-disable-next-line @typescript-eslint/no-misused-promises setTimeout(onSuccess, 1000) } }, [onSuccess]) From d2ead5b4104a6ef1f9747861f9bcb00188e88f1e Mon Sep 17 00:00:00 2001 From: ioay Date: Tue, 16 Jan 2024 17:57:49 +0100 Subject: [PATCH 6/9] Eslint config: fix no-floating-promises rule --- dapp/.eslintrc | 13 ------------- dapp/src/hooks/useDepositBTCTransaction.ts | 1 - dapp/src/types/callback.ts | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/dapp/.eslintrc b/dapp/.eslintrc index e0ec22303..c87013b23 100644 --- a/dapp/.eslintrc +++ b/dapp/.eslintrc @@ -17,19 +17,6 @@ ], "react/require-default-props": [0], }, - // FIXME: - // This is temporary solution after changes of the eslint-config version: @thesis-co/eslint-config: "github:thesis/eslint-config#7b9bc8c" - // Overrides rules should be fixed file by file. - "overrides": [ - { - "files": [ - "src/hooks/useSignMessage.ts" - ], - "rules": { - "@typescript-eslint/no-floating-promises": "off" - } - }, - ], "settings": { "import/resolver": { "alias": { diff --git a/dapp/src/hooks/useDepositBTCTransaction.ts b/dapp/src/hooks/useDepositBTCTransaction.ts index a3feb0507..e60d14c45 100644 --- a/dapp/src/hooks/useDepositBTCTransaction.ts +++ b/dapp/src/hooks/useDepositBTCTransaction.ts @@ -6,7 +6,6 @@ export function useDepositBTCTransaction(onSuccess?: OnSuccessCallback) { const depositBTC = useCallback(() => { if (onSuccess) { // FIXME: enable eslint rule when SDK ready - // eslint-disable-next-line @typescript-eslint/no-misused-promises setTimeout(onSuccess, 1000) } }, [onSuccess]) diff --git a/dapp/src/types/callback.ts b/dapp/src/types/callback.ts index 526705388..0c047f7c5 100644 --- a/dapp/src/types/callback.ts +++ b/dapp/src/types/callback.ts @@ -1 +1 @@ -export type OnSuccessCallback = () => void | Promise +export type OnSuccessCallback = () => void From 813abcb5b323e5affaa956dcf876d79bf2572090 Mon Sep 17 00:00:00 2001 From: ioay Date: Thu, 18 Jan 2024 13:19:11 +0100 Subject: [PATCH 7/9] Removed comment --- dapp/src/hooks/useDepositBTCTransaction.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/dapp/src/hooks/useDepositBTCTransaction.ts b/dapp/src/hooks/useDepositBTCTransaction.ts index e60d14c45..0bef0c4be 100644 --- a/dapp/src/hooks/useDepositBTCTransaction.ts +++ b/dapp/src/hooks/useDepositBTCTransaction.ts @@ -5,7 +5,6 @@ export function useDepositBTCTransaction(onSuccess?: OnSuccessCallback) { // TODO: sending transactions using the SDK const depositBTC = useCallback(() => { if (onSuccess) { - // FIXME: enable eslint rule when SDK ready setTimeout(onSuccess, 1000) } }, [onSuccess]) From e5ae9c88eabd4e85ce2c793bb4d0a17aff366258 Mon Sep 17 00:00:00 2001 From: ioay Date: Sun, 21 Jan 2024 20:54:53 +0100 Subject: [PATCH 8/9] Added generic async wrapper --- dapp/src/components/Header/ConnectWallet.tsx | 6 ++---- dapp/src/components/Modals/Staking/SignMessage.tsx | 5 ++--- dapp/src/components/Modals/Support/MissingAccount.tsx | 6 ++---- dapp/src/components/shared/Form/FormTokenBalanceInput.tsx | 5 ++--- dapp/src/utils/async.ts | 8 ++++++++ dapp/src/utils/index.ts | 1 + 6 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 dapp/src/utils/async.ts diff --git a/dapp/src/components/Header/ConnectWallet.tsx b/dapp/src/components/Header/ConnectWallet.tsx index 41be77ac0..767b68833 100644 --- a/dapp/src/components/Header/ConnectWallet.tsx +++ b/dapp/src/components/Header/ConnectWallet.tsx @@ -9,7 +9,7 @@ import { import { CurrencyBalance } from "#/components/shared/CurrencyBalance" import { TextMd } from "#/components/shared/Typography" import { Bitcoin, Ethereum } from "#/static/icons" -import { truncateAddress } from "#/utils" +import { truncateAddress, asyncWrapper } from "#/utils" export type ConnectButtonsProps = { leftIcon: typeof Icon @@ -25,9 +25,7 @@ function ConnectButton({ const colorScheme = !account ? "error" : undefined const handleClick = () => { - requestAccount().catch((error) => { - throw error - }) + asyncWrapper(requestAccount()) } return ( diff --git a/dapp/src/components/Modals/Staking/SignMessage.tsx b/dapp/src/components/Modals/Staking/SignMessage.tsx index 4bc8f7554..d653ba781 100644 --- a/dapp/src/components/Modals/Staking/SignMessage.tsx +++ b/dapp/src/components/Modals/Staking/SignMessage.tsx @@ -3,6 +3,7 @@ import { Highlight } from "@chakra-ui/react" import { useModalFlowContext, useSignMessage } from "#/hooks" import Alert from "#/components/shared/Alert" import { TextMd } from "#/components/shared/Typography" +import { asyncWrapper } from "#/utils" import StakingSteps from "./components/StakingSteps" export default function SignMessage() { @@ -10,9 +11,7 @@ export default function SignMessage() { const { signMessage } = useSignMessage(goNext) const handleClick = () => { - signMessage().catch((error) => { - throw error - }) + asyncWrapper(signMessage()) } return ( diff --git a/dapp/src/components/Modals/Support/MissingAccount.tsx b/dapp/src/components/Modals/Support/MissingAccount.tsx index b859f3cc8..861cb7c63 100644 --- a/dapp/src/components/Modals/Support/MissingAccount.tsx +++ b/dapp/src/components/Modals/Support/MissingAccount.tsx @@ -9,7 +9,7 @@ import { } from "@chakra-ui/react" import { TextMd } from "#/components/shared/Typography" import Alert from "#/components/shared/Alert" -import { getCurrencyByType } from "#/utils" +import { asyncWrapper, getCurrencyByType } from "#/utils" import { CurrencyType, RequestAccountParams } from "#/types" type MissingAccountProps = { @@ -26,9 +26,7 @@ export default function MissingAccount({ const { name, symbol } = getCurrencyByType(currency) const handleClick = () => { - requestAccount().catch((error) => { - throw error - }) + asyncWrapper(requestAccount()) } return ( diff --git a/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx b/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx index 817f840d0..5eefb5933 100644 --- a/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx +++ b/dapp/src/components/shared/Form/FormTokenBalanceInput.tsx @@ -1,5 +1,6 @@ import React from "react" import { useField } from "formik" +import { asyncWrapper } from "#/utils" import TokenBalanceInput, { TokenBalanceInputProps } from "../TokenBalanceInput" export type FormTokenBalanceInputProps = { @@ -12,9 +13,7 @@ export function FormTokenBalanceInput({ const [field, meta, helpers] = useField(name) const setAmount = (value?: bigint) => { - helpers.setValue(value).catch((error) => { - throw error - }) + asyncWrapper(helpers.setValue(value)) } return ( diff --git a/dapp/src/utils/async.ts b/dapp/src/utils/async.ts new file mode 100644 index 000000000..df3657065 --- /dev/null +++ b/dapp/src/utils/async.ts @@ -0,0 +1,8 @@ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function asyncWrapper(func: Promise) { + return () => { + func.catch((error) => { + throw error + }) + } +} diff --git a/dapp/src/utils/index.ts b/dapp/src/utils/index.ts index 02eaa61b8..5d4c83a8c 100644 --- a/dapp/src/utils/index.ts +++ b/dapp/src/utils/index.ts @@ -2,3 +2,4 @@ export * from "./numbers" export * from "./address" export * from "./forms" export * from "./currency" +export * from "./async" From 3f0f58d969c4cf1a20c6a4f7100fde9e22c03041 Mon Sep 17 00:00:00 2001 From: ioay Date: Tue, 23 Jan 2024 21:57:24 +0100 Subject: [PATCH 9/9] Moving fonts & icons to assets --- dapp/src/{ => assets}/fonts/Segment-Black.otf | Bin dapp/src/{ => assets}/fonts/Segment-Bold.otf | Bin dapp/src/{ => assets}/fonts/Segment-Medium.otf | Bin dapp/src/{ => assets}/fonts/Segment-Regular.otf | Bin dapp/src/{ => assets}/fonts/Segment-SemiBold.otf | Bin dapp/src/{static => assets}/icons/AcreLogo.tsx | 0 dapp/src/{static => assets}/icons/AlertInfo.tsx | 0 dapp/src/{static => assets}/icons/ArrowLeft.tsx | 0 dapp/src/{static => assets}/icons/ArrowRight.tsx | 0 dapp/src/{static => assets}/icons/ArrowUpRight.tsx | 0 dapp/src/{static => assets}/icons/Bitcoin.tsx | 0 .../{static => assets}/icons/ConnectBTCAccount.tsx | 0 .../{static => assets}/icons/ConnectETHAccount.tsx | 0 dapp/src/{static => assets}/icons/Ethereum.tsx | 0 dapp/src/{static => assets}/icons/Info.tsx | 0 dapp/src/{static => assets}/icons/ShieldPlus.tsx | 0 dapp/src/{static => assets}/icons/index.ts | 0 dapp/src/components/GlobalStyles/index.tsx | 10 +++++----- dapp/src/components/Header/ConnectWallet.tsx | 2 +- dapp/src/components/Header/index.tsx | 2 +- dapp/src/components/Modals/Support/index.tsx | 2 +- dapp/src/components/Overview/PositionDetails.tsx | 2 +- dapp/src/components/Overview/index.tsx | 2 +- dapp/src/components/Sidebar/index.tsx | 2 +- .../TransactionHistory/Table/utils/pagination.tsx | 2 +- dapp/src/components/shared/Alert/index.tsx | 2 +- dapp/src/components/shared/ButtonLink/index.tsx | 2 +- .../components/shared/TokenBalanceInput/index.tsx | 2 +- 28 files changed, 15 insertions(+), 15 deletions(-) rename dapp/src/{ => assets}/fonts/Segment-Black.otf (100%) rename dapp/src/{ => assets}/fonts/Segment-Bold.otf (100%) rename dapp/src/{ => assets}/fonts/Segment-Medium.otf (100%) rename dapp/src/{ => assets}/fonts/Segment-Regular.otf (100%) rename dapp/src/{ => assets}/fonts/Segment-SemiBold.otf (100%) rename dapp/src/{static => assets}/icons/AcreLogo.tsx (100%) rename dapp/src/{static => assets}/icons/AlertInfo.tsx (100%) rename dapp/src/{static => assets}/icons/ArrowLeft.tsx (100%) rename dapp/src/{static => assets}/icons/ArrowRight.tsx (100%) rename dapp/src/{static => assets}/icons/ArrowUpRight.tsx (100%) rename dapp/src/{static => assets}/icons/Bitcoin.tsx (100%) rename dapp/src/{static => assets}/icons/ConnectBTCAccount.tsx (100%) rename dapp/src/{static => assets}/icons/ConnectETHAccount.tsx (100%) rename dapp/src/{static => assets}/icons/Ethereum.tsx (100%) rename dapp/src/{static => assets}/icons/Info.tsx (100%) rename dapp/src/{static => assets}/icons/ShieldPlus.tsx (100%) rename dapp/src/{static => assets}/icons/index.ts (100%) diff --git a/dapp/src/fonts/Segment-Black.otf b/dapp/src/assets/fonts/Segment-Black.otf similarity index 100% rename from dapp/src/fonts/Segment-Black.otf rename to dapp/src/assets/fonts/Segment-Black.otf diff --git a/dapp/src/fonts/Segment-Bold.otf b/dapp/src/assets/fonts/Segment-Bold.otf similarity index 100% rename from dapp/src/fonts/Segment-Bold.otf rename to dapp/src/assets/fonts/Segment-Bold.otf diff --git a/dapp/src/fonts/Segment-Medium.otf b/dapp/src/assets/fonts/Segment-Medium.otf similarity index 100% rename from dapp/src/fonts/Segment-Medium.otf rename to dapp/src/assets/fonts/Segment-Medium.otf diff --git a/dapp/src/fonts/Segment-Regular.otf b/dapp/src/assets/fonts/Segment-Regular.otf similarity index 100% rename from dapp/src/fonts/Segment-Regular.otf rename to dapp/src/assets/fonts/Segment-Regular.otf diff --git a/dapp/src/fonts/Segment-SemiBold.otf b/dapp/src/assets/fonts/Segment-SemiBold.otf similarity index 100% rename from dapp/src/fonts/Segment-SemiBold.otf rename to dapp/src/assets/fonts/Segment-SemiBold.otf diff --git a/dapp/src/static/icons/AcreLogo.tsx b/dapp/src/assets/icons/AcreLogo.tsx similarity index 100% rename from dapp/src/static/icons/AcreLogo.tsx rename to dapp/src/assets/icons/AcreLogo.tsx diff --git a/dapp/src/static/icons/AlertInfo.tsx b/dapp/src/assets/icons/AlertInfo.tsx similarity index 100% rename from dapp/src/static/icons/AlertInfo.tsx rename to dapp/src/assets/icons/AlertInfo.tsx diff --git a/dapp/src/static/icons/ArrowLeft.tsx b/dapp/src/assets/icons/ArrowLeft.tsx similarity index 100% rename from dapp/src/static/icons/ArrowLeft.tsx rename to dapp/src/assets/icons/ArrowLeft.tsx diff --git a/dapp/src/static/icons/ArrowRight.tsx b/dapp/src/assets/icons/ArrowRight.tsx similarity index 100% rename from dapp/src/static/icons/ArrowRight.tsx rename to dapp/src/assets/icons/ArrowRight.tsx diff --git a/dapp/src/static/icons/ArrowUpRight.tsx b/dapp/src/assets/icons/ArrowUpRight.tsx similarity index 100% rename from dapp/src/static/icons/ArrowUpRight.tsx rename to dapp/src/assets/icons/ArrowUpRight.tsx diff --git a/dapp/src/static/icons/Bitcoin.tsx b/dapp/src/assets/icons/Bitcoin.tsx similarity index 100% rename from dapp/src/static/icons/Bitcoin.tsx rename to dapp/src/assets/icons/Bitcoin.tsx diff --git a/dapp/src/static/icons/ConnectBTCAccount.tsx b/dapp/src/assets/icons/ConnectBTCAccount.tsx similarity index 100% rename from dapp/src/static/icons/ConnectBTCAccount.tsx rename to dapp/src/assets/icons/ConnectBTCAccount.tsx diff --git a/dapp/src/static/icons/ConnectETHAccount.tsx b/dapp/src/assets/icons/ConnectETHAccount.tsx similarity index 100% rename from dapp/src/static/icons/ConnectETHAccount.tsx rename to dapp/src/assets/icons/ConnectETHAccount.tsx diff --git a/dapp/src/static/icons/Ethereum.tsx b/dapp/src/assets/icons/Ethereum.tsx similarity index 100% rename from dapp/src/static/icons/Ethereum.tsx rename to dapp/src/assets/icons/Ethereum.tsx diff --git a/dapp/src/static/icons/Info.tsx b/dapp/src/assets/icons/Info.tsx similarity index 100% rename from dapp/src/static/icons/Info.tsx rename to dapp/src/assets/icons/Info.tsx diff --git a/dapp/src/static/icons/ShieldPlus.tsx b/dapp/src/assets/icons/ShieldPlus.tsx similarity index 100% rename from dapp/src/static/icons/ShieldPlus.tsx rename to dapp/src/assets/icons/ShieldPlus.tsx diff --git a/dapp/src/static/icons/index.ts b/dapp/src/assets/icons/index.ts similarity index 100% rename from dapp/src/static/icons/index.ts rename to dapp/src/assets/icons/index.ts diff --git a/dapp/src/components/GlobalStyles/index.tsx b/dapp/src/components/GlobalStyles/index.tsx index 352fe7af0..e8b11945a 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 "#/assets/fonts/Segment-Regular.otf" +import SegmentMedium from "#/assets/fonts/Segment-Medium.otf" +import SegmentSemiBold from "#/assets/fonts/Segment-SemiBold.otf" +import SegmentBold from "#/assets/fonts/Segment-Bold.otf" +import SegmentBlack from "#/assets/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 767b68833..5e2445406 100644 --- a/dapp/src/components/Header/ConnectWallet.tsx +++ b/dapp/src/components/Header/ConnectWallet.tsx @@ -8,7 +8,7 @@ import { } from "#/hooks" import { CurrencyBalance } from "#/components/shared/CurrencyBalance" import { TextMd } from "#/components/shared/Typography" -import { Bitcoin, Ethereum } from "#/static/icons" +import { Bitcoin, Ethereum } from "#/assets/icons" import { truncateAddress, asyncWrapper } from "#/utils" export type ConnectButtonsProps = { diff --git a/dapp/src/components/Header/index.tsx b/dapp/src/components/Header/index.tsx index 480cb502e..df0a2eb53 100644 --- a/dapp/src/components/Header/index.tsx +++ b/dapp/src/components/Header/index.tsx @@ -1,6 +1,6 @@ import React from "react" import { Flex, HStack, Icon } from "@chakra-ui/react" -import { AcreLogo } from "#/static/icons" +import { AcreLogo } from "#/assets/icons" import ConnectWallet from "./ConnectWallet" export default function Header() { diff --git a/dapp/src/components/Modals/Support/index.tsx b/dapp/src/components/Modals/Support/index.tsx index ae5aa98eb..47689622a 100644 --- a/dapp/src/components/Modals/Support/index.tsx +++ b/dapp/src/components/Modals/Support/index.tsx @@ -4,7 +4,7 @@ import { useRequestEthereumAccount, useWalletContext, } from "#/hooks" -import { ConnectBTCAccount, ConnectETHAccount } from "#/static/icons" +import { ConnectBTCAccount, ConnectETHAccount } from "#/assets/icons" import MissingAccount from "./MissingAccount" export default function SupportWrapper({ diff --git a/dapp/src/components/Overview/PositionDetails.tsx b/dapp/src/components/Overview/PositionDetails.tsx index 0555c3ddf..290c7c52a 100644 --- a/dapp/src/components/Overview/PositionDetails.tsx +++ b/dapp/src/components/Overview/PositionDetails.tsx @@ -12,7 +12,7 @@ import { } from "@chakra-ui/react" import { CurrencyBalanceWithConversion } from "#/components/shared/CurrencyBalanceWithConversion" import { TextMd } from "#/components/shared/Typography" -import { Info } from "#/static/icons" +import { Info } from "#/assets/icons" import StakingModal from "../Modals/Staking" export default function PositionDetails(props: CardProps) { diff --git a/dapp/src/components/Overview/index.tsx b/dapp/src/components/Overview/index.tsx index 31764618f..c2c07064f 100644 --- a/dapp/src/components/Overview/index.tsx +++ b/dapp/src/components/Overview/index.tsx @@ -2,7 +2,7 @@ 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 { ArrowUpRight } from "#/assets/icons" import { USD } from "#/constants" import PositionDetails from "./PositionDetails" import Statistics from "./Statistics" diff --git a/dapp/src/components/Sidebar/index.tsx b/dapp/src/components/Sidebar/index.tsx index b0e46f3e5..0b485b142 100644 --- a/dapp/src/components/Sidebar/index.tsx +++ b/dapp/src/components/Sidebar/index.tsx @@ -13,7 +13,7 @@ import { } from "@chakra-ui/react" import RightSidebar from "#/assets/images/right-sidebar-bg.png" import { useSidebar, useDocsDrawer } from "#/hooks" -import { ShieldPlusIcon } from "#/static/icons" +import { ShieldPlusIcon } from "#/assets/icons" import { TextMd, TextSm } from "../shared/Typography" import ButtonLink from "../shared/ButtonLink" diff --git a/dapp/src/components/TransactionHistory/Table/utils/pagination.tsx b/dapp/src/components/TransactionHistory/Table/utils/pagination.tsx index 11dc7f697..b0bb99ef5 100644 --- a/dapp/src/components/TransactionHistory/Table/utils/pagination.tsx +++ b/dapp/src/components/TransactionHistory/Table/utils/pagination.tsx @@ -1,6 +1,6 @@ import React from "react" import { UseTransactionHistoryTableResult } from "#/types" -import { ArrowLeft, ArrowRight } from "#/static/icons" +import { ArrowLeft, ArrowRight } from "#/assets/icons" export const PAGINATION_BUTTONS = [ { diff --git a/dapp/src/components/shared/Alert/index.tsx b/dapp/src/components/shared/Alert/index.tsx index 687e0599b..c5a10f0eb 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 "#/assets/icons" const ICONS = { info: AlertInfo, diff --git a/dapp/src/components/shared/ButtonLink/index.tsx b/dapp/src/components/shared/ButtonLink/index.tsx index 32aa81907..88d44e3e1 100644 --- a/dapp/src/components/shared/ButtonLink/index.tsx +++ b/dapp/src/components/shared/ButtonLink/index.tsx @@ -1,6 +1,6 @@ import React from "react" import { Button, ButtonProps, Icon } from "@chakra-ui/react" -import { ArrowUpRight } from "#/static/icons" +import { ArrowUpRight } from "#/assets/icons" type ButtonLinkProps = ButtonProps & { icon?: typeof Icon diff --git a/dapp/src/components/shared/TokenBalanceInput/index.tsx b/dapp/src/components/shared/TokenBalanceInput/index.tsx index 68975da92..de55b64dd 100644 --- a/dapp/src/components/shared/TokenBalanceInput/index.tsx +++ b/dapp/src/components/shared/TokenBalanceInput/index.tsx @@ -17,7 +17,7 @@ import { getCurrencyByType, userAmountToBigInt, } from "#/utils" -import { AlertInfo } from "#/static/icons" +import { AlertInfo } from "#/assets/icons" import { CurrencyType } from "#/types" import NumberFormatInput, { NumberFormatInputValues,