From e893c8455acc0fa89ede552f06405546e66781f3 Mon Sep 17 00:00:00 2001 From: Peter Sanderson Date: Wed, 6 Nov 2024 12:29:17 +0100 Subject: [PATCH 1/4] chore: enable import/order rule for whole codebase --- .eslintrc.js | 1 - packages/analytics/src/utils.ts | 3 +- .../src/workers/baseWebsocket.ts | 2 +- .../blockchain-link/src/workers/baseWorker.ts | 6 ++- .../src/workers/blockbook/index.ts | 5 +- .../src/workers/blockbook/websocket.ts | 2 +- .../src/workers/blockfrost/index.ts | 5 +- .../src/workers/blockfrost/websocket.ts | 2 +- .../src/workers/electrum/client/caching.ts | 3 +- .../src/workers/electrum/client/electrum.ts | 1 + .../src/workers/electrum/client/json-rpc.ts | 2 + .../src/workers/electrum/index.ts | 5 +- .../electrum/listeners/blockListener.ts | 3 +- .../workers/electrum/listeners/txListener.ts | 5 +- .../workers/electrum/methods/estimateFee.ts | 3 +- .../methods/getAccountBalanceHistory.ts | 3 +- .../electrum/methods/getAccountInfo.ts | 3 +- .../electrum/methods/getAccountUtxo.ts | 3 +- .../workers/electrum/methods/getBlockHash.ts | 3 +- .../src/workers/electrum/methods/getInfo.ts | 3 +- .../electrum/methods/getTransaction.ts | 3 +- .../electrum/methods/pushTransaction.ts | 3 +- .../src/workers/electrum/sockets/base.ts | 1 + .../src/workers/electrum/sockets/index.ts | 1 + .../src/workers/electrum/sockets/tcp.ts | 1 + .../src/workers/electrum/sockets/tls.ts | 1 + .../src/workers/electrum/sockets/tor.ts | 3 +- .../workers/electrum/utils/addressManager.ts | 3 +- .../src/workers/electrum/utils/discovery.ts | 3 +- .../src/workers/electrum/utils/transaction.ts | 3 +- .../src/workers/ripple/index.ts | 4 +- .../blockchain-link/src/workers/solana/fee.ts | 1 + .../src/workers/solana/index.ts | 9 ++-- .../tests/integration/blockbook.test.ts | 1 + .../tests/integration/blockfrost.test.ts | 1 + .../tests/integration/connection.test.ts | 1 + .../tests/integration/electrum.test.ts | 3 +- .../tests/integration/ripple.test.ts | 1 + .../tests/integration/solana.test.ts | 1 + .../tests/unit/connection.test.ts | 1 + .../tests/unit/estimateFee.test.ts | 1 + .../tests/unit/getAccountInfo.test.ts | 1 + .../tests/unit/getAccountUtxo.test.ts | 1 + .../tests/unit/getBlockHash.test.ts | 1 + .../tests/unit/getInfo.test.ts | 1 + .../tests/unit/getTransaction.test.ts | 1 + .../tests/unit/notifications.test.ts | 2 +- .../tests/unit/pushTransaction.test.ts | 1 + .../tests/unit/subscribe.test.ts | 1 + .../blockchain-link/tests/unit/utils.test.ts | 1 - .../tests/unit/workers.test.ts | 1 + packages/blockchain-link/webpack/dev.js | 1 + .../blockchain-link/webpack/workers.web.js | 1 + .../components/AssetLogo/AssetInitials.tsx | 4 +- .../src/components/AssetLogo/AssetLogo.tsx | 12 +++-- .../AutoScalingInput.stories.tsx | 4 +- .../AutoScalingInput/AutoScalingInput.tsx | 1 + .../AutoScalingInputExamples.stories.tsx | 3 +- .../src/components/Badge/Badge.stories.tsx | 1 + .../components/src/components/Badge/Badge.tsx | 3 ++ .../src/components/Banner/Banner.stories.tsx | 3 +- .../src/components/Banner/Banner.tsx | 3 +- .../src/components/Banner/BannerContext.ts | 1 + .../src/components/Banner/utils.tsx | 4 +- .../src/components/Card/Card.stories.tsx | 1 + .../components/src/components/Card/utils.tsx | 4 +- .../CollapsibleBox/CollapsibleBox.tsx | 3 ++ .../src/components/CollapsibleBox/utils.tsx | 1 + .../ComponentWithSubIcon.stories.tsx | 1 + .../ComponentWithSubIcon.tsx | 7 ++- .../src/components/DataAnalytics.tsx | 7 ++- .../components/Divider/Divider.stories.tsx | 3 +- .../components/Dropdown/Dropdown.stories.tsx | 2 + .../src/components/Dropdown/Dropdown.tsx | 3 ++ .../src/components/Dropdown/Menu.tsx | 3 ++ .../src/components/Dropdown/menuStyle.ts | 1 + .../ElevationContext.stories.tsx | 22 ++++---- .../ElevationContext/ElevationContext.tsx | 4 +- .../src/components/Flag/Flag.stories.tsx | 1 + .../components/src/components/Flag/Flag.tsx | 1 + .../src/components/Flex/Flex.stories.tsx | 6 ++- .../components/src/components/Flex/Flex.tsx | 8 ++- .../GradientOverlay.stories.tsx | 3 +- .../GradientOverlay/GradientOverlay.tsx | 4 +- .../src/components/Grid/Grid.stories.tsx | 6 ++- .../components/src/components/Grid/Grid.tsx | 4 +- .../HotkeyBadge/HotkeyBadge.stories.tsx | 1 + .../components/HotkeyBadge/HotkeyBadge.tsx | 8 ++- .../src/components/Icon/Icon.stories.tsx | 12 +++-- .../components/src/components/Icon/Icon.tsx | 1 + .../src/components/Icon/icons.stories.tsx | 13 +++-- .../IconCircle/IconCircle.stories.tsx | 2 + .../src/components/IconCircle/types.tsx | 3 +- .../src/components/IconCircle/utils.tsx | 4 +- .../src/components/Image/Image.stories.tsx | 1 + .../components/src/components/Image/Image.tsx | 2 + .../components/InfoRow/InfoRow.stories.tsx | 1 + .../src/components/InfoRow/InfoRow.tsx | 5 +- .../src/components/List/List.stories.tsx | 2 + .../components/src/components/List/List.tsx | 4 +- .../src/components/List/ListItem.tsx | 5 +- .../components/Markdown/Markdown.stories.tsx | 1 + .../src/components/Markdown/Markdown.tsx | 7 ++- .../components/NewModal/NewModal.stories.tsx | 3 +- .../src/components/NewModal/NewModal.tsx | 4 +- .../components/NewModal/NewModalBackdrop.tsx | 7 ++- .../components/NewModal/NewModalContext.tsx | 1 + .../src/components/Note/Note.stories.tsx | 1 + .../components/src/components/Note/Note.tsx | 1 + .../ResizableBox/ResizableBox.stories.tsx | 1 + .../components/ResizableBox/ResizableBox.tsx | 4 +- .../ResizableBoxExamples.stories.tsx | 1 + .../components/src/components/Table/Table.tsx | 2 + .../src/components/Table/TableCell.tsx | 1 + .../src/components/Table/TableHeader.tsx | 1 + .../src/components/Table/TableRow.tsx | 1 + .../Timerange/Timerange.stories.tsx | 1 + .../src/components/Timerange/Timerange.tsx | 4 +- .../components/Tooltip/Tooltip.stories.tsx | 7 ++- .../src/components/Tooltip/Tooltip.tsx | 6 ++- .../src/components/Tooltip/TooltipArrow.tsx | 4 +- .../src/components/Tooltip/TooltipBox.tsx | 5 +- .../components/Tooltip/TooltipFloatingUi.tsx | 31 +++++------ .../VirtualizedList.stories.tsx | 4 +- .../VirtualizedList/VirtualizedList.tsx | 4 +- .../animations/AnimationPrimitives.tsx | 3 +- .../components/animations/DeviceAnimation.tsx | 1 + .../components/animations/LottieAnimation.tsx | 4 +- .../buttons/Button/Button.stories.tsx | 1 + .../src/components/buttons/Button/Button.tsx | 3 ++ .../buttons/Button/buttons.stories.tsx | 7 ++- .../buttons/ButtonGroup/ButtonGroup.tsx | 3 ++ .../ButtonGroup/ButtonGroups.stories.tsx | 2 + .../buttons/IconButton/IconButton.stories.tsx | 1 + .../buttons/IconButton/IconButton.tsx | 2 + .../IconButton/IconButtons.stories.tsx | 4 +- .../buttons/PinButton/PinButton.stories.tsx | 1 + .../buttons/PinButton/PinButton.tsx | 7 ++- .../buttons/TextButton/TextButton.stories.tsx | 1 + .../buttons/TextButton/TextButton.tsx | 3 ++ .../TextButton/TextButtons.stories.tsx | 2 + .../components/buttons/buttonStyleUtils.ts | 3 +- .../src/components/form/BottomText.tsx | 5 +- .../src/components/form/Checkbox/Checkbox.tsx | 2 + .../components/form/Input/Input.stories.tsx | 1 + .../src/components/form/Input/Input.tsx | 5 +- .../src/components/form/InputStyles.ts | 1 + .../src/components/form/Radio/Radio.tsx | 2 + .../src/components/form/Range/Range.tsx | 1 + .../src/components/form/Select/Select.tsx | 2 + .../form/Select/customComponents.tsx | 1 + .../form/Select/useDetectPortalTarget.ts | 1 + .../components/form/Select/useOnKeyDown.ts | 1 + .../components/form/SelectBar/SelectBar.tsx | 3 ++ .../src/components/form/Switch/Switch.tsx | 3 ++ .../form/Textarea/CharacterCount.tsx | 1 + .../form/Textarea/Textarea.stories.tsx | 4 +- .../src/components/form/Textarea/Textarea.tsx | 4 +- .../src/components/form/TopAddons.tsx | 2 + .../LoadingContent/LoadingContent.stories.tsx | 1 + .../loaders/LoadingContent/LoadingContent.tsx | 2 + .../ProgressBar/ProgressBar.stories.tsx | 1 + .../loaders/ProgressBar/ProgressBar.tsx | 3 +- .../ProgressPie/ProgressPie.stories.tsx | 1 + .../loaders/ProgressPie/ProgressPie.tsx | 1 + .../loaders/Spinner/Spinner.stories.tsx | 1 + .../components/loaders/Spinner/Spinner.tsx | 2 + .../loaders/Stepper/Stepper.stories.tsx | 1 + .../components/loaders/Stepper/Stepper.tsx | 1 + .../DialogModal/DialogModal.stories.tsx | 1 + .../modals/DialogModal/DialogModal.tsx | 5 +- .../src/components/modals/Modal/Backdrop.tsx | 2 + .../components/modals/Modal/Modal.stories.tsx | 1 + .../src/components/modals/Modal/Modal.tsx | 3 +- .../skeletons/SkeletonCircle.stories.tsx | 1 + .../components/skeletons/SkeletonCircle.tsx | 4 +- .../skeletons/SkeletonRectangle.stories.tsx | 1 + .../skeletons/SkeletonRectangle.tsx | 4 +- .../skeletons/SkeletonSpread.stories.tsx | 3 +- .../components/skeletons/SkeletonSpread.tsx | 1 + .../skeletons/SkeletonStack.stories.tsx | 1 + .../src/components/skeletons/utils.ts | 4 +- .../typography/Code/Code.stories.tsx | 1 + .../src/components/typography/Code/Code.tsx | 4 +- .../typography/Heading/Heading.stories.tsx | 1 + .../components/typography/Heading/Heading.tsx | 1 + .../typography/Link/Link.stories.tsx | 1 + .../src/components/typography/Link/Link.tsx | 3 ++ .../Paragraph/Paragraph.stories.tsx | 1 + .../typography/Paragraph/Paragraph.tsx | 1 + .../typography/Text/Text.stories.tsx | 1 + .../src/components/typography/Text/Text.tsx | 5 +- .../TruncateWithTooltip.stories.tsx | 3 +- .../TruncateWithTooltip.tsx | 4 +- .../typography/typography.stories.tsx | 3 +- .../src/components/typography/utils.tsx | 4 +- packages/components/src/support/Story.tsx | 1 + packages/components/src/utils/frameProps.tsx | 4 +- .../components/src/utils/useScrollShadow.tsx | 5 +- packages/components/styled.d.ts | 1 + .../src/actions/trezorConnectActions.ts | 1 - .../src/components/GuideIndex.tsx | 5 +- .../src/components/ZoomableIllustration.tsx | 2 +- .../src/components/fields/ArrayWrapper.tsx | 3 +- .../connect-explorer/src/pages/callback.mdx | 1 + .../connect-explorer/src/pages/changelog.mdx | 5 +- .../src/pages/details/deeplinking.mdx | 1 + .../src/pages/readme/[name].mdx | 1 + packages/connect-iframe/src/index.ts | 3 +- .../webpack/base.webpack.config.ts | 1 + packages/connect-plugin-stellar/src/index.ts | 1 + .../connect-popup/e2e/tests/analytics.test.ts | 1 + .../e2e/tests/browser-support.test.ts | 2 + .../connect-popup/e2e/tests/methods.test.ts | 3 +- .../e2e/tests/passphrase.test.ts | 2 + .../e2e/tests/permissions.test.ts | 2 + .../e2e/tests/popup-close.test.ts | 2 + .../e2e/tests/popup-pages.test.ts | 4 +- .../connect-popup/e2e/tests/transport.test.ts | 6 ++- .../connect-popup/e2e/tests/unchained.test.ts | 1 + packages/connect-popup/src/deeplink.tsx | 1 + packages/connect-popup/src/index.tsx | 5 +- packages/connect-popup/src/log.tsx | 1 + packages/connect-popup/src/view/browser.ts | 1 + packages/connect-popup/src/view/common.tsx | 7 +-- .../connect-popup/src/view/confirmation.ts | 1 + .../src/view/firmwareNotCompatible.ts | 3 +- .../src/view/firmwareNotSupported.ts | 1 + .../src/view/firmwareRequiredUpdate.ts | 1 + .../src/view/invalidPassphrase.ts | 1 + .../src/view/passphraseOnDevice.ts | 1 + .../connect-popup/src/view/permissions.ts | 1 + packages/connect-popup/src/view/pin.ts | 1 + .../src/view/react/StylesSheetWrapper.tsx | 1 + .../connect-popup/src/view/requestButton.ts | 1 + .../connect-popup/src/view/selectAccount.ts | 1 + .../connect-popup/src/view/selectDevice.ts | 3 +- packages/connect-popup/src/view/selectFee.ts | 1 + packages/connect-popup/src/view/word.ts | 3 +- .../webpack/dev.webpack.config.ts | 1 + .../webpack/prod.webpack.config.ts | 4 +- packages/connect-web/src/iframe/index.ts | 1 + .../connect-web/src/impl/core-in-iframe.ts | 2 +- .../connect-web/src/impl/core-in-popup.ts | 6 +-- packages/connect-web/src/index.ts | 3 +- packages/connect-web/src/popup/index.ts | 7 +-- .../webpack/inline.webpack.config.ts | 1 + .../e2e/__fixtures__/cardanoGetAddress.ts | 3 +- .../cardanoGetAddressDerivations.ts | 3 +- .../__fixtures__/cardanoSignTransaction.ts | 3 +- .../e2e/__fixtures__/ethereumSignMessage.ts | 1 + .../__fixtures__/stellarSignTransaction.ts | 3 +- packages/connect/e2e/__txcache__/gen-reftx.ts | 1 + packages/connect/e2e/__wscache__/server.js | 1 + packages/connect/e2e/common.setup.ts | 5 +- .../tests/device/authenticateDevice.test.ts | 2 +- .../tests/device/authorizeCoinjoin.test.ts | 1 - .../connect/e2e/tests/device/cancel.test.ts | 1 + .../cancelCoinjoinAuthorization.test.ts | 1 - .../e2e/tests/device/keepSession.test.ts | 1 - .../connect/e2e/tests/device/methods.test.ts | 1 - .../connect/e2e/tests/device/override.test.ts | 1 - .../e2e/tests/device/passphrase.test.ts | 1 - .../connect/e2e/tests/device/setBusy.test.ts | 1 - .../e2e/tests/device/unlockPath.test.ts | 1 - packages/connect/setupJest.ts | 1 + packages/connect/src/api/applyFlags.ts | 3 +- packages/connect/src/api/applySettings.ts | 3 +- .../connect/src/api/authenticateDevice.ts | 3 +- packages/connect/src/api/authorizeCoinjoin.ts | 3 +- packages/connect/src/api/backupDevice.ts | 3 +- .../src/api/binance/api/binanceGetAddress.ts | 3 +- .../api/binance/api/binanceGetPublicKey.ts | 3 +- .../api/binance/api/binanceSignTransaction.ts | 4 +- .../connect/src/api/binance/binanceSignTx.ts | 3 +- packages/connect/src/api/bitcoin/Fees.ts | 1 + .../src/api/bitcoin/TransactionComposer.ts | 1 + .../src/api/bitcoin/__fixtures__/refTx.ts | 1 + .../src/api/bitcoin/__tests__/Fees.test.ts | 1 + .../src/api/bitcoin/__tests__/inputs.test.ts | 1 + .../bitcoin/__tests__/signtxVerify.test.ts | 1 + .../src/api/bitcoin/createPendingTx.ts | 3 +- packages/connect/src/api/bitcoin/inputs.ts | 1 + packages/connect/src/api/bitcoin/outputs.ts | 1 + packages/connect/src/api/bitcoin/refTx.ts | 8 +-- .../connect/src/api/bitcoin/signtxVerify.ts | 2 +- .../connect/src/api/blockchainDisconnect.ts | 3 +- .../src/api/cancelCoinjoinAuthorization.ts | 3 +- .../src/api/cardano/api/cardanoGetAddress.ts | 3 +- .../cardano/api/cardanoGetNativeScriptHash.ts | 3 +- .../api/cardano/api/cardanoGetPublicKey.ts | 3 +- .../api/cardano/api/cardanoSignTransaction.ts | 3 +- .../api/cardano/cardanoAddressParameters.ts | 3 +- .../src/api/cardano/cardanoAuxiliaryData.ts | 3 +- .../src/api/cardano/cardanoCertificate.ts | 3 +- .../connect/src/api/cardano/cardanoInputs.ts | 3 +- .../connect/src/api/cardano/cardanoOutputs.ts | 3 +- .../src/api/cardano/cardanoTokenBundle.ts | 3 +- packages/connect/src/api/changeLanguage.ts | 3 +- packages/connect/src/api/changePin.ts | 3 +- packages/connect/src/api/cipherKeyValue.ts | 3 +- packages/connect/src/api/common/Discovery.ts | 1 + .../connect/src/api/composeTransaction.ts | 3 +- .../src/api/eos/api/eosGetPublicKey.ts | 3 +- .../src/api/eos/api/eosSignTransaction.ts | 3 +- .../__fixtures__/ethereumSignTypedData.ts | 1 + .../ethereum/__tests__/ethereumSignTx.test.ts | 1 - .../api/ethereum/api/ethereumGetAddress.ts | 3 +- .../api/ethereum/api/ethereumGetPublicKey.ts | 3 +- .../api/ethereum/api/ethereumSignMessage.ts | 5 +- .../ethereum/api/ethereumSignTransaction.ts | 9 ++-- .../api/ethereum/api/ethereumSignTypedData.ts | 5 +- .../api/ethereum/api/ethereumVerifyMessage.ts | 3 +- .../src/api/ethereum/ethereumDefinitions.ts | 3 +- .../src/api/ethereum/ethereumSignTx.ts | 1 + .../src/api/ethereum/ethereumSignTypedData.ts | 1 + .../api/firmware/verifyAuthenticityProof.ts | 1 + .../connect/src/api/getAccountDescriptor.ts | 3 +- packages/connect/src/api/getAddress.ts | 3 +- packages/connect/src/api/getCoinInfo.ts | 3 +- packages/connect/src/api/getFirmwareHash.ts | 3 +- packages/connect/src/api/getOwnershipId.ts | 3 +- packages/connect/src/api/getOwnershipProof.ts | 3 +- packages/connect/src/api/getPublicKey.ts | 3 +- packages/connect/src/api/loadDevice.ts | 3 +- .../connect/src/api/nem/api/nemGetAddress.ts | 3 +- .../src/api/nem/api/nemSignTransaction.ts | 3 +- packages/connect/src/api/pushTransaction.ts | 3 +- .../connect/src/api/rebootToBootloader.ts | 3 +- packages/connect/src/api/recoveryDevice.ts | 3 +- packages/connect/src/api/requestLogin.ts | 3 +- packages/connect/src/api/resetDevice.ts | 3 +- .../src/api/ripple/api/rippleGetAddress.ts | 3 +- .../api/ripple/api/rippleSignTransaction.ts | 3 +- packages/connect/src/api/setBrightness.ts | 3 +- packages/connect/src/api/setBusy.ts | 3 +- packages/connect/src/api/signMessage.ts | 3 +- .../connect/src/api/solana/additionalInfo.ts | 1 + .../src/api/solana/api/solanaGetAddress.ts | 3 +- .../src/api/solana/api/solanaGetPublicKey.ts | 3 +- .../api/solana/api/solanaSignTransaction.ts | 3 +- .../src/api/stellar/api/stellarGetAddress.ts | 3 +- .../api/stellar/api/stellarSignTransaction.ts | 3 +- .../connect/src/api/stellar/stellarSignTx.ts | 3 +- .../src/api/tezos/api/tezosGetAddress.ts | 3 +- .../src/api/tezos/api/tezosGetPublicKey.ts | 3 +- .../src/api/tezos/api/tezosSignTransaction.ts | 3 +- packages/connect/src/api/tezos/tezosSignTx.ts | 4 +- packages/connect/src/api/unlockPath.ts | 3 +- packages/connect/src/api/verifyMessage.ts | 3 +- .../connect/src/backend/BackendManager.ts | 1 - packages/connect/src/backend/Blockchain.ts | 2 +- .../connect/src/backend/BlockchainLink.ts | 1 - .../src/backend/__tests__/Blockchain.test.ts | 1 + packages/connect/src/core/AbstractMethod.ts | 3 +- .../connect/src/core/onCallFirmwareUpdate.ts | 2 +- packages/connect/src/data/DataManager.ts | 1 - .../src/data/__tests__/coinInfo.test.ts | 1 + .../src/data/__tests__/firmwareInfo.test.ts | 3 +- .../src/data/__tests__/transportInfo.test.ts | 3 +- packages/connect/src/data/analyticsInfo.ts | 1 + packages/connect/src/data/coinInfo.ts | 1 + .../src/data/deviceAuthenticityConfigTypes.ts | 1 + packages/connect/src/data/firmwareInfo.ts | 1 + packages/connect/src/device/Device.ts | 6 ++- packages/connect/src/device/DeviceCommands.ts | 5 +- packages/connect/src/device/DeviceList.ts | 4 +- packages/connect/src/device/StateStorage.ts | 3 +- .../__tests__/checkFirmwareRevision.test.ts | 1 + .../resolveDescriptorForTaproot.test.ts | 3 +- .../src/device/calculateRevisionForDevice.ts | 1 + .../src/device/checkFirmwareRevision.ts | 1 + .../src/device/resolveDescriptorForTaproot.ts | 3 +- packages/connect/src/events/blockchain.ts | 1 + packages/connect/src/events/transport.ts | 5 +- packages/connect/src/events/ui-promise.ts | 1 + packages/connect/src/factory.ts | 3 +- packages/connect/src/impl/dynamic.ts | 1 - .../connect/src/types/api/applySettings.ts | 1 + .../src/types/api/authenticateDevice.ts | 1 + .../src/types/api/authorizeCoinjoin.ts | 4 +- .../connect/src/types/api/binance/index.ts | 3 +- .../connect/src/types/api/bitcoin/index.ts | 3 +- .../src/types/api/blockchainEstimateFee.ts | 1 + .../src/types/api/blockchainEvmRpcCall.ts | 1 + .../api/blockchainGetAccountBalanceHistory.ts | 1 + .../api/blockchainGetCurrentFiatRates.ts | 1 + .../blockchainGetFiatRatesForTimestamps.ts | 1 + .../types/api/blockchainGetTransactions.ts | 1 + .../src/types/api/blockchainSubscribe.ts | 1 + .../types/api/blockchainSubscribeFiatRates.ts | 1 + .../src/types/api/blockchainUnsubscribe.ts | 1 + .../api/blockchainUnsubscribeFiatRates.ts | 1 + .../types/api/cancelCoinjoinAuthorization.ts | 1 + .../connect/src/types/api/cardano/index.ts | 1 + .../types/api/cardanoComposeTransaction.ts | 1 + .../connect/src/types/api/changeLanguage.ts | 1 + .../connect/src/types/api/cipherKeyValue.ts | 3 +- .../src/types/api/composeTransaction.ts | 1 + packages/connect/src/types/api/eos/index.ts | 3 +- .../connect/src/types/api/ethereum/index.ts | 1 + .../connect/src/types/api/firmwareUpdate.ts | 1 + .../src/types/api/getAccountDescriptor.ts | 1 + .../connect/src/types/api/getAccountInfo.ts | 1 + packages/connect/src/types/api/getAddress.ts | 1 + .../connect/src/types/api/getOwnershipId.ts | 1 + .../src/types/api/getOwnershipProof.ts | 1 + .../connect/src/types/api/getPublicKey.ts | 3 +- packages/connect/src/types/api/nem/index.ts | 3 +- .../connect/src/types/api/nemGetAddress.ts | 1 + .../connect/src/types/api/pushTransaction.ts | 1 + .../connect/src/types/api/recoveryDevice.ts | 1 + .../connect/src/types/api/requestLogin.ts | 1 + .../connect/src/types/api/ripple/index.ts | 3 +- .../connect/src/types/api/solana/index.ts | 3 +- .../connect/src/types/api/stellar/index.ts | 3 +- packages/connect/src/types/api/tezos/index.ts | 3 +- packages/connect/src/types/api/unlockPath.ts | 1 + packages/connect/src/types/coinInfo.ts | 1 + packages/connect/src/types/device.ts | 1 + packages/connect/src/types/params.ts | 1 + .../src/utils/__fixtures__/accountUtils.ts | 1 - .../src/utils/__fixtures__/ethereumUtils.ts | 1 - .../src/utils/__fixtures__/formatUtils.ts | 1 - .../src/utils/__tests__/accountUtils.test.ts | 1 - .../src/utils/__tests__/addressUtils.test.ts | 1 + .../__tests__/deviceFeaturesUtils.test.ts | 1 - .../src/utils/__tests__/ethereumUtils.test.ts | 1 - .../src/utils/__tests__/formatUtils.test.ts | 1 - packages/connect/src/utils/addressUtils.ts | 1 + packages/connect/src/utils/assetUtils.ts | 1 + packages/connect/src/utils/assets.ts | 1 + .../connect/src/utils/deviceFeaturesUtils.ts | 1 + packages/connect/src/utils/firmwareUtils.ts | 1 + packages/connect/src/utils/formatUtils.ts | 1 + packages/connect/src/utils/hdnodeUtils.ts | 1 + .../connect/src/utils/uiPromiseManager.ts | 3 +- .../AssetShareIndicator.tsx | 5 +- .../components/CoinLogo/CoinLogo.stories.tsx | 1 + .../src/components/CoinLogo/CoinLogo.tsx | 5 +- .../components/CoinLogo/coinLogos.stories.tsx | 7 ++- .../ConfirmOnDevice.stories.tsx | 4 +- .../ConfirmOnDevice/ConfirmOnDevice.tsx | 4 +- .../ConfirmOnDeviceContent.tsx | 3 ++ .../EnterOnTrezorButton.tsx | 2 + .../PassphraseTypeCard/NonAsciiBanner.tsx | 2 + .../PassphraseTypeCard.stories.tsx | 4 +- .../PassphraseTypeCard/PassphraseTypeCard.tsx | 9 ++-- .../PassphraseTypeCardContent.tsx | 13 +++-- .../PassphraseTypeCardHeading.tsx | 8 ++- .../PassphraseTypeCard/useNonAsciiChars.ts | 1 + .../PasswordStrengthIndicator.stories.tsx | 1 + .../PasswordStrengthIndicator.tsx | 2 +- .../RotateDeviceImage.stories.tsx | 4 +- .../RotateDeviceImage/RotateDeviceImage.tsx | 4 +- .../components/SelectAssetModal/AssetItem.tsx | 3 +- .../SelectAssetModal/AssetItemNotFound.tsx | 7 ++- .../SelectAssetModal/CheckableTag.tsx | 3 +- .../SelectAssetModal/NetworkTabs.tsx | 7 ++- .../SelectAssetModal.stories.tsx | 9 ++-- .../SelectAssetModal/SelectAssetModal.tsx | 7 ++- .../TokenIconSet/TokenIconSet.stories.tsx | 1 + .../components/TokenIconSet/TokenIconSet.tsx | 4 +- .../TrezorLogo/TrezorLogo.stories.tsx | 1 + .../src/components/TrezorLogo/TrezorLogo.tsx | 2 + .../TrezorLogo/trezorLogos.stories.tsx | 4 +- packages/product-components/styled.d.ts | 1 + .../request-manager/e2e/identities-stress.ts | 1 + packages/request-manager/src/httpPool.ts | 1 + packages/request-manager/src/interceptor.ts | 2 + .../request-manager/src/torControlPort.ts | 2 + packages/request-manager/src/torIdentities.ts | 1 + packages/suite-data/src/guide/parser.ts | 3 +- .../src/__tests__/ipcRenderer.ts | 3 +- packages/suite-desktop-api/src/factory.ts | 1 + packages/suite-storage/src/native/index.ts | 1 + packages/suite-storage/src/web/index.ts | 1 + packages/suite-web/e2e/cypress.config.ts | 4 +- packages/suite-web/e2e/run_tests.ts | 1 + packages/suite-web/e2e/support/commands.ts | 3 +- .../suite-web/e2e/support/utils/shortcuts.ts | 1 + .../e2e/tests/analytics/events.test.ts | 1 + .../e2e/tests/analytics/toggle.test.ts | 1 + .../e2e/tests/backup/t2t1-fail.test.ts | 1 + .../e2e/tests/backup/t2t1-success.test.ts | 1 + .../e2e/tests/dashboard/assets.test.ts | 1 + .../e2e/tests/dashboard/discreet-mode.test.ts | 1 + .../e2e/tests/settings/coins.test.ts | 1 + .../e2e/tests/settings/general.test.ts | 1 + .../e2e/tests/suite/passphrase.test.ts | 1 + .../tests/wallet/add-account-types.test.ts | 5 +- .../e2e/tests/wallet/check-coins-xpub.test.ts | 1 + .../tests/wallet/export-transactions.test.ts | 1 + packages/suite-web/src/Main.tsx | 13 +++-- packages/suite-web/src/support/Router.tsx | 3 +- packages/suite-web/src/support/useCypress.ts | 3 +- .../__tests__/onboardingActions.test.ts | 4 +- .../src/actions/recovery/recoveryActions.ts | 1 + .../settings/__fixtures__/deviceSettings.ts | 9 ++-- .../__tests__/walletSettingsActions.test.ts | 1 + .../actions/settings/deviceSettingsActions.ts | 3 +- .../actions/settings/walletSettingsActions.ts | 7 +-- .../suite/__tests__/analyticsActions.test.ts | 3 +- .../suite/__tests__/protocolActions.test.ts | 2 +- .../suite/__tests__/resizeActions.test.ts | 1 - .../suite/__tests__/routerActions.test.ts | 4 +- .../src/actions/suite/analyticsActions.ts | 6 +-- .../src/actions/suite/desktopUpdateActions.ts | 4 +- .../suite/src/actions/suite/guideActions.ts | 2 +- .../suite/src/actions/suite/initAction.ts | 4 +- .../src/actions/suite/metadataActions.ts | 5 +- .../actions/suite/metadataLabelingActions.ts | 1 - .../actions/suite/metadataPasswordsActions.ts | 1 - .../actions/suite/metadataProviderActions.ts | 4 +- .../src/actions/suite/protocolActions.ts | 12 +++-- .../suite/src/actions/suite/storageActions.ts | 9 ++-- .../__fixtures__/coinjoinAccountActions.ts | 1 + .../__fixtures__/mockCoinjoinService.ts | 1 + .../moveLabelsForRbfMetadataState.fixture.ts | 1 + .../moveLabelsForRbfTransactions.fixture.ts | 1 + .../wallet/__fixtures__/receiveActions.ts | 2 +- .../__tests__/cardanoStakingActions.test.ts | 10 ++-- .../__tests__/coinmarketBuyActions.test.ts | 6 +-- .../coinmarketExchangeActions.test.ts | 6 +-- .../wallet/__tests__/discoveryActions.test.ts | 2 +- .../wallet/__tests__/formDraftActions.test.ts | 2 +- .../__tests__/moveLabelsForRbfActions.test.ts | 4 +- .../wallet/__tests__/receiveActions.test.ts | 4 +- .../__tests__/selectedAccountActions.test.ts | 1 - .../__tests__/signVerifyActions.test.ts | 2 +- .../__tests__/transactionActions.test.ts | 6 ++- .../src/actions/wallet/addWalletThunk.ts | 4 +- .../actions/wallet/cardanoStakingActions.ts | 12 +++-- .../actions/wallet/coinjoinClientActions.ts | 4 +- .../coinmarketCommonActions/verifyAddress.ts | 2 +- .../__tests__/coinmarketCommonActions.test.ts | 6 +-- .../coinmarket/coinmarketCommonActions.ts | 4 +- .../actions/wallet/coinmarketBuyActions.ts | 6 ++- .../wallet/coinmarketExchangeActions.ts | 8 +-- .../actions/wallet/coinmarketInfoActions.ts | 1 + .../actions/wallet/coinmarketSellActions.ts | 4 +- .../wallet/exportTransactionsActions.ts | 1 + .../src/actions/wallet/formDraftActions.ts | 7 ++- .../suite/src/actions/wallet/graphActions.ts | 25 ++++----- .../actions/wallet/moveLabelsForRbfActions.ts | 7 +-- .../src/actions/wallet/receiveActions.ts | 3 +- .../src/actions/wallet/send/sendFormThunks.ts | 3 +- .../src/actions/wallet/signVerifyActions.ts | 4 +- .../wallet/stake/stakeFormEthereumActions.ts | 5 +- .../suite/src/actions/wallet/stakeActions.ts | 4 +- .../suite/src/actions/wallet/tokenActions.ts | 5 +- .../backup/AfterBackupCheckboxes.tsx | 5 +- .../src/components/backup/BackupSeedCard.tsx | 2 + .../src/components/backup/BackupSeedCards.tsx | 4 +- .../components/backup/PreBackupCheckboxes.tsx | 5 +- .../components/dashboard/DashboardSection.tsx | 2 + .../firmware/Buttons/FirmwareButtonsRow.tsx | 3 +- .../firmware/Buttons/FirmwareCloseButton.tsx | 1 + .../Buttons/FirmwareContinueButton.tsx | 3 ++ .../Buttons/FirmwareInstallButton.tsx | 1 + .../firmware/Buttons/FirmwareRetryButton.tsx | 1 + .../src/components/firmware/CheckSeedStep.tsx | 7 ++- .../src/components/firmware/Fingerprint.tsx | 1 + .../components/firmware/FirmwareInitial.tsx | 6 ++- .../firmware/FirmwareInstallation.tsx | 5 +- .../src/components/firmware/FirmwareOffer.tsx | 2 +- .../firmware/FirmwareProgressBar.tsx | 4 +- .../firmware/FirmwareUpdateHashCheckError.tsx | 1 + .../firmware/ReconnectDevicePrompt.tsx | 8 +-- .../firmware/SelectCustomFirmware.tsx | 1 + .../suite/src/components/guide/Feedback.tsx | 13 +++-- packages/suite/src/components/guide/Guide.tsx | 5 +- .../src/components/guide/GuideArticle.tsx | 3 +- .../src/components/guide/GuideButton.tsx | 4 +- .../src/components/guide/GuideCategories.tsx | 2 + .../src/components/guide/GuideCategory.tsx | 1 + .../src/components/guide/GuideContent.tsx | 2 + .../src/components/guide/GuideHeader.tsx | 7 ++- .../suite/src/components/guide/GuideHint.tsx | 1 + .../src/components/guide/GuideMarkdown.tsx | 3 ++ .../suite/src/components/guide/GuideNode.tsx | 8 +-- .../src/components/guide/GuideRouter.tsx | 6 ++- .../src/components/guide/GuideSearch.tsx | 7 ++- .../src/components/guide/GuideViewWrapper.tsx | 2 + .../src/components/guide/HeaderBreadcrumb.tsx | 6 +-- .../components/guide/OpenGuideFromTooltip.tsx | 4 +- .../guide/SupportFeedbackSelection.tsx | 2 +- .../Buttons/OnboardingButtonBack.tsx | 1 + .../Buttons/OnboardingButtonCta.tsx | 1 + .../Buttons/OnboardingButtonSkip.tsx | 2 + .../onboarding/CollapsibleOnboardingCard.tsx | 2 + .../src/components/onboarding/Hologram.tsx | 8 +-- .../onboarding/OnboardingLayout.tsx | 8 ++- .../onboarding/OnboardingOption.tsx | 2 + .../onboarding/OnboardingProgressBar.tsx | 2 + .../onboarding/OnboardingStepBox.tsx | 13 +++-- .../onboarding/SkipStepConfirmation.tsx | 4 +- .../suite/src/components/onboarding/index.ts | 2 - .../src/components/settings/DeviceBanner.tsx | 4 +- .../components/settings/SettingsLayout.tsx | 1 + .../components/settings/SettingsSection.tsx | 2 + .../src/components/suite/AccountLabel.tsx | 5 +- .../src/components/suite/AccountTypeBadge.tsx | 3 +- .../suite/AmountUnitSwitchWrapper.tsx | 9 +++- .../AppNavigation/AppNavigationTooltip.tsx | 3 +- .../components/suite/ChangeDeviceLabel.tsx | 12 +++-- .../components/suite/CoinGroup/CoinGroup.tsx | 4 +- .../suite/CoinGroup/CoinGroupHeader.tsx | 2 + .../src/components/suite/CoinList/Coin.tsx | 5 +- .../components/suite/CoinList/CoinList.tsx | 4 +- .../components/suite/ConnectDevicePrompt.tsx | 5 +- .../src/components/suite/CountdownTimer.tsx | 9 +++- .../suite/DeviceAuthenticationExplainer.tsx | 2 +- .../suite/DeviceDisplay/DeviceDisplay.tsx | 9 ++-- .../suite/DeviceDisplay/DisplayChunks.tsx | 5 +- .../DeviceDisplay/DisplayPageSeparator.tsx | 4 +- .../DeviceDisplay/DisplayPaginatedText.tsx | 5 +- .../DisplaySinglePageWrapText.tsx | 1 + .../__tests__/DeviceDisplay.test.tsx | 9 ++-- .../parseTextToPagesAndLines.test.ts | 1 + .../suite/DeviceMatrixExplanation.tsx | 5 +- .../suite/src/components/suite/DropZone.tsx | 5 +- packages/suite/src/components/suite/Error.tsx | 2 + .../suite/src/components/suite/FiatValue.tsx | 18 ++++--- .../components/suite/FormFractionButtons.tsx | 4 +- .../suite/FormattedCryptoAmount.tsx | 9 ++-- .../components/suite/FormattedNftAmount.tsx | 2 +- .../components/suite/HiddenPlaceholder.tsx | 5 +- .../src/components/suite/HoverAnimation.tsx | 2 + .../src/components/suite/InstructionStep.tsx | 2 + .../src/components/suite/LearnMoreButton.tsx | 3 +- .../suite/src/components/suite/Loading.tsx | 1 + .../suite/src/components/suite/Metadata.tsx | 4 +- .../src/components/suite/NotificationCard.tsx | 4 +- .../src/components/suite/NumberInput.tsx | 6 +-- .../suite/PinMatrix/PinInput/InputPin.tsx | 2 + .../suite/PinMatrix/PinInput/PinInput.tsx | 3 ++ .../components/suite/PinMatrix/PinMatrix.tsx | 4 ++ .../suite/Preloader/InitialLoading.tsx | 1 + .../components/suite/Preloader/Preloader.tsx | 18 ++++--- .../Preloader/__tests__/Preloader.test.tsx | 2 +- .../PrerequisitesGuide/DeviceInitialize.tsx | 2 + .../PrerequisitesGuide/DeviceNoFirmware.tsx | 1 + .../PrerequisitesGuide/DeviceRecoveryMode.tsx | 2 + .../PrerequisitesGuide/DeviceUnreadable.tsx | 1 + .../DeviceUpdateRequired.tsx | 1 + .../PrerequisitesGuide/PrerequisitesGuide.tsx | 5 +- .../suite/PrerequisitesGuide/Transport.tsx | 1 - .../suite/src/components/suite/QrCode.tsx | 3 +- .../src/components/suite/QuestionTooltip.tsx | 2 + .../src/components/suite/ReadMoreLink.tsx | 1 + .../suite/SecurityCheck/DeviceCompromised.tsx | 2 + .../suite/SecurityCheck/SecurityCheckFail.tsx | 1 + .../suite/SecurityCheck/checklistItems.tsx | 3 +- packages/suite/src/components/suite/Sign.tsx | 1 + .../components/suite/StakeAmountWrapper.tsx | 6 ++- .../src/components/suite/StakingFeature.tsx | 1 + .../suite/StakingProcess/InfoRow.tsx | 1 + .../suite/StakingProcess/StakingInfo.tsx | 7 ++- .../suite/StakingProcess/Subheading.tsx | 3 +- .../suite/StakingProcess/UnstakingInfo.tsx | 7 ++- .../src/components/suite/StatusLight.tsx | 3 +- .../suite/Ticker/LastUpdateTooltip.tsx | 9 ++-- .../suite/Ticker/NoRatesTooltip.tsx | 8 ++- .../components/suite/Ticker/PriceTicker.tsx | 7 ++- .../components/suite/Ticker/TrendTicker.tsx | 1 + .../src/components/suite/TooltipSymbol.tsx | 2 + .../components/suite/TorLoader/TorLoader.tsx | 5 +- .../suite/TorLoader/TorProgressBar.tsx | 2 +- .../components/suite/TrafficLightOffset.tsx | 4 +- .../suite/src/components/suite/TrezorLink.tsx | 1 + .../src/components/suite/UdevDownload.tsx | 6 ++- .../components/suite/UnstakingTxAmount.tsx | 2 + .../src/components/suite/WebUsbButton.tsx | 1 + .../suite/src/components/suite/WordInput.tsx | 7 ++- .../components/suite/WordInputAdvanced.tsx | 5 +- .../suite/__tests__/NumberInput.test.tsx | 10 ++-- .../suite/__tests__/Translation.test.tsx | 1 + .../suite/banners/MessageSystemBanner.tsx | 8 +-- .../SuiteBanners/FailedBackupBanner.tsx | 3 +- .../FirmwareHashMismatchBanner.tsx | 3 +- .../banners/SuiteBanners/NoBackupBanner.tsx | 3 +- .../SuiteBanners/NoConnectionBanner.tsx | 3 +- .../SuiteBanners/SafetyChecksBanner.tsx | 3 +- .../banners/SuiteBanners/SuiteBanners.tsx | 2 + .../SuiteBanners/TranslationModeBanner.tsx | 3 +- .../SuiteBanners/UpdateBridgeBanner.tsx | 3 +- .../suite/graph/GraphRangeSelector.tsx | 5 +- .../suite/graph/GraphScaleDropdownItem.tsx | 4 +- .../components/suite/graph/GraphSkeleton.tsx | 1 + .../TransactionsGraph/GraphTooltipAccount.tsx | 10 ++-- .../TransactionsGraph/GraphTooltipBase.tsx | 1 + .../TransactionsGraph/GraphXAxisTick.tsx | 3 +- .../TransactionsGraph/GraphYAxisTick.tsx | 8 ++- .../suite/labeling/AccountLabeling.tsx | 2 +- .../suite/labeling/AddressLabeling.tsx | 4 +- .../MetadataLabeling/MetadataLabeling.tsx | 14 +++-- .../labeling/MetadataLabeling/definitions.ts | 4 +- .../MetadataLabeling/withDropdown.tsx | 4 +- .../MetadataLabeling/withEditable.tsx | 1 + .../suite/labeling/WalletLabeling.tsx | 10 ++-- .../suite/layouts/LoggedOutLayout.tsx | 5 +- .../SuiteLayout/CoinjoinBars/CoinjoinBars.tsx | 4 +- .../DeviceSelector/DeviceSelector.tsx | 13 +++-- .../DeviceSelector/DeviceStatus.tsx | 10 ++-- .../DeviceSelector/SidebarDeviceStatus.tsx | 3 ++ .../MobileMenu/MobileActionItem.tsx | 2 + .../SuiteLayout/MobileMenu/MobileMenu.tsx | 2 + .../MobileMenu/MobileMenuActions.tsx | 2 +- .../MobileMenu/MobileNavigation.tsx | 6 ++- .../PageHeader/HeaderActionButton.tsx | 1 + .../SuiteLayout/PageHeader/HeaderActions.tsx | 2 + .../SuiteLayout/PageHeader/PageHeader.tsx | 5 +- .../PageNames/AccountName/AccountDetails.tsx | 7 ++- .../PageNames/AccountName/AccountName.tsx | 3 ++ .../AccountName/AccountSubpageName.tsx | 7 ++- .../PageHeader/PageNames/BasicName.tsx | 2 + .../PageHeader/PageNames/PageName.tsx | 1 + .../PageHeader/PageNames/SettingsName.tsx | 4 ++ .../SuiteLayout/PageHeader/TradeActions.tsx | 10 ++-- .../SuiteLayout/Sidebar/Navigation.tsx | 8 ++- .../SuiteLayout/Sidebar/NavigationItem.tsx | 9 ++-- .../Sidebar/NotificationDropdown.tsx | 4 ++ .../Sidebar/QuickActions/CustomBackend.tsx | 4 +- .../QuickActions/DebugAndExperimental.tsx | 7 ++- .../Sidebar/QuickActions/HideBalances.tsx | 1 + .../Sidebar/QuickActions/NavBackends.tsx | 9 ++-- .../QuickActions/QuickActionButton.tsx | 4 +- .../Sidebar/QuickActions/QuickActions.tsx | 1 + .../Sidebar/QuickActions/TooltipRow.tsx | 4 +- .../SuiteLayout/Sidebar/QuickActions/Tor.tsx | 15 +++--- .../QuickActions/Update/UpdateIconGroup.tsx | 4 +- .../Update/UpdateNotificationBanner.tsx | 5 +- .../Update/UpdateStatusActionBarIcon.tsx | 14 +++-- .../QuickActions/Update/UpdateTooltip.tsx | 16 +++--- .../Update/updateQuickActionTypes.ts | 4 +- .../layouts/SuiteLayout/Sidebar/Sidebar.tsx | 12 +++-- .../layouts/SuiteLayout/SubpageNavigation.tsx | 5 +- .../suite/layouts/SuiteLayout/SuiteLayout.tsx | 7 ++- .../layouts/SuiteLayout/useAppShortcuts.tsx | 7 ++- .../layouts/WelcomeLayout/NavSettings.tsx | 1 + .../layouts/WelcomeLayout/WelcomeLayout.tsx | 16 +++--- .../modals/ConfirmEvmExplanationModal.tsx | 12 +++-- .../suite/modals/Modal/DefaultRenderer.tsx | 3 ++ .../suite/modals/Modal/DialogRenderer.tsx | 5 +- .../components/suite/modals/Modal/Modal.tsx | 2 + .../suite/modals/ModalEnvironment.tsx | 1 + .../modals/ModalSwitcher/DiscoveryLoader.tsx | 5 +- .../ModalSwitcher/ForegroundAppModal.tsx | 7 ++- .../modals/ModalSwitcher/ModalSwitcher.tsx | 1 + .../modals/ReduxModal/ConfirmAddressModal.tsx | 1 + .../ConfirmValueModal/ConfirmValueModal.tsx | 10 ++-- .../ConfirmValueModal/DeviceDisconnected.tsx | 3 +- .../modals/ReduxModal/ConfirmXpubModal.tsx | 3 +- .../modals/ReduxModal/CopyAddressModal.tsx | 9 ++-- .../DeviceConfirmationModal/NoBackupModal.tsx | 6 ++- .../DeviceContextModal/ConfirmActionModal.tsx | 6 ++- .../ConfirmFingerprintModal.tsx | 4 +- .../DeviceContextModal/DeviceContextModal.tsx | 2 + .../DeviceContextModal/PassphraseModal.tsx | 4 +- .../PassphraseOnDeviceModal.tsx | 3 +- .../PassphraseWalletConfirmation.tsx | 5 +- .../PassphraseWalletConfirmationStep1.tsx | 4 +- .../PassphraseWalletConfirmationStep2.tsx | 7 ++- .../PassphraseWalletConfirmationStep3.tsx | 3 +- .../DeviceContextModal/PinInvalidModal.tsx | 1 + .../DeviceContextModal/PinModal.tsx | 3 +- .../DeviceContextModal/WordAdvancedModal.tsx | 5 +- .../DeviceContextModal/WordModal.tsx | 7 ++- .../suite/modals/ReduxModal/ReduxModal.tsx | 1 + .../TransactionReviewEvmExplanation.tsx | 5 +- .../TransactionReviewModal.tsx | 4 +- .../TransactionReviewModalContent.tsx | 11 ++-- .../TransactionReviewDetails.tsx | 3 +- .../TransactionReviewOutput.tsx | 13 +++-- .../TransactionReviewOutputElement.tsx | 11 ++-- .../TransactionReviewOutputList.tsx | 15 +++--- .../TransactionReviewStepIndicator.tsx | 1 + .../TransactionReviewTotalOutput.tsx | 6 ++- .../TransactionReviewSummary.tsx | 9 ++-- .../modals/ReduxModal/UnhideTokenModal.tsx | 10 ++-- .../AccountTypeDescription.tsx | 8 +-- .../AccountTypeSelect/AccountTypeSelect.tsx | 7 ++- .../AddAccountButton/AddAccountButton.tsx | 4 +- .../AddAccountButton/AddButton.tsx | 4 +- .../AddCoinjoinAccountButton.tsx | 2 +- .../AddAccountModal/AddAccountModal.tsx | 9 ++-- .../UserContextModal/AddTokenModal.tsx | 5 +- .../AdvancedCoinSettingsModal.tsx | 10 ++-- .../CustomBackends/BackendInput.tsx | 1 + .../CustomBackends/BackendTypeSelect.tsx | 5 +- .../CustomBackends/ConnectionInfo.tsx | 4 +- .../CustomBackends/CustomBackends.tsx | 10 ++-- .../CustomBackends/TorModal.tsx | 4 +- .../UserContextModal/ApplicationLogModal.tsx | 3 +- .../AuthenticateDeviceFailModal.tsx | 3 +- .../UserContextModal/CancelCoinjoinModal.tsx | 2 + .../ClaimModal/ClaimEthForm.tsx | 10 ++-- .../ClaimModal/ClaimModal.tsx | 2 + .../ClaimModal/ClaimModalContent.tsx | 2 + .../UserContextModal/ClaimModal/Fees.tsx | 1 + .../UserContextModal/CoinjoinSuccessModal.tsx | 3 +- .../UserContextModal/CoinmarketTermsModal.tsx | 8 +-- .../ConfirmUnverifiedAddressModal.tsx | 1 + .../ConfirmUnverifiedModal.tsx | 9 ++-- .../ConfirmUnverifiedProceedModal.tsx | 3 +- .../ConfirmUnverifiedXpubModal.tsx | 3 +- .../AutoStopButton.tsx | 5 +- .../CoinjoinPhaseProgress.tsx | 9 ++-- .../CriticalCoinjoinPhaseModal.tsx | 7 ++- .../DeviceAuthenticityOptOutModal.tsx | 3 +- .../UserContextModal/DisableTorModal.tsx | 7 ++- .../FirmwareRevisionOptOutModal.tsx | 3 +- .../ImportTransactionModal/DelimiterForm.tsx | 3 ++ .../ImportTransactionModal/ExampleCSV.tsx | 5 +- .../ImportTransactionModal.tsx | 3 ++ .../ImportTransactionModal/InputCSV.tsx | 2 + .../ImportTransactionModal/TabSelection.tsx | 5 +- .../MetadataProviderModal.tsx | 9 ++-- .../MoreRoundsNeededModal.tsx | 4 +- .../BackupInstructionsCard.tsx | 1 + .../BackupInstructionsStep.tsx | 1 + .../MultiShareBackupModal.tsx | 8 +-- .../MultiShareBackupStep1FirstInfo.tsx | 2 + .../MultiShareBackupStep5Done.tsx | 12 +++-- .../instructionSteps.tsx | 3 +- .../multiShareModalLayout.tsx | 3 +- .../PassphraseDuplicateModal.tsx | 1 - .../PassphraseMismatchModal.tsx | 7 +-- .../UserContextModal/PinMismatchModal.tsx | 2 + .../UserContextModal/QrScannerModal.tsx | 1 + .../UserContextModal/SafetyChecksModal.tsx | 7 ++- .../StakeEthInANutshellModal.tsx | 7 +-- .../StakeEthForm/AvailableBalance.tsx | 2 + .../StakeEthForm/ConfirmStakeEthModal.tsx | 6 ++- .../StakeModal/StakeEthForm/Inputs.tsx | 6 ++- .../StakeModal/StakeEthForm/StakeButton.tsx | 1 + .../StakeModal/StakeEthForm/StakeEthForm.tsx | 4 +- .../StakeModal/StakeModal.tsx | 4 +- .../StakingInfoCards/EstimatedGains.tsx | 12 +++-- .../StakingInfoCards/StakingInfoCards.tsx | 7 ++- .../AdvancedTxDetails/AdvancedTxDetails.tsx | 8 ++- .../AdvancedTxDetails/AmountDetails.tsx | 15 +++--- .../AdvancedTxDetails/AmountRow.tsx | 1 + .../TxDetailModal/AdvancedTxDetails/Data.tsx | 7 ++- .../IODetails/AnalyzeInExplorerBanner.tsx | 5 +- .../AdvancedTxDetails/IODetails/IODetails.tsx | 12 +++-- .../TxDetailModal/BasicTxDetails.tsx | 14 +++-- .../TxDetailModal/ChainedTxs.tsx | 3 +- .../ChangeFee/AffectedTransactionItem.tsx | 4 +- .../ChangeFee/AffectedTransactions.tsx | 3 ++ .../TxDetailModal/ChangeFee/ChangeFee.tsx | 11 ++-- .../ChangeFee/DecreasedOutputs.tsx | 9 +++- .../TxDetailModal/ChangeFee/GreyCard.tsx | 2 + .../ChangeFee/ReplaceTxButton.tsx | 2 + .../TxDetailModal/ChangeFee/WarnHeader.tsx | 2 + .../TxDetailModal/IOAddress.tsx | 10 ++-- .../TxDetailModal/TxDetailModal.tsx | 9 +++- .../UserContextModal/UnecoCoinjoinModal.tsx | 3 +- .../UnstakeModal/EverstakeModal.tsx | 6 ++- .../UnstakeModal/UnstakeEthForm/Fees.tsx | 1 + .../UnstakeModal/UnstakeEthForm/Inputs.tsx | 11 ++-- .../UnstakeModal/UnstakeEthForm/Options.tsx | 11 ++-- .../UnstakeEthForm/UnstakeButton.tsx | 1 + .../UnstakeEthForm/UnstakeEthForm.tsx | 15 ++++-- .../UnstakeModal/UnstakeModal.tsx | 11 ++-- .../UserContextModal/UserContextModal.tsx | 4 +- .../UserContextModal/WipeDeviceModal.tsx | 4 +- .../CoinProtocolRenderer.tsx | 8 +-- .../ConditionalActionRenderer.tsx | 2 + .../NotificationRenderer.tsx | 1 + .../NotificationGroup/NotificationGroup.tsx | 2 + .../NotificationList/NotificationList.tsx | 3 +- .../NotificationList/NotificationView.tsx | 1 + .../Notifications/Notifications.tsx | 8 ++- .../suite/notifications/ToastContainer.tsx | 3 +- .../suite/notifications/ToastNotification.tsx | 9 +++- .../components/suite/section/SectionItem.tsx | 2 + .../components/suite/section/TextColumn.tsx | 1 + .../suite/section/sectionStyles.tsx | 1 + .../troubleshooting/TroubleshootingTips.tsx | 5 +- .../troubleshooting/tips/UdevDescription.tsx | 6 ++- .../wallet/AccountExceptionLayout.tsx | 1 + .../components/wallet/AnimationWrapper.tsx | 1 + .../CoinjoinAccountDiscoveryProgress.tsx | 7 ++- .../RotatingFacts.tsx | 3 ++ .../components/wallet/DiscoveryProgress.tsx | 3 +- .../components/wallet/EvmExplanationBox.tsx | 6 ++- .../src/components/wallet/Fees/CustomFee.tsx | 22 +++++--- .../src/components/wallet/Fees/FeeDetails.tsx | 8 +-- .../suite/src/components/wallet/Fees/Fees.tsx | 16 ++++-- .../src/components/wallet/FiatHeader.tsx | 7 ++- .../src/components/wallet/InputError.tsx | 4 +- .../src/components/wallet/Pagination.tsx | 5 +- .../src/components/wallet/SearchAction.tsx | 4 +- .../components/wallet/TokenIconSetWrapper.tsx | 15 +++--- .../TransactionItem/CoinjoinBatchItem.tsx | 10 ++-- .../TransactionItem/CommonComponents.tsx | 3 ++ .../TransactionItem/InstantStakeBadge.tsx | 18 ++++--- .../TransactionItem/TransactionHeader.tsx | 5 +- .../TransactionItem/TransactionHeading.tsx | 22 ++++---- .../TransactionItem/TransactionItem.tsx | 30 ++++++----- .../wallet/TransactionItem/TransactionRow.tsx | 16 +++--- .../TransactionTarget/TargetAddressLabel.tsx | 7 ++- .../TokenTransferAddressLabel.tsx | 4 +- .../TransactionTarget/TransactionTarget.tsx | 11 ++-- .../TransactionTargetLayout.tsx | 5 +- .../TransactionItem/TransactionTypeIcon.tsx | 4 +- .../wallet/TransactionTimestamp.tsx | 4 +- .../AccountBanners/AccountBanners.tsx | 13 +++-- .../AccountBanners/BackendDisconnected.tsx | 5 +- .../AccountBanners/BannerPoints.tsx | 2 + .../AccountBanners/CloseableBanner.tsx | 6 ++- .../AccountBanners/ContextMessage.tsx | 9 ++-- .../AccountBanners/EvmExplanationBanner.tsx | 8 +-- .../AccountBanners/StakeEthBanner.tsx | 13 +++-- .../AccountBanners/TaprootBanner.tsx | 9 ++-- .../AccountBanners/XRPReserve.tsx | 6 ++- .../AccountException/AccountNotEnabled.tsx | 3 +- .../AccountTopPanel/AccountNavigation.tsx | 7 +-- .../AccountTopPanel/AccountTopPanel.tsx | 5 +- .../AccountsMenu/AccountGroup.tsx | 9 +++- .../WalletLayout/AccountsMenu/AccountItem.tsx | 5 +- .../AccountsMenu/AccountItemSkeleton.tsx | 3 +- .../AccountsMenu/AccountItemsGroup.tsx | 12 +++-- .../AccountsMenu/AccountSection.tsx | 8 +-- .../AccountsMenu/AccountsList.tsx | 8 +-- .../AccountsMenu/AccountsMenu.tsx | 9 ++-- .../AccountsMenu/AccountsMenuNotice.tsx | 3 +- .../AccountsMenu/AddAccountButton.tsx | 5 +- .../AccountsMenu/MobileAccountsMenu.tsx | 4 ++ .../RefreshAfterDiscoveryNeeded.tsx | 3 +- .../CoinjoinAccountDiscovery.tsx | 1 + .../RememberWallet.tsx | 2 +- .../wallet/WalletLayout/WalletLayout.tsx | 2 + .../WalletLayout/WalletSubpageHeading.tsx | 5 +- packages/suite/src/config/onboarding/steps.ts | 3 +- .../suite/src/constants/suite/experimental.ts | 1 - packages/suite/src/constants/suite/routes.ts | 2 +- .../useCoinjoinAccountLoadingProgress.ts | 1 + .../coinjoin/useCoinjoinSessionBlockers.ts | 4 +- .../hooks/coinjoin/useCoinjoinSessionPhase.ts | 1 + packages/suite/src/hooks/guide/useGuide.ts | 2 + .../suite/src/hooks/guide/useGuideKeyboard.ts | 1 + .../src/hooks/guide/useGuideLoadArticle.ts | 2 + .../suite/src/hooks/guide/useGuideSearch.ts | 2 + .../backends/useBackendReconnection.ts | 2 +- .../settings/backends/useBackendsForm.ts | 7 +-- .../settings/backends/useCustomBackends.ts | 3 +- .../hooks/settings/backends/useDefaultUrls.ts | 1 + .../src/hooks/settings/useNetworkSupport.ts | 2 +- .../suite/__fixtures__/useFilteredModal.ts | 1 + .../__tests__/useCountdownTimer.test.tsx | 1 + .../suite/__tests__/useFilteredModal.test.tsx | 8 ++- .../hooks/suite/__tests__/usePinModal.test.ts | 1 + packages/suite/src/hooks/suite/useActions.ts | 4 +- .../src/hooks/suite/useAnonymityStatus.ts | 3 +- .../suite/useClearAnchorHighlightOnClick.ts | 4 +- .../src/hooks/suite/useCountdownTimer.ts | 1 + .../hooks/suite/useDebugLanguageShortcut.ts | 6 ++- .../src/hooks/suite/useDefaultAccountLabel.ts | 7 ++- packages/suite/src/hooks/suite/useDevice.ts | 2 +- packages/suite/src/hooks/suite/useDispatch.ts | 2 + .../suite/src/hooks/suite/useDisplayMode.ts | 3 +- .../suite/src/hooks/suite/useExternalLink.ts | 1 + .../src/hooks/suite/useFiatFromCryptoValue.ts | 5 +- .../src/hooks/suite/useFormattersConfig.ts | 3 +- .../hooks/suite/useMessageSystemStaking.ts | 2 + .../suite/src/hooks/suite/useOnboarding.ts | 1 + .../src/hooks/suite/useOpenSuiteDesktop.ts | 1 + .../suite/src/hooks/suite/usePasswords.ts | 1 - packages/suite/src/hooks/suite/usePinModal.ts | 1 + .../src/hooks/suite/useRediscoveryNeeded.ts | 4 +- .../src/hooks/suite/useResetScrollOnUrl.ts | 1 + packages/suite/src/hooks/suite/useSelector.ts | 3 +- .../suite/src/hooks/suite/useTranslation.ts | 4 +- .../hooks/wallet/__fixtures__/useSendForm.ts | 1 + .../__tests__/useExcludedUtxos.test.tsx | 5 +- .../wallet/__tests__/useRbfForm.test.tsx | 7 ++- .../wallet/__tests__/useSendForm.test.tsx | 7 +-- .../form/common/useCoinmarketAccount.ts | 4 +- .../common/useCoinmarketBuildAccountGroups.ts | 4 +- .../common/useCoinmarketComposeTransaction.ts | 6 ++- .../common/useCoinmarketCurrencySwitcher.ts | 4 +- .../form/common/useCoinmarketFiatValues.tsx | 7 ++- .../form/common/useCoinmarketFormActions.ts | 11 ++-- .../form/common/useCoinmarketInitializer.ts | 4 +- .../form/common/useCoinmarketModalCrypto.ts | 4 +- .../coinmarket/form/useCoinmarketBuyForm.tsx | 12 +++-- .../useCoinmarketBuyFormDefaultValues.tsx | 10 ++-- .../form/useCoinmarketCommonForm.tsx | 1 + .../form/useCoinmarketExchangeForm.ts | 12 +++-- .../useCoinmarketExchangeFormDefaultValues.ts | 4 +- .../useCoinmarketExchangeWatchSendApproval.ts | 4 +- .../form/useCoinmarketPaymentMethod.tsx | 1 + .../coinmarket/form/useCoinmarketSellForm.ts | 11 ++-- .../useCoinmarketSellFormDefaultValues.ts | 6 ++- .../form/useCoinmarketVerifyAccount.tsx | 13 +++-- .../wallet/coinmarket/useCoinmarketDetail.ts | 3 +- .../wallet/coinmarket/useCoinmarketInfo.ts | 9 ++-- .../coinmarket/useCoinmarketLoadData.ts | 1 + .../coinmarket/useCoinmarketWatchTrade.ts | 12 +++-- .../wallet/form/useCoinjoinRegisteredUtxos.ts | 1 + .../form/useCoinjoinUnavailableUtxos.ts | 3 +- .../suite/src/hooks/wallet/form/useCompose.ts | 7 ++- .../suite/src/hooks/wallet/form/useFees.ts | 7 ++- .../src/hooks/wallet/form/useStakeCompose.ts | 5 +- .../src/hooks/wallet/form/useUtxoSelection.ts | 1 + .../sign-verify/useCopySignedMessage.ts | 3 +- .../sign-verify/useSignAddressOptions.ts | 1 + .../wallet/sign-verify/useSignVerifyForm.ts | 6 ++- .../src/hooks/wallet/useBitcoinAmountUnit.ts | 2 +- .../suite/src/hooks/wallet/useClaimEthForm.ts | 12 ++--- .../hooks/wallet/useCoinmarketNavigation.ts | 1 + .../wallet/useCoinmarketRecomposeAndSign.ts | 6 ++- .../src/hooks/wallet/useCoinmarketRedirect.ts | 7 ++- .../suite/src/hooks/wallet/useFormDraft.ts | 3 +- packages/suite/src/hooks/wallet/useRbfForm.ts | 12 +++-- .../suite/src/hooks/wallet/useSendForm.ts | 29 ++++++----- .../src/hooks/wallet/useSendFormCompose.ts | 10 ++-- .../src/hooks/wallet/useSendFormFields.ts | 7 ++- .../src/hooks/wallet/useSendFormImport.ts | 7 +-- .../src/hooks/wallet/useSendFormOutputs.ts | 2 + .../suite/src/hooks/wallet/useStakeEthForm.ts | 35 +++++++------ .../src/hooks/wallet/useUnstakeEthForm.ts | 26 +++++----- .../middlewares/backup/backupMiddleware.ts | 1 + .../__tests__/onboardingMiddleware.test.ts | 2 - .../recovery/recoveryMiddleware.ts | 1 + .../__tests__/protocolMiddleware.test.ts | 11 ++-- .../middlewares/suite/analyticsMiddleware.ts | 4 +- .../suite/buttonRequestMiddleware.ts | 2 +- .../src/middlewares/suite/logsMiddleware.ts | 1 + .../middlewares/suite/protocolMiddleware.ts | 2 +- .../src/middlewares/suite/routerMiddleware.ts | 2 +- .../src/middlewares/suite/toastMiddleware.ts | 4 +- .../wallet/__fixtures__/coinjoinMiddleware.ts | 2 +- .../wallet/__fixtures__/walletMiddleware.ts | 7 +-- .../__tests__/coinmarketMiddleware.test.ts | 4 +- .../wallet/coinmarketMiddleware.ts | 4 +- .../suite/src/middlewares/wallet/index.ts | 5 +- .../middlewares/wallet/storageMiddleware.ts | 4 +- .../src/reducers/backup/backupReducer.ts | 1 + .../reducers/onboarding/onboardingReducer.ts | 2 +- .../src/reducers/recovery/recoveryReducer.ts | 1 + packages/suite/src/reducers/store.ts | 2 +- .../__tests__/desktopUpdateReducer.test.ts | 3 +- .../suite/__tests__/modalReducer.test.ts | 3 +- .../suite/__tests__/protocolReducer.test.ts | 3 +- .../reducers/suite/desktopUpdateReducer.ts | 4 +- .../suite/src/reducers/suite/guideReducer.ts | 6 ++- .../src/reducers/suite/metadataReducer.ts | 4 +- .../src/reducers/suite/protocolReducer.ts | 4 +- .../suite/src/reducers/suite/resizeReducer.ts | 4 +- .../suite/src/reducers/suite/suiteReducer.ts | 9 ++-- .../wallet/__fixtures__/coinjoinReducer.ts | 1 + .../wallet/__tests__/coinjoinReducer.test.ts | 3 +- .../__tests__/coinmarketReducer.test.ts | 15 +++--- .../wallet/__tests__/sendFormReducer.test.ts | 4 +- .../__tests__/transactionReducer.test.ts | 4 +- .../reducers/wallet/cardanoStakingReducer.ts | 4 +- .../src/reducers/wallet/coinjoinReducer.ts | 3 +- .../src/reducers/wallet/coinmarketReducer.ts | 9 ++-- .../src/reducers/wallet/formDraftReducer.ts | 3 +- .../suite/src/reducers/wallet/graphReducer.ts | 5 +- .../src/reducers/wallet/receiveReducer.ts | 4 +- .../reducers/wallet/selectedAccountReducer.ts | 3 +- .../src/reducers/wallet/settingsReducer.ts | 6 ++- .../src/services/coinjoin/coinjoinService.ts | 1 + .../suite/src/services/coinjoin/config.ts | 3 +- packages/suite/src/services/github.ts | 4 +- packages/suite/src/services/google.ts | 3 +- .../suite/src/services/suite/invityAPI.ts | 2 + .../suite/metadata/DropboxProvider.ts | 4 +- .../suite/metadata/FileSystemProvider.ts | 1 + packages/suite/src/storage/definitions.ts | 17 ++++--- packages/suite/src/storage/index.ts | 3 +- .../suite/src/storage/migrations/index.ts | 14 ++--- .../suite/src/storage/migrations/utils.ts | 1 + .../suite/src/support/extraDependencies.ts | 18 ++++--- .../suite/src/support/suite/Autodetect.tsx | 1 + .../support/suite/ConnectedIntlProvider.tsx | 4 +- .../support/suite/ConnectedThemeProvider.tsx | 2 + .../suite/src/support/suite/ErrorBoundary.tsx | 2 + .../suite/src/support/suite/OnlineStatus.tsx | 1 + packages/suite/src/support/suite/Protocol.tsx | 3 +- packages/suite/src/support/suite/Resize.tsx | 2 + packages/suite/src/support/suite/Router.tsx | 1 + .../suite/src/support/suite/ThemeProvider.tsx | 3 ++ .../src/support/suite/screens/ErrorScreen.tsx | 1 + .../support/suite/screens/LoadingScreen.tsx | 2 + .../src/support/suite/styles/GlobalStyle.tsx | 4 +- packages/suite/src/support/suite/useTor.tsx | 6 ++- .../suite/src/support/tests/IntlHelper.tsx | 1 + .../suite/src/support/tests/hooksHelper.tsx | 5 +- .../suite/src/types/coinmarket/coinmarket.ts | 32 ++++++------ .../src/types/coinmarket/coinmarketDetail.ts | 3 +- .../src/types/coinmarket/coinmarketForm.ts | 46 +++++++++-------- .../src/types/coinmarket/coinmarketVerify.ts | 9 ++-- packages/suite/src/types/onboarding/index.ts | 1 + packages/suite/src/types/wallet/coinjoin.ts | 1 + .../src/types/wallet/coinmarketCommonTypes.ts | 4 +- packages/suite/src/types/wallet/index.ts | 3 +- packages/suite/src/types/wallet/sendForm.ts | 1 - .../utils/firmware/__tests__/firmware.test.ts | 3 +- packages/suite/src/utils/firmware/index.ts | 3 +- .../utils/onboarding/__tests__/steps.test.ts | 1 + .../src/utils/suite/__fixtures__/device.ts | 3 +- .../utils/suite/__fixtures__/homescreen.ts | 3 +- .../utils/suite/__tests__/homescreen.test.ts | 4 +- .../utils/suite/__tests__/logsUtils.test.ts | 2 +- .../utils/suite/__tests__/metadata.test.ts | 1 + .../utils/suite/__tests__/parseUri.test.ts | 1 + .../utils/suite/__tests__/protocol.test.ts | 1 + .../src/utils/suite/__tests__/reload.test.ts | 1 + .../src/utils/suite/__tests__/stake.test.ts | 51 ++++++++++--------- .../src/utils/suite/__tests__/theme.test.ts | 1 + .../src/utils/suite/__tests__/tor.test.ts | 1 + packages/suite/src/utils/suite/anchor.ts | 4 +- packages/suite/src/utils/suite/l10n.ts | 3 +- packages/suite/src/utils/suite/metadata.ts | 4 +- .../suite/src/utils/suite/notification.ts | 3 +- packages/suite/src/utils/suite/oauth.ts | 3 +- .../suite/src/utils/suite/prerequisites.ts | 2 + packages/suite/src/utils/suite/protocol.ts | 3 +- packages/suite/src/utils/suite/stake.ts | 6 ++- packages/suite/src/utils/suite/storage.ts | 2 +- packages/suite/src/utils/suite/theme.ts | 1 + packages/suite/src/utils/suite/tor.ts | 1 + packages/suite/src/utils/suite/validation.ts | 1 + .../wallet/__fixtures__/coinjoinUtils.ts | 2 + .../suite/src/utils/wallet/accountUtils.ts | 1 + .../suite/src/utils/wallet/coinjoinUtils.ts | 27 +++++----- .../coinmarket/__fixtures__/exchangeUtils.ts | 3 +- .../__tests__/coinmarketUtils.test.ts | 3 +- .../__tests__/exchangeUtils.test.ts | 1 + .../src/utils/wallet/coinmarket/buyUtils.ts | 6 ++- .../coinmarket/coinmarketTypingUtils.ts | 4 +- .../wallet/coinmarket/coinmarketUtils.ts | 16 +++--- .../utils/wallet/coinmarket/exchangeUtils.ts | 3 +- .../src/utils/wallet/coinmarket/sellUtils.ts | 6 ++- .../utils/wallet/exportTransactionsUtils.ts | 1 - .../suite/src/utils/wallet/graph/utils.ts | 8 +-- .../src/utils/wallet/graph/utilsShared.ts | 1 + .../src/utils/wallet/graph/utilsWorker.ts | 8 +-- packages/suite/src/utils/wallet/tokenUtils.ts | 1 - .../views/dashboard/AssetsView/ArrowIcon.tsx | 3 +- .../AssetsView/AssetCard/AssetCard.tsx | 46 ++++++++++------- .../AssetsView/AssetCard/AssetCardInfo.tsx | 8 +-- .../AssetCardTokensAndStakingInfo.tsx | 3 +- .../dashboard/AssetsView/AssetCoinLogo.tsx | 3 +- .../dashboard/AssetsView/AssetCoinName.tsx | 2 + .../AssetsView/AssetTable/AssetRow.tsx | 22 ++++---- .../AssetTable/AssetRowSkeleton.tsx | 4 +- .../AssetsView/AssetTable/AssetStakingRow.tsx | 4 +- .../AssetsView/AssetTable/AssetTable.tsx | 10 ++-- .../AssetTable/AssetTableExtraRowsSection.tsx | 1 + .../AssetsView/AssetTable/AssetTokenRow.tsx | 4 +- .../views/dashboard/AssetsView/AssetsView.tsx | 28 +++++----- .../AssetsView/CoinmarketBuyButton.tsx | 10 ++-- .../dashboard/AssetsView/assetsViewUtils.ts | 11 ++-- .../dashboard/DashboardPassphraseBanner.tsx | 13 +++-- .../dashboard/PortfolioCard/EmptyWallet.tsx | 2 +- .../dashboard/PortfolioCard/PortfolioCard.tsx | 10 ++-- .../PortfolioCard/PortfolioCardHeader.tsx | 3 +- .../suite/src/views/dashboard/PromoBanner.tsx | 8 ++- .../dashboard/StakeEthCard/StakeEthCard.tsx | 17 ++++--- .../StakeEthCardFooter/NetworkBadge.tsx | 1 + .../StakeEthCardFooter/StakeEthCardFooter.tsx | 6 ++- .../T3T1PromoBanner/T3T1PromoBanner.tsx | 14 +++-- .../T3T1PromoBanner/T3T1PromoLogo.tsx | 2 + packages/suite/src/views/dashboard/index.tsx | 7 ++- .../src/views/firmware/FirmwareCustom.tsx | 1 + .../src/views/firmware/FirmwareModal.tsx | 1 + .../src/views/firmware/FirmwareUpdate.tsx | 1 + .../components/IsSameDevice.tsx | 1 + .../onboarding/UnexpectedState/index.tsx | 1 + packages/suite/src/views/onboarding/index.tsx | 4 +- .../steps/BasicSettings/AdvancedSetup.tsx | 10 ++-- .../BasicSettings/BasicSettingsStepBox.tsx | 11 ++-- .../steps/BasicSettings/TorSection.tsx | 2 + .../views/onboarding/steps/DeviceTutorial.tsx | 4 +- .../src/views/onboarding/steps/Final.tsx | 6 ++- .../steps/Recovery/RecoveryStepBox.tsx | 1 + .../views/onboarding/steps/ResetDevice.tsx | 8 ++- .../src/views/onboarding/steps/Security.tsx | 1 + .../SecurityCheck/DeviceAuthenticity.tsx | 1 + .../steps/SecurityCheck/SecurityCheck.tsx | 2 + .../steps/SecurityCheck/SecurityChecklist.tsx | 1 + .../onboarding/steps/SecurityCheck/types.ts | 1 + .../steps/SelectBackupType/DefaultTag.tsx | 1 + .../SelectBackupType/FloatingSelections.tsx | 10 ++-- .../steps/SelectBackupType/LegacyOptions.tsx | 6 ++- .../SelectBackupType/OptionWithContent.tsx | 12 +++-- .../SelectBackupType/SelectBackupType.tsx | 26 ++++++---- .../steps/SelectBackupType/ShamirOptions.tsx | 8 +-- .../steps/SelectBackupType/typesToLabelMap.ts | 1 + .../PasswordManager/EntryForm.tsx | 9 ++-- .../PasswordManager/PasswordEntry.tsx | 3 +- .../PasswordManager/PasswordManager.tsx | 2 + .../PasswordManager/PasswordsList.tsx | 11 ++-- .../PasswordManager/TagsList.tsx | 3 +- .../src/views/password-manager/index.tsx | 3 +- .../SettingsCoins/FirmwareTypeSuggestion.tsx | 7 +-- .../settings/SettingsDebug/InvityApi.tsx | 3 +- .../settings/SettingsDebug/SettingsDebug.tsx | 4 +- .../src/views/settings/SettingsDebug/Tor.tsx | 1 - .../settings/SettingsDebug/Transport.tsx | 2 +- .../SettingsDebug/TransportBackends.tsx | 3 +- .../SettingsDebug/TriggerHighlight.tsx | 1 + .../SettingsDebug/ViewOnlySettings.tsx | 2 +- .../views/settings/SettingsDebug/WipeData.tsx | 3 +- .../settings/SettingsDevice/AutoLock.tsx | 2 +- .../settings/SettingsDevice/Brightness.tsx | 2 + .../SettingsDevice/ChangeLanguage.tsx | 1 + .../SettingsDevice/DefaultWalletLoading.tsx | 2 +- .../SettingsDevice/DisplayRotation.tsx | 2 +- .../SettingsDevice/FirmwareRevisionCheck.tsx | 3 +- .../SettingsDevice/FirmwareTypeChange.tsx | 15 +++--- .../SettingsDevice/HapticFeedback.tsx | 6 ++- .../settings/SettingsDevice/Homescreen.tsx | 3 +- .../SettingsDevice/MultiShareBackup.tsx | 9 ++-- .../settings/SettingsDevice/Passphrase.tsx | 2 +- .../settings/SettingsDevice/PinProtection.tsx | 2 +- .../settings/SettingsDevice/WipeCode.tsx | 5 +- .../settings/SettingsGeneral/Analytics.tsx | 1 + .../settings/SettingsGeneral/AutoStart.tsx | 2 +- .../SettingsGeneral/AutomaticUpdate.tsx | 6 ++- .../SettingsGeneral/BitcoinAmountUnit.tsx | 2 +- .../SettingsGeneral/DesktopSuiteBanner.tsx | 4 +- .../settings/SettingsGeneral/Experimental.tsx | 1 + .../settings/SettingsGeneral/Language.tsx | 5 +- .../SettingsGeneral/SettingsGeneral.tsx | 2 +- .../SettingsGeneral/ShowApplicationLog.tsx | 1 - .../settings/SettingsGeneral/ShowOnTray.tsx | 2 +- .../views/settings/SettingsGeneral/Theme.tsx | 4 +- .../views/settings/SettingsGeneral/Tor.tsx | 2 + .../SettingsGeneral/TorOnionLinks.tsx | 2 +- .../settings/SettingsGeneral/TorSnowflake.tsx | 6 ++- .../src/views/settings/SettingsLoader.tsx | 8 ++- .../suite/src/views/start/StartContent.tsx | 6 ++- packages/suite/src/views/start/SuiteStart.tsx | 2 + packages/suite/src/views/suite/ErrorPage.tsx | 4 +- .../suite/SwitchDevice/CardWithDevice.tsx | 3 +- .../DeviceItem/AddWalletButton.tsx | 4 +- .../DeviceItem/DeviceConnectionText.tsx | 6 ++- .../SwitchDevice/DeviceItem/DeviceDetail.tsx | 3 +- .../SwitchDevice/DeviceItem/DeviceHeader.tsx | 8 +-- .../SwitchDevice/DeviceItem/DeviceItem.tsx | 11 ++-- .../DeviceItem/DeviceStatusText.tsx | 10 ++-- .../SwitchDevice/DeviceItem/ViewOnly.tsx | 11 ++-- .../DeviceItem/ViewOnlyRadios.tsx | 4 +- .../views/suite/SwitchDevice/SwitchDevice.tsx | 2 +- .../suite/SwitchDevice/SwitchDeviceModal.tsx | 3 ++ .../views/suite/bridge-requested/index.tsx | 12 +++-- .../suite/src/views/suite/bridge/index.tsx | 7 ++- .../src/views/suite/notifications/index.tsx | 1 + .../suite/src/views/suite/version/index.tsx | 4 +- .../suite/src/views/view-only/MacWindow.tsx | 6 ++- .../src/views/view-only/ViewOnlyPromo.tsx | 4 +- .../views/view-only/ViewOnlyPromoContent.tsx | 20 +++++--- .../src/views/view-only/ViewOnlyTooltip.tsx | 4 +- .../components/CoinjoinConfirmation.tsx | 9 ++-- .../wallet/anonymize/components/Tile.tsx | 1 + .../coinmarket/DCA/CoinmarketDCALanding.tsx | 9 ++-- .../common/CoinmarketAddressOptions.tsx | 12 +++-- .../coinmarket/common/CoinmarketBalance.tsx | 4 +- .../coinmarket/common/CoinmarketCoinLogo.tsx | 4 +- .../coinmarket/common/CoinmarketContainer.tsx | 1 + .../common/CoinmarketCryptoAmount.tsx | 8 +-- .../CoinmarketDetailBuy.tsx | 1 + .../CoinmarketDetailBuyPaymentFailed.tsx | 4 +- .../CoinmarketDetailBuyPaymentProcessing.tsx | 4 +- .../CoinmarketDetailBuyPaymentSuccessful.tsx | 2 + ...inmarketDetailBuyPaymentWaitingForUser.tsx | 8 ++- .../CoinmarketDetailExchange.tsx | 1 + ...nmarketDetailExchangePaymentConverting.tsx | 4 +- .../CoinmarketDetailExchangePaymentFailed.tsx | 3 +- .../CoinmarketDetailExchangePaymentKYC.tsx | 5 +- ...CoinmarketDetailExchangePaymentSending.tsx | 4 +- ...nmarketDetailExchangePaymentSuccessful.tsx | 2 + .../CoinmarketDetailSell.tsx | 1 + .../CoinmarketDetailSellPaymentFailed.tsx | 3 +- .../CoinmarketDetailSellPaymentPending.tsx | 4 +- .../CoinmarketDetailSellPaymentSuccessful.tsx | 4 +- .../CoinmarketFeaturedOffersAmounts.tsx | 9 ++-- .../CoinmarketFeaturedOffersItem.tsx | 6 ++- .../CoinmarketFeaturedOffersPaymentInfo.tsx | 6 ++- .../CoinmarketFooter/CoinmarketFooter.tsx | 7 ++- .../CoinmarketProvidedByInvity.tsx | 4 +- .../CoinmarketFormInputAccount.tsx | 11 ++-- .../CoinmarketFormInputAccountOption.tsx | 1 + .../CoinmarketFormInputCountry.tsx | 7 ++- .../CoinmarketFormInputCryptoSelect.tsx | 8 +-- .../CoinmarketFormInputCurrency.tsx | 6 ++- .../CoinmarketFormInputCryptoAmount.tsx | 14 ++--- .../CoinmarketFormInputFiat.tsx | 13 +++-- .../CoinmarketFormInputLoader.tsx | 3 +- .../CoinmarketFormInputPaymentMethod.tsx | 2 + .../CoinmarketFormSwitcherCryptoFiat.tsx | 1 + .../CoinmarketFormSwitcherExchangeRates.tsx | 9 ++-- .../CoinmarketForm/CoinmarketFormInputs.tsx | 12 +++-- .../CoinmarketForm/CoinmarketFormLayout.tsx | 1 + .../CoinmarketForm/CoinmarketFormOffer.tsx | 7 ++- .../CoinmarketFormOfferCryptoAmount.tsx | 3 +- .../CoinmarketFormOfferFiatAmount.tsx | 1 + .../CoinmarketFormOfferItem.tsx | 1 + .../CoinmarketFormOffersSwitcher.tsx | 4 +- .../CoinmarketFormOffersSwitcherItem.tsx | 8 +-- .../common/CoinmarketFractionButtons.tsx | 3 +- .../CoinmarketExchangeHeaderSummary.tsx | 10 ++-- .../CoinmarketHeader/CoinmarketHeader.tsx | 8 +-- .../CoinmarketHeaderFilter.tsx | 4 +- .../CoinmarketHeaderSummary.tsx | 4 +- .../CoinmarketOffersExchangeFiltersPanel.tsx | 8 +-- .../CoinmarketLayout/CoinmarketLayout.tsx | 1 + .../CoinmarketLayoutHeader.tsx | 6 ++- .../CoinmarketLayoutNavigation.tsx | 1 + .../CoinmarketLayoutNavigationItem.tsx | 4 +- .../CoinmarketOffersEmpty.tsx | 3 +- .../CoinmarketOffersExchange.tsx | 6 ++- ...arketOffersExchangeQuotesByTypeSection.tsx | 4 +- .../CoinmarketOffers/CoinmarketOffersItem.tsx | 6 ++- .../common/CoinmarketPaymentPlainType.tsx | 4 +- .../common/CoinmarketPaymentType.tsx | 1 + .../common/CoinmarketProviderInfo.tsx | 1 + .../common/CoinmarketRefreshTime.tsx | 2 + .../CoinmarketInfoExchangeType.tsx | 4 +- .../CoinmarketInfo/CoinmarketInfoHeader.tsx | 4 +- .../CoinmarketInfo/CoinmarketInfoItem.tsx | 4 +- .../CoinmarketInfoPaymentMethod.tsx | 1 + .../CoinmarketInfo/CoinmarketInfoProvider.tsx | 1 + .../CoinmarketOfferExchange.tsx | 3 +- .../CoinmarketOfferExchangeSendApproval.tsx | 7 ++- .../CoinmarketOfferExchangeSendSwap.tsx | 9 ++-- .../CoinmarketOfferSell.tsx | 1 + .../CoinmarketOfferSellBankAccount.tsx | 10 ++-- .../CoinmarketOfferSellTransaction.tsx | 7 ++- .../CoinmarketSelectedOffer.tsx | 1 + .../CoinmarketSelectedOfferInfo.tsx | 1 + .../CoinmarketSelectedOfferStepper.tsx | 4 +- .../CoinmarketVerify/CoinmarketVerify.tsx | 11 ++-- .../CoinmarketVerifyOptions.tsx | 1 + .../CoinmarketVerifyOptionsItem.tsx | 4 +- .../coinmarket/common/CoinmarketTag.tsx | 1 + .../common/CoinmarketTransactionId.tsx | 6 ++- .../CoinmarketTransactionAmounts.tsx | 1 + .../CoinmarketTransactionId.tsx | 1 + .../CoinmarketTransactionInfo.tsx | 1 + .../CoinmarketTransactionProvider.tsx | 1 + .../CoinmarketTransactionStatus.tsx | 10 ++-- .../CoinmarketTransactionExchange.tsx | 1 + .../CoinmarketTransactionsBuy.tsx | 4 +- .../CoinmarketTransactionsList.tsx | 8 +-- .../CoinmarketTransactionsSell.tsx | 4 +- .../CoinmarketUtils/CoinmarketUtilsKyc.tsx | 6 ++- .../CoinmarketUtils/CoinmarketUtilsPrice.tsx | 4 +- .../CoinmarketUtilsProvider.tsx | 1 + .../CoinmarketUtilsTooltip.tsx | 4 +- .../CoinmarketUtilsTooltipFee.tsx | 2 + .../coinmarket/common/ConfirmedOnTrezor.tsx | 4 +- .../src/views/wallet/coinmarket/index.tsx | 4 +- .../redirect/CoinmarketRedirect.tsx | 11 ++-- .../src/views/wallet/details/CoinjoinLogs.tsx | 4 +- .../CoinjoinSetup/AnonymityLevelSetup.tsx | 5 +- .../details/CoinjoinSetup/CoinjoinSetup.tsx | 7 ++- .../CoinjoinSetup/MaxMiningFeeSetup.tsx | 4 +- .../CoinjoinSetup/SetupSlider/SetupSlider.tsx | 5 +- .../CoinjoinSetup/SetupSlider/SliderInput.tsx | 2 + .../details/CoinjoinSetup/SkipRoundsSetup.tsx | 4 +- .../views/wallet/details/RescanAccount.tsx | 1 + .../suite/src/views/wallet/details/Row.tsx | 3 +- .../suite/src/views/wallet/details/index.tsx | 11 ++-- .../src/views/wallet/receive/Receive.tsx | 6 +-- .../components/CoinjoinReceiveWarning.tsx | 4 +- .../receive/components/ConnectDevicePromo.tsx | 4 +- .../receive/components/FreshAddress.tsx | 12 +++-- .../wallet/receive/components/Header.tsx | 4 +- .../receive/components/UsedAddresses.tsx | 1 + .../Options/BitcoinOptions/BitcoinOptions.tsx | 7 ++- .../CoinControl/CoinControl.tsx | 7 ++- .../BitcoinOptions/CoinControl/UtxoSearch.tsx | 3 ++ .../CoinControl/UtxoSelection.tsx | 6 ++- .../CoinControl/UtxoSelectionList.tsx | 8 ++- .../BitcoinOptions/CoinControl/UtxoTag.tsx | 1 + .../BitcoinOptions/Locktime/Locktime.tsx | 15 ++++-- .../wallet/send/Options/CardanoOptions.tsx | 2 + .../Options/EthereumOptions/EthereumData.tsx | 10 ++-- .../EthereumOptions/EthereumOptions.tsx | 2 + .../wallet/send/Options/OnOffSwitcher.tsx | 1 + .../Options/RippleOptions/DestinationTag.tsx | 8 +-- .../Options/RippleOptions/RippleOptions.tsx | 2 + .../src/views/wallet/send/Outputs/Address.tsx | 19 ++++--- .../wallet/send/Outputs/Amount/Amount.tsx | 4 +- .../wallet/send/Outputs/Amount/FiatInput.tsx | 20 +++++--- .../send/Outputs/Amount/SendMaxSwitch.tsx | 4 +- .../send/Outputs/Amount/TokenSelect.tsx | 15 +++--- .../views/wallet/send/Outputs/OpReturn.tsx | 11 ++-- .../src/views/wallet/send/Outputs/Outputs.tsx | 4 +- .../src/views/wallet/send/SendHeader.tsx | 6 ++- .../suite/src/views/wallet/send/SendRaw.tsx | 6 ++- .../wallet/send/TotalSent/ReviewButton.tsx | 7 ++- .../views/wallet/send/TotalSent/TotalSent.tsx | 8 ++- .../suite/src/views/wallet/send/index.tsx | 2 + .../sign-verify/components/ButtonRow.tsx | 11 ++-- .../components/HiddenAddressRow.tsx | 4 +- .../sign-verify/components/Navigation.tsx | 1 + .../sign-verify/components/NavigationTab.tsx | 2 + .../components/SignAddressInput.tsx | 4 ++ .../components/VerifyAddressButton.tsx | 5 +- .../src/views/wallet/sign-verify/index.tsx | 14 ++--- .../views/wallet/staking/WalletStaking.tsx | 4 +- .../components/CardanoActionPending.tsx | 3 +- .../staking/components/CardanoPrimitives.ts | 3 +- .../staking/components/CardanoRedelegate.tsx | 6 +-- .../staking/components/CardanoRewards.tsx | 4 +- .../staking/components/CardanoStake.tsx | 4 +- .../components/CardanoStakingDashboard.tsx | 9 ++-- .../EthStakingDashboard.tsx | 2 + .../ApproximateInstantEthAmount.tsx | 3 +- .../components/ApyCard.tsx | 3 ++ .../components/EmptyStakingCard.tsx | 4 +- .../components/EverstakeFooter.tsx | 7 ++- .../components/InstantStakeBanner.tsx | 13 +++-- .../components/PayoutCard.tsx | 12 +++-- .../ProgressLabels/ProgressLabel.tsx | 5 +- .../ProgressLabels/ProgressLabels.tsx | 2 + .../components/StakingCard.tsx | 7 ++- .../components/StakingDashboard.tsx | 24 +++++---- .../components/Transactions.tsx | 5 +- .../components/TrimmedCryptoAmount.tsx | 4 +- .../components/claim/ClaimCard.tsx | 3 ++ .../components/claim/ClaimPendingCard.tsx | 9 ++-- .../components/claim/ClaimReadyCard.tsx | 7 ++- .../components/claim/styled.ts | 1 + .../EthStakingDashboard/components/styled.ts | 1 + .../hooks/useIsTxStatusShown.ts | 1 + .../hooks/useProgressLabelsData.tsx | 6 ++- .../views/wallet/tokens/coins/CoinsTable.tsx | 3 +- .../views/wallet/tokens/common/BlurUrls.tsx | 5 +- .../tokens/common/TokensTable/TokenRow.tsx | 3 +- .../tokens/common/TokensTable/TokensTable.tsx | 2 + .../hidden-tokens/HiddenTokensTable.tsx | 9 ++-- .../suite/src/views/wallet/tokens/index.tsx | 6 ++- .../CoinjoinExplanation.tsx | 5 +- .../CoinjoinProcessStep.tsx | 3 ++ .../BalancePrivacyBreakdown.tsx | 2 + .../CryptoAmountWithHeader.tsx | 7 ++- .../CoinjoinSummary/CoinjoinBalanceError.tsx | 2 + .../CoinjoinBalanceSection.tsx | 3 ++ .../CoinjoinProgressContent.tsx | 7 ++- .../CoinjoinProgressWheel.tsx | 14 +++-- .../CoinjoinStatusMessage.tsx | 4 +- .../CoinjoinStatusWheel.tsx | 10 ++-- .../CoinjoinSummary/CoinjoinSummary.tsx | 2 + .../wallet/transactions/TradeBox/TradeBox.tsx | 9 ++-- .../transactions/TradeBox/TradeBoxMenu.tsx | 8 ++- .../transactions/TradeBox/TradeBoxPrices.tsx | 8 ++- .../TransactionList/NoSearchResults.tsx | 5 +- .../TransactionList/TransactionCandidates.tsx | 2 + .../TransactionGroupedList.tsx | 4 +- .../TransactionList/TransactionList.tsx | 13 +++-- .../TransactionListActions/ExportAction.tsx | 13 +++-- .../TransactionListActions.tsx | 13 +++-- .../TransactionsGroup/CommonComponents.tsx | 2 + .../TransactionsGroup/DayHeader.tsx | 5 +- .../TransactionsGroup/PendingGroupHeader.tsx | 1 + .../TransactionsGroup/TransactionsGroup.tsx | 10 ++-- .../wallet/transactions/Transactions.tsx | 15 ++++-- .../transactions/components/InfoCard.tsx | 5 +- .../components/NoTransactions.tsx | 3 +- .../transactions/components/SummaryCards.tsx | 12 +++-- .../components/TransactionSummary.tsx | 10 ++-- packages/transport/src/api/abstract.ts | 2 +- packages/transport/src/api/udp.ts | 1 + packages/transport/src/api/usb.ts | 1 - .../src/sessions/background-browser.ts | 1 - packages/transport/src/transports/abstract.ts | 2 +- .../transport/src/transports/abstractApi.ts | 2 +- packages/transport/src/transports/bridge.ts | 2 +- .../src/transports/nodeusb.browser.ts | 1 - packages/transport/src/transports/nodeusb.ts | 1 + .../transport/src/transports/udp.browser.ts | 1 - packages/transport/src/transports/udp.ts | 1 - .../src/transports/webusb.browser.ts | 1 - packages/transport/src/transports/webusb.ts | 1 - packages/transport/src/utils/bridgeApiCall.ts | 5 +- .../transport/src/utils/bridgeApiResult.ts | 1 - .../src/utils/bridgeProtocolMessage.ts | 1 + packages/transport/src/utils/send.ts | 1 + packages/transport/tests/abstractUsb.test.ts | 3 +- packages/transport/tests/apiUdp.test.ts | 1 + .../transport/tests/build-receive.test.ts | 2 + packages/utxo-lib/src/address.ts | 1 + packages/utxo-lib/src/bip32.ts | 1 + packages/utxo-lib/src/bs58check.ts | 3 +- packages/utxo-lib/src/bufferutils.ts | 2 + .../src/coinselect/coinselectUtils.ts | 1 + .../src/coinselect/inputs/accumulative.ts | 1 + .../src/coinselect/inputs/branchAndBound.ts | 1 + .../utxo-lib/src/coinselect/outputs/split.ts | 1 + .../compose/sorting/randomSortingStrategy.ts | 3 +- packages/utxo-lib/src/derivation.ts | 2 + packages/utxo-lib/src/payments/p2ms.ts | 1 + packages/utxo-lib/src/payments/p2pk.ts | 1 + packages/utxo-lib/src/payments/p2pkh.ts | 1 + packages/utxo-lib/src/payments/p2tr.ts | 1 + packages/utxo-lib/src/payments/p2wpkh.ts | 1 + packages/utxo-lib/src/payments/p2wsh.ts | 1 + packages/utxo-lib/src/script/index.ts | 1 + .../utxo-lib/src/script/scriptSignature.ts | 1 + packages/utxo-lib/src/transaction/base.ts | 2 +- packages/utxo-lib/src/transaction/dash.ts | 1 + packages/utxo-lib/src/transaction/decred.ts | 1 + packages/utxo-lib/src/transaction/zcash.ts | 1 + packages/utxo-lib/src/types/coinselect.ts | 1 + .../tests/coinselect/coinselectUtils.test.ts | 1 + .../utxo-lib/tests/coinselect/test.utils.ts | 1 + packages/utxo-lib/tests/compose.test.ts | 4 +- packages/utxo-lib/tests/script.test.ts | 4 +- 1519 files changed, 4410 insertions(+), 2045 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index e160df3fab4..ec4eb5e01cd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -360,7 +360,6 @@ module.exports = { rules: { '@typescript-eslint/no-shadow': 'off', 'import/no-default-export': 'off', - 'import/order': 'off', '@typescript-eslint/no-unused-vars': 'off', 'no-console': 'off', 'react/jsx-no-undef': 'off', diff --git a/packages/analytics/src/utils.ts b/packages/analytics/src/utils.ts index 5cb59538ee6..031e6b6e043 100644 --- a/packages/analytics/src/utils.ts +++ b/packages/analytics/src/utils.ts @@ -1,7 +1,8 @@ import type { Environment } from '@trezor/env-utils'; -import type { App, Event as AnalyticsEvent } from './types'; import { getWeakRandomId } from '@trezor/utils'; +import type { App, Event as AnalyticsEvent } from './types'; + export const getTrackingRandomId = () => getWeakRandomId(10); export const getRandomId = () => getWeakRandomId(10); diff --git a/packages/blockchain-link/src/workers/baseWebsocket.ts b/packages/blockchain-link/src/workers/baseWebsocket.ts index 1d999d20b78..6f55974bf5f 100644 --- a/packages/blockchain-link/src/workers/baseWebsocket.ts +++ b/packages/blockchain-link/src/workers/baseWebsocket.ts @@ -1,6 +1,6 @@ import WebSocket from 'ws'; -import { createDeferred, createDeferredManager, TypedEmitter } from '@trezor/utils'; +import { createDeferred, createDeferredManager, TypedEmitter } from '@trezor/utils'; import { CustomError } from '@trezor/blockchain-link-types/src/constants/errors'; interface Subscription { diff --git a/packages/blockchain-link/src/workers/baseWorker.ts b/packages/blockchain-link/src/workers/baseWorker.ts index cfe6d8f069d..e1ad3184439 100644 --- a/packages/blockchain-link/src/workers/baseWorker.ts +++ b/packages/blockchain-link/src/workers/baseWorker.ts @@ -6,13 +6,15 @@ // new BlockchainLink({ worker: () => new BlockchainLinkModule() }); import { SocksProxyAgent } from 'socks-proxy-agent'; + import { CustomError } from '@trezor/blockchain-link-types/src/constants/errors'; -import { WorkerState } from './state'; -import { prioritizeEndpoints } from './utils'; import { MESSAGES, RESPONSES } from '@trezor/blockchain-link-types/src/constants'; import type { Response, BlockchainSettings } from '@trezor/blockchain-link-types'; import type { Message } from '@trezor/blockchain-link-types/src/messages'; +import { prioritizeEndpoints } from './utils'; +import { WorkerState } from './state'; + // self is not declared in TS Webworker lib typings declare const self: { postMessage: (...args: any[]) => any }; diff --git a/packages/blockchain-link/src/workers/blockbook/index.ts b/packages/blockchain-link/src/workers/blockbook/index.ts index 60d6ba85ac9..f552b4b6ed7 100644 --- a/packages/blockchain-link/src/workers/blockbook/index.ts +++ b/packages/blockchain-link/src/workers/blockbook/index.ts @@ -1,7 +1,5 @@ import { CustomError } from '@trezor/blockchain-link-types/src/constants/errors'; import { MESSAGES, RESPONSES } from '@trezor/blockchain-link-types/src/constants'; -import { BaseWorker, CONTEXT, ContextType } from '../baseWorker'; -import { BlockbookAPI } from './websocket'; import * as utils from '@trezor/blockchain-link-utils/src/blockbook'; import type { Response, SubscriptionAccountInfo } from '@trezor/blockchain-link-types'; import type { @@ -12,6 +10,9 @@ import type { } from '@trezor/blockchain-link-types/src/blockbook'; import type * as MessageTypes from '@trezor/blockchain-link-types/src/messages'; +import { BlockbookAPI } from './websocket'; +import { BaseWorker, CONTEXT, ContextType } from '../baseWorker'; + type Context = ContextType; type Request = T & Context; diff --git a/packages/blockchain-link/src/workers/blockbook/websocket.ts b/packages/blockchain-link/src/workers/blockbook/websocket.ts index d3cfbb46253..77a74f11a30 100644 --- a/packages/blockchain-link/src/workers/blockbook/websocket.ts +++ b/packages/blockchain-link/src/workers/blockbook/websocket.ts @@ -20,9 +20,9 @@ import type { AccountBalanceHistoryParams, RpcCallParams, } from '@trezor/blockchain-link-types/src/params'; +import { getSuiteVersion } from '@trezor/env-utils'; import { BaseWebsocket } from '../baseWebsocket'; -import { getSuiteVersion } from '@trezor/env-utils'; interface BlockbookEvents { block: BlockNotification; diff --git a/packages/blockchain-link/src/workers/blockfrost/index.ts b/packages/blockchain-link/src/workers/blockfrost/index.ts index 7fa640e7c7e..7b6f2b5ca69 100644 --- a/packages/blockchain-link/src/workers/blockfrost/index.ts +++ b/packages/blockchain-link/src/workers/blockfrost/index.ts @@ -1,7 +1,5 @@ import { CustomError } from '@trezor/blockchain-link-types/src/constants/errors'; import { MESSAGES, RESPONSES } from '@trezor/blockchain-link-types/src/constants'; -import { BaseWorker, CONTEXT, ContextType } from '../baseWorker'; -import { BlockfrostAPI } from './websocket'; import { transformUtxos, transformAccountInfo, @@ -15,6 +13,9 @@ import type { } from '@trezor/blockchain-link-types/src/blockfrost'; import type * as MessageTypes from '@trezor/blockchain-link-types/src/messages'; +import { BlockfrostAPI } from './websocket'; +import { BaseWorker, CONTEXT, ContextType } from '../baseWorker'; + type Context = ContextType; type Request = T & Context; diff --git a/packages/blockchain-link/src/workers/blockfrost/websocket.ts b/packages/blockchain-link/src/workers/blockfrost/websocket.ts index f629692dffc..274477224e1 100644 --- a/packages/blockchain-link/src/workers/blockfrost/websocket.ts +++ b/packages/blockchain-link/src/workers/blockfrost/websocket.ts @@ -10,9 +10,9 @@ import type { EstimateFeeParams, AccountBalanceHistoryParams, } from '@trezor/blockchain-link-types/src/params'; +import { getSuiteVersion } from '@trezor/env-utils'; import { BaseWebsocket } from '../baseWebsocket'; -import { getSuiteVersion } from '@trezor/env-utils'; interface BlockfrostEvents { block: BlockContent; diff --git a/packages/blockchain-link/src/workers/electrum/client/caching.ts b/packages/blockchain-link/src/workers/electrum/client/caching.ts index 5ea93b48f5e..cbe8dd58002 100644 --- a/packages/blockchain-link/src/workers/electrum/client/caching.ts +++ b/packages/blockchain-link/src/workers/electrum/client/caching.ts @@ -1,6 +1,7 @@ -import { ElectrumClient } from './electrum'; import { Status } from '@trezor/blockchain-link-types/src/electrum'; +import { ElectrumClient } from './electrum'; + type Cache = { [descriptor: string]: [Status, any]; }; diff --git a/packages/blockchain-link/src/workers/electrum/client/electrum.ts b/packages/blockchain-link/src/workers/electrum/client/electrum.ts index 4fbd3d50a5d..17733b50ef2 100644 --- a/packages/blockchain-link/src/workers/electrum/client/electrum.ts +++ b/packages/blockchain-link/src/workers/electrum/client/electrum.ts @@ -1,5 +1,6 @@ import { Network, networks } from '@trezor/utxo-lib'; import { ElectrumAPI, BlockHeader, Version } from '@trezor/blockchain-link-types/src/electrum'; + import { JsonRpcClientOptions } from './json-rpc'; import { BatchingJsonRpcClient } from './batching'; import type { ISocket } from '../sockets/interface'; diff --git a/packages/blockchain-link/src/workers/electrum/client/json-rpc.ts b/packages/blockchain-link/src/workers/electrum/client/json-rpc.ts index d63e6554713..1d8add2ad97 100644 --- a/packages/blockchain-link/src/workers/electrum/client/json-rpc.ts +++ b/packages/blockchain-link/src/workers/electrum/client/json-rpc.ts @@ -1,5 +1,7 @@ import { EventEmitter } from 'events'; + import { throwError } from '@trezor/utils'; + import type { ISocket } from '../sockets/interface'; type Callback = (error: any, result?: any) => void; diff --git a/packages/blockchain-link/src/workers/electrum/index.ts b/packages/blockchain-link/src/workers/electrum/index.ts index 5c5ecd4950b..bc732d36a94 100644 --- a/packages/blockchain-link/src/workers/electrum/index.ts +++ b/packages/blockchain-link/src/workers/electrum/index.ts @@ -1,13 +1,14 @@ import { CustomError } from '@trezor/blockchain-link-types/src/constants/errors'; import { MESSAGES, RESPONSES } from '@trezor/blockchain-link-types/src/constants'; +import type { Response } from '@trezor/blockchain-link-types'; +import { Message } from '@trezor/blockchain-link-types/src/messages'; + import { BaseWorker, CONTEXT, ContextType } from '../baseWorker'; import * as M from './methods'; import * as L from './listeners'; import { createSocket } from './sockets'; import { CachingElectrumClient } from './client/caching'; import type { ElectrumClient } from './client/electrum'; -import type { Response } from '@trezor/blockchain-link-types'; -import { Message } from '@trezor/blockchain-link-types/src/messages'; type BlockListener = ReturnType; type TxListener = ReturnType; diff --git a/packages/blockchain-link/src/workers/electrum/listeners/blockListener.ts b/packages/blockchain-link/src/workers/electrum/listeners/blockListener.ts index 94600a25da6..dca0709e606 100644 --- a/packages/blockchain-link/src/workers/electrum/listeners/blockListener.ts +++ b/packages/blockchain-link/src/workers/electrum/listeners/blockListener.ts @@ -1,8 +1,9 @@ import { throwError } from '@trezor/utils'; import { RESPONSES } from '@trezor/blockchain-link-types/src/constants'; +import type { BlockHeader, ElectrumAPI } from '@trezor/blockchain-link-types/src/electrum'; + import { blockheaderToBlockhash } from '../utils'; import type { BaseWorker } from '../../baseWorker'; -import type { BlockHeader, ElectrumAPI } from '@trezor/blockchain-link-types/src/electrum'; export const blockListener = (worker: BaseWorker) => { const { state } = worker; diff --git a/packages/blockchain-link/src/workers/electrum/listeners/txListener.ts b/packages/blockchain-link/src/workers/electrum/listeners/txListener.ts index 7e3f0c6d01b..204694af64b 100644 --- a/packages/blockchain-link/src/workers/electrum/listeners/txListener.ts +++ b/packages/blockchain-link/src/workers/electrum/listeners/txListener.ts @@ -1,8 +1,6 @@ import { throwError } from '@trezor/utils'; import { RESPONSES } from '@trezor/blockchain-link-types/src/constants'; -import { createAddressManager, getTransactions } from '../utils'; import { transformTransaction } from '@trezor/blockchain-link-utils/src/blockbook'; -import type { BaseWorker } from '../../baseWorker'; import type { ElectrumAPI, HistoryTx, @@ -10,6 +8,9 @@ import type { } from '@trezor/blockchain-link-types/src/electrum'; import type { Subscribe, Unsubscribe } from '@trezor/blockchain-link-types/src/messages'; +import type { BaseWorker } from '../../baseWorker'; +import { createAddressManager, getTransactions } from '../utils'; + type Payload = Extract< T['payload'], { type: 'addresses' | 'accounts' } diff --git a/packages/blockchain-link/src/workers/electrum/methods/estimateFee.ts b/packages/blockchain-link/src/workers/electrum/methods/estimateFee.ts index 9be3f4bf75f..5dede3fe56e 100644 --- a/packages/blockchain-link/src/workers/electrum/methods/estimateFee.ts +++ b/packages/blockchain-link/src/workers/electrum/methods/estimateFee.ts @@ -1,7 +1,8 @@ -import { Api, btcToSat } from '../utils'; import type { EstimateFee as Req } from '@trezor/blockchain-link-types/src/messages'; import type { EstimateFee as Res } from '@trezor/blockchain-link-types/src/responses'; +import { Api, btcToSat } from '../utils'; + const estimateFee: Api = (client, payload) => Promise.all( (payload.blocks || []).map(num => diff --git a/packages/blockchain-link/src/workers/electrum/methods/getAccountBalanceHistory.ts b/packages/blockchain-link/src/workers/electrum/methods/getAccountBalanceHistory.ts index a39c57f282e..b6d51ec3dbc 100644 --- a/packages/blockchain-link/src/workers/electrum/methods/getAccountBalanceHistory.ts +++ b/packages/blockchain-link/src/workers/electrum/methods/getAccountBalanceHistory.ts @@ -1,13 +1,14 @@ import { BigNumber } from '@trezor/utils/src/bigNumber'; import { discovery } from '@trezor/utxo-lib'; import { sumVinVout } from '@trezor/blockchain-link-utils'; -import { Api, tryGetScripthash, getTransactions, discoverAddress, AddressHistory } from '../utils'; import { transformTransaction } from '@trezor/blockchain-link-utils/src/blockbook'; import type { GetAccountBalanceHistory as Req } from '@trezor/blockchain-link-types/src/messages'; import type { GetAccountBalanceHistory as Res } from '@trezor/blockchain-link-types/src/responses'; import type { AccountAddresses, Transaction } from '@trezor/blockchain-link-types/src/common'; import type { HistoryTx } from '@trezor/blockchain-link-types/src/electrum'; +import { Api, tryGetScripthash, getTransactions, discoverAddress, AddressHistory } from '../utils'; + const transformAddress = (addr: AddressHistory) => ({ address: addr.address, path: addr.path, diff --git a/packages/blockchain-link/src/workers/electrum/methods/getAccountInfo.ts b/packages/blockchain-link/src/workers/electrum/methods/getAccountInfo.ts index 381a0724b9f..fd62f7f813f 100644 --- a/packages/blockchain-link/src/workers/electrum/methods/getAccountInfo.ts +++ b/packages/blockchain-link/src/workers/electrum/methods/getAccountInfo.ts @@ -1,6 +1,5 @@ import { discovery } from '@trezor/utxo-lib'; import { sortTxsFromLatest } from '@trezor/blockchain-link-utils'; -import { Api, tryGetScripthash, discoverAddress, AddressHistory, getTransactions } from '../utils'; import { transformTransaction } from '@trezor/blockchain-link-utils/src/blockbook'; import type { ElectrumAPI } from '@trezor/blockchain-link-types/src/electrum'; import type { GetAccountInfo as Req } from '@trezor/blockchain-link-types/src/messages'; @@ -8,6 +7,8 @@ import type { GetAccountInfo as Res } from '@trezor/blockchain-link-types/src/re import type { VinVout } from '@trezor/blockchain-link-types/src/blockbook'; import type { Address, Transaction } from '@trezor/blockchain-link-types'; +import { Api, tryGetScripthash, discoverAddress, AddressHistory, getTransactions } from '../utils'; + // const PAGE_DEFAULT = 0; const PAGE_SIZE_DEFAULT = 25; diff --git a/packages/blockchain-link/src/workers/electrum/methods/getAccountUtxo.ts b/packages/blockchain-link/src/workers/electrum/methods/getAccountUtxo.ts index cdea012d9a6..73736975d06 100644 --- a/packages/blockchain-link/src/workers/electrum/methods/getAccountUtxo.ts +++ b/packages/blockchain-link/src/workers/electrum/methods/getAccountUtxo.ts @@ -1,10 +1,11 @@ import { throwError } from '@trezor/utils'; import { discovery } from '@trezor/utxo-lib'; -import { Api, tryGetScripthash, discoverAddress } from '../utils'; import type { GetAccountUtxo as Req } from '@trezor/blockchain-link-types/src/messages'; import type { GetAccountUtxo as Res } from '@trezor/blockchain-link-types/src/responses'; import type { Utxo } from '@trezor/blockchain-link-types/src/electrum'; +import { Api, tryGetScripthash, discoverAddress } from '../utils'; + const transformUtxo = (currentHeight: number, addressInfo: { address?: string; path?: string } = {}) => ({ height, tx_hash, tx_pos, value }: Utxo): Res['payload'][number] => ({ diff --git a/packages/blockchain-link/src/workers/electrum/methods/getBlockHash.ts b/packages/blockchain-link/src/workers/electrum/methods/getBlockHash.ts index c8e2e60879e..de8e55a0047 100644 --- a/packages/blockchain-link/src/workers/electrum/methods/getBlockHash.ts +++ b/packages/blockchain-link/src/workers/electrum/methods/getBlockHash.ts @@ -1,7 +1,8 @@ -import { Api, blockheaderToBlockhash } from '../utils'; import type { GetBlockHash as Req } from '@trezor/blockchain-link-types/src/messages'; import type { GetBlockHash as Res } from '@trezor/blockchain-link-types/src/responses'; +import { Api, blockheaderToBlockhash } from '../utils'; + const getBlockHash: Api = async (client, payload) => { const blockheader = await client.request('blockchain.block.header', payload); diff --git a/packages/blockchain-link/src/workers/electrum/methods/getInfo.ts b/packages/blockchain-link/src/workers/electrum/methods/getInfo.ts index 88da9bb1a91..7b553cc8d6c 100644 --- a/packages/blockchain-link/src/workers/electrum/methods/getInfo.ts +++ b/packages/blockchain-link/src/workers/electrum/methods/getInfo.ts @@ -1,8 +1,9 @@ import { throwError } from '@trezor/utils'; -import { Api, blockheaderToBlockhash } from '../utils'; import type { GetInfo as Req } from '@trezor/blockchain-link-types/src/messages'; import type { GetInfo as Res } from '@trezor/blockchain-link-types/src/responses'; +import { Api, blockheaderToBlockhash } from '../utils'; + const getInfo: Api = client => { const { url, diff --git a/packages/blockchain-link/src/workers/electrum/methods/getTransaction.ts b/packages/blockchain-link/src/workers/electrum/methods/getTransaction.ts index 6efc4ee9591..c4a088ee6b4 100644 --- a/packages/blockchain-link/src/workers/electrum/methods/getTransaction.ts +++ b/packages/blockchain-link/src/workers/electrum/methods/getTransaction.ts @@ -1,8 +1,9 @@ -import { Api, getTransactions } from '../utils'; import { transformTransaction } from '@trezor/blockchain-link-utils/src/blockbook'; import type { GetTransaction as Req } from '@trezor/blockchain-link-types/src/messages'; import type { GetTransaction as Res } from '@trezor/blockchain-link-types/src/responses'; +import { Api, getTransactions } from '../utils'; + const getTransaction: Api = async (client, payload) => { const [tx] = await getTransactions(client, [{ tx_hash: payload, height: -1 }]); diff --git a/packages/blockchain-link/src/workers/electrum/methods/pushTransaction.ts b/packages/blockchain-link/src/workers/electrum/methods/pushTransaction.ts index 0ffbd7ef278..00122d50688 100644 --- a/packages/blockchain-link/src/workers/electrum/methods/pushTransaction.ts +++ b/packages/blockchain-link/src/workers/electrum/methods/pushTransaction.ts @@ -1,7 +1,8 @@ -import { Api } from '../utils'; import type { PushTransaction as Req } from '@trezor/blockchain-link-types/src/messages'; import type { PushTransaction as Res } from '@trezor/blockchain-link-types/src/responses'; +import { Api } from '../utils'; + const pushTransaction: Api = async (client, payload) => { const res = await client.request('blockchain.transaction.broadcast', payload); diff --git a/packages/blockchain-link/src/workers/electrum/sockets/base.ts b/packages/blockchain-link/src/workers/electrum/sockets/base.ts index a724c199407..6b5614f0b1c 100644 --- a/packages/blockchain-link/src/workers/electrum/sockets/base.ts +++ b/packages/blockchain-link/src/workers/electrum/sockets/base.ts @@ -1,6 +1,7 @@ import type { Socket as TCPSocket } from 'net'; import type { TLSSocket } from 'tls'; import type { SocksProxyAgent } from 'socks-proxy-agent'; + import type { ISocket, SocketListener } from './interface'; const TIMEOUT = 10000; diff --git a/packages/blockchain-link/src/workers/electrum/sockets/index.ts b/packages/blockchain-link/src/workers/electrum/sockets/index.ts index dfb401af562..888d286708c 100644 --- a/packages/blockchain-link/src/workers/electrum/sockets/index.ts +++ b/packages/blockchain-link/src/workers/electrum/sockets/index.ts @@ -1,5 +1,6 @@ import { parseElectrumUrl } from '@trezor/utils'; import { CustomError } from '@trezor/blockchain-link-types/src/constants/errors'; + import { TcpSocket } from './tcp'; import { TlsSocket } from './tls'; import { TorSocket } from './tor'; diff --git a/packages/blockchain-link/src/workers/electrum/sockets/tcp.ts b/packages/blockchain-link/src/workers/electrum/sockets/tcp.ts index e183142ed4c..f4ed9bfe994 100644 --- a/packages/blockchain-link/src/workers/electrum/sockets/tcp.ts +++ b/packages/blockchain-link/src/workers/electrum/sockets/tcp.ts @@ -1,4 +1,5 @@ import { Socket as TCPSocket } from 'net'; + import { SocketBase } from './base'; import type { SocketListener } from './interface'; diff --git a/packages/blockchain-link/src/workers/electrum/sockets/tls.ts b/packages/blockchain-link/src/workers/electrum/sockets/tls.ts index 71d09798bd6..16bbe5bab7e 100644 --- a/packages/blockchain-link/src/workers/electrum/sockets/tls.ts +++ b/packages/blockchain-link/src/workers/electrum/sockets/tls.ts @@ -1,4 +1,5 @@ import { TLSSocket } from 'tls'; + import { SocketBase } from './base'; import type { SocketListener } from './interface'; diff --git a/packages/blockchain-link/src/workers/electrum/sockets/tor.ts b/packages/blockchain-link/src/workers/electrum/sockets/tor.ts index c4907cc569a..902456364cb 100644 --- a/packages/blockchain-link/src/workers/electrum/sockets/tor.ts +++ b/packages/blockchain-link/src/workers/electrum/sockets/tor.ts @@ -1,5 +1,6 @@ -import { SocketBase, SocketConfig } from './base'; import type { SocksProxyAgent } from 'socks-proxy-agent'; + +import { SocketBase, SocketConfig } from './base'; import type { SocketListener } from './interface'; type TorSocketConfig = SocketConfig & { diff --git a/packages/blockchain-link/src/workers/electrum/utils/addressManager.ts b/packages/blockchain-link/src/workers/electrum/utils/addressManager.ts index d6bfe7495c2..2a950b4bc29 100644 --- a/packages/blockchain-link/src/workers/electrum/utils/addressManager.ts +++ b/packages/blockchain-link/src/workers/electrum/utils/addressManager.ts @@ -1,8 +1,9 @@ import { isNotUndefined, arrayDistinct, objectPartition } from '@trezor/utils'; -import { addressToScripthash } from './transform'; import type { Network } from '@trezor/utxo-lib'; import type { AccountAddresses, SubscriptionAccountInfo } from '@trezor/blockchain-link-types/src'; +import { addressToScripthash } from './transform'; + type AddressMap = { [address: string]: string }; type AccountMap = { [descriptor: string]: AccountAddresses }; diff --git a/packages/blockchain-link/src/workers/electrum/utils/discovery.ts b/packages/blockchain-link/src/workers/electrum/utils/discovery.ts index 4d29a33388c..8a26ab70763 100644 --- a/packages/blockchain-link/src/workers/electrum/utils/discovery.ts +++ b/packages/blockchain-link/src/workers/electrum/utils/discovery.ts @@ -1,6 +1,7 @@ -import { addressToScripthash } from './transform'; import type { ElectrumAPI, HistoryTx } from '@trezor/blockchain-link-types/src/electrum'; +import { addressToScripthash } from './transform'; + export type AddressHistory = { address: string; scripthash: string; diff --git a/packages/blockchain-link/src/workers/electrum/utils/transaction.ts b/packages/blockchain-link/src/workers/electrum/utils/transaction.ts index 6e1feb07d70..d6ac609b584 100644 --- a/packages/blockchain-link/src/workers/electrum/utils/transaction.ts +++ b/packages/blockchain-link/src/workers/electrum/utils/transaction.ts @@ -1,5 +1,4 @@ import { arrayToDictionary, arrayDistinct } from '@trezor/utils'; -import { btcToSat } from './transform'; import type { Transaction as BlockbookTransaction } from '@trezor/blockchain-link-types/src/blockbook'; import type { ElectrumAPI, @@ -10,6 +9,8 @@ import type { HistoryTx, } from '@trezor/blockchain-link-types/src/electrum'; +import { btcToSat } from './transform'; + const transformOpReturn = (hex: string) => { const [, _len, data] = hex.match(/^6a(?:4c)?([0-9a-f]{2})([0-9a-f]*)$/i) ?? []; diff --git a/packages/blockchain-link/src/workers/ripple/index.ts b/packages/blockchain-link/src/workers/ripple/index.ts index 5ee200360e9..57897cfdc2e 100644 --- a/packages/blockchain-link/src/workers/ripple/index.ts +++ b/packages/blockchain-link/src/workers/ripple/index.ts @@ -1,13 +1,15 @@ import { RippleAPI, APIOptions } from 'ripple-lib'; import { RippleError } from 'ripple-lib/dist/npm/common/errors'; + import { BigNumber } from '@trezor/utils/src/bigNumber'; import { CustomError } from '@trezor/blockchain-link-types/src/constants/errors'; import { MESSAGES, RESPONSES } from '@trezor/blockchain-link-types/src/constants'; -import { BaseWorker, CONTEXT, ContextType } from '../baseWorker'; import * as utils from '@trezor/blockchain-link-utils/src/ripple'; import type { Response, SubscriptionAccountInfo, AccountInfo } from '@trezor/blockchain-link-types'; import type * as MessageTypes from '@trezor/blockchain-link-types/src/messages'; +import { BaseWorker, CONTEXT, ContextType } from '../baseWorker'; + type Context = ContextType; type Request = T & Context; diff --git a/packages/blockchain-link/src/workers/solana/fee.ts b/packages/blockchain-link/src/workers/solana/fee.ts index 72c46971abb..dcaa4e6967b 100644 --- a/packages/blockchain-link/src/workers/solana/fee.ts +++ b/packages/blockchain-link/src/workers/solana/fee.ts @@ -1,4 +1,5 @@ import { Connection, Message, PublicKey } from '@solana/web3.js'; + import { BigNumber } from '@trezor/utils/src/bigNumber'; const COMPUTE_BUDGET_PROGRAM_ID = 'ComputeBudget111111111111111111111111111111'; diff --git a/packages/blockchain-link/src/workers/solana/index.ts b/packages/blockchain-link/src/workers/solana/index.ts index f5af3c99202..52a55969eed 100644 --- a/packages/blockchain-link/src/workers/solana/index.ts +++ b/packages/blockchain-link/src/workers/solana/index.ts @@ -1,3 +1,5 @@ +import { Connection, Message, PublicKey, SendTransactionError } from '@solana/web3.js'; + import type { Response, AccountInfo, @@ -13,20 +15,19 @@ import type { } from '@trezor/blockchain-link-types/src/solana'; import type * as MessageTypes from '@trezor/blockchain-link-types/src/messages'; import { CustomError } from '@trezor/blockchain-link-types/src/constants/errors'; -import { BaseWorker, ContextType, CONTEXT } from '../baseWorker'; import { MESSAGES, RESPONSES } from '@trezor/blockchain-link-types/src/constants'; -import { Connection, Message, PublicKey, SendTransactionError } from '@solana/web3.js'; import { solanaUtils } from '@trezor/blockchain-link-utils'; import { createLazy } from '@trezor/utils'; - import { transformTokenInfo, TOKEN_PROGRAM_PUBLIC_KEY, } from '@trezor/blockchain-link-utils/src/solana'; +import { getSuiteVersion } from '@trezor/env-utils'; + import { TOKEN_ACCOUNT_LAYOUT } from './tokenUtils'; import { getBaseFee, getPriorityFee } from './fee'; import { confirmTransactionWithResubmit } from './transactionConfirmation'; -import { getSuiteVersion } from '@trezor/env-utils'; +import { BaseWorker, ContextType, CONTEXT } from '../baseWorker'; export type SolanaAPI = Connection; diff --git a/packages/blockchain-link/tests/integration/blockbook.test.ts b/packages/blockchain-link/tests/integration/blockbook.test.ts index 389a80689d7..4dd92f02049 100644 --- a/packages/blockchain-link/tests/integration/blockbook.test.ts +++ b/packages/blockchain-link/tests/integration/blockbook.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import BlockchainLink from '../../src'; import { // blockbookWorkerFactory, diff --git a/packages/blockchain-link/tests/integration/blockfrost.test.ts b/packages/blockchain-link/tests/integration/blockfrost.test.ts index ddccb1f5e96..9f03bd8f1d7 100644 --- a/packages/blockchain-link/tests/integration/blockfrost.test.ts +++ b/packages/blockchain-link/tests/integration/blockfrost.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import BlockchainLink from '../../src'; import { // blockfrostWorkerFactory, diff --git a/packages/blockchain-link/tests/integration/connection.test.ts b/packages/blockchain-link/tests/integration/connection.test.ts index 40cc1687b6f..ef68ff4137b 100644 --- a/packages/blockchain-link/tests/integration/connection.test.ts +++ b/packages/blockchain-link/tests/integration/connection.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import BlockchainLink from '../../src'; import { // rippleWorkerFactory, diff --git a/packages/blockchain-link/tests/integration/electrum.test.ts b/packages/blockchain-link/tests/integration/electrum.test.ts index d3e927f424d..3781c2fea8f 100644 --- a/packages/blockchain-link/tests/integration/electrum.test.ts +++ b/packages/blockchain-link/tests/integration/electrum.test.ts @@ -1,8 +1,9 @@ -import ElectrumWorker from '../../src/workers/electrum'; import type { Message } from '@trezor/blockchain-link-types/src/messages'; import type { Response } from '@trezor/blockchain-link-types/src/responses'; import { GET_ACCOUNT_INFO, HANDSHAKE } from '@trezor/blockchain-link-types/src/constants/messages'; +import ElectrumWorker from '../../src/workers/electrum'; + const TCP_CONFIG = '127.0.0.1:50001:t'; const NETWORK = 'REGTEST'; diff --git a/packages/blockchain-link/tests/integration/ripple.test.ts b/packages/blockchain-link/tests/integration/ripple.test.ts index 4119cf331bd..c64c807148c 100644 --- a/packages/blockchain-link/tests/integration/ripple.test.ts +++ b/packages/blockchain-link/tests/integration/ripple.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import BlockchainLink from '../../src'; import { // rippleWorkerFactory, diff --git a/packages/blockchain-link/tests/integration/solana.test.ts b/packages/blockchain-link/tests/integration/solana.test.ts index e53444d189d..2752bc95c03 100644 --- a/packages/blockchain-link/tests/integration/solana.test.ts +++ b/packages/blockchain-link/tests/integration/solana.test.ts @@ -1,4 +1,5 @@ import { AccountInfoParams } from '@trezor/blockchain-link-types'; + import BlockchainLink from '../../src'; import SolanaWorker, { SolanaAPI } from '../../src/workers/solana'; diff --git a/packages/blockchain-link/tests/unit/connection.test.ts b/packages/blockchain-link/tests/unit/connection.test.ts index 5c06a7eea2f..86e42eccf9a 100644 --- a/packages/blockchain-link/tests/unit/connection.test.ts +++ b/packages/blockchain-link/tests/unit/connection.test.ts @@ -1,5 +1,6 @@ /* eslint-disable jest/no-jasmine-globals */ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import workers from './worker'; import BlockchainLink from '../../src'; diff --git a/packages/blockchain-link/tests/unit/estimateFee.test.ts b/packages/blockchain-link/tests/unit/estimateFee.test.ts index 57a4b1187fe..db58740a5a5 100644 --- a/packages/blockchain-link/tests/unit/estimateFee.test.ts +++ b/packages/blockchain-link/tests/unit/estimateFee.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import workers from './worker'; import BlockchainLink from '../../src'; import fixtures from './fixtures/estimateFee'; diff --git a/packages/blockchain-link/tests/unit/getAccountInfo.test.ts b/packages/blockchain-link/tests/unit/getAccountInfo.test.ts index 24c1ec08db9..8712a6464a0 100644 --- a/packages/blockchain-link/tests/unit/getAccountInfo.test.ts +++ b/packages/blockchain-link/tests/unit/getAccountInfo.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import workers from './worker'; import BlockchainLink from '../../src'; import fixtures from './fixtures/getAccountInfo'; diff --git a/packages/blockchain-link/tests/unit/getAccountUtxo.test.ts b/packages/blockchain-link/tests/unit/getAccountUtxo.test.ts index 9fb0b3ada3d..500c3f31a1c 100644 --- a/packages/blockchain-link/tests/unit/getAccountUtxo.test.ts +++ b/packages/blockchain-link/tests/unit/getAccountUtxo.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import workers from './worker'; import BlockchainLink from '../../src'; import fixtures from './fixtures/getAccountUtxo'; diff --git a/packages/blockchain-link/tests/unit/getBlockHash.test.ts b/packages/blockchain-link/tests/unit/getBlockHash.test.ts index 347a77615e7..9a63c0873da 100644 --- a/packages/blockchain-link/tests/unit/getBlockHash.test.ts +++ b/packages/blockchain-link/tests/unit/getBlockHash.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import workers from './worker'; import BlockchainLink from '../../src'; import fixtures from './fixtures/getBlockHash'; diff --git a/packages/blockchain-link/tests/unit/getInfo.test.ts b/packages/blockchain-link/tests/unit/getInfo.test.ts index 53b1a2fd85a..f143f1af43c 100644 --- a/packages/blockchain-link/tests/unit/getInfo.test.ts +++ b/packages/blockchain-link/tests/unit/getInfo.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import workers from './worker'; import BlockchainLink from '../../src'; import fixtures from './fixtures/getInfo'; diff --git a/packages/blockchain-link/tests/unit/getTransaction.test.ts b/packages/blockchain-link/tests/unit/getTransaction.test.ts index a821639183c..3aacdca842a 100644 --- a/packages/blockchain-link/tests/unit/getTransaction.test.ts +++ b/packages/blockchain-link/tests/unit/getTransaction.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import workers from './worker'; import BlockchainLink from '../../src'; import fixtures from './fixtures/getTransaction'; diff --git a/packages/blockchain-link/tests/unit/notifications.test.ts b/packages/blockchain-link/tests/unit/notifications.test.ts index b0ecbf1687f..dbab1887fdb 100644 --- a/packages/blockchain-link/tests/unit/notifications.test.ts +++ b/packages/blockchain-link/tests/unit/notifications.test.ts @@ -1,7 +1,7 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import workers from './worker'; import BlockchainLink from '../../src'; - import fixturesBlockbook from './fixtures/notifications-blockbook'; import fixturesRipple from './fixtures/notifications-ripple'; import fixturesBlockfrost from './fixtures/notifications-blockfrost'; diff --git a/packages/blockchain-link/tests/unit/pushTransaction.test.ts b/packages/blockchain-link/tests/unit/pushTransaction.test.ts index 0b58302d260..c27b934611d 100644 --- a/packages/blockchain-link/tests/unit/pushTransaction.test.ts +++ b/packages/blockchain-link/tests/unit/pushTransaction.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import workers from './worker'; import BlockchainLink from '../../src'; import fixtures from './fixtures/pushTransaction'; diff --git a/packages/blockchain-link/tests/unit/subscribe.test.ts b/packages/blockchain-link/tests/unit/subscribe.test.ts index 83db8ed478f..66d6051a46d 100644 --- a/packages/blockchain-link/tests/unit/subscribe.test.ts +++ b/packages/blockchain-link/tests/unit/subscribe.test.ts @@ -1,4 +1,5 @@ import { BackendWebsocketServerMock } from '@trezor/e2e-utils'; + import workers from './worker'; import BlockchainLink from '../../src'; import fixtures from './fixtures/subscribe'; diff --git a/packages/blockchain-link/tests/unit/utils.test.ts b/packages/blockchain-link/tests/unit/utils.test.ts index b8e3eba9cfc..a294210a0c1 100644 --- a/packages/blockchain-link/tests/unit/utils.test.ts +++ b/packages/blockchain-link/tests/unit/utils.test.ts @@ -1,5 +1,4 @@ import { prioritizeEndpoints } from '../../src/workers/utils'; - import * as fixtures from './fixtures/utils'; describe('prioritizeEndpoints', () => { diff --git a/packages/blockchain-link/tests/unit/workers.test.ts b/packages/blockchain-link/tests/unit/workers.test.ts index 34cebbcb12e..da4203a36fe 100644 --- a/packages/blockchain-link/tests/unit/workers.test.ts +++ b/packages/blockchain-link/tests/unit/workers.test.ts @@ -1,5 +1,6 @@ /* eslint-disable jest/no-jasmine-globals */ import TinyWorker from 'tiny-worker'; + import BlockchainLink from '../../src'; class BaseMockWorker { diff --git a/packages/blockchain-link/webpack/dev.js b/packages/blockchain-link/webpack/dev.js index ff811e42dd4..94f0f2d8286 100644 --- a/packages/blockchain-link/webpack/dev.js +++ b/packages/blockchain-link/webpack/dev.js @@ -1,5 +1,6 @@ const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); + const { SRC, BUILD, PORT } = require('./constants'); module.exports = { diff --git a/packages/blockchain-link/webpack/workers.web.js b/packages/blockchain-link/webpack/workers.web.js index bb8b9594a77..4197bfb4ada 100644 --- a/packages/blockchain-link/webpack/workers.web.js +++ b/packages/blockchain-link/webpack/workers.web.js @@ -1,4 +1,5 @@ const webpack = require('webpack'); + const { SRC, BUILD } = require('./constants'); module.exports = { diff --git a/packages/components/src/components/AssetLogo/AssetInitials.tsx b/packages/components/src/components/AssetLogo/AssetInitials.tsx index 6f5ebdb48d5..23ff3f25efe 100644 --- a/packages/components/src/components/AssetLogo/AssetInitials.tsx +++ b/packages/components/src/components/AssetLogo/AssetInitials.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components'; -import { ElevationUp, useElevation } from '../ElevationContext/ElevationContext'; + import { borders, Elevation, @@ -7,6 +7,8 @@ import { mapElevationToBorder, spacingsPx, } from '@trezor/theme'; + +import { ElevationUp, useElevation } from '../ElevationContext/ElevationContext'; import { Text } from '../typography/Text/Text'; import { Tooltip } from '../Tooltip/Tooltip'; diff --git a/packages/components/src/components/AssetLogo/AssetLogo.tsx b/packages/components/src/components/AssetLogo/AssetLogo.tsx index ec97026763c..c515cedd030 100644 --- a/packages/components/src/components/AssetLogo/AssetLogo.tsx +++ b/packages/components/src/components/AssetLogo/AssetLogo.tsx @@ -1,14 +1,16 @@ +import { useEffect, useState } from 'react'; + +import styled from 'styled-components'; + +import { borders, Elevation, mapElevationToBackground, mapElevationToBorder } from '@trezor/theme'; +import { getAssetLogoUrl } from '@trezor/asset-utils'; + import { FrameProps, FramePropsKeys, pickAndPrepareFrameProps, withFrameProps, } from '../../utils/frameProps'; -import { useEffect, useState } from 'react'; -import styled from 'styled-components'; -import { borders, Elevation, mapElevationToBackground, mapElevationToBorder } from '@trezor/theme'; -import { getAssetLogoUrl } from '@trezor/asset-utils'; - import { AssetInitials } from './AssetInitials'; import { TransientProps } from '../../utils/transientProps'; import { ElevationUp, useElevation } from '../ElevationContext/ElevationContext'; diff --git a/packages/components/src/components/AutoScalingInput/AutoScalingInput.stories.tsx b/packages/components/src/components/AutoScalingInput/AutoScalingInput.stories.tsx index c6f5a269363..d8cd47f8067 100644 --- a/packages/components/src/components/AutoScalingInput/AutoScalingInput.stories.tsx +++ b/packages/components/src/components/AutoScalingInput/AutoScalingInput.stories.tsx @@ -1,7 +1,9 @@ import { ForwardRefExoticComponent, RefAttributes } from 'react'; -import { AutoScalingInput as AutoScalingInputComponent, Props } from './AutoScalingInput'; + import { Meta, StoryObj } from '@storybook/react'; +import { AutoScalingInput as AutoScalingInputComponent, Props } from './AutoScalingInput'; + const meta: Meta = { title: 'Form/AutoScalingInput', component: AutoScalingInputComponent, diff --git a/packages/components/src/components/AutoScalingInput/AutoScalingInput.tsx b/packages/components/src/components/AutoScalingInput/AutoScalingInput.tsx index 72e940cc7f0..402af20f113 100644 --- a/packages/components/src/components/AutoScalingInput/AutoScalingInput.tsx +++ b/packages/components/src/components/AutoScalingInput/AutoScalingInput.tsx @@ -1,4 +1,5 @@ import React, { useRef, useEffect, forwardRef, useState, ChangeEvent, useCallback } from 'react'; + import styled from 'styled-components'; const HiddenInputToMeasurePlaceholderScrollableWidth = styled.input` diff --git a/packages/components/src/components/AutoScalingInput/AutoScalingInputExamples.stories.tsx b/packages/components/src/components/AutoScalingInput/AutoScalingInputExamples.stories.tsx index 480071c9b3c..1159d3d20a4 100644 --- a/packages/components/src/components/AutoScalingInput/AutoScalingInputExamples.stories.tsx +++ b/packages/components/src/components/AutoScalingInput/AutoScalingInputExamples.stories.tsx @@ -1,7 +1,8 @@ import styled from 'styled-components'; -import { AutoScalingInput as Input } from './AutoScalingInput'; import { Meta } from '@storybook/react'; +import { AutoScalingInput as Input } from './AutoScalingInput'; + const Wrapper = styled.div` display: flex; flex: 1; diff --git a/packages/components/src/components/Badge/Badge.stories.tsx b/packages/components/src/components/Badge/Badge.stories.tsx index c97522f92b0..38b0bb26787 100644 --- a/packages/components/src/components/Badge/Badge.stories.tsx +++ b/packages/components/src/components/Badge/Badge.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Badge as BadgeComponent, BadgeProps, allowedBadgeFrameProps, badgeSizes } from './Badge'; import { getFramePropsStory } from '../../utils/frameProps'; diff --git a/packages/components/src/components/Badge/Badge.tsx b/packages/components/src/components/Badge/Badge.tsx index 491867c8fc4..856c27264a3 100644 --- a/packages/components/src/components/Badge/Badge.tsx +++ b/packages/components/src/components/Badge/Badge.tsx @@ -1,6 +1,9 @@ import React from 'react'; + import styled, { css, DefaultTheme, useTheme } from 'styled-components'; + import { borders, Color, CSSColor, spacings, spacingsPx, typography } from '@trezor/theme'; + import { focusStyleTransition, getFocusShadowStyle } from '../../utils/utils'; import type { UISize, UIVariant } from '../../config/types'; import { diff --git a/packages/components/src/components/Banner/Banner.stories.tsx b/packages/components/src/components/Banner/Banner.stories.tsx index 534aee0e7c9..3349a7f91ef 100644 --- a/packages/components/src/components/Banner/Banner.stories.tsx +++ b/packages/components/src/components/Banner/Banner.stories.tsx @@ -1,7 +1,8 @@ import { Meta, StoryObj } from '@storybook/react'; +import styled from 'styled-components'; + import { Banner as BannerComponent, BannerProps, variables, Row } from '../../index'; import { allowedBannerFrameProps } from './Banner'; -import styled from 'styled-components'; import { getFramePropsStory } from '../../utils/frameProps'; const Wrapper = styled.div` diff --git a/packages/components/src/components/Banner/Banner.tsx b/packages/components/src/components/Banner/Banner.tsx index 9d3ddf5eddd..721bbec2fe1 100755 --- a/packages/components/src/components/Banner/Banner.tsx +++ b/packages/components/src/components/Banner/Banner.tsx @@ -1,7 +1,7 @@ import { ReactNode } from 'react'; + import styled, { css, DefaultTheme, useTheme } from 'styled-components'; -import { variables } from '../../config'; import { Elevation, borders, spacingsPx, typography, spacings } from '@trezor/theme'; import { FrameProps, @@ -26,6 +26,7 @@ import { TransientProps } from '../../utils/transientProps'; import { useMediaQuery } from '../../utils/useMediaQuery'; import { useElevation } from '../ElevationContext/ElevationContext'; import { Column, Row } from '../Flex/Flex'; +import { variables } from '../../config'; export const allowedBannerFrameProps = ['margin'] as const satisfies FramePropsKeys[]; type AllowedFrameProps = Pick; diff --git a/packages/components/src/components/Banner/BannerContext.ts b/packages/components/src/components/Banner/BannerContext.ts index cddde230cc2..58ba257eded 100644 --- a/packages/components/src/components/Banner/BannerContext.ts +++ b/packages/components/src/components/Banner/BannerContext.ts @@ -1,4 +1,5 @@ import { createContext, useContext } from 'react'; + import { BannerVariant } from './types'; export const BannerContext = createContext<{ diff --git a/packages/components/src/components/Banner/utils.tsx b/packages/components/src/components/Banner/utils.tsx index ded9531ee3d..ea4165229d4 100644 --- a/packages/components/src/components/Banner/utils.tsx +++ b/packages/components/src/components/Banner/utils.tsx @@ -1,6 +1,8 @@ +import { DefaultTheme } from 'styled-components'; + import { Color, CSSColor, Elevation, mapElevationToBackgroundToken } from '@trezor/theme'; + import { BannerVariant } from './types'; -import { DefaultTheme } from 'styled-components'; import { IconName } from '../Icon/Icon'; type MapArgs = { diff --git a/packages/components/src/components/Card/Card.stories.tsx b/packages/components/src/components/Card/Card.stories.tsx index 1d430859b2d..46d13292a32 100644 --- a/packages/components/src/components/Card/Card.stories.tsx +++ b/packages/components/src/components/Card/Card.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Card as CardComponent, allowedCardFrameProps } from './Card'; import { paddingTypes, fillTypes } from './types'; import { getFramePropsStory } from '../../utils/frameProps'; diff --git a/packages/components/src/components/Card/utils.tsx b/packages/components/src/components/Card/utils.tsx index e0e39cd7659..7ab24439420 100644 --- a/packages/components/src/components/Card/utils.tsx +++ b/packages/components/src/components/Card/utils.tsx @@ -1,3 +1,5 @@ +import { css, DefaultTheme, RuleSet } from 'styled-components'; + import { spacingsPx, Elevation, @@ -5,7 +7,7 @@ import { mapElevationToBorder, SpacingPxValues, } from '@trezor/theme'; -import { css, DefaultTheme, RuleSet } from 'styled-components'; + import { PaddingType, FillType } from './types'; type PaddingMapArgs = { diff --git a/packages/components/src/components/CollapsibleBox/CollapsibleBox.tsx b/packages/components/src/components/CollapsibleBox/CollapsibleBox.tsx index ecc7b8d550d..335da570caa 100644 --- a/packages/components/src/components/CollapsibleBox/CollapsibleBox.tsx +++ b/packages/components/src/components/CollapsibleBox/CollapsibleBox.tsx @@ -1,6 +1,8 @@ import { useState, ReactNode, MouseEvent } from 'react'; + import { motion } from 'framer-motion'; import styled, { css } from 'styled-components'; + import { spacingsPx, borders, @@ -9,6 +11,7 @@ import { mapElevationToBorder, spacings, } from '@trezor/theme'; + import { Icon } from '../Icon/Icon'; import { Row, Column } from '../Flex/Flex'; import { Text } from '../typography/Text/Text'; diff --git a/packages/components/src/components/CollapsibleBox/utils.tsx b/packages/components/src/components/CollapsibleBox/utils.tsx index 6691b9a7b68..4d107dfb60b 100644 --- a/packages/components/src/components/CollapsibleBox/utils.tsx +++ b/packages/components/src/components/CollapsibleBox/utils.tsx @@ -1,4 +1,5 @@ import { spacingsPx, TypographyStyle } from '@trezor/theme'; + import { HeadingSize, PaddingType } from './types'; import { IconSize } from '../Icon/Icon'; diff --git a/packages/components/src/components/ComponentWithSubIcon/ComponentWithSubIcon.stories.tsx b/packages/components/src/components/ComponentWithSubIcon/ComponentWithSubIcon.stories.tsx index 6cc42af8c57..74c18b1bf77 100644 --- a/packages/components/src/components/ComponentWithSubIcon/ComponentWithSubIcon.stories.tsx +++ b/packages/components/src/components/ComponentWithSubIcon/ComponentWithSubIcon.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Icon, iconVariants } from '../Icon/Icon'; import { allowedComponentWithSubIconFrameProps, diff --git a/packages/components/src/components/ComponentWithSubIcon/ComponentWithSubIcon.tsx b/packages/components/src/components/ComponentWithSubIcon/ComponentWithSubIcon.tsx index 32125d7d71f..632436ff1db 100644 --- a/packages/components/src/components/ComponentWithSubIcon/ComponentWithSubIcon.tsx +++ b/packages/components/src/components/ComponentWithSubIcon/ComponentWithSubIcon.tsx @@ -1,4 +1,9 @@ +import { ReactNode } from 'react'; + import styled, { useTheme } from 'styled-components'; + +import { borders, spacingsPx } from '@trezor/theme'; + import { ExclusiveColorOrVariant, getColorForIconVariant, @@ -6,9 +11,7 @@ import { Icon, IconProps, } from '../Icon/Icon'; -import { borders, spacingsPx } from '@trezor/theme'; import { TransientProps } from '../../utils/transientProps'; -import { ReactNode } from 'react'; import { FramePropsKeys, FrameProps, diff --git a/packages/components/src/components/DataAnalytics.tsx b/packages/components/src/components/DataAnalytics.tsx index 665c8c2ee05..ba6afe52835 100644 --- a/packages/components/src/components/DataAnalytics.tsx +++ b/packages/components/src/components/DataAnalytics.tsx @@ -1,13 +1,16 @@ import { Fragment, useState, ReactNode } from 'react'; +import { FormattedMessage } from 'react-intl'; + import styled from 'styled-components'; -import { FormattedMessage } from 'react-intl'; +import { spacingsPx } from '@trezor/theme'; + import { variables } from '../config'; import { Button } from './buttons/Button/Button'; import { CollapsibleBox } from './CollapsibleBox/CollapsibleBox'; import { Card } from './Card/Card'; import { Switch } from './form/Switch/Switch'; -import { spacingsPx } from '@trezor/theme'; + const Wrapper = styled.div` display: flex; diff --git a/packages/components/src/components/Divider/Divider.stories.tsx b/packages/components/src/components/Divider/Divider.stories.tsx index a7fd9b8bfbe..41faa6ccc28 100644 --- a/packages/components/src/components/Divider/Divider.stories.tsx +++ b/packages/components/src/components/Divider/Divider.stories.tsx @@ -1,6 +1,7 @@ import { Meta, StoryObj } from '@storybook/react'; -import { Divider as DividerComponent, allowedDividerFrameProps } from './Divider'; import styled from 'styled-components'; + +import { Divider as DividerComponent, allowedDividerFrameProps } from './Divider'; import { getFramePropsStory } from '../../utils/frameProps'; const Container = styled.div` diff --git a/packages/components/src/components/Dropdown/Dropdown.stories.tsx b/packages/components/src/components/Dropdown/Dropdown.stories.tsx index f5b6becf2ed..97f48f9b6ad 100644 --- a/packages/components/src/components/Dropdown/Dropdown.stories.tsx +++ b/packages/components/src/components/Dropdown/Dropdown.stories.tsx @@ -1,6 +1,8 @@ import React from 'react'; + import styled from 'styled-components'; import { Meta, StoryObj } from '@storybook/react'; + import { Dropdown as DropdownComponent, DropdownProps } from './Dropdown'; const Center = styled.div` diff --git a/packages/components/src/components/Dropdown/Dropdown.tsx b/packages/components/src/components/Dropdown/Dropdown.tsx index 275339e2785..e39dcb76f10 100644 --- a/packages/components/src/components/Dropdown/Dropdown.tsx +++ b/packages/components/src/components/Dropdown/Dropdown.tsx @@ -11,8 +11,11 @@ import { useEffect, } from 'react'; import { createPortal } from 'react-dom'; + import styled from 'styled-components'; + import { useOnClickOutside } from '@trezor/react-utils'; + import { Menu, MenuProps, DropdownMenuItemProps } from './Menu'; import { Coords, getAdjustedCoords } from './getAdjustedCoords'; import { IconButton } from '../buttons/IconButton/IconButton'; diff --git a/packages/components/src/components/Dropdown/Menu.tsx b/packages/components/src/components/Dropdown/Menu.tsx index 646fc96df97..9cc52796f3e 100644 --- a/packages/components/src/components/Dropdown/Menu.tsx +++ b/packages/components/src/components/Dropdown/Menu.tsx @@ -1,5 +1,7 @@ import React, { forwardRef, useEffect, useState } from 'react'; + import styled, { css, keyframes, useTheme } from 'styled-components'; + import { borders, spacings, @@ -9,6 +11,7 @@ import { mapElevationToBackground, nextElevation, } from '@trezor/theme'; + import type { Coords } from './getAdjustedCoords'; import { menuStyle } from './menuStyle'; import { useElevation } from '../ElevationContext/ElevationContext'; diff --git a/packages/components/src/components/Dropdown/menuStyle.ts b/packages/components/src/components/Dropdown/menuStyle.ts index 773550a5db5..4d9bcf01b61 100644 --- a/packages/components/src/components/Dropdown/menuStyle.ts +++ b/packages/components/src/components/Dropdown/menuStyle.ts @@ -1,4 +1,5 @@ import { css, keyframes } from 'styled-components'; + import { spacingsPx, borders, diff --git a/packages/components/src/components/ElevationContext/ElevationContext.stories.tsx b/packages/components/src/components/ElevationContext/ElevationContext.stories.tsx index 859b816350b..129ace1de78 100644 --- a/packages/components/src/components/ElevationContext/ElevationContext.stories.tsx +++ b/packages/components/src/components/ElevationContext/ElevationContext.stories.tsx @@ -1,7 +1,18 @@ +import { ReactNode } from 'react'; + import { Meta, StoryObj } from '@storybook/react'; +import styled from 'styled-components'; + +import { + Elevation, + borders, + mapElevationToBackground, + mapElevationToBorder, + spacingsPx, +} from '@trezor/theme'; + import { Card } from '../Card/Card'; import { Modal } from '../modals/Modal/Modal'; -import styled from 'styled-components'; import { Textarea } from '../form/Textarea/Textarea'; import { useElevation, @@ -9,14 +20,7 @@ import { ElevationDown, ElevationUp, } from './ElevationContext'; -import { - Elevation, - borders, - mapElevationToBackground, - mapElevationToBorder, - spacingsPx, -} from '@trezor/theme'; -import { ReactNode } from 'react'; + const UiBox = styled.div<{ $elevation: Elevation }>` background-color: ${mapElevationToBackground}; diff --git a/packages/components/src/components/ElevationContext/ElevationContext.tsx b/packages/components/src/components/ElevationContext/ElevationContext.tsx index cea2ee7011b..291f5834c68 100644 --- a/packages/components/src/components/ElevationContext/ElevationContext.tsx +++ b/packages/components/src/components/ElevationContext/ElevationContext.tsx @@ -1,7 +1,9 @@ -import { Elevation, nextElevation, prevElevation } from '@trezor/theme'; import { ReactNode, createContext, useContext, useMemo } from 'react'; + import styled from 'styled-components'; +import { Elevation, nextElevation, prevElevation } from '@trezor/theme'; + const DEBUG = false; const ElevationReactContext = createContext<{ diff --git a/packages/components/src/components/Flag/Flag.stories.tsx b/packages/components/src/components/Flag/Flag.stories.tsx index 603200398d0..ee375c2fccf 100644 --- a/packages/components/src/components/Flag/Flag.stories.tsx +++ b/packages/components/src/components/Flag/Flag.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Flag as FlagComponent } from './Flag'; const meta: Meta = { diff --git a/packages/components/src/components/Flag/Flag.tsx b/packages/components/src/components/Flag/Flag.tsx index f0b2e7c4564..393f1000648 100644 --- a/packages/components/src/components/Flag/Flag.tsx +++ b/packages/components/src/components/Flag/Flag.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { FLAGS } from './flags'; export type FlagType = keyof typeof FLAGS; diff --git a/packages/components/src/components/Flex/Flex.stories.tsx b/packages/components/src/components/Flex/Flex.stories.tsx index 80e4a22729d..c21449141d8 100644 --- a/packages/components/src/components/Flex/Flex.stories.tsx +++ b/packages/components/src/components/Flex/Flex.stories.tsx @@ -1,4 +1,8 @@ import { ArgTypes, Meta, StoryObj } from '@storybook/react'; +import styled from 'styled-components'; + +import { spacings } from '@trezor/theme'; + import { FlexProps, flexAlignItems, @@ -8,8 +12,6 @@ import { Column as ColumnComponent, allowedFlexFrameProps, } from './Flex'; -import { spacings } from '@trezor/theme'; -import styled from 'styled-components'; import { getFramePropsStory } from '../../utils/frameProps'; const Container = styled.div` diff --git a/packages/components/src/components/Flex/Flex.tsx b/packages/components/src/components/Flex/Flex.tsx index 8cb1801ed44..4634fe219cc 100644 --- a/packages/components/src/components/Flex/Flex.tsx +++ b/packages/components/src/components/Flex/Flex.tsx @@ -1,5 +1,9 @@ -import { Elevation, mapElevationToBorder, SpacingValues } from '@trezor/theme'; +import React from 'react'; + import styled, { css, DefaultTheme } from 'styled-components'; + +import { Elevation, mapElevationToBorder, SpacingValues } from '@trezor/theme'; + import { FrameProps, FramePropsKeys, @@ -8,7 +12,7 @@ import { } from '../../utils/frameProps'; import { makePropsTransient, TransientProps } from '../../utils/transientProps'; import { useElevation } from '../ElevationContext/ElevationContext'; -import React from 'react'; + export const allowedFlexFrameProps = [ 'margin', diff --git a/packages/components/src/components/GradientOverlay/GradientOverlay.stories.tsx b/packages/components/src/components/GradientOverlay/GradientOverlay.stories.tsx index db8cc9b3416..2d7eda6a8f5 100644 --- a/packages/components/src/components/GradientOverlay/GradientOverlay.stories.tsx +++ b/packages/components/src/components/GradientOverlay/GradientOverlay.stories.tsx @@ -1,9 +1,10 @@ import { Meta, StoryObj } from '@storybook/react'; +import styled from 'styled-components'; + import { GradientOverlay as GradientOverlayComponent, GradientOverlayProps, } from './GradientOverlay'; -import styled from 'styled-components'; import { Card } from '../Card/Card'; import { ElevationContext } from '../ElevationContext/ElevationContext'; diff --git a/packages/components/src/components/GradientOverlay/GradientOverlay.tsx b/packages/components/src/components/GradientOverlay/GradientOverlay.tsx index b399bb68c51..f0d0c8874b5 100644 --- a/packages/components/src/components/GradientOverlay/GradientOverlay.tsx +++ b/packages/components/src/components/GradientOverlay/GradientOverlay.tsx @@ -1,5 +1,7 @@ -import { Elevation, mapElevationToBackground } from '@trezor/theme'; import styled from 'styled-components'; + +import { Elevation, mapElevationToBackground } from '@trezor/theme'; + import { useElevation } from '../ElevationContext/ElevationContext'; export interface GradientOverlayProps { diff --git a/packages/components/src/components/Grid/Grid.stories.tsx b/packages/components/src/components/Grid/Grid.stories.tsx index bc4c60cc523..774808462d6 100644 --- a/packages/components/src/components/Grid/Grid.stories.tsx +++ b/packages/components/src/components/Grid/Grid.stories.tsx @@ -1,7 +1,9 @@ import { ArgTypes, Meta, StoryObj } from '@storybook/react'; -import { GridProps, Grid as GridComponent, allowedGridFrameProps } from './Grid'; -import { spacings } from '@trezor/theme'; import styled from 'styled-components'; + +import { spacings } from '@trezor/theme'; + +import { GridProps, Grid as GridComponent, allowedGridFrameProps } from './Grid'; import { getFramePropsStory } from '../../utils/frameProps'; const Container = styled.div` diff --git a/packages/components/src/components/Grid/Grid.tsx b/packages/components/src/components/Grid/Grid.tsx index 26cbf3a1093..27d3a24a606 100644 --- a/packages/components/src/components/Grid/Grid.tsx +++ b/packages/components/src/components/Grid/Grid.tsx @@ -1,5 +1,7 @@ -import { SpacingValues } from '@trezor/theme'; import styled from 'styled-components'; + +import { SpacingValues } from '@trezor/theme'; + import { FrameProps, FramePropsKeys, withFrameProps } from '../../utils/frameProps'; import { makePropsTransient, TransientProps } from '../../utils/transientProps'; diff --git a/packages/components/src/components/HotkeyBadge/HotkeyBadge.stories.tsx b/packages/components/src/components/HotkeyBadge/HotkeyBadge.stories.tsx index 42e43595f90..90e3ad32595 100644 --- a/packages/components/src/components/HotkeyBadge/HotkeyBadge.stories.tsx +++ b/packages/components/src/components/HotkeyBadge/HotkeyBadge.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { HotkeyBadge as HotkeyBadgeComponent, HotkeyBadgeProps } from './HotkeyBadge'; const meta: Meta = { diff --git a/packages/components/src/components/HotkeyBadge/HotkeyBadge.tsx b/packages/components/src/components/HotkeyBadge/HotkeyBadge.tsx index 19ebd53f4a0..c1b6322dd05 100644 --- a/packages/components/src/components/HotkeyBadge/HotkeyBadge.tsx +++ b/packages/components/src/components/HotkeyBadge/HotkeyBadge.tsx @@ -1,3 +1,7 @@ +import { Fragment } from 'react'; + +import styled from 'styled-components'; + import { Elevation, borders, @@ -5,10 +9,10 @@ import { spacingsPx, typography, } from '@trezor/theme'; -import styled from 'styled-components'; + import { ElevationDown, useElevation } from '../ElevationContext/ElevationContext'; import { Keys, keyboardKeys } from './keyboardKeys'; -import { Fragment } from 'react'; + export const Container = styled.div<{ $elevation: Elevation; $isActive: boolean }>` display: flex; diff --git a/packages/components/src/components/Icon/Icon.stories.tsx b/packages/components/src/components/Icon/Icon.stories.tsx index faf61f9ec37..7c9d2518b41 100644 --- a/packages/components/src/components/Icon/Icon.stories.tsx +++ b/packages/components/src/components/Icon/Icon.stories.tsx @@ -1,4 +1,11 @@ import { Meta, StoryObj } from '@storybook/react'; + +import { IconName, icons } from '@suite-common/icons/src/icons'; +import { + icons as iconsDeprecated, + IconName as IconNameDeprecated, +} from '@suite-common/icons-deprecated'; + import { allowedIconFrameProps, Icon as IconComponent, @@ -6,11 +13,6 @@ import { iconVariants, iconSizes, } from './Icon'; -import { IconName, icons } from '@suite-common/icons/src/icons'; -import { - icons as iconsDeprecated, - IconName as IconNameDeprecated, -} from '@suite-common/icons-deprecated'; import { getFramePropsStory } from '../../utils/frameProps'; const meta: Meta = { diff --git a/packages/components/src/components/Icon/Icon.tsx b/packages/components/src/components/Icon/Icon.tsx index 12b882166c8..48da5a049ee 100644 --- a/packages/components/src/components/Icon/Icon.tsx +++ b/packages/components/src/components/Icon/Icon.tsx @@ -2,6 +2,7 @@ import { ReactSVG } from 'react-svg'; import { forwardRef, MouseEvent, Ref } from 'react'; import styled, { css, DefaultTheme } from 'styled-components'; + import { icons as iconsDeprecated, IconName as IconNameDeprecated, diff --git a/packages/components/src/components/Icon/icons.stories.tsx b/packages/components/src/components/Icon/icons.stories.tsx index 76bf4a2feeb..7232aafdd6a 100644 --- a/packages/components/src/components/Icon/icons.stories.tsx +++ b/packages/components/src/components/Icon/icons.stories.tsx @@ -1,11 +1,8 @@ import React, { useState } from 'react'; + import styled, { useTheme } from 'styled-components'; import { Meta, StoryObj } from '@storybook/react'; -import { Icon, IconProps, allowedIconFrameProps, iconVariants, iconSizes } from './Icon'; -import { getFramePropsStory } from '../../utils/frameProps'; -import { Input } from '../form/Input/Input'; -import { Checkbox } from '../form/Checkbox/Checkbox'; -import { Text } from '../typography/Text/Text'; + import { typography } from '@trezor/theme'; import { icons, IconName } from '@suite-common/icons/src/icons'; import { @@ -13,6 +10,12 @@ import { IconName as IconNameDeprecated, } from '@suite-common/icons-deprecated'; +import { Icon, IconProps, allowedIconFrameProps, iconVariants, iconSizes } from './Icon'; +import { getFramePropsStory } from '../../utils/frameProps'; +import { Input } from '../form/Input/Input'; +import { Checkbox } from '../form/Checkbox/Checkbox'; +import { Text } from '../typography/Text/Text'; + const CopiedText = styled.div` display: flex; justify-content: center; diff --git a/packages/components/src/components/IconCircle/IconCircle.stories.tsx b/packages/components/src/components/IconCircle/IconCircle.stories.tsx index d966a91f53d..d20b670aa83 100644 --- a/packages/components/src/components/IconCircle/IconCircle.stories.tsx +++ b/packages/components/src/components/IconCircle/IconCircle.stories.tsx @@ -1,5 +1,7 @@ import React from 'react'; + import { Meta, StoryObj } from '@storybook/react'; + import { icons, IconName } from '@suite-common/icons/src/icons'; import { diff --git a/packages/components/src/components/IconCircle/types.tsx b/packages/components/src/components/IconCircle/types.tsx index 62d00ad7b82..c813c094a60 100644 --- a/packages/components/src/components/IconCircle/types.tsx +++ b/packages/components/src/components/IconCircle/types.tsx @@ -1,6 +1,7 @@ -import { UIVariant } from '../../config/types'; import { CSSColor } from '@trezor/theme'; +import { UIVariant } from '../../config/types'; + export const iconCircleVariants = [ 'primary', 'warning', diff --git a/packages/components/src/components/IconCircle/utils.tsx b/packages/components/src/components/IconCircle/utils.tsx index cc49d8347e7..2e2358bc032 100644 --- a/packages/components/src/components/IconCircle/utils.tsx +++ b/packages/components/src/components/IconCircle/utils.tsx @@ -1,6 +1,8 @@ +import { DefaultTheme } from 'styled-components'; + import { Color, CSSColor } from '@trezor/theme'; + import { IconCircleVariant, IconCircleExclusiveColorOrVariant } from './types'; -import { DefaultTheme } from 'styled-components'; import { TransientProps } from '../../utils/transientProps'; type MapArgs = { diff --git a/packages/components/src/components/Image/Image.stories.tsx b/packages/components/src/components/Image/Image.stories.tsx index c596964890c..21dd8faf331 100644 --- a/packages/components/src/components/Image/Image.stories.tsx +++ b/packages/components/src/components/Image/Image.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Image as ImageComponent, ImageProps } from './Image'; import { PNG_IMAGES, SVG_IMAGES } from './images'; diff --git a/packages/components/src/components/Image/Image.tsx b/packages/components/src/components/Image/Image.tsx index 4cbc1ff2695..c8b29cc4691 100644 --- a/packages/components/src/components/Image/Image.tsx +++ b/packages/components/src/components/Image/Image.tsx @@ -1,5 +1,7 @@ import { ImgHTMLAttributes } from 'react'; + import styled from 'styled-components'; + import { PngImage, SvgImage, PNG_IMAGES, SVG_IMAGES } from './images'; import { resolveStaticPath } from '../../utils/resolveStaticPath'; diff --git a/packages/components/src/components/InfoRow/InfoRow.stories.tsx b/packages/components/src/components/InfoRow/InfoRow.stories.tsx index 136c9705431..ec339c91557 100644 --- a/packages/components/src/components/InfoRow/InfoRow.stories.tsx +++ b/packages/components/src/components/InfoRow/InfoRow.stories.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import { Meta, StoryObj } from '@storybook/react'; import { diff --git a/packages/components/src/components/InfoRow/InfoRow.tsx b/packages/components/src/components/InfoRow/InfoRow.tsx index 73e3a4cf32d..1b3023fb2c8 100644 --- a/packages/components/src/components/InfoRow/InfoRow.tsx +++ b/packages/components/src/components/InfoRow/InfoRow.tsx @@ -1,6 +1,9 @@ import { ReactNode } from 'react'; -import { spacings } from '@trezor/theme'; + import styled from 'styled-components'; + +import { spacings } from '@trezor/theme'; + import { FrameProps, FramePropsKeys, diff --git a/packages/components/src/components/List/List.stories.tsx b/packages/components/src/components/List/List.stories.tsx index 4f08099bfef..9d809b6ce98 100644 --- a/packages/components/src/components/List/List.stories.tsx +++ b/packages/components/src/components/List/List.stories.tsx @@ -1,7 +1,9 @@ import React from 'react'; + import { Meta, StoryObj } from '@storybook/react'; import { spacings } from '@trezor/theme'; + import { Icon } from '../Icon/Icon'; import { List as ListComponent, diff --git a/packages/components/src/components/List/List.tsx b/packages/components/src/components/List/List.tsx index 60bac4d42c7..232630cb65a 100644 --- a/packages/components/src/components/List/List.tsx +++ b/packages/components/src/components/List/List.tsx @@ -1,7 +1,9 @@ import { createContext, useContext } from 'react'; -import { spacings, SpacingValues } from '@trezor/theme'; import styled from 'styled-components'; + +import { spacings, SpacingValues } from '@trezor/theme'; + import { FrameProps, FramePropsKeys, diff --git a/packages/components/src/components/List/ListItem.tsx b/packages/components/src/components/List/ListItem.tsx index 638d0832dda..55aa6342a16 100644 --- a/packages/components/src/components/List/ListItem.tsx +++ b/packages/components/src/components/List/ListItem.tsx @@ -1,6 +1,9 @@ import { useEffect, useRef } from 'react'; -import { SpacingValues, spacingsPx, borders } from '@trezor/theme'; + import styled, { css } from 'styled-components'; + +import { SpacingValues, spacingsPx, borders } from '@trezor/theme'; + import { FlexAlignItems } from '../Flex/Flex'; import { useList, BulletVerticalAlignment } from './List'; diff --git a/packages/components/src/components/Markdown/Markdown.stories.tsx b/packages/components/src/components/Markdown/Markdown.stories.tsx index e845eeb37c7..0c41f39734a 100644 --- a/packages/components/src/components/Markdown/Markdown.stories.tsx +++ b/packages/components/src/components/Markdown/Markdown.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Markdown as MarkdownComponent } from './Markdown'; const meta: Meta = { diff --git a/packages/components/src/components/Markdown/Markdown.tsx b/packages/components/src/components/Markdown/Markdown.tsx index 67cb605bd47..c898c62756c 100644 --- a/packages/components/src/components/Markdown/Markdown.tsx +++ b/packages/components/src/components/Markdown/Markdown.tsx @@ -1,9 +1,12 @@ +import ReactMarkdown, { Options } from 'react-markdown'; + import styled from 'styled-components'; -import ReactMarkdown, { Options } from 'react-markdown'; -import { variables } from '../../config'; import { typography } from '@trezor/theme'; +import { variables } from '../../config'; + + const StyledMarkdown = styled.div` ${typography.hint} diff --git a/packages/components/src/components/NewModal/NewModal.stories.tsx b/packages/components/src/components/NewModal/NewModal.stories.tsx index 3434e955672..3da32c7bfcf 100644 --- a/packages/components/src/components/NewModal/NewModal.stories.tsx +++ b/packages/components/src/components/NewModal/NewModal.stories.tsx @@ -1,5 +1,7 @@ import { Meta, StoryObj } from '@storybook/react'; import { action } from '@storybook/addon-actions'; +import { ThemeProvider } from 'styled-components'; + import { allowedNewModalFrameProps, NewModal as ModalComponent, @@ -9,7 +11,6 @@ import { IconCircle, } from '../../index'; import { newModalVariants, newModalSizes } from './types'; -import { ThemeProvider } from 'styled-components'; import { getFramePropsStory } from '../../utils/frameProps'; const Buttons = () => ( diff --git a/packages/components/src/components/NewModal/NewModal.tsx b/packages/components/src/components/NewModal/NewModal.tsx index 1fcb501980c..a8ff48d910c 100644 --- a/packages/components/src/components/NewModal/NewModal.tsx +++ b/packages/components/src/components/NewModal/NewModal.tsx @@ -1,6 +1,8 @@ import { ReactNode } from 'react'; -import styled from 'styled-components'; import { useEvent } from 'react-use'; + +import styled from 'styled-components'; + import { borders, Elevation, diff --git a/packages/components/src/components/NewModal/NewModalBackdrop.tsx b/packages/components/src/components/NewModal/NewModalBackdrop.tsx index 5939346cf75..56089d43d6d 100644 --- a/packages/components/src/components/NewModal/NewModalBackdrop.tsx +++ b/packages/components/src/components/NewModal/NewModalBackdrop.tsx @@ -1,9 +1,12 @@ import { ReactNode } from 'react'; -import styled from 'styled-components'; import FocusLock from 'react-focus-lock'; -import { zIndices, spacings } from '@trezor/theme'; import { createPortal } from 'react-dom'; +import styled from 'styled-components'; + +import { zIndices, spacings } from '@trezor/theme'; + + import { NewModalAlignment } from './types'; import { mapAlignmentToAlignItems, mapAlignmentToJustifyContent } from './utils'; import { useModalTarget } from './NewModalProvider'; diff --git a/packages/components/src/components/NewModal/NewModalContext.tsx b/packages/components/src/components/NewModal/NewModalContext.tsx index b94f5479a73..8f436e34c4e 100644 --- a/packages/components/src/components/NewModal/NewModalContext.tsx +++ b/packages/components/src/components/NewModal/NewModalContext.tsx @@ -1,4 +1,5 @@ import { createContext, useContext } from 'react'; + import { NewModalVariant } from './types'; export const NewModalContext = createContext<{ diff --git a/packages/components/src/components/Note/Note.stories.tsx b/packages/components/src/components/Note/Note.stories.tsx index 068de82c543..8dbebcdc98e 100644 --- a/packages/components/src/components/Note/Note.stories.tsx +++ b/packages/components/src/components/Note/Note.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Note as NoteComponent, NoteProps } from './Note'; const meta: Meta = { diff --git a/packages/components/src/components/Note/Note.tsx b/packages/components/src/components/Note/Note.tsx index 9fd581cbc80..286a2f7e025 100644 --- a/packages/components/src/components/Note/Note.tsx +++ b/packages/components/src/components/Note/Note.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled, { useTheme } from 'styled-components'; import { spacings, spacingsPx } from '@trezor/theme'; diff --git a/packages/components/src/components/ResizableBox/ResizableBox.stories.tsx b/packages/components/src/components/ResizableBox/ResizableBox.stories.tsx index 1a530f6ddfb..19edddb5cbf 100644 --- a/packages/components/src/components/ResizableBox/ResizableBox.stories.tsx +++ b/packages/components/src/components/ResizableBox/ResizableBox.stories.tsx @@ -1,5 +1,6 @@ import styled from 'styled-components'; import { Meta, StoryObj } from '@storybook/react'; + import { ResizableBoxProps, ResizableBox as ResizableBoxComponent } from './ResizableBox'; const Container = styled.div` diff --git a/packages/components/src/components/ResizableBox/ResizableBox.tsx b/packages/components/src/components/ResizableBox/ResizableBox.tsx index 72fabc73862..5010706ef23 100644 --- a/packages/components/src/components/ResizableBox/ResizableBox.tsx +++ b/packages/components/src/components/ResizableBox/ResizableBox.tsx @@ -1,5 +1,7 @@ -import styled, { css } from 'styled-components'; import { useCallback, useEffect, useRef, useState } from 'react'; + +import styled, { css } from 'styled-components'; + import { createCooldown } from '@trezor/utils'; import { ZIndexValues, zIndices } from '@trezor/theme'; diff --git a/packages/components/src/components/ResizableBox/ResizableBoxExamples.stories.tsx b/packages/components/src/components/ResizableBox/ResizableBoxExamples.stories.tsx index 6381e50563c..24bce4ef473 100644 --- a/packages/components/src/components/ResizableBox/ResizableBoxExamples.stories.tsx +++ b/packages/components/src/components/ResizableBox/ResizableBoxExamples.stories.tsx @@ -1,5 +1,6 @@ import styled from 'styled-components'; import { Meta, StoryObj } from '@storybook/react'; + import { ResizableBox } from './ResizableBox'; const Container = styled.div` diff --git a/packages/components/src/components/Table/Table.tsx b/packages/components/src/components/Table/Table.tsx index 72977686702..da0a985d208 100644 --- a/packages/components/src/components/Table/Table.tsx +++ b/packages/components/src/components/Table/Table.tsx @@ -1,7 +1,9 @@ import { createContext, ReactNode, useContext } from 'react'; + import styled from 'styled-components'; import { mapElevationToBackgroundToken } from '@trezor/theme'; + import { FrameProps, FramePropsKeys, withFrameProps } from '../../utils/frameProps'; import { makePropsTransient, TransientProps } from '../../utils/transientProps'; import { TableHeader } from './TableHeader'; diff --git a/packages/components/src/components/Table/TableCell.tsx b/packages/components/src/components/Table/TableCell.tsx index e8eed543057..34efa2b4009 100644 --- a/packages/components/src/components/Table/TableCell.tsx +++ b/packages/components/src/components/Table/TableCell.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled, { css } from 'styled-components'; import { diff --git a/packages/components/src/components/Table/TableHeader.tsx b/packages/components/src/components/Table/TableHeader.tsx index e3fdff18f64..92bb419a548 100644 --- a/packages/components/src/components/Table/TableHeader.tsx +++ b/packages/components/src/components/Table/TableHeader.tsx @@ -1,4 +1,5 @@ import { createContext, useContext, ReactNode } from 'react'; + import styled from 'styled-components'; import { Elevation, mapElevationToBorder } from '@trezor/theme'; diff --git a/packages/components/src/components/Table/TableRow.tsx b/packages/components/src/components/Table/TableRow.tsx index 554c090f215..00b7c2d27df 100644 --- a/packages/components/src/components/Table/TableRow.tsx +++ b/packages/components/src/components/Table/TableRow.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled, { css } from 'styled-components'; import { diff --git a/packages/components/src/components/Timerange/Timerange.stories.tsx b/packages/components/src/components/Timerange/Timerange.stories.tsx index 5d2bf6cce4b..3397b4e3f06 100644 --- a/packages/components/src/components/Timerange/Timerange.stories.tsx +++ b/packages/components/src/components/Timerange/Timerange.stories.tsx @@ -1,5 +1,6 @@ import styled from 'styled-components'; import { Meta, StoryObj } from '@storybook/react'; + import { Timerange as TimerangeComponent, TimerangeProps } from './Timerange'; const Center = styled.div` diff --git a/packages/components/src/components/Timerange/Timerange.tsx b/packages/components/src/components/Timerange/Timerange.tsx index 73c6c456a40..35204258a1d 100644 --- a/packages/components/src/components/Timerange/Timerange.tsx +++ b/packages/components/src/components/Timerange/Timerange.tsx @@ -1,10 +1,12 @@ import { useState, ReactNode } from 'react'; import { DateRange } from 'react-date-range'; + import styled, { css } from 'styled-components'; +import type { Locale } from 'date-fns'; + import { mediaQueries } from '@trezor/styles'; import { borders, spacingsPx, zIndices } from '@trezor/theme'; -import type { Locale } from 'date-fns'; import { Button } from '../buttons/Button/Button'; diff --git a/packages/components/src/components/Tooltip/Tooltip.stories.tsx b/packages/components/src/components/Tooltip/Tooltip.stories.tsx index 339431bd32f..9dd0ae1bd1d 100644 --- a/packages/components/src/components/Tooltip/Tooltip.stories.tsx +++ b/packages/components/src/components/Tooltip/Tooltip.stories.tsx @@ -1,8 +1,12 @@ +import { useState } from 'react'; + import styled from 'styled-components'; -import { Tooltip as TooltipComponent, TooltipProps } from './Tooltip'; import { Meta, StoryObj } from '@storybook/react'; import { Placement } from '@floating-ui/react'; + import { Elevation, mapElevationToBackground, spacingsPx, zIndices } from '@trezor/theme'; + +import { Tooltip as TooltipComponent, TooltipProps } from './Tooltip'; import { ElevationContext, useElevation } from '../ElevationContext/ElevationContext'; import { TOOLTIP_DELAY_LONG, @@ -10,7 +14,6 @@ import { TOOLTIP_DELAY_NORMAL, TOOLTIP_DELAY_SHORT, } from './TooltipDelay'; -import { useState } from 'react'; import { Button } from '../buttons/Button/Button'; const Center = styled.div` diff --git a/packages/components/src/components/Tooltip/Tooltip.tsx b/packages/components/src/components/Tooltip/Tooltip.tsx index 3fece61b9f5..f60221c3dc5 100644 --- a/packages/components/src/components/Tooltip/Tooltip.tsx +++ b/packages/components/src/components/Tooltip/Tooltip.tsx @@ -1,11 +1,13 @@ -import styled, { ThemeProvider } from 'styled-components'; import { ReactNode, MutableRefObject } from 'react'; + +import styled, { ThemeProvider } from 'styled-components'; import { transparentize } from 'polished'; +import { Placement, ShiftOptions } from '@floating-ui/react'; + import { ZIndexValues, spacingsPx, spacings, zIndices } from '@trezor/theme'; import { Icon } from '../Icon/Icon'; import { TooltipContent, TooltipFloatingUi, TooltipTrigger } from './TooltipFloatingUi'; -import { Placement, ShiftOptions } from '@floating-ui/react'; import { TooltipBox, TooltipBoxProps } from './TooltipBox'; import { TooltipArrow } from './TooltipArrow'; import { TOOLTIP_DELAY_SHORT, TooltipDelay } from './TooltipDelay'; diff --git a/packages/components/src/components/Tooltip/TooltipArrow.tsx b/packages/components/src/components/Tooltip/TooltipArrow.tsx index 346ef76dd4b..4c375516c9d 100644 --- a/packages/components/src/components/Tooltip/TooltipArrow.tsx +++ b/packages/components/src/components/Tooltip/TooltipArrow.tsx @@ -1,6 +1,8 @@ import { FloatingArrow } from '@floating-ui/react'; -import { ArrowProps } from './TooltipFloatingUi'; + import { palette } from '@trezor/theme'; + +import { ArrowProps } from './TooltipFloatingUi'; import { TOOLTIP_BORDER_RADIUS } from './TooltipBox'; export const TooltipArrow = ({ ref, context }: ArrowProps) => ( diff --git a/packages/components/src/components/Tooltip/TooltipBox.tsx b/packages/components/src/components/Tooltip/TooltipBox.tsx index b40fff1b387..3b05063d05f 100644 --- a/packages/components/src/components/Tooltip/TooltipBox.tsx +++ b/packages/components/src/components/Tooltip/TooltipBox.tsx @@ -1,6 +1,9 @@ import { ReactElement, ReactNode } from 'react'; -import { borders, palette, spacings, spacingsPx, typography } from '@trezor/theme'; + import styled from 'styled-components'; + +import { borders, palette, spacings, spacingsPx, typography } from '@trezor/theme'; + import { Icon, IconName } from '../Icon/Icon'; export const TOOLTIP_BORDER_RADIUS = borders.radii.sm; diff --git a/packages/components/src/components/Tooltip/TooltipFloatingUi.tsx b/packages/components/src/components/Tooltip/TooltipFloatingUi.tsx index 7745feded01..ff2561723aa 100644 --- a/packages/components/src/components/Tooltip/TooltipFloatingUi.tsx +++ b/packages/components/src/components/Tooltip/TooltipFloatingUi.tsx @@ -1,3 +1,19 @@ +import { + useState, + useMemo, + createContext, + useContext, + ReactNode, + HTMLProps, + forwardRef, + isValidElement, + cloneElement, + useRef, + RefObject, + CSSProperties, + MutableRefObject, +} from 'react'; + import { useFloating, autoUpdate, @@ -15,21 +31,6 @@ import { arrow, } from '@floating-ui/react'; import type { Placement, ShiftOptions, UseFloatingReturn } from '@floating-ui/react'; -import { - useState, - useMemo, - createContext, - useContext, - ReactNode, - HTMLProps, - forwardRef, - isValidElement, - cloneElement, - useRef, - RefObject, - CSSProperties, - MutableRefObject, -} from 'react'; /** * Based on https://floating-ui.com/docs/tooltip but heavily modified diff --git a/packages/components/src/components/VirtualizedList/VirtualizedList.stories.tsx b/packages/components/src/components/VirtualizedList/VirtualizedList.stories.tsx index b764a92990f..9462f98bf67 100644 --- a/packages/components/src/components/VirtualizedList/VirtualizedList.stories.tsx +++ b/packages/components/src/components/VirtualizedList/VirtualizedList.stories.tsx @@ -1,7 +1,9 @@ +import { useEffect, useState } from 'react'; + import { Meta, StoryFn } from '@storybook/react'; import styled from 'styled-components'; + import { VirtualizedList as VirtualizedListComponent } from './VirtualizedList'; -import { useEffect, useState } from 'react'; const meta: Meta = { title: 'VirtualizedList', diff --git a/packages/components/src/components/VirtualizedList/VirtualizedList.tsx b/packages/components/src/components/VirtualizedList/VirtualizedList.tsx index 2b7718c58ba..4ae6dd13404 100644 --- a/packages/components/src/components/VirtualizedList/VirtualizedList.tsx +++ b/packages/components/src/components/VirtualizedList/VirtualizedList.tsx @@ -1,7 +1,9 @@ -import { isChanged } from '@suite-common/suite-utils'; import React, { useState, useEffect, useCallback, forwardRef, useRef } from 'react'; + import styled from 'styled-components'; +import { isChanged } from '@suite-common/suite-utils'; + function debounce void>( func: T, wait: number, diff --git a/packages/components/src/components/animations/AnimationPrimitives.tsx b/packages/components/src/components/animations/AnimationPrimitives.tsx index a646cc8be04..dc4b99fb193 100644 --- a/packages/components/src/components/animations/AnimationPrimitives.tsx +++ b/packages/components/src/components/animations/AnimationPrimitives.tsx @@ -1,6 +1,7 @@ -import { borders } from '@trezor/theme'; import styled, { CSSProperties, css } from 'styled-components'; +import { borders } from '@trezor/theme'; + export type Shape = 'CIRCLE' | 'ROUNDED' | 'ROUNDED-SMALL'; export const AnimationWrapper = styled.div<{ diff --git a/packages/components/src/components/animations/DeviceAnimation.tsx b/packages/components/src/components/animations/DeviceAnimation.tsx index d0296463f75..1f927e4c520 100644 --- a/packages/components/src/components/animations/DeviceAnimation.tsx +++ b/packages/components/src/components/animations/DeviceAnimation.tsx @@ -1,4 +1,5 @@ import { CSSProperties, MouseEventHandler, forwardRef } from 'react'; + import styled, { useTheme } from 'styled-components'; import { DEFAULT_FLAGSHIP_MODEL } from '@suite-common/suite-constants'; diff --git a/packages/components/src/components/animations/LottieAnimation.tsx b/packages/components/src/components/animations/LottieAnimation.tsx index c8515b240a9..a4fc0ad212a 100644 --- a/packages/components/src/components/animations/LottieAnimation.tsx +++ b/packages/components/src/components/animations/LottieAnimation.tsx @@ -1,10 +1,12 @@ -import styled from 'styled-components'; import React, { useEffect, useState } from 'react'; + +import styled from 'styled-components'; import Lottie, { LottieOptions } from 'lottie-react'; import { DEFAULT_FLAGSHIP_MODEL } from '@suite-common/suite-constants'; import { getNarrowedDeviceModelInternal } from '@suite-common/suite-utils'; import { DeviceModelInternal } from '@trezor/connect'; + import { AnimationWrapper, Shape } from './AnimationPrimitives'; import { resolveStaticPath } from '../../utils/resolveStaticPath'; diff --git a/packages/components/src/components/buttons/Button/Button.stories.tsx b/packages/components/src/components/buttons/Button/Button.stories.tsx index 8defbc1befa..e0822a1cf87 100644 --- a/packages/components/src/components/buttons/Button/Button.stories.tsx +++ b/packages/components/src/components/buttons/Button/Button.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { allowedButtonFrameProps, Button as ButtonComponent, ButtonProps } from './Button'; import { getFramePropsStory } from '../../../utils/frameProps'; import { variables } from '../../../config'; diff --git a/packages/components/src/components/buttons/Button/Button.tsx b/packages/components/src/components/buttons/Button/Button.tsx index 187b5c817ac..be95425b49e 100644 --- a/packages/components/src/components/buttons/Button/Button.tsx +++ b/packages/components/src/components/buttons/Button/Button.tsx @@ -1,6 +1,9 @@ import { ButtonHTMLAttributes } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { borders, CSSColor, Elevation, spacingsPx, typography } from '@trezor/theme'; + import { Spinner } from '../../loaders/Spinner/Spinner'; import { ButtonSize, diff --git a/packages/components/src/components/buttons/Button/buttons.stories.tsx b/packages/components/src/components/buttons/Button/buttons.stories.tsx index 1fc6df2080d..4dac9402fe9 100644 --- a/packages/components/src/components/buttons/Button/buttons.stories.tsx +++ b/packages/components/src/components/buttons/Button/buttons.stories.tsx @@ -1,9 +1,12 @@ -import { Button } from '../../../index'; import { Meta, StoryFn } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; + import { capitalizeFirstLetter } from '@trezor/utils'; + +import { Button } from '../../../index'; import { StoryColumn } from '../../../support/Story'; import { ButtonVariant } from '../buttonStyleUtils'; -import { action } from '@storybook/addon-actions'; + const variants: Array = ['primary', 'tertiary', 'info', 'warning', 'destructive']; diff --git a/packages/components/src/components/buttons/ButtonGroup/ButtonGroup.tsx b/packages/components/src/components/buttons/ButtonGroup/ButtonGroup.tsx index eb561288197..c7631de2823 100644 --- a/packages/components/src/components/buttons/ButtonGroup/ButtonGroup.tsx +++ b/packages/components/src/components/buttons/ButtonGroup/ButtonGroup.tsx @@ -1,6 +1,9 @@ import React from 'react'; + import styled from 'styled-components'; + import { borders } from '@trezor/theme'; + import { ButtonProps } from '../Button/Button'; import { ButtonSize, ButtonVariant } from '../buttonStyleUtils'; import { IconButtonProps } from '../IconButton/IconButton'; diff --git a/packages/components/src/components/buttons/ButtonGroup/ButtonGroups.stories.tsx b/packages/components/src/components/buttons/ButtonGroup/ButtonGroups.stories.tsx index 3a2f79b7ed7..95dacead1c6 100644 --- a/packages/components/src/components/buttons/ButtonGroup/ButtonGroups.stories.tsx +++ b/packages/components/src/components/buttons/ButtonGroup/ButtonGroups.stories.tsx @@ -1,5 +1,7 @@ import React from 'react'; + import { Meta, StoryObj } from '@storybook/react'; + import { StoryColumn } from '../../../support/Story'; import { Button } from '../Button/Button'; import { ButtonGroup } from './ButtonGroup'; diff --git a/packages/components/src/components/buttons/IconButton/IconButton.stories.tsx b/packages/components/src/components/buttons/IconButton/IconButton.stories.tsx index 9fb9db388b8..1ba9795d09a 100644 --- a/packages/components/src/components/buttons/IconButton/IconButton.stories.tsx +++ b/packages/components/src/components/buttons/IconButton/IconButton.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { IconButton as IconButtonComponent, IconButtonProps } from './IconButton'; import { variables } from '../../../config'; import { buttonSizes, buttonVariants, subtleButtonVariants } from '../buttonStyleUtils'; diff --git a/packages/components/src/components/buttons/IconButton/IconButton.tsx b/packages/components/src/components/buttons/IconButton/IconButton.tsx index af676067806..39c7c441eda 100644 --- a/packages/components/src/components/buttons/IconButton/IconButton.tsx +++ b/packages/components/src/components/buttons/IconButton/IconButton.tsx @@ -1,5 +1,7 @@ import React from 'react'; + import styled, { useTheme } from 'styled-components'; + import { Spinner } from '../../loaders/Spinner/Spinner'; import { ButtonContainer, ButtonProps, getIcon, IconOrComponent } from '../Button/Button'; import { ButtonVariant, getIconColor, getIconSize, getPadding } from '../buttonStyleUtils'; diff --git a/packages/components/src/components/buttons/IconButton/IconButtons.stories.tsx b/packages/components/src/components/buttons/IconButton/IconButtons.stories.tsx index e49974fc70c..f7442d3e9be 100644 --- a/packages/components/src/components/buttons/IconButton/IconButtons.stories.tsx +++ b/packages/components/src/components/buttons/IconButton/IconButtons.stories.tsx @@ -1,8 +1,10 @@ import React from 'react'; + +import { Meta, StoryObj } from '@storybook/react'; + import { IconButton } from '../../../index'; import { StoryColumn } from '../../../support/Story'; import { ButtonVariant } from '../buttonStyleUtils'; -import { Meta, StoryObj } from '@storybook/react'; const variants: Array> = ['primary', 'tertiary']; diff --git a/packages/components/src/components/buttons/PinButton/PinButton.stories.tsx b/packages/components/src/components/buttons/PinButton/PinButton.stories.tsx index 7d330768fdb..9cbcedeae7a 100644 --- a/packages/components/src/components/buttons/PinButton/PinButton.stories.tsx +++ b/packages/components/src/components/buttons/PinButton/PinButton.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { PinButton as PinButtonComponent } from './PinButton'; const meta: Meta = { diff --git a/packages/components/src/components/buttons/PinButton/PinButton.tsx b/packages/components/src/components/buttons/PinButton/PinButton.tsx index e881aba4bec..d22e9e57666 100644 --- a/packages/components/src/components/buttons/PinButton/PinButton.tsx +++ b/packages/components/src/components/buttons/PinButton/PinButton.tsx @@ -1,3 +1,7 @@ +import { ButtonHTMLAttributes } from 'react'; + +import styled from 'styled-components'; + import { Elevation, borders, @@ -5,8 +9,7 @@ import { mapElevationToBorder, spacingsPx, } from '@trezor/theme'; -import { ButtonHTMLAttributes } from 'react'; -import styled from 'styled-components'; + import { useElevation } from '../../ElevationContext/ElevationContext'; const Button = styled.button<{ $elevation: Elevation }>` diff --git a/packages/components/src/components/buttons/TextButton/TextButton.stories.tsx b/packages/components/src/components/buttons/TextButton/TextButton.stories.tsx index a467b60a466..666318f5977 100644 --- a/packages/components/src/components/buttons/TextButton/TextButton.stories.tsx +++ b/packages/components/src/components/buttons/TextButton/TextButton.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { TextButton as TextButtonComponent, TextButtonProps } from './TextButton'; import { variables } from '../../../config'; import { buttonSizes } from '../buttonStyleUtils'; diff --git a/packages/components/src/components/buttons/TextButton/TextButton.tsx b/packages/components/src/components/buttons/TextButton/TextButton.tsx index 70bfa45dda9..b5746b4c592 100644 --- a/packages/components/src/components/buttons/TextButton/TextButton.tsx +++ b/packages/components/src/components/buttons/TextButton/TextButton.tsx @@ -1,6 +1,9 @@ import React from 'react'; + import styled from 'styled-components'; + import { borders, spacingsPx, typography } from '@trezor/theme'; + import { ButtonProps, getIcon } from '../Button/Button'; import { ButtonSize, getIconSize, IconAlignment } from '../buttonStyleUtils'; import { Spinner } from '../../loaders/Spinner/Spinner'; diff --git a/packages/components/src/components/buttons/TextButton/TextButtons.stories.tsx b/packages/components/src/components/buttons/TextButton/TextButtons.stories.tsx index 22eebfbc248..42fa8c88d59 100644 --- a/packages/components/src/components/buttons/TextButton/TextButtons.stories.tsx +++ b/packages/components/src/components/buttons/TextButton/TextButtons.stories.tsx @@ -1,5 +1,7 @@ import React from 'react'; + import { Meta, StoryFn } from '@storybook/react'; + import { TextButton } from '../../../index'; import { StoryColumn } from '../../../support/Story'; diff --git a/packages/components/src/components/buttons/buttonStyleUtils.ts b/packages/components/src/components/buttons/buttonStyleUtils.ts index 0fa8bf15152..fb00519dad3 100644 --- a/packages/components/src/components/buttons/buttonStyleUtils.ts +++ b/packages/components/src/components/buttons/buttonStyleUtils.ts @@ -1,10 +1,11 @@ import { DefaultTheme, css, useTheme } from 'styled-components'; import { Color, Colors, Elevation, spacings, spacingsPx } from '@trezor/theme'; -import type { UIHorizontalAlignment, UISize, UIVariant } from '../../config/types'; import { hexToRgba } from '@suite-common/suite-utils'; import { capitalizeFirstLetter } from '@trezor/utils'; +import type { UIHorizontalAlignment, UISize, UIVariant } from '../../config/types'; + const SUBTLE_ALPHA = 0.12; const SUBTLE_ALPHA_HOVER = 0.2; diff --git a/packages/components/src/components/form/BottomText.tsx b/packages/components/src/components/form/BottomText.tsx index 2e1204590fd..059664174ad 100644 --- a/packages/components/src/components/form/BottomText.tsx +++ b/packages/components/src/components/form/BottomText.tsx @@ -1,7 +1,10 @@ +import { ReactNode } from 'react'; + import styled, { keyframes } from 'styled-components'; + import { spacingsPx, typography } from '@trezor/theme'; + import { getInputStateTextColor } from './InputStyles'; -import { ReactNode } from 'react'; import { InputState } from './inputTypes'; export const BOTTOM_TEXT_MIN_HEIGHT = 26; // 1 line of text + top padding diff --git a/packages/components/src/components/form/Checkbox/Checkbox.tsx b/packages/components/src/components/form/Checkbox/Checkbox.tsx index 3dc19fb3de7..0926274b8eb 100755 --- a/packages/components/src/components/form/Checkbox/Checkbox.tsx +++ b/packages/components/src/components/form/Checkbox/Checkbox.tsx @@ -1,5 +1,7 @@ import { EventHandler, SyntheticEvent, KeyboardEvent, ReactNode } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { borders, Color, spacingsPx, typography } from '@trezor/theme'; import { KEYBOARD_CODE } from '../../../constants/keyboardEvents'; diff --git a/packages/components/src/components/form/Input/Input.stories.tsx b/packages/components/src/components/form/Input/Input.stories.tsx index f576e3f8b3a..60927a34b8e 100644 --- a/packages/components/src/components/form/Input/Input.stories.tsx +++ b/packages/components/src/components/form/Input/Input.stories.tsx @@ -1,4 +1,5 @@ import { ChangeEvent } from 'react'; + import { useArgs } from '@storybook/client-api'; import { Meta, StoryObj } from '@storybook/react'; diff --git a/packages/components/src/components/form/Input/Input.tsx b/packages/components/src/components/form/Input/Input.tsx index 620a504f74f..375395cbb7a 100644 --- a/packages/components/src/components/form/Input/Input.tsx +++ b/packages/components/src/components/form/Input/Input.tsx @@ -1,7 +1,10 @@ import { useState, Ref, ReactNode, ReactElement, InputHTMLAttributes } from 'react'; -import styled, { useTheme } from 'styled-components'; import { useMeasure } from 'react-use'; + +import styled, { useTheme } from 'styled-components'; + import { spacingsPx, spacings, typography } from '@trezor/theme'; + import { Icon } from '../../Icon/Icon'; import { baseInputStyle, diff --git a/packages/components/src/components/form/InputStyles.ts b/packages/components/src/components/form/InputStyles.ts index c5aa3f26140..0e1ed09effa 100644 --- a/packages/components/src/components/form/InputStyles.ts +++ b/packages/components/src/components/form/InputStyles.ts @@ -1,4 +1,5 @@ import styled, { css, DefaultTheme } from 'styled-components'; + import { borders, spacingsPx, diff --git a/packages/components/src/components/form/Radio/Radio.tsx b/packages/components/src/components/form/Radio/Radio.tsx index e60fc22a591..25d6c59396a 100755 --- a/packages/components/src/components/form/Radio/Radio.tsx +++ b/packages/components/src/components/form/Radio/Radio.tsx @@ -1,5 +1,7 @@ import { EventHandler, KeyboardEvent, ReactNode, SyntheticEvent } from 'react'; + import styled from 'styled-components'; + import { Color, borders } from '@trezor/theme'; import { KEYBOARD_CODE } from '../../../constants/keyboardEvents'; diff --git a/packages/components/src/components/form/Range/Range.tsx b/packages/components/src/components/form/Range/Range.tsx index 1e94733617c..9416ae2676e 100644 --- a/packages/components/src/components/form/Range/Range.tsx +++ b/packages/components/src/components/form/Range/Range.tsx @@ -6,6 +6,7 @@ import { KeyboardEventHandler, ChangeEventHandler, } from 'react'; + import styled, { css, CSSObject } from 'styled-components'; import { borders, spacingsPx, typography } from '@trezor/theme'; diff --git a/packages/components/src/components/form/Select/Select.tsx b/packages/components/src/components/form/Select/Select.tsx index d5a48d69048..d934f76ca8a 100644 --- a/packages/components/src/components/form/Select/Select.tsx +++ b/packages/components/src/components/form/Select/Select.tsx @@ -1,6 +1,8 @@ import { useCallback, useRef, ReactNode, useMemo } from 'react'; import ReactSelect, { Props as ReactSelectProps, StylesConfig, SelectInstance } from 'react-select'; + import styled, { css, DefaultTheme, useTheme } from 'styled-components'; + import { borders, spacings, diff --git a/packages/components/src/components/form/Select/customComponents.tsx b/packages/components/src/components/form/Select/customComponents.tsx index c2297931bd7..2143922bc43 100644 --- a/packages/components/src/components/form/Select/customComponents.tsx +++ b/packages/components/src/components/form/Select/customComponents.tsx @@ -1,4 +1,5 @@ import { components, ControlProps, OptionProps, GroupHeadingProps } from 'react-select'; + import type { Option as OptionType } from './Select'; export interface ControlComponentProps extends ControlProps { diff --git a/packages/components/src/components/form/Select/useDetectPortalTarget.ts b/packages/components/src/components/form/Select/useDetectPortalTarget.ts index 8b90d84a507..22757fc43e9 100644 --- a/packages/components/src/components/form/Select/useDetectPortalTarget.ts +++ b/packages/components/src/components/form/Select/useDetectPortalTarget.ts @@ -1,5 +1,6 @@ import { useState, useEffect, RefObject } from 'react'; import { SelectInstance } from 'react-select'; + import { MODAL_CONTENT_ID } from '../../modals/Modal/Modal'; import type { Option } from './Select'; diff --git a/packages/components/src/components/form/Select/useOnKeyDown.ts b/packages/components/src/components/form/Select/useOnKeyDown.ts index 793d98fe465..633a557df82 100644 --- a/packages/components/src/components/form/Select/useOnKeyDown.ts +++ b/packages/components/src/components/form/Select/useOnKeyDown.ts @@ -1,5 +1,6 @@ import { useRef, useCallback, RefObject, KeyboardEvent } from 'react'; import { GroupBase, Options, OptionsOrGroups, SelectInstance } from 'react-select'; + import type { Option } from './Select'; /** Custom Type Guards to check if options are grouped or not */ diff --git a/packages/components/src/components/form/SelectBar/SelectBar.tsx b/packages/components/src/components/form/SelectBar/SelectBar.tsx index bc632f4e8c9..8abf533b44f 100644 --- a/packages/components/src/components/form/SelectBar/SelectBar.tsx +++ b/packages/components/src/components/form/SelectBar/SelectBar.tsx @@ -1,5 +1,7 @@ import { useState, useEffect, ReactNode, useCallback, KeyboardEvent } from 'react'; + import styled, { css } from 'styled-components'; + import { breakpointMediaQueries } from '@trezor/styles'; import { borders, @@ -10,6 +12,7 @@ import { mapElevationToBackground, nextElevation, } from '@trezor/theme'; + import { focusStyleTransition, getFocusShadowStyle } from '../../../utils/utils'; import { useElevation } from '../../ElevationContext/ElevationContext'; diff --git a/packages/components/src/components/form/Switch/Switch.tsx b/packages/components/src/components/form/Switch/Switch.tsx index 69e8c41f092..2f1e09e8aa5 100755 --- a/packages/components/src/components/form/Switch/Switch.tsx +++ b/packages/components/src/components/form/Switch/Switch.tsx @@ -1,7 +1,10 @@ import { ReactNode } from 'react'; + import styled, { css } from 'styled-components'; + import { borders, spacingsPx, typography } from '@trezor/theme'; import { getWeakRandomId } from '@trezor/utils'; + import { getInputColor, getLabelColor, diff --git a/packages/components/src/components/form/Textarea/CharacterCount.tsx b/packages/components/src/components/form/Textarea/CharacterCount.tsx index 64c875c6278..de8debece6f 100644 --- a/packages/components/src/components/form/Textarea/CharacterCount.tsx +++ b/packages/components/src/components/form/Textarea/CharacterCount.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { borders, spacings, spacingsPx, typography } from '@trezor/theme'; const Container = styled.div` diff --git a/packages/components/src/components/form/Textarea/Textarea.stories.tsx b/packages/components/src/components/form/Textarea/Textarea.stories.tsx index 76057136f9a..e9ceefc22db 100644 --- a/packages/components/src/components/form/Textarea/Textarea.stories.tsx +++ b/packages/components/src/components/form/Textarea/Textarea.stories.tsx @@ -1,6 +1,8 @@ +import { ChangeEventHandler } from 'react'; + import { useArgs } from '@storybook/client-api'; import { Meta, StoryObj } from '@storybook/react'; -import { ChangeEventHandler } from 'react'; + import { Textarea as TextareaComponent, TextareaProps } from './Textarea'; const meta: Meta = { diff --git a/packages/components/src/components/form/Textarea/Textarea.tsx b/packages/components/src/components/form/Textarea/Textarea.tsx index c295c65ba6d..6fca19fa91b 100644 --- a/packages/components/src/components/form/Textarea/Textarea.tsx +++ b/packages/components/src/components/form/Textarea/Textarea.tsx @@ -1,5 +1,7 @@ -import styled from 'styled-components'; import { useState, Ref, ReactNode, TextareaHTMLAttributes } from 'react'; + +import styled from 'styled-components'; + import { spacingsPx, Elevation } from '@trezor/theme'; import { InputState } from '../inputTypes'; diff --git a/packages/components/src/components/form/TopAddons.tsx b/packages/components/src/components/form/TopAddons.tsx index a3fdc9827ef..768ba15ec16 100644 --- a/packages/components/src/components/form/TopAddons.tsx +++ b/packages/components/src/components/form/TopAddons.tsx @@ -1,5 +1,7 @@ import React from 'react'; + import styled from 'styled-components'; + import { spacingsPx } from '@trezor/theme'; const Container = styled.div<{ $hasLeftAddon?: boolean }>` diff --git a/packages/components/src/components/loaders/LoadingContent/LoadingContent.stories.tsx b/packages/components/src/components/loaders/LoadingContent/LoadingContent.stories.tsx index 13081b7f922..2d16178f4ea 100644 --- a/packages/components/src/components/loaders/LoadingContent/LoadingContent.stories.tsx +++ b/packages/components/src/components/loaders/LoadingContent/LoadingContent.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { H1, LoadingContent as LoadingContentComponent, LoadingContentProps } from '../../../index'; const meta: Meta = { diff --git a/packages/components/src/components/loaders/LoadingContent/LoadingContent.tsx b/packages/components/src/components/loaders/LoadingContent/LoadingContent.tsx index 62603ca36d1..1eeeb9f720d 100644 --- a/packages/components/src/components/loaders/LoadingContent/LoadingContent.tsx +++ b/packages/components/src/components/loaders/LoadingContent/LoadingContent.tsx @@ -1,5 +1,7 @@ import { ReactNode, useState, useEffect } from 'react'; + import styled, { css } from 'styled-components'; + import { Spinner } from '../Spinner/Spinner'; const LoadingWrapper = styled.div` diff --git a/packages/components/src/components/loaders/ProgressBar/ProgressBar.stories.tsx b/packages/components/src/components/loaders/ProgressBar/ProgressBar.stories.tsx index 7c4a8ad1a57..ba82870a6d5 100644 --- a/packages/components/src/components/loaders/ProgressBar/ProgressBar.stories.tsx +++ b/packages/components/src/components/loaders/ProgressBar/ProgressBar.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { ProgressBar as ProgressBarComponent, ProgressBarProps } from './ProgressBar'; const meta: Meta = { diff --git a/packages/components/src/components/loaders/ProgressBar/ProgressBar.tsx b/packages/components/src/components/loaders/ProgressBar/ProgressBar.tsx index 76343684d15..96b610b273e 100644 --- a/packages/components/src/components/loaders/ProgressBar/ProgressBar.tsx +++ b/packages/components/src/components/loaders/ProgressBar/ProgressBar.tsx @@ -1,6 +1,7 @@ -import { borders } from '@trezor/theme'; import styled from 'styled-components'; +import { borders } from '@trezor/theme'; + const Wrapper = styled.div` background: ${({ theme }) => theme.backgroundNeutralSubdued}; width: 100%; diff --git a/packages/components/src/components/loaders/ProgressPie/ProgressPie.stories.tsx b/packages/components/src/components/loaders/ProgressPie/ProgressPie.stories.tsx index eb0d2d48cb1..c3ababa25fd 100644 --- a/packages/components/src/components/loaders/ProgressPie/ProgressPie.stories.tsx +++ b/packages/components/src/components/loaders/ProgressPie/ProgressPie.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { ProgressPie as ProgressPieComponent, ProgressPieProps } from './ProgressPie'; const meta: Meta = { diff --git a/packages/components/src/components/loaders/ProgressPie/ProgressPie.tsx b/packages/components/src/components/loaders/ProgressPie/ProgressPie.tsx index 8941fe4fcb2..1547cf215f3 100644 --- a/packages/components/src/components/loaders/ProgressPie/ProgressPie.tsx +++ b/packages/components/src/components/loaders/ProgressPie/ProgressPie.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; const Container = styled.div<{ diff --git a/packages/components/src/components/loaders/Spinner/Spinner.stories.tsx b/packages/components/src/components/loaders/Spinner/Spinner.stories.tsx index 81aca151198..fabd17abd93 100644 --- a/packages/components/src/components/loaders/Spinner/Spinner.stories.tsx +++ b/packages/components/src/components/loaders/Spinner/Spinner.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Spinner as SpinnerComponent, SpinnerProps, allowedSpinnerFrameProps } from './Spinner'; import { getFramePropsStory } from '../../../utils/frameProps'; diff --git a/packages/components/src/components/loaders/Spinner/Spinner.tsx b/packages/components/src/components/loaders/Spinner/Spinner.tsx index 31b1058652f..b17aaed948f 100644 --- a/packages/components/src/components/loaders/Spinner/Spinner.tsx +++ b/packages/components/src/components/loaders/Spinner/Spinner.tsx @@ -1,6 +1,8 @@ import { useState } from 'react'; + import Lottie from 'lottie-react'; import styled from 'styled-components'; + import animationStart from './animationData/refresh-spinner-start.json'; import animationMiddle from './animationData/refresh-spinner-middle.json'; import animationEnd from './animationData/refresh-spinner-end-success.json'; diff --git a/packages/components/src/components/loaders/Stepper/Stepper.stories.tsx b/packages/components/src/components/loaders/Stepper/Stepper.stories.tsx index cbbe0fd68e8..3e7791ee086 100644 --- a/packages/components/src/components/loaders/Stepper/Stepper.stories.tsx +++ b/packages/components/src/components/loaders/Stepper/Stepper.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Stepper as StepperComponent, StepperProps } from './Stepper'; const meta: Meta = { diff --git a/packages/components/src/components/loaders/Stepper/Stepper.tsx b/packages/components/src/components/loaders/Stepper/Stepper.tsx index 764e2612ab3..5e9ee5235e4 100644 --- a/packages/components/src/components/loaders/Stepper/Stepper.tsx +++ b/packages/components/src/components/loaders/Stepper/Stepper.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { borders, spacingsPx } from '@trezor/theme'; const Container = styled.div<{ $maxWidth: number }>` diff --git a/packages/components/src/components/modals/DialogModal/DialogModal.stories.tsx b/packages/components/src/components/modals/DialogModal/DialogModal.stories.tsx index 75b7897dca6..4ffd033529e 100644 --- a/packages/components/src/components/modals/DialogModal/DialogModal.stories.tsx +++ b/packages/components/src/components/modals/DialogModal/DialogModal.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { DialogModal as ModalComponent, Button, DialogModalProps } from '../../../index'; import { variables } from '../../../config'; diff --git a/packages/components/src/components/modals/DialogModal/DialogModal.tsx b/packages/components/src/components/modals/DialogModal/DialogModal.tsx index 6ca8294107e..bf92ab9ccac 100644 --- a/packages/components/src/components/modals/DialogModal/DialogModal.tsx +++ b/packages/components/src/components/modals/DialogModal/DialogModal.tsx @@ -1,8 +1,11 @@ +import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { borders, spacingsPx, typography } from '@trezor/theme'; + import { Icon, IconName } from '../../Icon/Icon'; import { Modal, ModalProps } from '../Modal/Modal'; -import { ReactNode } from 'react'; const BodyHeading = styled.div` margin-bottom: ${spacingsPx.xs}; diff --git a/packages/components/src/components/modals/Modal/Backdrop.tsx b/packages/components/src/components/modals/Modal/Backdrop.tsx index 449994843f7..ffa2b952230 100644 --- a/packages/components/src/components/modals/Modal/Backdrop.tsx +++ b/packages/components/src/components/modals/Modal/Backdrop.tsx @@ -1,5 +1,7 @@ import { ReactNode } from 'react'; + import styled, { css } from 'styled-components'; + import { zIndices } from '@trezor/theme'; export type ModalAlignment = { x: 'center' | 'left'; y: 'center' | 'top' }; diff --git a/packages/components/src/components/modals/Modal/Modal.stories.tsx b/packages/components/src/components/modals/Modal/Modal.stories.tsx index 7fe6e9d6c7d..aebc56f081e 100644 --- a/packages/components/src/components/modals/Modal/Modal.stories.tsx +++ b/packages/components/src/components/modals/Modal/Modal.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Modal as ModalComponent, Button, ModalProps } from '../../../index'; import { Icon } from '../../Icon/Icon'; diff --git a/packages/components/src/components/modals/Modal/Modal.tsx b/packages/components/src/components/modals/Modal/Modal.tsx index 9d884dae45c..aad9e4ff0e2 100644 --- a/packages/components/src/components/modals/Modal/Modal.tsx +++ b/packages/components/src/components/modals/Modal/Modal.tsx @@ -1,7 +1,8 @@ import { useCallback, useState, ReactNode, useEffect } from 'react'; +import { useEvent } from 'react-use'; import styled, { css, useTheme } from 'styled-components'; -import { useEvent } from 'react-use'; + import { borders, spacings, spacingsPx, typography } from '@trezor/theme'; import { Stepper } from '../../loaders/Stepper/Stepper'; diff --git a/packages/components/src/components/skeletons/SkeletonCircle.stories.tsx b/packages/components/src/components/skeletons/SkeletonCircle.stories.tsx index 79ca80dc133..2e46a667b2e 100644 --- a/packages/components/src/components/skeletons/SkeletonCircle.stories.tsx +++ b/packages/components/src/components/skeletons/SkeletonCircle.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { SkeletonCircle as SkeletonCircleComponent, SkeletonCircleProps } from './SkeletonCircle'; const meta: Meta = { diff --git a/packages/components/src/components/skeletons/SkeletonCircle.tsx b/packages/components/src/components/skeletons/SkeletonCircle.tsx index c2cf1d98c90..6926817b517 100644 --- a/packages/components/src/components/skeletons/SkeletonCircle.tsx +++ b/packages/components/src/components/skeletons/SkeletonCircle.tsx @@ -1,7 +1,9 @@ import styled, { css } from 'styled-components'; + +import { Elevation, mapElevationToBackground } from '@trezor/theme'; + import { getValue, shimmerEffect } from './utils'; import { SkeletonBaseProps } from './types'; -import { Elevation, mapElevationToBackground } from '@trezor/theme'; import { useElevation } from '../ElevationContext/ElevationContext'; import { TransientProps } from '../../utils/transientProps'; diff --git a/packages/components/src/components/skeletons/SkeletonRectangle.stories.tsx b/packages/components/src/components/skeletons/SkeletonRectangle.stories.tsx index aba04a8c7f1..70a836674e1 100644 --- a/packages/components/src/components/skeletons/SkeletonRectangle.stories.tsx +++ b/packages/components/src/components/skeletons/SkeletonRectangle.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { SkeletonRectangle as SkeletonRectangleComponent, SkeletonRectangleProps, diff --git a/packages/components/src/components/skeletons/SkeletonRectangle.tsx b/packages/components/src/components/skeletons/SkeletonRectangle.tsx index 2b0244467cb..b9b8d0f82a4 100644 --- a/packages/components/src/components/skeletons/SkeletonRectangle.tsx +++ b/packages/components/src/components/skeletons/SkeletonRectangle.tsx @@ -1,7 +1,9 @@ import styled, { css } from 'styled-components'; + +import { Elevation, borders, mapElevationToBackground } from '@trezor/theme'; + import { SkeletonBaseProps } from './types'; import { getValue, shimmerEffect } from './utils'; -import { Elevation, borders, mapElevationToBackground } from '@trezor/theme'; import { useElevation } from '../ElevationContext/ElevationContext'; import { TransientProps } from '../../utils/transientProps'; diff --git a/packages/components/src/components/skeletons/SkeletonSpread.stories.tsx b/packages/components/src/components/skeletons/SkeletonSpread.stories.tsx index b73a202b307..99260d771c2 100644 --- a/packages/components/src/components/skeletons/SkeletonSpread.stories.tsx +++ b/packages/components/src/components/skeletons/SkeletonSpread.stories.tsx @@ -1,7 +1,8 @@ import { Meta, StoryObj } from '@storybook/react'; +import styled from 'styled-components'; + import { SkeletonSpread as SkeletonSpreadComponent, SkeletonSpreadProps } from './SkeletonSpread'; import { SkeletonCircle } from './SkeletonCircle'; -import styled from 'styled-components'; import { ElevationContext } from '../ElevationContext/ElevationContext'; const Container = styled.div` diff --git a/packages/components/src/components/skeletons/SkeletonSpread.tsx b/packages/components/src/components/skeletons/SkeletonSpread.tsx index ee17ea2304e..f917be4da49 100644 --- a/packages/components/src/components/skeletons/SkeletonSpread.tsx +++ b/packages/components/src/components/skeletons/SkeletonSpread.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { SkeletonStack, SkeletonStackProps } from './SkeletonStack'; export interface SkeletonSpreadProps extends SkeletonStackProps { diff --git a/packages/components/src/components/skeletons/SkeletonStack.stories.tsx b/packages/components/src/components/skeletons/SkeletonStack.stories.tsx index c9d3508e56d..04db1ac42cc 100644 --- a/packages/components/src/components/skeletons/SkeletonStack.stories.tsx +++ b/packages/components/src/components/skeletons/SkeletonStack.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { SkeletonStack as SkeletonStackComponent, SkeletonStackProps } from './SkeletonStack'; import { SkeletonCircle } from './SkeletonCircle'; import { ElevationContext } from '../ElevationContext/ElevationContext'; diff --git a/packages/components/src/components/skeletons/utils.ts b/packages/components/src/components/skeletons/utils.ts index d8be77b695b..f9e1e61b684 100644 --- a/packages/components/src/components/skeletons/utils.ts +++ b/packages/components/src/components/skeletons/utils.ts @@ -1,5 +1,7 @@ -import { Elevation, mapElevationToBackground } from '@trezor/theme'; import { css, keyframes } from 'styled-components'; + +import { Elevation, mapElevationToBackground } from '@trezor/theme'; + import { mapElevationToSkeletonForeground } from './colors'; const SHINE = keyframes` diff --git a/packages/components/src/components/typography/Code/Code.stories.tsx b/packages/components/src/components/typography/Code/Code.stories.tsx index d2723080011..dede65b54c6 100644 --- a/packages/components/src/components/typography/Code/Code.stories.tsx +++ b/packages/components/src/components/typography/Code/Code.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Code } from './Code'; const meta: Meta = { diff --git a/packages/components/src/components/typography/Code/Code.tsx b/packages/components/src/components/typography/Code/Code.tsx index c80b79aa41e..977c95c0a58 100644 --- a/packages/components/src/components/typography/Code/Code.tsx +++ b/packages/components/src/components/typography/Code/Code.tsx @@ -1,7 +1,9 @@ -import { borders, spacingsPx } from '@trezor/theme'; import React, { type ReactNode } from 'react'; + import styled from 'styled-components'; +import { borders, spacingsPx } from '@trezor/theme'; + const StyledCode = styled.code` font-family: RobotoMono, 'PixelOperatorMono8', monospace; display: inline; diff --git a/packages/components/src/components/typography/Heading/Heading.stories.tsx b/packages/components/src/components/typography/Heading/Heading.stories.tsx index 9ff87b3ecfe..930eb5906a2 100644 --- a/packages/components/src/components/typography/Heading/Heading.stories.tsx +++ b/packages/components/src/components/typography/Heading/Heading.stories.tsx @@ -1,5 +1,6 @@ import styled from 'styled-components'; import { Meta, StoryObj } from '@storybook/react'; + import { H1, H2, H3, H4, allowedHeadingFrameProps, allowedHeadingTextProps } from './Heading'; import { getFramePropsStory } from '../../../utils/frameProps'; import { getTextPropsStory } from '../utils'; diff --git a/packages/components/src/components/typography/Heading/Heading.tsx b/packages/components/src/components/typography/Heading/Heading.tsx index 700fa280233..1f52b53987f 100644 --- a/packages/components/src/components/typography/Heading/Heading.tsx +++ b/packages/components/src/components/typography/Heading/Heading.tsx @@ -1,6 +1,7 @@ import styled from 'styled-components'; import { Color, TypographyStyle } from '@trezor/theme'; + import { FrameProps, FramePropsKeys, diff --git a/packages/components/src/components/typography/Link/Link.stories.tsx b/packages/components/src/components/typography/Link/Link.stories.tsx index 22066c78a98..0f158d4562d 100644 --- a/packages/components/src/components/typography/Link/Link.stories.tsx +++ b/packages/components/src/components/typography/Link/Link.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Link as LinkComponent, LinkProps } from '../../../index'; const meta: Meta = { diff --git a/packages/components/src/components/typography/Link/Link.tsx b/packages/components/src/components/typography/Link/Link.tsx index a60566d3561..d4058186c08 100644 --- a/packages/components/src/components/typography/Link/Link.tsx +++ b/packages/components/src/components/typography/Link/Link.tsx @@ -1,6 +1,9 @@ import { ReactNode, MouseEvent } from 'react'; + import styled, { css } from 'styled-components'; + import { TypographyStyle, spacingsPx, typography, typographyStylesBase } from '@trezor/theme'; + import { Icon, IconName } from '../../Icon/Icon'; type AProps = { diff --git a/packages/components/src/components/typography/Paragraph/Paragraph.stories.tsx b/packages/components/src/components/typography/Paragraph/Paragraph.stories.tsx index 948a75b3d1f..0ba245343ca 100644 --- a/packages/components/src/components/typography/Paragraph/Paragraph.stories.tsx +++ b/packages/components/src/components/typography/Paragraph/Paragraph.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { Paragraph as P } from './Paragraph'; import { getFramePropsStory } from '../../../utils/frameProps'; import { getTextPropsStory } from '../utils'; diff --git a/packages/components/src/components/typography/Paragraph/Paragraph.tsx b/packages/components/src/components/typography/Paragraph/Paragraph.tsx index f81f563230a..9ae742fbec5 100644 --- a/packages/components/src/components/typography/Paragraph/Paragraph.tsx +++ b/packages/components/src/components/typography/Paragraph/Paragraph.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import { Text, TextProps } from '../Text/Text'; export const Paragraph = ({ children, ...rest }: TextProps) => { diff --git a/packages/components/src/components/typography/Text/Text.stories.tsx b/packages/components/src/components/typography/Text/Text.stories.tsx index 5c1d39fd3c7..8c84f1c8b10 100644 --- a/packages/components/src/components/typography/Text/Text.stories.tsx +++ b/packages/components/src/components/typography/Text/Text.stories.tsx @@ -1,5 +1,6 @@ import styled from 'styled-components'; import { Meta, StoryObj } from '@storybook/react'; + import { allowedTextFrameProps, allowedTextTextProps, Text as TextComponent } from './Text'; import { getFramePropsStory } from '../../../utils/frameProps'; import { getTextPropsStory } from '../utils'; diff --git a/packages/components/src/components/typography/Text/Text.tsx b/packages/components/src/components/typography/Text/Text.tsx index f57e5beec08..5e67ee73781 100644 --- a/packages/components/src/components/typography/Text/Text.tsx +++ b/packages/components/src/components/typography/Text/Text.tsx @@ -1,6 +1,9 @@ +import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { CSSColor, Color, Colors } from '@trezor/theme'; -import { ReactNode } from 'react'; + import { TransientProps } from '../../../utils/transientProps'; import { FrameProps, diff --git a/packages/components/src/components/typography/TruncateWithTooltip/TruncateWithTooltip.stories.tsx b/packages/components/src/components/typography/TruncateWithTooltip/TruncateWithTooltip.stories.tsx index 960bd860776..18c99733291 100644 --- a/packages/components/src/components/typography/TruncateWithTooltip/TruncateWithTooltip.stories.tsx +++ b/packages/components/src/components/typography/TruncateWithTooltip/TruncateWithTooltip.stories.tsx @@ -1,9 +1,10 @@ import { Meta, StoryObj } from '@storybook/react'; +import styled from 'styled-components'; + import { TruncateWithTooltip as TruncateWithTooltipComponent, TruncateWithTooltipProps, } from './TruncateWithTooltip'; -import styled from 'styled-components'; const Container = styled.div` overflow: hidden; diff --git a/packages/components/src/components/typography/TruncateWithTooltip/TruncateWithTooltip.tsx b/packages/components/src/components/typography/TruncateWithTooltip/TruncateWithTooltip.tsx index f23eb2c2945..decf5aa4c54 100644 --- a/packages/components/src/components/typography/TruncateWithTooltip/TruncateWithTooltip.tsx +++ b/packages/components/src/components/typography/TruncateWithTooltip/TruncateWithTooltip.tsx @@ -1,5 +1,7 @@ -import styled from 'styled-components'; import { useEffect, useRef, useState } from 'react'; + +import styled from 'styled-components'; + import { Tooltip, Cursor } from '../../Tooltip/Tooltip'; import { TooltipDelay } from '../../Tooltip/TooltipDelay'; diff --git a/packages/components/src/components/typography/typography.stories.tsx b/packages/components/src/components/typography/typography.stories.tsx index f6473c92daa..b92417330c8 100644 --- a/packages/components/src/components/typography/typography.stories.tsx +++ b/packages/components/src/components/typography/typography.stories.tsx @@ -1,6 +1,7 @@ +import { Meta, StoryFn } from '@storybook/react'; + import { StoryColumn } from '../../support/Story'; import { H1, H2, Paragraph, Link } from '../../index'; -import { Meta, StoryFn } from '@storybook/react'; const meta: Meta = { title: 'Typography', diff --git a/packages/components/src/components/typography/utils.tsx b/packages/components/src/components/typography/utils.tsx index 6f12928271c..5c980549b77 100644 --- a/packages/components/src/components/typography/utils.tsx +++ b/packages/components/src/components/typography/utils.tsx @@ -1,7 +1,9 @@ +import { css } from 'styled-components'; + import { typography, TypographyStyle, typographyStyles } from '@trezor/theme'; + import { TransientProps, makePropsTransient } from '../../utils/transientProps'; import { UIHorizontalAlignment, uiHorizontalAlignments } from '../../config/types'; -import { css } from 'styled-components'; export const textWraps = ['balance', 'break-word']; export type TextWrap = (typeof textWraps)[number]; diff --git a/packages/components/src/support/Story.tsx b/packages/components/src/support/Story.tsx index ab437b298a7..53a440117c6 100644 --- a/packages/components/src/support/Story.tsx +++ b/packages/components/src/support/Story.tsx @@ -1,4 +1,5 @@ import styled, { ThemeProvider } from 'styled-components'; + import { intermediaryTheme } from '../index'; const Wrapper = styled.div` diff --git a/packages/components/src/utils/frameProps.tsx b/packages/components/src/utils/frameProps.tsx index 1c1307880c4..54ffaa1b85a 100644 --- a/packages/components/src/utils/frameProps.tsx +++ b/packages/components/src/utils/frameProps.tsx @@ -1,7 +1,9 @@ import { css } from 'styled-components'; -import { makePropsTransient, TransientProps } from './transientProps'; + import { SpacingValues } from '@trezor/theme'; +import { makePropsTransient, TransientProps } from './transientProps'; + type Margin = { top?: SpacingValues | 'auto'; bottom?: SpacingValues | 'auto'; diff --git a/packages/components/src/utils/useScrollShadow.tsx b/packages/components/src/utils/useScrollShadow.tsx index 0eacf47939b..c6abfb19ace 100644 --- a/packages/components/src/utils/useScrollShadow.tsx +++ b/packages/components/src/utils/useScrollShadow.tsx @@ -1,7 +1,10 @@ import { useEffect, useRef, useState } from 'react'; + import styled, { CSSObject, DefaultTheme } from 'styled-components'; -import { useElevation } from '../components/ElevationContext/ElevationContext'; + import { Color, Elevation, mapElevationToBackground } from '@trezor/theme'; + +import { useElevation } from '../components/ElevationContext/ElevationContext'; import { UIHorizontalAlignment, UIVerticalAlignment } from '../config/types'; type GradientDirection = Exclude; diff --git a/packages/components/styled.d.ts b/packages/components/styled.d.ts index ff56311cfb2..83b3a85013a 100644 --- a/packages/components/styled.d.ts +++ b/packages/components/styled.d.ts @@ -1,6 +1,7 @@ // import original module declarations import 'styled-components'; import { BoxShadows, Colors } from '@trezor/theme'; + import { SuiteThemeColors } from './src/config/colors'; declare module 'styled-components' { diff --git a/packages/connect-explorer/src/actions/trezorConnectActions.ts b/packages/connect-explorer/src/actions/trezorConnectActions.ts index 0bda38d062c..07663536d19 100644 --- a/packages/connect-explorer/src/actions/trezorConnectActions.ts +++ b/packages/connect-explorer/src/actions/trezorConnectActions.ts @@ -4,7 +4,6 @@ import TrezorConnect, { TRANSPORT_EVENT, WEBEXTENSION, } from '@trezor/connect-web'; - import TrezorConnectMobile from '@trezor/connect-mobile'; import { TrezorConnectDevice, Dispatch, Field, GetState } from '../types'; diff --git a/packages/connect-explorer/src/components/GuideIndex.tsx b/packages/connect-explorer/src/components/GuideIndex.tsx index 3e86ecadfe1..f7e01a60fcc 100644 --- a/packages/connect-explorer/src/components/GuideIndex.tsx +++ b/packages/connect-explorer/src/components/GuideIndex.tsx @@ -1,9 +1,10 @@ +import { ReactNode } from 'react'; + import { getPagesUnderRoute } from 'nextra/context'; import Link from 'next/link'; -import { ReactNode } from 'react'; +import styled from 'styled-components'; import { Card as TrezorCard, H3, Paragraph, Button } from '@trezor/components'; -import styled from 'styled-components'; import { spacingsPx } from '@trezor/theme'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/connect-explorer/src/components/ZoomableIllustration.tsx b/packages/connect-explorer/src/components/ZoomableIllustration.tsx index 8d33328c94b..0012c5aac65 100644 --- a/packages/connect-explorer/src/components/ZoomableIllustration.tsx +++ b/packages/connect-explorer/src/components/ZoomableIllustration.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Zoom from 'react-medium-image-zoom'; -import { useRouter } from 'next/router'; +import { useRouter } from 'next/router'; import { createGlobalStyle, useTheme, styled } from 'styled-components'; import 'react-medium-image-zoom/dist/styles.css'; diff --git a/packages/connect-explorer/src/components/fields/ArrayWrapper.tsx b/packages/connect-explorer/src/components/fields/ArrayWrapper.tsx index 0d22e70f520..852e67a7317 100644 --- a/packages/connect-explorer/src/components/fields/ArrayWrapper.tsx +++ b/packages/connect-explorer/src/components/fields/ArrayWrapper.tsx @@ -2,9 +2,10 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; -import type { FieldWithBundle } from '../../types'; import { Icon } from '@trezor/components'; +import type { FieldWithBundle } from '../../types'; + interface AddButtonProps { field: FieldWithBundle; onAdd: () => void; diff --git a/packages/connect-explorer/src/pages/callback.mdx b/packages/connect-explorer/src/pages/callback.mdx index 8ec2ef41e86..fb77584a588 100644 --- a/packages/connect-explorer/src/pages/callback.mdx +++ b/packages/connect-explorer/src/pages/callback.mdx @@ -1,4 +1,5 @@ import { useEffect } from 'react'; + import { Button } from '@trezor/components'; export const CallbackHandler = () => { diff --git a/packages/connect-explorer/src/pages/changelog.mdx b/packages/connect-explorer/src/pages/changelog.mdx index b8f49ffd6c6..18de55d9b1e 100644 --- a/packages/connect-explorer/src/pages/changelog.mdx +++ b/packages/connect-explorer/src/pages/changelog.mdx @@ -2,14 +2,15 @@ icon: log --- +import Markdown from 'react-markdown'; + import rehypeSectionize from '@hbsnow/rehype-sectionize'; import remarkGfm from 'remark-gfm'; import remarkGemoji from 'remark-gemoji'; import useSWR from 'swr'; -import Markdown from 'react-markdown'; -import { useMDXComponents } from '@trezor/connect-explorer-theme'; import { Callout } from 'nextra/components'; +import { useMDXComponents } from '@trezor/connect-explorer-theme'; import { spacings } from '@trezor/theme'; import { CollapsibleBox } from '@trezor/components'; import { isNewer } from '@trezor/utils/src/versionUtils'; diff --git a/packages/connect-explorer/src/pages/details/deeplinking.mdx b/packages/connect-explorer/src/pages/details/deeplinking.mdx index a56977f7eaf..b4c67277cbe 100644 --- a/packages/connect-explorer/src/pages/details/deeplinking.mdx +++ b/packages/connect-explorer/src/pages/details/deeplinking.mdx @@ -1,4 +1,5 @@ import { Callout } from 'nextra/components'; + import { BetaOnly } from '../../components/BetaOnly'; # Deep linking specification diff --git a/packages/connect-explorer/src/pages/readme/[name].mdx b/packages/connect-explorer/src/pages/readme/[name].mdx index f9bdec59a62..0002bd71e1f 100644 --- a/packages/connect-explorer/src/pages/readme/[name].mdx +++ b/packages/connect-explorer/src/pages/readme/[name].mdx @@ -2,6 +2,7 @@ import { RemoteContent } from 'nextra/data'; import { buildDynamicMDX, buildDynamicMeta } from 'nextra/remote'; import rehypeSectionize from '@hbsnow/rehype-sectionize'; import remarkGemoji from 'remark-gemoji'; + import { isBetaOnly } from '../../components/BetaOnly'; export const getStaticPaths = () => { diff --git a/packages/connect-iframe/src/index.ts b/packages/connect-iframe/src/index.ts index 74f95a7da9f..816ba439bff 100644 --- a/packages/connect-iframe/src/index.ts +++ b/packages/connect-iframe/src/index.ts @@ -28,8 +28,9 @@ import { getOrigin } from '@trezor/connect/src/utils/urlUtils'; import { suggestBridgeInstaller } from '@trezor/connect/src/data/transportInfo'; import { suggestUdevInstaller } from '@trezor/connect/src/data/udevInfo'; import { storage, getSystemInfo, getInstallerPackage } from '@trezor/connect-common'; -import { parseConnectSettings, isOriginWhitelisted } from './connectSettings'; import { analytics, EventType } from '@trezor/connect-analytics'; + +import { parseConnectSettings, isOriginWhitelisted } from './connectSettings'; // @ts-expect-error (typescript does not know this is worker constructor, this is done by webpack) import LogWorker from './sharedLoggerWorker'; import { initLogWriterWithWorker } from './sharedLoggerUtils'; diff --git a/packages/connect-iframe/webpack/base.webpack.config.ts b/packages/connect-iframe/webpack/base.webpack.config.ts index 1b73e0ea59f..8a8238ae09b 100644 --- a/packages/connect-iframe/webpack/base.webpack.config.ts +++ b/packages/connect-iframe/webpack/base.webpack.config.ts @@ -3,6 +3,7 @@ import { execSync } from 'child_process'; import webpack from 'webpack'; import CopyWebpackPlugin from 'copy-webpack-plugin'; import TerserPlugin from 'terser-webpack-plugin'; + import { version } from '../package.json'; const COMMON_DATA_SRC = '../../packages/connect-common/files'; diff --git a/packages/connect-plugin-stellar/src/index.ts b/packages/connect-plugin-stellar/src/index.ts index bf42c2f23e5..21cb64240c3 100644 --- a/packages/connect-plugin-stellar/src/index.ts +++ b/packages/connect-plugin-stellar/src/index.ts @@ -9,6 +9,7 @@ import { MemoHash, MemoReturn, } from '@stellar/stellar-sdk'; + import { BigNumber } from '@trezor/utils/src/bigNumber'; /** diff --git a/packages/connect-popup/e2e/tests/analytics.test.ts b/packages/connect-popup/e2e/tests/analytics.test.ts index 9a9b20b049b..380347e5099 100644 --- a/packages/connect-popup/e2e/tests/analytics.test.ts +++ b/packages/connect-popup/e2e/tests/analytics.test.ts @@ -1,6 +1,7 @@ import { test, expect } from '@playwright/test'; import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; + import { waitAndClick } from '../support/helpers'; const url = process.env.URL || 'http://localhost:8088/'; diff --git a/packages/connect-popup/e2e/tests/browser-support.test.ts b/packages/connect-popup/e2e/tests/browser-support.test.ts index 58cca779072..8bab9442706 100644 --- a/packages/connect-popup/e2e/tests/browser-support.test.ts +++ b/packages/connect-popup/e2e/tests/browser-support.test.ts @@ -1,6 +1,8 @@ import { test, expect, Page, devices } from '@playwright/test'; + import { ensureDirectoryExists } from '@trezor/node-utils'; import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; + import { formatUrl, log, waitAndClick } from '../support/helpers'; const url = process.env.URL || 'http://localhost:8088/'; diff --git a/packages/connect-popup/e2e/tests/methods.test.ts b/packages/connect-popup/e2e/tests/methods.test.ts index 9cddbd281d7..9929a08b3f9 100644 --- a/packages/connect-popup/e2e/tests/methods.test.ts +++ b/packages/connect-popup/e2e/tests/methods.test.ts @@ -1,9 +1,10 @@ import { expect, test } from '@playwright/test'; import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; +import { ensureDirectoryExists } from '@trezor/node-utils'; + import { fixtures } from './__fixtures__/methods'; import { buildOverview } from '../support/buildOverview'; -import { ensureDirectoryExists } from '@trezor/node-utils'; import { getContexts, log, formatUrl, openPopup, setConnectSettings } from '../support/helpers'; const url = process.env.URL || 'http://localhost:8088/'; diff --git a/packages/connect-popup/e2e/tests/passphrase.test.ts b/packages/connect-popup/e2e/tests/passphrase.test.ts index 252eec90ca8..f38a5f9fb36 100644 --- a/packages/connect-popup/e2e/tests/passphrase.test.ts +++ b/packages/connect-popup/e2e/tests/passphrase.test.ts @@ -1,5 +1,7 @@ import { test, Page, BrowserContext } from '@playwright/test'; + import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; + import { findElementByDataTest, formatUrl, diff --git a/packages/connect-popup/e2e/tests/permissions.test.ts b/packages/connect-popup/e2e/tests/permissions.test.ts index 3d6837c3803..f5d8dc8d1b2 100644 --- a/packages/connect-popup/e2e/tests/permissions.test.ts +++ b/packages/connect-popup/e2e/tests/permissions.test.ts @@ -1,5 +1,7 @@ import { test, chromium, Page } from '@playwright/test'; + import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; + import { setConnectSettings, waitAndClick } from '../support/helpers'; const url = process.env.URL || 'http://localhost:8088/'; diff --git a/packages/connect-popup/e2e/tests/popup-close.test.ts b/packages/connect-popup/e2e/tests/popup-close.test.ts index cb2a28c2c9e..91371d68c74 100644 --- a/packages/connect-popup/e2e/tests/popup-close.test.ts +++ b/packages/connect-popup/e2e/tests/popup-close.test.ts @@ -1,6 +1,8 @@ import { test, Page, BrowserContext } from '@playwright/test'; + import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; import { addDashesToSpaces, createTimeoutPromise } from '@trezor/utils'; + import { findElementByDataTest, waitAndClick, diff --git a/packages/connect-popup/e2e/tests/popup-pages.test.ts b/packages/connect-popup/e2e/tests/popup-pages.test.ts index 84b3ed32ff3..fcae9e676f3 100644 --- a/packages/connect-popup/e2e/tests/popup-pages.test.ts +++ b/packages/connect-popup/e2e/tests/popup-pages.test.ts @@ -1,5 +1,8 @@ import { test, Page, BrowserContext, expect } from '@playwright/test'; +import fs from 'fs'; + import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; + import { getContexts, openPopup, @@ -9,7 +12,6 @@ import { waitAndClick, } from '../support/helpers'; -import fs from 'fs'; const url = process.env.URL || 'http://localhost:8088/'; diff --git a/packages/connect-popup/e2e/tests/transport.test.ts b/packages/connect-popup/e2e/tests/transport.test.ts index f4297de5c29..21bb1d86059 100644 --- a/packages/connect-popup/e2e/tests/transport.test.ts +++ b/packages/connect-popup/e2e/tests/transport.test.ts @@ -1,9 +1,11 @@ import { test, expect, firefox, chromium, Page, BrowserContext } from '@playwright/test'; -import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; -import { waitAndClick, log, formatUrl } from '../support/helpers'; import http from 'http'; import https from 'https'; +import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; + +import { waitAndClick, log, formatUrl } from '../support/helpers'; + const url = process.env.URL || 'http://localhost:8088/'; // different origin URL for testing cross-origin requests diff --git a/packages/connect-popup/e2e/tests/unchained.test.ts b/packages/connect-popup/e2e/tests/unchained.test.ts index 17c3a975a81..d0045cae326 100644 --- a/packages/connect-popup/e2e/tests/unchained.test.ts +++ b/packages/connect-popup/e2e/tests/unchained.test.ts @@ -1,6 +1,7 @@ /* eslint no-await-in-loop: 0 */ import { test, expect, Page } from '@playwright/test'; + import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; const connectUrl = process.env.URL ? process.env.URL : 'https://connect.trezor.io/9/'; diff --git a/packages/connect-popup/src/deeplink.tsx b/packages/connect-popup/src/deeplink.tsx index df7bcd3b47f..ae9e7c2dd30 100644 --- a/packages/connect-popup/src/deeplink.tsx +++ b/packages/connect-popup/src/deeplink.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import styled, { ThemeProvider } from 'styled-components'; import { createRoot } from 'react-dom/client'; diff --git a/packages/connect-popup/src/index.tsx b/packages/connect-popup/src/index.tsx index 0374ffd798c..3953fbdff37 100644 --- a/packages/connect-popup/src/index.tsx +++ b/packages/connect-popup/src/index.tsx @@ -22,11 +22,12 @@ import type { Core } from '@trezor/connect/src/core'; import { config } from '@trezor/connect/src/data/config'; import { parseConnectSettings } from '@trezor/connect-iframe/src/connectSettings'; import { initLogWriterWithSrcPath } from '@trezor/connect-iframe/src/sharedLoggerUtils'; - import { reactEventBus } from '@trezor/connect-ui/src/utils/eventBus'; import { ErrorViewProps } from '@trezor/connect-ui/src/views/Error'; import { analytics, EventType } from '@trezor/connect-analytics'; import { getSystemInfo } from '@trezor/connect-common'; +import { initLog, setLogWriter, LogWriter } from '@trezor/connect/src/utils/debug'; +import { DEFAULT_DOMAIN } from '@trezor/connect/src/data/version'; import * as view from './view'; import { @@ -38,8 +39,6 @@ import { showView, } from './view/common'; import { isPhishingDomain } from './utils/isPhishingDomain'; -import { initLog, setLogWriter, LogWriter } from '@trezor/connect/src/utils/debug'; -import { DEFAULT_DOMAIN } from '@trezor/connect/src/data/version'; const INTERVAL_CHECK_PARENT_ALIVE_MS = 1000; const INTERVAL_HANDSHAKE_TIMEOUT_MS = 90 * 1000; diff --git a/packages/connect-popup/src/log.tsx b/packages/connect-popup/src/log.tsx index 12c7b1dd9cb..499042d1511 100644 --- a/packages/connect-popup/src/log.tsx +++ b/packages/connect-popup/src/log.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useState } from 'react'; + import styled, { ThemeProvider } from 'styled-components'; import { createRoot } from 'react-dom/client'; diff --git a/packages/connect-popup/src/view/browser.ts b/packages/connect-popup/src/view/browser.ts index 782170d5c52..c193b80efc1 100644 --- a/packages/connect-popup/src/view/browser.ts +++ b/packages/connect-popup/src/view/browser.ts @@ -2,6 +2,7 @@ import { SystemInfo } from '@trezor/connect'; import { storage } from '@trezor/connect-common'; + import { container, showView } from './common'; export const initBrowserView = (systemInfo: SystemInfo): Promise => { diff --git a/packages/connect-popup/src/view/common.tsx b/packages/connect-popup/src/view/common.tsx index 29f3b98b480..4a5bcefe131 100644 --- a/packages/connect-popup/src/view/common.tsx +++ b/packages/connect-popup/src/view/common.tsx @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/popup/view/common.js +import { createRoot } from 'react-dom/client'; + import { POPUP, ERRORS, @@ -8,12 +10,11 @@ import { CoreRequestMessage, CoreEventMessage, } from '@trezor/connect'; -import { createRoot } from 'react-dom/client'; - import { ConnectUI, State, getDefaultState } from '@trezor/connect-ui'; -import { StyleSheetWrapper } from './react/StylesSheetWrapper'; import { reactEventBus } from '@trezor/connect-ui/src/utils/eventBus'; +import { StyleSheetWrapper } from './react/StylesSheetWrapper'; + export const header: HTMLElement = document.getElementsByTagName('header')[0]; export const container: HTMLElement = document.getElementById('container')!; export const views: HTMLElement = document.getElementById('views')!; diff --git a/packages/connect-popup/src/view/confirmation.ts b/packages/connect-popup/src/view/confirmation.ts index 8bf81d8f8a7..f5806df33cf 100644 --- a/packages/connect-popup/src/view/confirmation.ts +++ b/packages/connect-popup/src/view/confirmation.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/popup/view/confirmation.js import { UI, createUiResponse, UiRequestConfirmation } from '@trezor/connect'; + import { container, showView, postMessage } from './common'; export const initConfirmationView = (data: UiRequestConfirmation['payload']) => { diff --git a/packages/connect-popup/src/view/firmwareNotCompatible.ts b/packages/connect-popup/src/view/firmwareNotCompatible.ts index 5844b275cf3..1378f0f6ba7 100644 --- a/packages/connect-popup/src/view/firmwareNotCompatible.ts +++ b/packages/connect-popup/src/view/firmwareNotCompatible.ts @@ -1,9 +1,10 @@ // origin https://github.com/trezor/connect/blob/develop/src/js/popup/view/firmwareNotCompatible.js import { UI, createUiResponse, UiRequestUnexpectedDeviceMode } from '@trezor/connect'; -import { showView, postMessage, getState } from './common'; import { getFirmwareVersion } from '@trezor/device-utils'; +import { showView, postMessage, getState } from './common'; + export const firmwareNotCompatible = (device: UiRequestUnexpectedDeviceMode['payload']) => { const view = showView('firmware-not-compatible'); diff --git a/packages/connect-popup/src/view/firmwareNotSupported.ts b/packages/connect-popup/src/view/firmwareNotSupported.ts index f59ad2fd9d3..5ada49d8373 100644 --- a/packages/connect-popup/src/view/firmwareNotSupported.ts +++ b/packages/connect-popup/src/view/firmwareNotSupported.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/popup/view/firmwareNotSupported.js import { UiRequestUnexpectedDeviceMode } from '@trezor/connect'; + import { showView } from './common'; export const firmwareNotSupported = (device: UiRequestUnexpectedDeviceMode['payload']) => { diff --git a/packages/connect-popup/src/view/firmwareRequiredUpdate.ts b/packages/connect-popup/src/view/firmwareRequiredUpdate.ts index 4d7001a708f..411d740b419 100644 --- a/packages/connect-popup/src/view/firmwareRequiredUpdate.ts +++ b/packages/connect-popup/src/view/firmwareRequiredUpdate.ts @@ -2,6 +2,7 @@ import { UiRequestUnexpectedDeviceMode } from '@trezor/connect'; import { SUITE_FIRMWARE_URL } from '@trezor/urls'; + import { showView } from './common'; export const firmwareRequiredUpdate = (device: UiRequestUnexpectedDeviceMode['payload']) => { diff --git a/packages/connect-popup/src/view/invalidPassphrase.ts b/packages/connect-popup/src/view/invalidPassphrase.ts index f33978b16fb..5924c0e6333 100644 --- a/packages/connect-popup/src/view/invalidPassphrase.ts +++ b/packages/connect-popup/src/view/invalidPassphrase.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/popup/view/invalidPassphrase.js import { UI, createUiResponse, UiRequestDeviceAction } from '@trezor/connect'; + import { container, showView, postMessage } from './common'; export const initInvalidPassphraseView = (_payload: UiRequestDeviceAction['payload']) => { diff --git a/packages/connect-popup/src/view/passphraseOnDevice.ts b/packages/connect-popup/src/view/passphraseOnDevice.ts index 36f4cbd2e54..09776bdfa97 100644 --- a/packages/connect-popup/src/view/passphraseOnDevice.ts +++ b/packages/connect-popup/src/view/passphraseOnDevice.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/popup/view/passphraseOnDevice.js import { UiRequestDeviceAction } from '@trezor/connect'; + import { container, showView } from './common'; export const passphraseOnDeviceView = (payload: UiRequestDeviceAction['payload']) => { diff --git a/packages/connect-popup/src/view/permissions.ts b/packages/connect-popup/src/view/permissions.ts index dfaf71a6499..cc2d80f2b95 100644 --- a/packages/connect-popup/src/view/permissions.ts +++ b/packages/connect-popup/src/view/permissions.ts @@ -2,6 +2,7 @@ import { UI, createUiResponse, UiRequestPermission } from '@trezor/connect'; import { analytics, EventType } from '@trezor/connect-analytics'; + import { container, showView, postMessage, createTooltip, getState } from './common'; const getPermissionText = (permissionType: string, _deviceName: string) => { diff --git a/packages/connect-popup/src/view/pin.ts b/packages/connect-popup/src/view/pin.ts index 65c4a592197..826769368e2 100644 --- a/packages/connect-popup/src/view/pin.ts +++ b/packages/connect-popup/src/view/pin.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/popup/view/pin.js import { UI, createUiResponse, UiRequestDeviceAction } from '@trezor/connect'; + import { container, showView, postMessage } from './common'; const isSubmitButtonDisabled = (isDisabled: boolean) => { diff --git a/packages/connect-popup/src/view/react/StylesSheetWrapper.tsx b/packages/connect-popup/src/view/react/StylesSheetWrapper.tsx index 403b9af421e..a9b2af0faf5 100644 --- a/packages/connect-popup/src/view/react/StylesSheetWrapper.tsx +++ b/packages/connect-popup/src/view/react/StylesSheetWrapper.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import { StyleSheetManager } from 'styled-components'; interface StyleSheetWrapperProps { diff --git a/packages/connect-popup/src/view/requestButton.ts b/packages/connect-popup/src/view/requestButton.ts index 5f2a0e5fe83..44924f86d71 100644 --- a/packages/connect-popup/src/view/requestButton.ts +++ b/packages/connect-popup/src/view/requestButton.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/popup/view/requestButton.js import { UiRequestButton } from '@trezor/connect'; + import { container, showView } from './common'; let toastTimeout: NodeJS.Timeout | undefined; diff --git a/packages/connect-popup/src/view/selectAccount.ts b/packages/connect-popup/src/view/selectAccount.ts index 25765e34e0a..32a0f6cf51c 100644 --- a/packages/connect-popup/src/view/selectAccount.ts +++ b/packages/connect-popup/src/view/selectAccount.ts @@ -7,6 +7,7 @@ import { UiRequestSelectAccount, DiscoveryAccountType, } from '@trezor/connect'; + import { container, showView, postMessage } from './common'; const setHeader = (payload: UiRequestSelectAccount['payload']) => { diff --git a/packages/connect-popup/src/view/selectDevice.ts b/packages/connect-popup/src/view/selectDevice.ts index 5f46ad7f5bd..593c7b88f1a 100644 --- a/packages/connect-popup/src/view/selectDevice.ts +++ b/packages/connect-popup/src/view/selectDevice.ts @@ -12,9 +12,10 @@ import { } from '@trezor/connect'; import { TREZOR_USB_DESCRIPTORS } from '@trezor/transport/src/constants'; import { SUITE_URL, SUITE_UDEV_URL, TREZOR_SUPPORT_URL } from '@trezor/urls'; -import { container, getState, showView, postMessage } from './common'; import { reactEventBus } from '@trezor/connect-ui/src/utils/eventBus'; +import { container, getState, showView, postMessage } from './common'; + const initWebUsbButton = (showLoader: boolean) => { const webusbContainer = container.getElementsByClassName('webusb')[0] as HTMLElement; webusbContainer.style.display = 'flex'; diff --git a/packages/connect-popup/src/view/selectFee.ts b/packages/connect-popup/src/view/selectFee.ts index 255f110009c..41baf35336c 100644 --- a/packages/connect-popup/src/view/selectFee.ts +++ b/packages/connect-popup/src/view/selectFee.ts @@ -9,6 +9,7 @@ import { SelectFeeLevel, } from '@trezor/connect'; import { formatAmount, formatTime } from '@trezor/connect/src/utils/formatUtils'; + import { container, showView, postMessage } from './common'; const fees: SelectFeeLevel[] = []; diff --git a/packages/connect-popup/src/view/word.ts b/packages/connect-popup/src/view/word.ts index 0db8f117ae3..4c91de58cab 100644 --- a/packages/connect-popup/src/view/word.ts +++ b/packages/connect-popup/src/view/word.ts @@ -1,9 +1,10 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/popup/view/word.js import { UI, createUiResponse, UiRequestDeviceAction } from '@trezor/connect'; -import { container, showView, postMessage } from './common'; import { bip39 } from '@trezor/crypto-utils'; +import { container, showView, postMessage } from './common'; + const initWordPlainView = (payload: UiRequestDeviceAction['payload']) => { showView('word-plain'); diff --git a/packages/connect-popup/webpack/dev.webpack.config.ts b/packages/connect-popup/webpack/dev.webpack.config.ts index 0455850df4b..cf1a1440b5b 100644 --- a/packages/connect-popup/webpack/dev.webpack.config.ts +++ b/packages/connect-popup/webpack/dev.webpack.config.ts @@ -1,6 +1,7 @@ import path from 'path'; import { merge } from 'webpack-merge'; import { WebpackPluginServe } from 'webpack-plugin-serve'; + import prod from './prod.webpack.config'; const dev = { diff --git a/packages/connect-popup/webpack/prod.webpack.config.ts b/packages/connect-popup/webpack/prod.webpack.config.ts index 81300ba31a9..7e6649d07de 100644 --- a/packages/connect-popup/webpack/prod.webpack.config.ts +++ b/packages/connect-popup/webpack/prod.webpack.config.ts @@ -3,10 +3,12 @@ import webpack, { DefinePlugin } from 'webpack'; import HtmlWebpackPlugin from 'html-webpack-plugin'; import TerserPlugin from 'terser-webpack-plugin'; import CopyPlugin from 'copy-webpack-plugin'; +import { execSync } from 'child_process'; + import * as URLS from '@trezor/urls'; import { DEEPLINK_VERSION } from '@trezor/connect/src/data/version'; + import { version } from '../package.json'; -import { execSync } from 'child_process'; const STATIC_SRC = path.join(__dirname, '../src/static'); const DIST = path.resolve(__dirname, '../build'); diff --git a/packages/connect-web/src/iframe/index.ts b/packages/connect-web/src/iframe/index.ts index ffa538eccf1..f49b47bb00e 100644 --- a/packages/connect-web/src/iframe/index.ts +++ b/packages/connect-web/src/iframe/index.ts @@ -6,6 +6,7 @@ import { IFRAME, CoreRequestMessage } from '@trezor/connect/src/events'; import type { ConnectSettings } from '@trezor/connect/src/types'; import { getOrigin } from '@trezor/connect/src/utils/urlUtils'; import { setLogWriter, LogMessage, LogWriter } from '@trezor/connect/src/utils/debug'; + import css from './inlineStyles'; export let instance: HTMLIFrameElement | null; diff --git a/packages/connect-web/src/impl/core-in-iframe.ts b/packages/connect-web/src/impl/core-in-iframe.ts index 1757a90fce8..40888071e88 100644 --- a/packages/connect-web/src/impl/core-in-iframe.ts +++ b/packages/connect-web/src/impl/core-in-iframe.ts @@ -29,12 +29,12 @@ import { ConnectFactoryDependencies, factory } from '@trezor/connect/src/factory import { Log, initLog } from '@trezor/connect/src/utils/debug'; import { config } from '@trezor/connect/src/data/config'; import { DeferredManager, createDeferredManager } from '@trezor/utils/src/createDeferredManager'; +import { InitFullSettings } from '@trezor/connect/src/types/api/init'; import * as iframe from '../iframe'; import * as popup from '../popup'; import webUSBButton from '../webusb/button'; import { parseConnectSettings } from '../connectSettings'; -import { InitFullSettings } from '@trezor/connect/src/types/api/init'; export class CoreInIframe implements ConnectFactoryDependencies { public eventEmitter = new EventEmitter(); diff --git a/packages/connect-web/src/impl/core-in-popup.ts b/packages/connect-web/src/impl/core-in-popup.ts index da2fe68df67..966b202c94b 100644 --- a/packages/connect-web/src/impl/core-in-popup.ts +++ b/packages/connect-web/src/impl/core-in-popup.ts @@ -19,13 +19,13 @@ import type { } from '@trezor/connect/src/types'; import { ConnectFactoryDependencies, factory } from '@trezor/connect/src/factory'; import { initLog, setLogWriter, LogMessage, LogWriter, Log } from '@trezor/connect/src/utils/debug'; -import * as popup from '../popup'; - -import { parseConnectSettings } from '../connectSettings'; import { Login } from '@trezor/connect/src/types/api/requestLogin'; import { createDeferred } from '@trezor/utils'; import { InitFullSettings } from '@trezor/connect/src/types/api/init'; +import { parseConnectSettings } from '../connectSettings'; +import * as popup from '../popup'; + /** * Base class for CoreInPopup methods for TrezorConnect factory. * This implementation is directly used here in connect-web, but it is also extended in connect-webextension. diff --git a/packages/connect-web/src/index.ts b/packages/connect-web/src/index.ts index b1d74503dd6..052bf1c0994 100644 --- a/packages/connect-web/src/index.ts +++ b/packages/connect-web/src/index.ts @@ -1,8 +1,9 @@ import { ConnectFactoryDependencies, factory } from '@trezor/connect/src/factory'; import { TrezorConnectDynamic } from '@trezor/connect/src/impl/dynamic'; +import type { ConnectSettingsPublic, ConnectSettingsWeb } from '@trezor/connect'; + import { CoreInIframe } from './impl/core-in-iframe'; import { CoreInPopup } from './impl/core-in-popup'; -import type { ConnectSettingsPublic, ConnectSettingsWeb } from '@trezor/connect'; import { getEnv } from './connectSettings'; const IFRAME_ERRORS = ['Init_IframeBlocked', 'Init_IframeTimeout', 'Transport_Missing']; diff --git a/packages/connect-web/src/popup/index.ts b/packages/connect-web/src/popup/index.ts index b76e095c326..1019596eb3f 100644 --- a/packages/connect-web/src/popup/index.ts +++ b/packages/connect-web/src/popup/index.ts @@ -1,19 +1,20 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/popup/PopupManager.js import EventEmitter from 'events'; + import { createDeferred, Deferred, scheduleAction } from '@trezor/utils'; import { POPUP, IFRAME, UI, CoreEventMessage, IFrameLoaded } from '@trezor/connect/src/events'; import type { ConnectSettings } from '@trezor/connect/src/types'; import { getOrigin } from '@trezor/connect/src/utils/urlUtils'; import { CONTENT_SCRIPT_VERSION, VERSION } from '@trezor/connect/src/data/version'; -import { showPopupRequest } from './showPopupRequest'; import { Log } from '@trezor/connect/src/utils/debug'; - -import { ServiceWorkerWindowChannel } from '../channels/serviceworker-window'; import { AbstractMessageChannel, Message, } from '@trezor/connect-common/src/messageChannel/abstract'; + +import { showPopupRequest } from './showPopupRequest'; +import { ServiceWorkerWindowChannel } from '../channels/serviceworker-window'; import { WindowWindowChannel } from '../channels/window-window'; // Util diff --git a/packages/connect-web/webpack/inline.webpack.config.ts b/packages/connect-web/webpack/inline.webpack.config.ts index 1dd8abc4874..0e5101d024e 100644 --- a/packages/connect-web/webpack/inline.webpack.config.ts +++ b/packages/connect-web/webpack/inline.webpack.config.ts @@ -1,6 +1,7 @@ import webpack from 'webpack'; import path from 'path'; import TerserPlugin from 'terser-webpack-plugin'; + import prod from './prod.webpack.config'; // Generate inline script hosted on https://connect.trezor.io/X/trezor-connect.js diff --git a/packages/connect/e2e/__fixtures__/cardanoGetAddress.ts b/packages/connect/e2e/__fixtures__/cardanoGetAddress.ts index 62fccdbc29b..8317204bf99 100644 --- a/packages/connect/e2e/__fixtures__/cardanoGetAddress.ts +++ b/packages/connect/e2e/__fixtures__/cardanoGetAddress.ts @@ -1,6 +1,7 @@ -import { NETWORK_IDS, PROTOCOL_MAGICS } from '../../src/constants/cardano'; import { MessagesSchema } from '@trezor/protobuf'; +import { NETWORK_IDS, PROTOCOL_MAGICS } from '../../src/constants/cardano'; + const { CardanoAddressType } = MessagesSchema; const legacyResults = { diff --git a/packages/connect/e2e/__fixtures__/cardanoGetAddressDerivations.ts b/packages/connect/e2e/__fixtures__/cardanoGetAddressDerivations.ts index e8d483c6676..e8669f19e36 100644 --- a/packages/connect/e2e/__fixtures__/cardanoGetAddressDerivations.ts +++ b/packages/connect/e2e/__fixtures__/cardanoGetAddressDerivations.ts @@ -1,8 +1,9 @@ /* eslint-disable @typescript-eslint/prefer-ts-expect-error */ // @ts-ignore +import { MessagesSchema } from '@trezor/protobuf'; + import commonFixtures from '../../../../submodules/trezor-common/tests/fixtures/cardano/get_base_address.derivations.json'; -import { MessagesSchema } from '@trezor/protobuf'; const { CardanoAddressType, CardanoDerivationType } = MessagesSchema; diff --git a/packages/connect/e2e/__fixtures__/cardanoSignTransaction.ts b/packages/connect/e2e/__fixtures__/cardanoSignTransaction.ts index 5381f9696cb..8c580fa03e4 100644 --- a/packages/connect/e2e/__fixtures__/cardanoSignTransaction.ts +++ b/packages/connect/e2e/__fixtures__/cardanoSignTransaction.ts @@ -1,6 +1,7 @@ +import { MessagesSchema } from '@trezor/protobuf'; + import { NETWORK_IDS, PROTOCOL_MAGICS } from '../../src/constants/cardano'; -import { MessagesSchema } from '@trezor/protobuf'; const { CardanoAddressType, diff --git a/packages/connect/e2e/__fixtures__/ethereumSignMessage.ts b/packages/connect/e2e/__fixtures__/ethereumSignMessage.ts index c0f7f676937..5dc85eea401 100644 --- a/packages/connect/e2e/__fixtures__/ethereumSignMessage.ts +++ b/packages/connect/e2e/__fixtures__/ethereumSignMessage.ts @@ -1,4 +1,5 @@ import { arrayPartition } from '@trezor/utils'; + /* eslint-disable @typescript-eslint/prefer-ts-expect-error */ // @ts-ignore import commonFixtures from '../../../../submodules/trezor-common/tests/fixtures/ethereum/signmessage.json'; diff --git a/packages/connect/e2e/__fixtures__/stellarSignTransaction.ts b/packages/connect/e2e/__fixtures__/stellarSignTransaction.ts index 22818af2705..6171e2adc41 100644 --- a/packages/connect/e2e/__fixtures__/stellarSignTransaction.ts +++ b/packages/connect/e2e/__fixtures__/stellarSignTransaction.ts @@ -1,8 +1,9 @@ /* eslint-disable @typescript-eslint/prefer-ts-expect-error */ // @ts-ignore -import commonFixtures from '../../../../submodules/trezor-common/tests/fixtures/stellar/sign_tx.json'; import * as Messages from '@trezor/protobuf/src/messages'; +import commonFixtures from '../../../../submodules/trezor-common/tests/fixtures/stellar/sign_tx.json'; + // operations are in protobuf format (snake_case) const transformAsset = (asset: any) => ({ diff --git a/packages/connect/e2e/__txcache__/gen-reftx.ts b/packages/connect/e2e/__txcache__/gen-reftx.ts index 468a2ca1cb0..0b064064c70 100644 --- a/packages/connect/e2e/__txcache__/gen-reftx.ts +++ b/packages/connect/e2e/__txcache__/gen-reftx.ts @@ -1,6 +1,7 @@ import * as BitcoinJs from '@trezor/utxo-lib'; import type { TxInput, TxOutput } from '@trezor/utxo-lib/src/transaction/base'; import { bufferUtils } from '@trezor/utils'; + import { RefTransaction } from '../../src'; // Referenced transaction generator script. diff --git a/packages/connect/e2e/__wscache__/server.js b/packages/connect/e2e/__wscache__/server.js index 00a5b23518a..7aaa191f471 100644 --- a/packages/connect/e2e/__wscache__/server.js +++ b/packages/connect/e2e/__wscache__/server.js @@ -1,4 +1,5 @@ const WebSocket = require('ws'); + const { blockbookFixtures } = require('./blockbook'); const { rippleFixtures } = require('./ripple'); const { blockfrostFixtures } = require('./blockfrost'); diff --git a/packages/connect/e2e/common.setup.ts b/packages/connect/e2e/common.setup.ts index 53dd39e2672..ef055bb644e 100644 --- a/packages/connect/e2e/common.setup.ts +++ b/packages/connect/e2e/common.setup.ts @@ -1,6 +1,4 @@ -import TrezorConnect from '../src'; import { versionUtils } from '@trezor/utils'; -import { UI } from '../src/events'; import { TrezorUserEnvLink, type TrezorUserEnvLinkClass, @@ -9,6 +7,9 @@ import { } from '@trezor/trezor-user-env-link'; import { ApplySettings } from '@trezor/protobuf/src/messages-schema'; +import { UI } from '../src/events'; +import TrezorConnect from '../src'; + const emulatorStartOpts = (process.env.emulatorStartOpts as StartEmu) || global.emulatorStartOpts || {}; diff --git a/packages/connect/e2e/tests/device/authenticateDevice.test.ts b/packages/connect/e2e/tests/device/authenticateDevice.test.ts index d2b002f8f4f..8bc7c083ed0 100644 --- a/packages/connect/e2e/tests/device/authenticateDevice.test.ts +++ b/packages/connect/e2e/tests/device/authenticateDevice.test.ts @@ -1,6 +1,6 @@ import { DeviceAuthenticityConfig } from '@trezor/connect/src/data/deviceAuthenticityConfigTypes'; -import TrezorConnect from '../../../src'; +import TrezorConnect from '../../../src'; import { getController, setup, initTrezorConnect } from '../../common.setup'; const controller = getController(); diff --git a/packages/connect/e2e/tests/device/authorizeCoinjoin.test.ts b/packages/connect/e2e/tests/device/authorizeCoinjoin.test.ts index 8d83cd42785..2935255ada6 100644 --- a/packages/connect/e2e/tests/device/authorizeCoinjoin.test.ts +++ b/packages/connect/e2e/tests/device/authorizeCoinjoin.test.ts @@ -1,5 +1,4 @@ import TrezorConnect from '../../../src'; - import { getController, setup, conditionalTest, initTrezorConnect } from '../../common.setup'; const controller = getController(); diff --git a/packages/connect/e2e/tests/device/cancel.test.ts b/packages/connect/e2e/tests/device/cancel.test.ts index 10f0338cd5d..1cd9ed9d9d9 100644 --- a/packages/connect/e2e/tests/device/cancel.test.ts +++ b/packages/connect/e2e/tests/device/cancel.test.ts @@ -1,4 +1,5 @@ import { StartEmu, SetupEmu } from '@trezor/trezor-user-env-link'; + import { getController, initTrezorConnect } from '../../common.setup'; import TrezorConnect from '../../../src'; diff --git a/packages/connect/e2e/tests/device/cancelCoinjoinAuthorization.test.ts b/packages/connect/e2e/tests/device/cancelCoinjoinAuthorization.test.ts index f83dcc1c2c3..6f1e2d3114f 100644 --- a/packages/connect/e2e/tests/device/cancelCoinjoinAuthorization.test.ts +++ b/packages/connect/e2e/tests/device/cancelCoinjoinAuthorization.test.ts @@ -1,5 +1,4 @@ import TrezorConnect, { Success, PROTO, Unsuccessful } from '../../../src'; - import { getController, setup, conditionalTest, initTrezorConnect } from '../../common.setup'; describe('TrezorConnect.cancelCoinjoinAuthorization', () => { diff --git a/packages/connect/e2e/tests/device/keepSession.test.ts b/packages/connect/e2e/tests/device/keepSession.test.ts index dfbae507985..a6c6f20e644 100644 --- a/packages/connect/e2e/tests/device/keepSession.test.ts +++ b/packages/connect/e2e/tests/device/keepSession.test.ts @@ -1,5 +1,4 @@ import TrezorConnect, { StaticSessionId } from '../../../src'; - import { getController, setup, conditionalTest, initTrezorConnect } from '../../common.setup'; const controller = getController(); diff --git a/packages/connect/e2e/tests/device/methods.test.ts b/packages/connect/e2e/tests/device/methods.test.ts index 8491b81269c..f03352a8b21 100644 --- a/packages/connect/e2e/tests/device/methods.test.ts +++ b/packages/connect/e2e/tests/device/methods.test.ts @@ -1,6 +1,5 @@ import TrezorConnect from '../../../src'; import * as fixtures from '../../__fixtures__'; - import { getController, skipTest, diff --git a/packages/connect/e2e/tests/device/override.test.ts b/packages/connect/e2e/tests/device/override.test.ts index b3b2ac42410..1e21737c221 100644 --- a/packages/connect/e2e/tests/device/override.test.ts +++ b/packages/connect/e2e/tests/device/override.test.ts @@ -1,5 +1,4 @@ import TrezorConnect from '../../../src'; - import { getController, setup, initTrezorConnect } from '../../common.setup'; const controller = getController(); diff --git a/packages/connect/e2e/tests/device/passphrase.test.ts b/packages/connect/e2e/tests/device/passphrase.test.ts index 8aa03fad36a..02a0786bf32 100644 --- a/packages/connect/e2e/tests/device/passphrase.test.ts +++ b/packages/connect/e2e/tests/device/passphrase.test.ts @@ -1,5 +1,4 @@ import TrezorConnect from '../../../src'; - import { getController, setup, conditionalTest, initTrezorConnect } from '../../common.setup'; const controller = getController(); diff --git a/packages/connect/e2e/tests/device/setBusy.test.ts b/packages/connect/e2e/tests/device/setBusy.test.ts index f3ffdc504f9..0dc2f69077f 100644 --- a/packages/connect/e2e/tests/device/setBusy.test.ts +++ b/packages/connect/e2e/tests/device/setBusy.test.ts @@ -1,5 +1,4 @@ import TrezorConnect from '../../../src'; - import { getController, setup, conditionalTest, initTrezorConnect } from '../../common.setup'; const controller = getController(); diff --git a/packages/connect/e2e/tests/device/unlockPath.test.ts b/packages/connect/e2e/tests/device/unlockPath.test.ts index 3c41c7cae8f..4a7506401b7 100644 --- a/packages/connect/e2e/tests/device/unlockPath.test.ts +++ b/packages/connect/e2e/tests/device/unlockPath.test.ts @@ -1,5 +1,4 @@ import TrezorConnect from '../../../src'; - import { getController, setup, conditionalTest, initTrezorConnect } from '../../common.setup'; const controller = getController(); diff --git a/packages/connect/setupJest.ts b/packages/connect/setupJest.ts index 8ddfa9e6ac7..893737511e1 100644 --- a/packages/connect/setupJest.ts +++ b/packages/connect/setupJest.ts @@ -1,6 +1,7 @@ /* WARNING! This file should be imported ONLY in tests! */ import { AbstractApiTransport, UsbApi } from '@trezor/transport'; + import { DeviceModelInternal, type Features, type FirmwareRelease } from './src/types'; class TestTransport extends AbstractApiTransport { diff --git a/packages/connect/src/api/applyFlags.ts b/packages/connect/src/api/applyFlags.ts index a342871ed2c..0a728ef7186 100644 --- a/packages/connect/src/api/applyFlags.ts +++ b/packages/connect/src/api/applyFlags.ts @@ -1,8 +1,9 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/ApplyFlags.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { PROTO } from '../constants'; -import { Assert } from '@trezor/schema-utils'; export default class ApplyFlags extends AbstractMethod<'applyFlags', PROTO.ApplyFlags> { init() { diff --git a/packages/connect/src/api/applySettings.ts b/packages/connect/src/api/applySettings.ts index c49067919b9..94391678170 100644 --- a/packages/connect/src/api/applySettings.ts +++ b/packages/connect/src/api/applySettings.ts @@ -1,8 +1,9 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/ApplySettings.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { PROTO } from '../constants'; -import { Assert } from '@trezor/schema-utils'; import { ApplySettings as ApplySettingsSchema } from '../types/api/applySettings'; export default class ApplySettings extends AbstractMethod<'applySettings', PROTO.ApplySettings> { diff --git a/packages/connect/src/api/authenticateDevice.ts b/packages/connect/src/api/authenticateDevice.ts index 6d0afb7a925..5bbe34ed379 100644 --- a/packages/connect/src/api/authenticateDevice.ts +++ b/packages/connect/src/api/authenticateDevice.ts @@ -1,10 +1,11 @@ +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { UI } from '../events'; import { getFirmwareRange } from './common/paramsValidator'; import { deviceAuthenticityConfig } from '../data/deviceAuthenticityConfig'; import { AuthenticateDeviceParams } from '../types/api/authenticateDevice'; import { getRandomChallenge, verifyAuthenticityProof } from './firmware/verifyAuthenticityProof'; -import { Assert } from '@trezor/schema-utils'; export default class AuthenticateDevice extends AbstractMethod< 'authenticateDevice', diff --git a/packages/connect/src/api/authorizeCoinjoin.ts b/packages/connect/src/api/authorizeCoinjoin.ts index 5053c309429..4d1be821cea 100644 --- a/packages/connect/src/api/authorizeCoinjoin.ts +++ b/packages/connect/src/api/authorizeCoinjoin.ts @@ -1,9 +1,10 @@ +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { getFirmwareRange } from './common/paramsValidator'; import { validatePath, getScriptType } from '../utils/pathUtils'; import { getBitcoinNetwork } from '../data/coinInfo'; import { PROTO } from '../constants'; -import { Assert } from '@trezor/schema-utils'; import { AuthorizeCoinjoin as AuthorizeCoinjoinSchema } from '../types/api/authorizeCoinjoin'; export default class AuthorizeCoinjoin extends AbstractMethod< diff --git a/packages/connect/src/api/backupDevice.ts b/packages/connect/src/api/backupDevice.ts index 93f002cbdd6..68d3c0479db 100644 --- a/packages/connect/src/api/backupDevice.ts +++ b/packages/connect/src/api/backupDevice.ts @@ -1,8 +1,9 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/BackupDevice.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { PROTO } from '../constants'; -import { Assert } from '@trezor/schema-utils'; export default class BackupDevice extends AbstractMethod<'backupDevice', PROTO.BackupDevice> { init() { diff --git a/packages/connect/src/api/binance/api/binanceGetAddress.ts b/packages/connect/src/api/binance/api/binanceGetAddress.ts index 800492fe84a..7ae967f1ea4 100644 --- a/packages/connect/src/api/binance/api/binanceGetAddress.ts +++ b/packages/connect/src/api/binance/api/binanceGetAddress.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/BinanceGetAddress.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { PROTO, ERRORS } from '../../../constants'; import { UI, createUiMessage } from '../../../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../../../types'; import { GetAddress as GetAddressSchema } from '../../../types/api/getAddress'; diff --git a/packages/connect/src/api/binance/api/binanceGetPublicKey.ts b/packages/connect/src/api/binance/api/binanceGetPublicKey.ts index dd5aa42ecbe..c9f15a1eb0b 100644 --- a/packages/connect/src/api/binance/api/binanceGetPublicKey.ts +++ b/packages/connect/src/api/binance/api/binanceGetPublicKey.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/BinanceGetPublicKey.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { UI, createUiMessage } from '../../../events'; import type { PROTO } from '../../../constants'; -import { Assert } from '@trezor/schema-utils'; import { Bundle, GetPublicKey as GetPublicKeySchema } from '../../../types'; export default class BinanceGetPublicKey extends AbstractMethod< diff --git a/packages/connect/src/api/binance/api/binanceSignTransaction.ts b/packages/connect/src/api/binance/api/binanceSignTransaction.ts index ca186d0ec5c..9b82cb0f509 100644 --- a/packages/connect/src/api/binance/api/binanceSignTransaction.ts +++ b/packages/connect/src/api/binance/api/binanceSignTransaction.ts @@ -1,13 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/BinanceSignTransaction.js +import { AssertWeak } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath } from '../../../utils/pathUtils'; import * as helper from '../binanceSignTx'; import { BinanceSignTransaction as BinanceSignTransactionSchema } from '../../../types/api/binance'; -import { AssertWeak } from '@trezor/schema-utils'; - import type { BinancePreparedTransaction } from '../../../types/api/binance'; type Params = { diff --git a/packages/connect/src/api/binance/binanceSignTx.ts b/packages/connect/src/api/binance/binanceSignTx.ts index aec5165114b..e38dd384352 100644 --- a/packages/connect/src/api/binance/binanceSignTx.ts +++ b/packages/connect/src/api/binance/binanceSignTx.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/helpers/binanceSignTx.js +import { Assert } from '@trezor/schema-utils'; + import { PROTO, ERRORS } from '../../constants'; import { BinanceSDKTransaction, @@ -7,7 +9,6 @@ import { BinancePreparedTransaction, } from '../../types/api/binance'; import type { TypedCall } from '../../device/DeviceCommands'; -import { Assert } from '@trezor/schema-utils'; const processTxRequest = async ( typedCall: TypedCall, diff --git a/packages/connect/src/api/bitcoin/Fees.ts b/packages/connect/src/api/bitcoin/Fees.ts index 9c8b35fff64..763e775fd59 100644 --- a/packages/connect/src/api/bitcoin/Fees.ts +++ b/packages/connect/src/api/bitcoin/Fees.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/tx/Fees.js import { BigNumber } from '@trezor/utils/src/bigNumber'; + import { Blockchain } from '../../backend/BlockchainLink'; import type { CoinInfo, FeeLevel } from '../../types'; diff --git a/packages/connect/src/api/bitcoin/TransactionComposer.ts b/packages/connect/src/api/bitcoin/TransactionComposer.ts index f6538a200d7..31de94c5c57 100644 --- a/packages/connect/src/api/bitcoin/TransactionComposer.ts +++ b/packages/connect/src/api/bitcoin/TransactionComposer.ts @@ -2,6 +2,7 @@ import { BigNumber } from '@trezor/utils/src/bigNumber'; import { composeTx, ComposeOutput, TransactionInputOutputSortingStrategy } from '@trezor/utxo-lib'; + import { FeeLevels } from './Fees'; import { Blockchain } from '../../backend/BlockchainLink'; import type { BitcoinNetworkInfo, DiscoveryAccount, SelectFeeLevel } from '../../types'; diff --git a/packages/connect/src/api/bitcoin/__fixtures__/refTx.ts b/packages/connect/src/api/bitcoin/__fixtures__/refTx.ts index 0b4bb35c6d5..8156d40ed15 100644 --- a/packages/connect/src/api/bitcoin/__fixtures__/refTx.ts +++ b/packages/connect/src/api/bitcoin/__fixtures__/refTx.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/prefer-ts-expect-error */ import { networks } from '@trezor/utxo-lib'; + // @ts-ignore import tx43d273 from '../../../../e2e/__txcache__/testnet/43d273d3caf41759ad843474f960fbf80ff2ec961135d018b61e9fab3ad1fc06.json'; // @ts-ignore diff --git a/packages/connect/src/api/bitcoin/__tests__/Fees.test.ts b/packages/connect/src/api/bitcoin/__tests__/Fees.test.ts index fc7a9bc29f1..401dc0c1156 100644 --- a/packages/connect/src/api/bitcoin/__tests__/Fees.test.ts +++ b/packages/connect/src/api/bitcoin/__tests__/Fees.test.ts @@ -1,6 +1,7 @@ import coinsJSON from '@trezor/connect-common/files/coins.json'; import coinsJSONEth from '@trezor/connect-common/files/coins-eth.json'; import BlockchainLink from '@trezor/blockchain-link'; + import { parseCoinsJson, getBitcoinNetwork } from '../../../data/coinInfo'; import { initBlockchain } from '../../../backend/BlockchainLink'; import { FeeLevels } from '../Fees'; diff --git a/packages/connect/src/api/bitcoin/__tests__/inputs.test.ts b/packages/connect/src/api/bitcoin/__tests__/inputs.test.ts index dce271afdf1..2eaf7207c9f 100644 --- a/packages/connect/src/api/bitcoin/__tests__/inputs.test.ts +++ b/packages/connect/src/api/bitcoin/__tests__/inputs.test.ts @@ -1,4 +1,5 @@ import { networks } from '@trezor/utxo-lib'; + import { validateTrezorInputs } from '../inputs'; import * as fixtures from '../__fixtures__/inputs'; diff --git a/packages/connect/src/api/bitcoin/__tests__/signtxVerify.test.ts b/packages/connect/src/api/bitcoin/__tests__/signtxVerify.test.ts index 07c89977778..1ad323d7136 100644 --- a/packages/connect/src/api/bitcoin/__tests__/signtxVerify.test.ts +++ b/packages/connect/src/api/bitcoin/__tests__/signtxVerify.test.ts @@ -1,4 +1,5 @@ import { networks } from '@trezor/utxo-lib'; + import { verifyTx } from '../signtxVerify'; import fixtures from '../__fixtures__/signtxVerify'; diff --git a/packages/connect/src/api/bitcoin/createPendingTx.ts b/packages/connect/src/api/bitcoin/createPendingTx.ts index 4ea0724950e..d5daedbbb07 100644 --- a/packages/connect/src/api/bitcoin/createPendingTx.ts +++ b/packages/connect/src/api/bitcoin/createPendingTx.ts @@ -1,9 +1,8 @@ import { BigNumber } from '@trezor/utils/src/bigNumber'; - import { Transaction as BitcoinJsTransaction } from '@trezor/utxo-lib'; + import { getSerializedPath } from '../../utils/pathUtils'; import { PROTO } from '../../constants'; - import type { AccountAddresses } from '../../types'; export const createPendingTransaction = ( diff --git a/packages/connect/src/api/bitcoin/inputs.ts b/packages/connect/src/api/bitcoin/inputs.ts index 856cbe01306..062834e8221 100644 --- a/packages/connect/src/api/bitcoin/inputs.ts +++ b/packages/connect/src/api/bitcoin/inputs.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/tx/inputs.js import { Transaction as BitcoinJsTransaction } from '@trezor/utxo-lib'; + import { validatePath, isSegwitPath, diff --git a/packages/connect/src/api/bitcoin/outputs.ts b/packages/connect/src/api/bitcoin/outputs.ts index 99e25ea4145..dd23bee93dc 100644 --- a/packages/connect/src/api/bitcoin/outputs.ts +++ b/packages/connect/src/api/bitcoin/outputs.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/tx/outputs.js import { ComposeOutput as ComposeOutputBase } from '@trezor/utxo-lib'; + import { getOutputScriptType, fixPath, getHDPath } from '../../utils/pathUtils'; import { isValidAddress } from '../../utils/addressUtils'; import { convertMultisigPubKey } from '../../utils/hdnodeUtils'; diff --git a/packages/connect/src/api/bitcoin/refTx.ts b/packages/connect/src/api/bitcoin/refTx.ts index 27cd7bedc46..778663b7efc 100644 --- a/packages/connect/src/api/bitcoin/refTx.ts +++ b/packages/connect/src/api/bitcoin/refTx.ts @@ -7,12 +7,14 @@ import { Network, } from '@trezor/utxo-lib'; import { bufferUtils } from '@trezor/utils'; -import { getHDPath, getScriptType, getOutputScriptType } from '../../utils/pathUtils'; -import { TypedError } from '../../constants/errors'; import type { TxInput as BitcoinJsInput, TxOutput as BitcoinJsOutput, } from '@trezor/utxo-lib/src/transaction/base'; +import { Assert, Type } from '@trezor/schema-utils'; + +import { getHDPath, getScriptType, getOutputScriptType } from '../../utils/pathUtils'; +import { TypedError } from '../../constants/errors'; import type { CoinInfo, AccountAddresses, @@ -21,7 +23,7 @@ import type { } from '../../types'; import type { RefTransaction, TransactionOptions } from '../../types/api/bitcoin'; import { PROTO } from '../../constants'; -import { Assert, Type } from '@trezor/schema-utils'; + // Referenced transactions are not required if: // - all internal inputs script_type === SPENDTAPROOT diff --git a/packages/connect/src/api/bitcoin/signtxVerify.ts b/packages/connect/src/api/bitcoin/signtxVerify.ts index 10c70aa63cc..29887f26ea6 100644 --- a/packages/connect/src/api/bitcoin/signtxVerify.ts +++ b/packages/connect/src/api/bitcoin/signtxVerify.ts @@ -6,8 +6,8 @@ import { payments as BitcoinJsPayments, Transaction as BitcoinJsTransaction, } from '@trezor/utxo-lib'; -import { PROTO, ERRORS } from '../../constants'; +import { PROTO, ERRORS } from '../../constants'; import type { BitcoinNetworkInfo } from '../../types'; import type { DeviceCommands } from '../../device/DeviceCommands'; diff --git a/packages/connect/src/api/blockchainDisconnect.ts b/packages/connect/src/api/blockchainDisconnect.ts index e3fafc4c422..ee21a745969 100644 --- a/packages/connect/src/api/blockchainDisconnect.ts +++ b/packages/connect/src/api/blockchainDisconnect.ts @@ -1,11 +1,12 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/blockchain/BlockchainDisconnect.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { ERRORS } from '../constants'; import { isBackendSupported, findBackend } from '../backend/BlockchainLink'; import { getCoinInfo } from '../data/coinInfo'; import { CoinObj, CoinInfo } from '../types'; -import { Assert } from '@trezor/schema-utils'; type Params = { coinInfo: CoinInfo; diff --git a/packages/connect/src/api/cancelCoinjoinAuthorization.ts b/packages/connect/src/api/cancelCoinjoinAuthorization.ts index 102a7caa0a6..c1f57db01d1 100644 --- a/packages/connect/src/api/cancelCoinjoinAuthorization.ts +++ b/packages/connect/src/api/cancelCoinjoinAuthorization.ts @@ -1,7 +1,8 @@ +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { getFirmwareRange } from './common/paramsValidator'; import { PROTO } from '../constants'; -import { Assert } from '@trezor/schema-utils'; import { CancelCoinjoinAuthorization as CancelCoinjoinAuthorizationSchema } from '../types/api/cancelCoinjoinAuthorization'; export default class CancelCoinjoinAuthorization extends AbstractMethod< diff --git a/packages/connect/src/api/cardano/api/cardanoGetAddress.ts b/packages/connect/src/api/cardano/api/cardanoGetAddress.ts index 5e41845a17e..e78ade2771a 100644 --- a/packages/connect/src/api/cardano/api/cardanoGetAddress.ts +++ b/packages/connect/src/api/cardano/api/cardanoGetAddress.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/CardanoGetAddress.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; @@ -12,7 +14,6 @@ import { } from '../cardanoAddressParameters'; import { PROTO, ERRORS } from '../../../constants'; import { UI, createUiMessage } from '../../../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../../../types'; import { CardanoGetAddress as CardanoGetAddressSchema } from '../../../types/api/cardano'; diff --git a/packages/connect/src/api/cardano/api/cardanoGetNativeScriptHash.ts b/packages/connect/src/api/cardano/api/cardanoGetNativeScriptHash.ts index a90c0394191..57f616642bc 100644 --- a/packages/connect/src/api/cardano/api/cardanoGetNativeScriptHash.ts +++ b/packages/connect/src/api/cardano/api/cardanoGetNativeScriptHash.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/CardanoGetNativeScriptHash.js +import { Assert } from '@trezor/schema-utils'; + import { PROTO } from '../../../constants'; import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; @@ -9,7 +11,6 @@ import { CardanoGetNativeScriptHash as CardanoGetNativeScriptHashSchema, CardanoNativeScript, } from '../../../types/api/cardano'; -import { Assert } from '@trezor/schema-utils'; export default class CardanoGetNativeScriptHash extends AbstractMethod< 'cardanoGetNativeScriptHash', diff --git a/packages/connect/src/api/cardano/api/cardanoGetPublicKey.ts b/packages/connect/src/api/cardano/api/cardanoGetPublicKey.ts index efc7ff47ada..78a8fadff90 100644 --- a/packages/connect/src/api/cardano/api/cardanoGetPublicKey.ts +++ b/packages/connect/src/api/cardano/api/cardanoGetPublicKey.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/CardanoGetPublicKey.js +import { Assert } from '@trezor/schema-utils'; + import { PROTO } from '../../../constants'; import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { UI, createUiMessage } from '../../../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../../../types'; import { CardanoGetPublicKey as CardanoGetPublicKeySchema } from '../../../types/api/cardano'; diff --git a/packages/connect/src/api/cardano/api/cardanoSignTransaction.ts b/packages/connect/src/api/cardano/api/cardanoSignTransaction.ts index 9d7eb66cd2b..c780e77c505 100644 --- a/packages/connect/src/api/cardano/api/cardanoSignTransaction.ts +++ b/packages/connect/src/api/cardano/api/cardanoSignTransaction.ts @@ -4,6 +4,8 @@ import { trezorUtils } from '@fivebinaries/coin-selection'; +import { AssertWeak, Type } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; @@ -35,7 +37,6 @@ import { import { gatherWitnessPaths } from '../cardanoWitnesses'; import type { AssetGroupWithTokens } from '../cardanoTokenBundle'; import { tokenBundleToProto } from '../cardanoTokenBundle'; -import { AssertWeak, Type } from '@trezor/schema-utils'; const CardanoSignTransactionFeatures = Object.freeze({ // FW <2.6.0 is not supported by Connect at all diff --git a/packages/connect/src/api/cardano/cardanoAddressParameters.ts b/packages/connect/src/api/cardano/cardanoAddressParameters.ts index 7c5e76c71ff..2695f8eac57 100644 --- a/packages/connect/src/api/cardano/cardanoAddressParameters.ts +++ b/packages/connect/src/api/cardano/cardanoAddressParameters.ts @@ -1,9 +1,10 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/helpers/cardanoAddressParameters.js +import { Assert } from '@trezor/schema-utils'; + import { validatePath } from '../../utils/pathUtils'; import { PROTO, ERRORS } from '../../constants'; import { CardanoAddressParameters } from '../../types/api/cardano'; -import { Assert } from '@trezor/schema-utils'; export const validateAddressParameters = (addressParameters: CardanoAddressParameters) => { Assert(CardanoAddressParameters, addressParameters); diff --git a/packages/connect/src/api/cardano/cardanoAuxiliaryData.ts b/packages/connect/src/api/cardano/cardanoAuxiliaryData.ts index bb92b3557c3..e625c3c4d9a 100644 --- a/packages/connect/src/api/cardano/cardanoAuxiliaryData.ts +++ b/packages/connect/src/api/cardano/cardanoAuxiliaryData.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/helpers/cardanoAuxiliaryData.js +import { Assert } from '@trezor/schema-utils'; + import { addressParametersToProto, modifyAddressParametersForBackwardsCompatibility, @@ -12,7 +14,6 @@ import { CardanoCVoteRegistrationDelegation, CardanoCVoteRegistrationParameters, } from '../../types/api/cardano'; -import { Assert } from '@trezor/schema-utils'; const MAX_DELEGATION_COUNT = 32; diff --git a/packages/connect/src/api/cardano/cardanoCertificate.ts b/packages/connect/src/api/cardano/cardanoCertificate.ts index 92998d7545f..29d39b3db0a 100644 --- a/packages/connect/src/api/cardano/cardanoCertificate.ts +++ b/packages/connect/src/api/cardano/cardanoCertificate.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/helpers/cardanoCertificate.js +import { Assert } from '@trezor/schema-utils'; + import { validatePath } from '../../utils/pathUtils'; import { PROTO, ERRORS } from '../../constants'; import { @@ -9,7 +11,6 @@ import { CardanoPoolRelay, CardanoDRep, } from '../../types/api/cardano'; -import { Assert } from '@trezor/schema-utils'; const ipv4AddressToHex = (ipv4Address: string) => Buffer.from(ipv4Address.split('.').map(ipPart => parseInt(ipPart, 10))).toString('hex'); diff --git a/packages/connect/src/api/cardano/cardanoInputs.ts b/packages/connect/src/api/cardano/cardanoInputs.ts index fe24e2940f8..86c80a830a4 100644 --- a/packages/connect/src/api/cardano/cardanoInputs.ts +++ b/packages/connect/src/api/cardano/cardanoInputs.ts @@ -1,8 +1,9 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/helpers/cardanoInputs.js +import { Assert, Type, Static } from '@trezor/schema-utils'; + import { validatePath } from '../../utils/pathUtils'; import { PROTO } from '../../constants'; -import { Assert, Type, Static } from '@trezor/schema-utils'; import { DerivationPath } from '../../exports'; export type Path = number[]; diff --git a/packages/connect/src/api/cardano/cardanoOutputs.ts b/packages/connect/src/api/cardano/cardanoOutputs.ts index aa6638936d1..97ece64e515 100644 --- a/packages/connect/src/api/cardano/cardanoOutputs.ts +++ b/packages/connect/src/api/cardano/cardanoOutputs.ts @@ -2,12 +2,13 @@ // allow for...of statements +import { Assert, Type } from '@trezor/schema-utils'; + import { addressParametersToProto, validateAddressParameters } from './cardanoAddressParameters'; import { tokenBundleToProto, AssetGroupWithTokens } from './cardanoTokenBundle'; import { PROTO } from '../../constants'; import { hexStringByteLength, sendChunkedHexString } from './cardanoUtils'; import { CardanoAssetGroup, CardanoAddressParameters } from '../../types/api/cardano'; -import { Assert, Type } from '@trezor/schema-utils'; export type OutputWithData = { output: PROTO.CardanoTxOutput; diff --git a/packages/connect/src/api/cardano/cardanoTokenBundle.ts b/packages/connect/src/api/cardano/cardanoTokenBundle.ts index 9916c5d0f52..ac98219e5e6 100644 --- a/packages/connect/src/api/cardano/cardanoTokenBundle.ts +++ b/packages/connect/src/api/cardano/cardanoTokenBundle.ts @@ -1,8 +1,9 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/helpers/cardanoTokenBundle.js +import { Assert, Type, Static } from '@trezor/schema-utils'; + import { PROTO } from '../../constants'; import { CardanoAssetGroup, CardanoToken } from '../../types/api/cardano'; -import { Assert, Type, Static } from '@trezor/schema-utils'; export type AssetGroupWithTokens = Static; export const AssetGroupWithTokens = Type.Object({ diff --git a/packages/connect/src/api/changeLanguage.ts b/packages/connect/src/api/changeLanguage.ts index 472da0522b3..d4576253e1d 100644 --- a/packages/connect/src/api/changeLanguage.ts +++ b/packages/connect/src/api/changeLanguage.ts @@ -1,8 +1,9 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/ChangeLanguage.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { UI } from '../events'; -import { Assert } from '@trezor/schema-utils'; import { ChangeLanguage as ChangeLanguageSchema } from '../types/api/changeLanguage'; export default class ChangeLanguage extends AbstractMethod<'changeLanguage', ChangeLanguageSchema> { diff --git a/packages/connect/src/api/changePin.ts b/packages/connect/src/api/changePin.ts index 932130fdddf..b0d094026f2 100644 --- a/packages/connect/src/api/changePin.ts +++ b/packages/connect/src/api/changePin.ts @@ -1,7 +1,8 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/ChangePin.js -import { AbstractMethod } from '../core/AbstractMethod'; import { Assert } from '@trezor/schema-utils'; + +import { AbstractMethod } from '../core/AbstractMethod'; import { PROTO } from '../constants'; export default class ChangePin extends AbstractMethod<'changePin', PROTO.ChangePin> { diff --git a/packages/connect/src/api/cipherKeyValue.ts b/packages/connect/src/api/cipherKeyValue.ts index a7efc79921d..4a45b211928 100644 --- a/packages/connect/src/api/cipherKeyValue.ts +++ b/packages/connect/src/api/cipherKeyValue.ts @@ -1,11 +1,12 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/CipherKeyValue.js +import { Assert } from '@trezor/schema-utils'; + import { UI, createUiMessage } from '../events'; import { AbstractMethod } from '../core/AbstractMethod'; import { getFirmwareRange } from './common/paramsValidator'; import { validatePath } from '../utils/pathUtils'; import type { PROTO } from '../constants'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../types/params'; import { CipherKeyValue as CipherKeyValueSchema } from '../types/api/cipherKeyValue'; diff --git a/packages/connect/src/api/common/Discovery.ts b/packages/connect/src/api/common/Discovery.ts index 7d4fafdeb63..d4251abd52e 100644 --- a/packages/connect/src/api/common/Discovery.ts +++ b/packages/connect/src/api/common/Discovery.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/helpers/Discovery.js import EventEmitter from 'events'; + import { PROTO, ERRORS } from '../../constants'; import { Blockchain } from '../../backend/BlockchainLink'; import { DeviceCommands } from '../../device/DeviceCommands'; diff --git a/packages/connect/src/api/composeTransaction.ts b/packages/connect/src/api/composeTransaction.ts index 2aac36bef60..f72749c222d 100644 --- a/packages/connect/src/api/composeTransaction.ts +++ b/packages/connect/src/api/composeTransaction.ts @@ -1,6 +1,8 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/ComposeTransaction.js import { BigNumber } from '@trezor/utils/src/bigNumber'; +import type { ComposeOutput, TransactionInputOutputSortingStrategy } from '@trezor/utxo-lib'; + import { AbstractMethod } from '../core/AbstractMethod'; import { ERRORS } from '../constants'; import { UI, createUiMessage } from '../events'; @@ -25,7 +27,6 @@ import { verifyTx, parseTransactionHexes, } from './bitcoin'; -import type { ComposeOutput, TransactionInputOutputSortingStrategy } from '@trezor/utxo-lib'; import type { BitcoinNetworkInfo, DiscoveryAccount, AccountUtxo } from '../types'; import type { SignedTransaction, diff --git a/packages/connect/src/api/eos/api/eosGetPublicKey.ts b/packages/connect/src/api/eos/api/eosGetPublicKey.ts index f5718336369..e4a61d2e140 100644 --- a/packages/connect/src/api/eos/api/eosGetPublicKey.ts +++ b/packages/connect/src/api/eos/api/eosGetPublicKey.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/EosGetPublicKey.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { UI, createUiMessage } from '../../../events'; import type { PROTO } from '../../../constants'; -import { Assert } from '@trezor/schema-utils'; import { Bundle, GetPublicKey as GetPublicKeySchema } from '../../../types'; export default class EosGetPublicKey extends AbstractMethod< diff --git a/packages/connect/src/api/eos/api/eosSignTransaction.ts b/packages/connect/src/api/eos/api/eosSignTransaction.ts index 54aa8c19098..67d3653764d 100644 --- a/packages/connect/src/api/eos/api/eosSignTransaction.ts +++ b/packages/connect/src/api/eos/api/eosSignTransaction.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/EosSignTransaction.js +import { AssertWeak } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath } from '../../../utils/pathUtils'; import * as helper from '../eosSignTx'; import type { PROTO } from '../../../constants'; -import { AssertWeak } from '@trezor/schema-utils'; import { EosSignTransaction as EosSignTransactionSchema } from '../../../types/api/eos'; type Params = { diff --git a/packages/connect/src/api/ethereum/__fixtures__/ethereumSignTypedData.ts b/packages/connect/src/api/ethereum/__fixtures__/ethereumSignTypedData.ts index d28b3e5d9ca..11bf052d59d 100644 --- a/packages/connect/src/api/ethereum/__fixtures__/ethereumSignTypedData.ts +++ b/packages/connect/src/api/ethereum/__fixtures__/ethereumSignTypedData.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/prefer-ts-expect-error */ import { BigNumber } from '@trezor/utils/src/bigNumber'; + import { TrezorError } from '../../../constants/errors'; import { PROTO } from '../../../constants'; diff --git a/packages/connect/src/api/ethereum/__tests__/ethereumSignTx.test.ts b/packages/connect/src/api/ethereum/__tests__/ethereumSignTx.test.ts index a0c6f3d58ff..b218957b39c 100644 --- a/packages/connect/src/api/ethereum/__tests__/ethereumSignTx.test.ts +++ b/packages/connect/src/api/ethereum/__tests__/ethereumSignTx.test.ts @@ -2,7 +2,6 @@ import { TransactionFactory } from '@ethereumjs/tx'; import { keccak256, toHex } from 'web3-utils'; import { serializeEthereumTx } from '../ethereumSignTx'; - import * as fixtures from '../__fixtures__/ethereumSignTx'; describe('helpers/ethereumSignTx', () => { diff --git a/packages/connect/src/api/ethereum/api/ethereumGetAddress.ts b/packages/connect/src/api/ethereum/api/ethereumGetAddress.ts index bb5f1194a9a..03c46401a43 100644 --- a/packages/connect/src/api/ethereum/api/ethereumGetAddress.ts +++ b/packages/connect/src/api/ethereum/api/ethereumGetAddress.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/EthereumGetAddress.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { validatePath, getSerializedPath, getSlip44ByPath } from '../../../utils/pathUtils'; @@ -14,7 +16,6 @@ import { decodeEthereumDefinition, ethereumNetworkInfoFromDefinition, } from '../ethereumDefinitions'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../../../types'; import { GetAddress as GetAddressSchema } from '../../../types/api/getAddress'; diff --git a/packages/connect/src/api/ethereum/api/ethereumGetPublicKey.ts b/packages/connect/src/api/ethereum/api/ethereumGetPublicKey.ts index c6f5960e758..f0f7d919bf8 100644 --- a/packages/connect/src/api/ethereum/api/ethereumGetPublicKey.ts +++ b/packages/connect/src/api/ethereum/api/ethereumGetPublicKey.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/EthereumGetPublicKey.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { validatePath } from '../../../utils/pathUtils'; @@ -8,7 +10,6 @@ import { getEthereumNetwork, getUniqueNetworks } from '../../../data/coinInfo'; import { UI, createUiMessage } from '../../../events'; import type { PROTO } from '../../../constants'; import type { EthereumNetworkInfo } from '../../../types'; -import { Assert } from '@trezor/schema-utils'; import { Bundle, GetPublicKey as GetPublicKeySchema } from '../../../types'; type Params = PROTO.EthereumGetPublicKey & { diff --git a/packages/connect/src/api/ethereum/api/ethereumSignMessage.ts b/packages/connect/src/api/ethereum/api/ethereumSignMessage.ts index 00ec9164cba..2b5d9a23437 100644 --- a/packages/connect/src/api/ethereum/api/ethereumSignMessage.ts +++ b/packages/connect/src/api/ethereum/api/ethereumSignMessage.ts @@ -1,5 +1,8 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/EthereumSignMessage.js +import { MessagesSchema } from '@trezor/protobuf'; +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getSlip44ByPath, validatePath } from '../../../utils/pathUtils'; @@ -12,8 +15,6 @@ import { EthereumNetworkInfo, EthereumSignMessage as EthereumSignMessageSchema, } from '../../../types'; -import { MessagesSchema } from '@trezor/protobuf'; -import { Assert } from '@trezor/schema-utils'; type Params = PROTO.EthereumSignMessage & { network?: EthereumNetworkInfo; diff --git a/packages/connect/src/api/ethereum/api/ethereumSignTransaction.ts b/packages/connect/src/api/ethereum/api/ethereumSignTransaction.ts index 7e6661d3a9c..0a40ebf6e4b 100644 --- a/packages/connect/src/api/ethereum/api/ethereumSignTransaction.ts +++ b/packages/connect/src/api/ethereum/api/ethereumSignTransaction.ts @@ -1,5 +1,10 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/EthereumSignTransaction.js +import { FeeMarketEIP1559TxData, LegacyTxData } from '@ethereumjs/tx'; + +import { MessagesSchema } from '@trezor/protobuf'; +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getSlip44ByPath, validatePath } from '../../../utils/pathUtils'; @@ -17,9 +22,7 @@ import { EthereumNetworkInfo, EthereumSignTransaction as EthereumSignTransactionSchema, } from '../../../types'; -import { MessagesSchema } from '@trezor/protobuf'; -import { Assert } from '@trezor/schema-utils'; -import { FeeMarketEIP1559TxData, LegacyTxData } from '@ethereumjs/tx'; + type Params = { path: number[]; diff --git a/packages/connect/src/api/ethereum/api/ethereumSignTypedData.ts b/packages/connect/src/api/ethereum/api/ethereumSignTypedData.ts index 810c1fa5a46..ab27f21c2e2 100644 --- a/packages/connect/src/api/ethereum/api/ethereumSignTypedData.ts +++ b/packages/connect/src/api/ethereum/api/ethereumSignTypedData.ts @@ -1,5 +1,8 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/EthereumSignTypedData.js +import { MessagesSchema } from '@trezor/protobuf'; +import { Assert, Type } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getSlip44ByPath, validatePath } from '../../../utils/pathUtils'; @@ -15,8 +18,6 @@ import { getFieldType, parseArrayType, encodeData } from '../ethereumSignTypedDa import { messageToHex } from '../../../utils/formatUtils'; import { getEthereumDefinitions } from '../ethereumDefinitions'; import { EthereumNetworkInfo, DeviceModelInternal } from '../../../types'; -import { MessagesSchema } from '@trezor/protobuf'; -import { Assert, Type } from '@trezor/schema-utils'; // This type is not inferred, because it internally uses types that are generic type Params = ( diff --git a/packages/connect/src/api/ethereum/api/ethereumVerifyMessage.ts b/packages/connect/src/api/ethereum/api/ethereumVerifyMessage.ts index 1edad2cb798..ba89fa88e77 100644 --- a/packages/connect/src/api/ethereum/api/ethereumVerifyMessage.ts +++ b/packages/connect/src/api/ethereum/api/ethereumVerifyMessage.ts @@ -1,10 +1,11 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/EthereumVerifyMessage.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { stripHexPrefix, messageToHex } from '../../../utils/formatUtils'; import type { PROTO } from '../../../constants'; -import { Assert } from '@trezor/schema-utils'; import { EthereumVerifyMessage as EthereumVerifyMessageSchema } from '../../../types'; export default class EthereumVerifyMessage extends AbstractMethod< diff --git a/packages/connect/src/api/ethereum/ethereumDefinitions.ts b/packages/connect/src/api/ethereum/ethereumDefinitions.ts index 0601766d188..3a1aaf98501 100644 --- a/packages/connect/src/api/ethereum/ethereumDefinitions.ts +++ b/packages/connect/src/api/ethereum/ethereumDefinitions.ts @@ -2,10 +2,11 @@ import fetch from 'cross-fetch'; import { MessagesSchema, parseConfigure, decode as decodeProtobuf } from '@trezor/protobuf'; import { trzd } from '@trezor/protocol'; +import { Type, Static, Assert } from '@trezor/schema-utils'; + import { DataManager } from '../../data/DataManager'; import { EthereumNetworkInfo } from '../../types'; import { ethereumNetworkInfoBase } from '../../data/coinInfo'; -import { Type, Static, Assert } from '@trezor/schema-utils'; interface GetEthereumDefinitions { chainId?: number; diff --git a/packages/connect/src/api/ethereum/ethereumSignTx.ts b/packages/connect/src/api/ethereum/ethereumSignTx.ts index 82205b30d9b..a844bc1d308 100644 --- a/packages/connect/src/api/ethereum/ethereumSignTx.ts +++ b/packages/connect/src/api/ethereum/ethereumSignTx.ts @@ -4,6 +4,7 @@ import { Common, Chain, Hardfork } from '@ethereumjs/common'; import { FeeMarketEIP1559TxData, TransactionFactory, LegacyTxData } from '@ethereumjs/tx'; import { MessagesSchema } from '@trezor/protobuf'; + import { PROTO, ERRORS } from '../../constants'; import type { TypedCall } from '../../device/DeviceCommands'; import type { EthereumAccessList } from '../../types/api/ethereum'; diff --git a/packages/connect/src/api/ethereum/ethereumSignTypedData.ts b/packages/connect/src/api/ethereum/ethereumSignTypedData.ts index de0979f0a62..b65dbaa1975 100644 --- a/packages/connect/src/api/ethereum/ethereumSignTypedData.ts +++ b/packages/connect/src/api/ethereum/ethereumSignTypedData.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/helpers/ethereumSignTypedData.js import { BigNumber } from '@trezor/utils/src/bigNumber'; + import { PROTO, ERRORS } from '../../constants'; import { messageToHex } from '../../utils/formatUtils'; import type { EthereumSignTypedDataTypes } from '../../types/api/ethereum'; diff --git a/packages/connect/src/api/firmware/verifyAuthenticityProof.ts b/packages/connect/src/api/firmware/verifyAuthenticityProof.ts index 33e28ea740e..f86cd6d2a4b 100644 --- a/packages/connect/src/api/firmware/verifyAuthenticityProof.ts +++ b/packages/connect/src/api/firmware/verifyAuthenticityProof.ts @@ -1,4 +1,5 @@ import * as crypto from 'crypto'; + import { bufferUtils } from '@trezor/utils'; import { PROTO } from '../../constants'; diff --git a/packages/connect/src/api/getAccountDescriptor.ts b/packages/connect/src/api/getAccountDescriptor.ts index a78ba51ea53..1e5417a4916 100644 --- a/packages/connect/src/api/getAccountDescriptor.ts +++ b/packages/connect/src/api/getAccountDescriptor.ts @@ -1,3 +1,5 @@ +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType, DEFAULT_FIRMWARE_RANGE } from '../core/AbstractMethod'; import { getFirmwareRange } from './common/paramsValidator'; import { validatePath, getSerializedPath } from '../utils/pathUtils'; @@ -10,7 +12,6 @@ import { GetAccountDescriptorParams, GetAccountDescriptorResponse, } from '../types/api/getAccountDescriptor'; -import { Assert } from '@trezor/schema-utils'; type Request = GetAccountDescriptorParams & { address_n: number[]; coinInfo: CoinInfo }; diff --git a/packages/connect/src/api/getAddress.ts b/packages/connect/src/api/getAddress.ts index d759a9ad7ac..bdf7140ecb3 100644 --- a/packages/connect/src/api/getAddress.ts +++ b/packages/connect/src/api/getAddress.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/GetAddress.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../core/AbstractMethod'; import { validateCoinPath, getFirmwareRange } from './common/paramsValidator'; import { validatePath, getLabel, getSerializedPath } from '../utils/pathUtils'; @@ -7,7 +9,6 @@ import { getBitcoinNetwork, fixCoinInfoNetwork, getUniqueNetworks } from '../dat import { PROTO, ERRORS } from '../constants'; import { UI, createUiMessage } from '../events'; import { Bundle, type BitcoinNetworkInfo } from '../types'; -import { Assert } from '@trezor/schema-utils'; import { GetAddress as GetAddressSchema } from '../types/api/getAddress'; type Params = PROTO.GetAddress & { diff --git a/packages/connect/src/api/getCoinInfo.ts b/packages/connect/src/api/getCoinInfo.ts index a948e487062..2b32220bb92 100644 --- a/packages/connect/src/api/getCoinInfo.ts +++ b/packages/connect/src/api/getCoinInfo.ts @@ -1,10 +1,11 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/GetCoinInfo.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { ERRORS } from '../constants'; import { getCoinInfo } from '../data/coinInfo'; import { CoinObj, CoinInfo } from '../types'; -import { Assert } from '@trezor/schema-utils'; type Params = { coinInfo: CoinInfo; diff --git a/packages/connect/src/api/getFirmwareHash.ts b/packages/connect/src/api/getFirmwareHash.ts index e44ef009d6f..933ba5c4384 100644 --- a/packages/connect/src/api/getFirmwareHash.ts +++ b/packages/connect/src/api/getFirmwareHash.ts @@ -1,8 +1,9 @@ +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { PROTO } from '../constants'; import { UI } from '../events'; import { getFirmwareRange } from './common/paramsValidator'; -import { Assert } from '@trezor/schema-utils'; export default class GetFirmwareHash extends AbstractMethod< 'getFirmwareHash', diff --git a/packages/connect/src/api/getOwnershipId.ts b/packages/connect/src/api/getOwnershipId.ts index f36d2615d1e..440fbea6423 100644 --- a/packages/connect/src/api/getOwnershipId.ts +++ b/packages/connect/src/api/getOwnershipId.ts @@ -1,10 +1,11 @@ +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../core/AbstractMethod'; import { getFirmwareRange } from './common/paramsValidator'; import { validatePath, getScriptType, getSerializedPath } from '../utils/pathUtils'; import { getBitcoinNetwork } from '../data/coinInfo'; import { PROTO } from '../constants'; import { UI, createUiMessage } from '../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../exports'; import { GetOwnershipId as GetOwnershipIdSchema } from '../types/api/getOwnershipId'; diff --git a/packages/connect/src/api/getOwnershipProof.ts b/packages/connect/src/api/getOwnershipProof.ts index 6e923cb69f5..eb8c4c7a195 100644 --- a/packages/connect/src/api/getOwnershipProof.ts +++ b/packages/connect/src/api/getOwnershipProof.ts @@ -1,10 +1,11 @@ +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../core/AbstractMethod'; import { getFirmwareRange } from './common/paramsValidator'; import { validatePath, getScriptType, getSerializedPath } from '../utils/pathUtils'; import { getBitcoinNetwork } from '../data/coinInfo'; import { PROTO } from '../constants'; import { UI, createUiMessage } from '../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../exports'; import { GetOwnershipProof as GetOwnershipProofSchema } from '../types/api/getOwnershipProof'; diff --git a/packages/connect/src/api/getPublicKey.ts b/packages/connect/src/api/getPublicKey.ts index d04b2aed617..c21b4a0455e 100644 --- a/packages/connect/src/api/getPublicKey.ts +++ b/packages/connect/src/api/getPublicKey.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/GetPublicKey.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../core/AbstractMethod'; import { validateCoinPath, getFirmwareRange } from './common/paramsValidator'; import { validatePath } from '../utils/pathUtils'; @@ -8,7 +10,6 @@ import { getBitcoinNetwork } from '../data/coinInfo'; import { getPublicKeyLabel } from '../utils/accountUtils'; import type { BitcoinNetworkInfo } from '../types'; import type { PROTO } from '../constants'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../types'; import { GetPublicKey as GetPublicKeySchema } from '../types/api/getPublicKey'; diff --git a/packages/connect/src/api/loadDevice.ts b/packages/connect/src/api/loadDevice.ts index 04a6eca2809..53827718a22 100644 --- a/packages/connect/src/api/loadDevice.ts +++ b/packages/connect/src/api/loadDevice.ts @@ -1,8 +1,9 @@ +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { UI } from '../events'; import { getFirmwareRange } from './common/paramsValidator'; import { PROTO } from '../constants'; -import { Assert } from '@trezor/schema-utils'; export default class LoadDevice extends AbstractMethod<'loadDevice', PROTO.LoadDevice> { init() { diff --git a/packages/connect/src/api/nem/api/nemGetAddress.ts b/packages/connect/src/api/nem/api/nemGetAddress.ts index 0d8a6b1b02a..931aea0c0be 100644 --- a/packages/connect/src/api/nem/api/nemGetAddress.ts +++ b/packages/connect/src/api/nem/api/nemGetAddress.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/NEMGetAddress.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { PROTO, ERRORS } from '../../../constants'; import { UI, createUiMessage } from '../../../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../../../types'; import { GetAddress as GetAddressSchema } from '../../../types/api/getAddress'; diff --git a/packages/connect/src/api/nem/api/nemSignTransaction.ts b/packages/connect/src/api/nem/api/nemSignTransaction.ts index 6fb693e8d95..086371e2b02 100644 --- a/packages/connect/src/api/nem/api/nemSignTransaction.ts +++ b/packages/connect/src/api/nem/api/nemSignTransaction.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/NEMSignTransaction.js +import { AssertWeak } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath } from '../../../utils/pathUtils'; import * as helper from '../nemSignTx'; import type { PROTO } from '../../../constants'; -import { AssertWeak } from '@trezor/schema-utils'; import { NEMSignTransaction as NEMSignTransactionSchema } from '../../../types/api/nem'; export default class NEMSignTransaction extends AbstractMethod< diff --git a/packages/connect/src/api/pushTransaction.ts b/packages/connect/src/api/pushTransaction.ts index 14369bcdf2d..277624e9b3d 100644 --- a/packages/connect/src/api/pushTransaction.ts +++ b/packages/connect/src/api/pushTransaction.ts @@ -1,11 +1,12 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/PushTransaction.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { getCoinInfo } from '../data/coinInfo'; import { ERRORS } from '../constants'; import { isBackendSupported, initBlockchain } from '../backend/BlockchainLink'; import type { CoinInfo } from '../types'; -import { Assert } from '@trezor/schema-utils'; import { PushTransaction as PushTransactionSchema } from '../types/api/pushTransaction'; type Params = { diff --git a/packages/connect/src/api/rebootToBootloader.ts b/packages/connect/src/api/rebootToBootloader.ts index e8036de919d..e3f25c3729d 100644 --- a/packages/connect/src/api/rebootToBootloader.ts +++ b/packages/connect/src/api/rebootToBootloader.ts @@ -1,9 +1,10 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/RebootToBootloader.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { getFirmwareRange } from './common/paramsValidator'; import { UI } from '../events'; -import { Assert } from '@trezor/schema-utils'; import { PROTO } from '../constants'; export default class RebootToBootloader extends AbstractMethod< diff --git a/packages/connect/src/api/recoveryDevice.ts b/packages/connect/src/api/recoveryDevice.ts index 337557d7a70..559d7d9abe2 100644 --- a/packages/connect/src/api/recoveryDevice.ts +++ b/packages/connect/src/api/recoveryDevice.ts @@ -1,8 +1,9 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/RecoveryDevice.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { UI } from '../events'; -import { Assert } from '@trezor/schema-utils'; import type { PROTO } from '../constants'; import { RecoveryDevice as RecoveryDeviceSchema } from '../types/api/recoveryDevice'; diff --git a/packages/connect/src/api/requestLogin.ts b/packages/connect/src/api/requestLogin.ts index b835cf6d1dd..0dbf2e8d719 100644 --- a/packages/connect/src/api/requestLogin.ts +++ b/packages/connect/src/api/requestLogin.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/RequestLogin.js +import { Assert, Type } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { getFirmwareRange } from './common/paramsValidator'; import { ERRORS } from '../constants'; @@ -7,7 +9,6 @@ import { UI, createUiMessage } from '../events'; import { DataManager } from '../data/DataManager'; import type { ConnectSettings } from '../types'; import type { PROTO } from '../constants'; -import { Assert, Type } from '@trezor/schema-utils'; import { RequestLoginSchema } from '../types/api/requestLogin'; export default class RequestLogin extends AbstractMethod<'requestLogin', PROTO.SignIdentity> { diff --git a/packages/connect/src/api/resetDevice.ts b/packages/connect/src/api/resetDevice.ts index 4edad293580..d19f695c271 100644 --- a/packages/connect/src/api/resetDevice.ts +++ b/packages/connect/src/api/resetDevice.ts @@ -1,10 +1,11 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/ResetDevice.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { UI } from '../events'; import { getFirmwareRange } from './common/paramsValidator'; import { PROTO } from '../constants'; -import { Assert } from '@trezor/schema-utils'; export default class ResetDevice extends AbstractMethod<'resetDevice', PROTO.ResetDevice> { init() { diff --git a/packages/connect/src/api/ripple/api/rippleGetAddress.ts b/packages/connect/src/api/ripple/api/rippleGetAddress.ts index d71e8acb8ce..d8ca192d78e 100644 --- a/packages/connect/src/api/ripple/api/rippleGetAddress.ts +++ b/packages/connect/src/api/ripple/api/rippleGetAddress.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/RippleGetAddress.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { PROTO, ERRORS } from '../../../constants'; import { UI, createUiMessage } from '../../../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../../../types'; import { GetAddress as GetAddressSchema } from '../../../types/api/getAddress'; diff --git a/packages/connect/src/api/ripple/api/rippleSignTransaction.ts b/packages/connect/src/api/ripple/api/rippleSignTransaction.ts index 034e3033bbb..a53e64a3971 100644 --- a/packages/connect/src/api/ripple/api/rippleSignTransaction.ts +++ b/packages/connect/src/api/ripple/api/rippleSignTransaction.ts @@ -1,11 +1,12 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/RippleSignTransaction.js +import { AssertWeak } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath } from '../../../utils/pathUtils'; import type { PROTO } from '../../../constants'; -import { AssertWeak } from '@trezor/schema-utils'; import { RippleSignTransaction as RippleSignTransactionSchema } from '../../../types/api/ripple'; export default class RippleSignTransaction extends AbstractMethod< diff --git a/packages/connect/src/api/setBrightness.ts b/packages/connect/src/api/setBrightness.ts index 97a8fb89f71..ee0665c7eec 100644 --- a/packages/connect/src/api/setBrightness.ts +++ b/packages/connect/src/api/setBrightness.ts @@ -1,8 +1,9 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/SetBrightness.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { PROTO } from '../constants'; -import { Assert } from '@trezor/schema-utils'; export default class SetBrightness extends AbstractMethod<'setBrightness', PROTO.SetBrightness> { init() { diff --git a/packages/connect/src/api/setBusy.ts b/packages/connect/src/api/setBusy.ts index 576aac81b1a..67940bbfedb 100644 --- a/packages/connect/src/api/setBusy.ts +++ b/packages/connect/src/api/setBusy.ts @@ -1,8 +1,9 @@ +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { DEVICE, createDeviceMessage } from '../events'; import { PROTO } from '../constants'; import { getFirmwareRange } from './common/paramsValidator'; -import { Assert } from '@trezor/schema-utils'; export default class SetBusy extends AbstractMethod<'setBusy', PROTO.SetBusy> { init() { diff --git a/packages/connect/src/api/signMessage.ts b/packages/connect/src/api/signMessage.ts index 3bf9e74b80a..d8c9b2eefa7 100644 --- a/packages/connect/src/api/signMessage.ts +++ b/packages/connect/src/api/signMessage.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/SignMessage.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { validateCoinPath, getFirmwareRange } from './common/paramsValidator'; import { validatePath, getLabel, getScriptType } from '../utils/pathUtils'; @@ -8,7 +10,6 @@ import { messageToHex } from '../utils/formatUtils'; import type { BitcoinNetworkInfo } from '../types'; import type { PROTO } from '../constants'; import { SignMessage as SignMessageSchema } from '../types'; -import { Assert } from '@trezor/schema-utils'; export default class SignMessage extends AbstractMethod<'signMessage', PROTO.SignMessage> { init() { diff --git a/packages/connect/src/api/solana/additionalInfo.ts b/packages/connect/src/api/solana/additionalInfo.ts index c49490af41d..5a86efabeb9 100644 --- a/packages/connect/src/api/solana/additionalInfo.ts +++ b/packages/connect/src/api/solana/additionalInfo.ts @@ -1,4 +1,5 @@ import { Assert } from '@trezor/schema-utils'; + import { SolanaTxAdditionalInfo } from '../../types/api/solana'; export const transformAdditionalInfo = (additionalInfo?: SolanaTxAdditionalInfo) => { diff --git a/packages/connect/src/api/solana/api/solanaGetAddress.ts b/packages/connect/src/api/solana/api/solanaGetAddress.ts index 5a575cefcf7..793954c9cca 100644 --- a/packages/connect/src/api/solana/api/solanaGetAddress.ts +++ b/packages/connect/src/api/solana/api/solanaGetAddress.ts @@ -1,10 +1,11 @@ +import { Assert } from '@trezor/schema-utils'; + import { ERRORS, PROTO } from '../../../constants'; import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { UI, createUiMessage } from '../../../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../../../types'; import { GetAddress as GetAddressSchema } from '../../../types/api/getAddress'; diff --git a/packages/connect/src/api/solana/api/solanaGetPublicKey.ts b/packages/connect/src/api/solana/api/solanaGetPublicKey.ts index ab427c90d01..de1fcc753ec 100644 --- a/packages/connect/src/api/solana/api/solanaGetPublicKey.ts +++ b/packages/connect/src/api/solana/api/solanaGetPublicKey.ts @@ -1,10 +1,11 @@ +import { Assert } from '@trezor/schema-utils'; + import { PROTO } from '../../../constants'; import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { UI, createUiMessage } from '../../../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle, GetPublicKey as GetPublicKeySchema } from '../../../types'; export default class SolanaGetPublicKey extends AbstractMethod< diff --git a/packages/connect/src/api/solana/api/solanaSignTransaction.ts b/packages/connect/src/api/solana/api/solanaSignTransaction.ts index f3daf36535a..26a64d3fb5f 100644 --- a/packages/connect/src/api/solana/api/solanaSignTransaction.ts +++ b/packages/connect/src/api/solana/api/solanaSignTransaction.ts @@ -1,10 +1,11 @@ +import { AssertWeak } from '@trezor/schema-utils'; + import { PROTO } from '../../../constants'; import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath } from '../../../utils/pathUtils'; import { transformAdditionalInfo } from '../additionalInfo'; -import { AssertWeak } from '@trezor/schema-utils'; import { SolanaSignTransaction as SolanaSignTransactionSchema } from '../../../types/api/solana'; export default class SolanaSignTransaction extends AbstractMethod< diff --git a/packages/connect/src/api/stellar/api/stellarGetAddress.ts b/packages/connect/src/api/stellar/api/stellarGetAddress.ts index a7b1558cbb3..4cf73a86675 100644 --- a/packages/connect/src/api/stellar/api/stellarGetAddress.ts +++ b/packages/connect/src/api/stellar/api/stellarGetAddress.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/StellarGetAddress.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { PROTO, ERRORS } from '../../../constants'; import { UI, createUiMessage } from '../../../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../../../types'; import { GetAddress as GetAddressSchema } from '../../../types/api/getAddress'; diff --git a/packages/connect/src/api/stellar/api/stellarSignTransaction.ts b/packages/connect/src/api/stellar/api/stellarSignTransaction.ts index cb9bca69ef0..1bd087a8347 100644 --- a/packages/connect/src/api/stellar/api/stellarSignTransaction.ts +++ b/packages/connect/src/api/stellar/api/stellarSignTransaction.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/StellarSignTransaction.js +import { AssertWeak } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; @@ -10,7 +12,6 @@ import { StellarTransaction, StellarSignTransaction as StellarSignTransactionSchema, } from '../../../types/api/stellar'; -import { AssertWeak } from '@trezor/schema-utils'; type Params = { path: number[]; diff --git a/packages/connect/src/api/stellar/stellarSignTx.ts b/packages/connect/src/api/stellar/stellarSignTx.ts index c7b8197437c..9cf84b881dc 100644 --- a/packages/connect/src/api/stellar/stellarSignTx.ts +++ b/packages/connect/src/api/stellar/stellarSignTx.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/helpers/stellarSignTx.js +import { Assert } from '@trezor/schema-utils'; + import { PROTO, ERRORS } from '../../constants'; import type { TypedCall } from '../../device/DeviceCommands'; import { @@ -7,7 +9,6 @@ import { StellarOperation, StellarOperationMessage, } from '../../types/api/stellar'; -import { Assert } from '@trezor/schema-utils'; const processTxRequest = async ( typedCall: TypedCall, diff --git a/packages/connect/src/api/tezos/api/tezosGetAddress.ts b/packages/connect/src/api/tezos/api/tezosGetAddress.ts index 05911319e3c..07862cfa696 100644 --- a/packages/connect/src/api/tezos/api/tezosGetAddress.ts +++ b/packages/connect/src/api/tezos/api/tezosGetAddress.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/TezosGetAddress.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { PROTO, ERRORS } from '../../../constants'; import { UI, createUiMessage } from '../../../events'; -import { Assert } from '@trezor/schema-utils'; import { Bundle } from '../../../types'; import { GetAddress as GetAddressSchema } from '../../../types/api/getAddress'; diff --git a/packages/connect/src/api/tezos/api/tezosGetPublicKey.ts b/packages/connect/src/api/tezos/api/tezosGetPublicKey.ts index df4146120b9..beb8a5a1700 100644 --- a/packages/connect/src/api/tezos/api/tezosGetPublicKey.ts +++ b/packages/connect/src/api/tezos/api/tezosGetPublicKey.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/TezosGetPublicKey.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod, MethodReturnType } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath, fromHardened, getSerializedPath } from '../../../utils/pathUtils'; import { UI, createUiMessage } from '../../../events'; import type { PROTO } from '../../../constants'; -import { Assert } from '@trezor/schema-utils'; import { Bundle, GetPublicKey as GetPublicKeySchema } from '../../../types'; export default class TezosGetPublicKey extends AbstractMethod< diff --git a/packages/connect/src/api/tezos/api/tezosSignTransaction.ts b/packages/connect/src/api/tezos/api/tezosSignTransaction.ts index 2c906cc3193..f2200be4f1a 100644 --- a/packages/connect/src/api/tezos/api/tezosSignTransaction.ts +++ b/packages/connect/src/api/tezos/api/tezosSignTransaction.ts @@ -1,12 +1,13 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/TezosSignTransaction.js +import { AssertWeak } from '@trezor/schema-utils'; + import { AbstractMethod } from '../../../core/AbstractMethod'; import { getFirmwareRange } from '../../common/paramsValidator'; import { getMiscNetwork } from '../../../data/coinInfo'; import { validatePath } from '../../../utils/pathUtils'; import * as helper from '../tezosSignTx'; import type { PROTO } from '../../../constants'; -import { AssertWeak } from '@trezor/schema-utils'; import { TezosSignTransaction as TezosSignTransactionSchema } from '../../../types/api/tezos'; export default class TezosSignTransaction extends AbstractMethod< diff --git a/packages/connect/src/api/tezos/tezosSignTx.ts b/packages/connect/src/api/tezos/tezosSignTx.ts index 268f2198c00..68951bb79b7 100644 --- a/packages/connect/src/api/tezos/tezosSignTx.ts +++ b/packages/connect/src/api/tezos/tezosSignTx.ts @@ -1,7 +1,9 @@ import bs58check from 'bs58check'; + +import { Assert } from '@trezor/schema-utils'; + import { PROTO, ERRORS } from '../../constants'; import { TezosOperation } from '../../types/api/tezos'; -import { Assert } from '@trezor/schema-utils'; const PREFIX = { B: new Uint8Array([1, 52]), diff --git a/packages/connect/src/api/unlockPath.ts b/packages/connect/src/api/unlockPath.ts index a445a67807b..89e852f3037 100644 --- a/packages/connect/src/api/unlockPath.ts +++ b/packages/connect/src/api/unlockPath.ts @@ -1,8 +1,9 @@ +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { PROTO } from '../constants'; import { validatePath } from '../utils/pathUtils'; import { getFirmwareRange } from './common/paramsValidator'; -import { Assert } from '@trezor/schema-utils'; import { UnlockPathParams } from '../types/api/unlockPath'; export default class UnlockPath extends AbstractMethod<'unlockPath', PROTO.UnlockPath> { diff --git a/packages/connect/src/api/verifyMessage.ts b/packages/connect/src/api/verifyMessage.ts index 08a90a81a6f..9c6be6ff739 100644 --- a/packages/connect/src/api/verifyMessage.ts +++ b/packages/connect/src/api/verifyMessage.ts @@ -1,5 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/core/methods/VerifyMessage.js +import { Assert } from '@trezor/schema-utils'; + import { AbstractMethod } from '../core/AbstractMethod'; import { getFirmwareRange } from './common/paramsValidator'; import { getBitcoinNetwork } from '../data/coinInfo'; @@ -7,7 +9,6 @@ import { getLabel } from '../utils/pathUtils'; import { messageToHex } from '../utils/formatUtils'; import { PROTO, ERRORS } from '../constants'; import { VerifyMessage as VerifyMessageSchema } from '../types'; -import { Assert } from '@trezor/schema-utils'; export default class VerifyMessage extends AbstractMethod<'verifyMessage', PROTO.VerifyMessage> { init() { diff --git a/packages/connect/src/backend/BackendManager.ts b/packages/connect/src/backend/BackendManager.ts index d2457e10358..fbe4767963f 100644 --- a/packages/connect/src/backend/BackendManager.ts +++ b/packages/connect/src/backend/BackendManager.ts @@ -2,7 +2,6 @@ import { DataManager } from '../data/DataManager'; import { ERRORS } from '../constants'; import { Blockchain, BlockchainOptions } from './Blockchain'; import { createBlockchainMessage, BLOCKCHAIN } from '../events'; - import type { CoinInfo, BlockchainLink } from '../types'; type CoinShortcut = CoinInfo['shortcut']; diff --git a/packages/connect/src/backend/Blockchain.ts b/packages/connect/src/backend/Blockchain.ts index 8f42f4a2f92..a20ed76536c 100644 --- a/packages/connect/src/backend/Blockchain.ts +++ b/packages/connect/src/backend/Blockchain.ts @@ -4,6 +4,7 @@ import BlockchainLink, { BlockchainLinkParams, BlockchainLinkResponse, } from '@trezor/blockchain-link'; + import { createBlockchainMessage, BLOCKCHAIN, CoreEventMessage } from '../events'; import { ERRORS } from '../constants'; import { @@ -13,7 +14,6 @@ import { ElectrumWorker, SolanaWorker, } from '../workers/workers'; - import type { CoinInfo, Proxy } from '../types'; const getWorker = (type: string) => { diff --git a/packages/connect/src/backend/BlockchainLink.ts b/packages/connect/src/backend/BlockchainLink.ts index 7efc4df87ab..3b57ed5e2c8 100644 --- a/packages/connect/src/backend/BlockchainLink.ts +++ b/packages/connect/src/backend/BlockchainLink.ts @@ -1,5 +1,4 @@ import { BackendManager } from './BackendManager'; - import type { BlockchainOptions as Options } from './Blockchain'; import type { CoinInfo } from '../types'; diff --git a/packages/connect/src/backend/__tests__/Blockchain.test.ts b/packages/connect/src/backend/__tests__/Blockchain.test.ts index 363307a7a78..3d8e4086bd0 100644 --- a/packages/connect/src/backend/__tests__/Blockchain.test.ts +++ b/packages/connect/src/backend/__tests__/Blockchain.test.ts @@ -1,6 +1,7 @@ import coinsJSON from '@trezor/connect-common/files/coins.json'; import coinsJSONEth from '@trezor/connect-common/files/coins-eth.json'; import BlockchainLink from '@trezor/blockchain-link'; + import { parseCoinsJson, getBitcoinNetwork, getEthereumNetwork } from '../../data/coinInfo'; import { initBlockchain } from '../BlockchainLink'; diff --git a/packages/connect/src/core/AbstractMethod.ts b/packages/connect/src/core/AbstractMethod.ts index a584336585c..95713119a46 100644 --- a/packages/connect/src/core/AbstractMethod.ts +++ b/packages/connect/src/core/AbstractMethod.ts @@ -1,5 +1,7 @@ import { storage } from '@trezor/connect-common'; import { versionUtils } from '@trezor/utils'; +import { Capability } from '@trezor/protobuf/src/messages'; + import { NETWORK, ERRORS } from '../constants'; import { UI, @@ -21,7 +23,6 @@ import type { DeviceUniquePath, ConnectSettings, } from '../types'; -import { Capability } from '@trezor/protobuf/src/messages'; import { config } from '../data/config'; export type Payload = Extract & { override?: boolean }; diff --git a/packages/connect/src/core/onCallFirmwareUpdate.ts b/packages/connect/src/core/onCallFirmwareUpdate.ts index fb8aa29a5ee..cc9531ea04b 100644 --- a/packages/connect/src/core/onCallFirmwareUpdate.ts +++ b/packages/connect/src/core/onCallFirmwareUpdate.ts @@ -1,6 +1,7 @@ import { randomBytes } from 'crypto'; import { createTimeoutPromise } from '@trezor/utils'; +import { isNewer } from '@trezor/utils/src/versionUtils'; import { DeviceList } from '../device/DeviceList'; import { UI, DEVICE, createUiMessage, createDeviceMessage, CoreEventMessage } from '../events'; @@ -18,7 +19,6 @@ import { CommonParams, DeviceUniquePath, IntermediaryVersion } from '../types'; import { FIRMWARE, PROTO, ERRORS } from '../constants'; import type { Log } from '../utils/debug'; import type { Device } from '../device/Device'; -import { isNewer } from '@trezor/utils/src/versionUtils'; type PostMessage = (message: CoreEventMessage) => void; diff --git a/packages/connect/src/data/DataManager.ts b/packages/connect/src/data/DataManager.ts index d72c1a59412..2413c2037e7 100644 --- a/packages/connect/src/data/DataManager.ts +++ b/packages/connect/src/data/DataManager.ts @@ -4,7 +4,6 @@ import { httpRequest } from '../utils/assets'; import { parseCoinsJson } from './coinInfo'; import { parseFirmware } from './firmwareInfo'; import { parseBridgeJSON } from './transportInfo'; - import { ConnectSettings, DeviceModelInternal } from '../types'; type AssetCollection = { [key: string]: Record }; diff --git a/packages/connect/src/data/__tests__/coinInfo.test.ts b/packages/connect/src/data/__tests__/coinInfo.test.ts index ec23950cd45..da5b40e139b 100644 --- a/packages/connect/src/data/__tests__/coinInfo.test.ts +++ b/packages/connect/src/data/__tests__/coinInfo.test.ts @@ -1,4 +1,5 @@ import coinsJSON from '@trezor/connect-common/files/coins.json'; + import { parseCoinsJson, getCoinInfo, getUniqueNetworks, getAllNetworks } from '../coinInfo'; describe('data/coinInfo', () => { diff --git a/packages/connect/src/data/__tests__/firmwareInfo.test.ts b/packages/connect/src/data/__tests__/firmwareInfo.test.ts index 469b77fb26b..d345601e503 100644 --- a/packages/connect/src/data/__tests__/firmwareInfo.test.ts +++ b/packages/connect/src/data/__tests__/firmwareInfo.test.ts @@ -1,5 +1,6 @@ -import { getReleases, parseFirmware, getFirmwareStatus } from '../firmwareInfo'; import * as releases2 from '@trezor/connect-common/files/firmware/t2t1/releases.json'; + +import { getReleases, parseFirmware, getFirmwareStatus } from '../firmwareInfo'; import { DeviceModelInternal } from '../../types'; describe('data/firmwareInfo', () => { diff --git a/packages/connect/src/data/__tests__/transportInfo.test.ts b/packages/connect/src/data/__tests__/transportInfo.test.ts index c70d4348667..83add78dfca 100644 --- a/packages/connect/src/data/__tests__/transportInfo.test.ts +++ b/packages/connect/src/data/__tests__/transportInfo.test.ts @@ -1,6 +1,7 @@ -import { parseBridgeJSON } from '../transportInfo'; import * as releases from '@trezor/connect-common/files/bridge/releases.json'; +import { parseBridgeJSON } from '../transportInfo'; + describe('data/transportInfo', () => { test('parseBridgeJSON', () => { expect(parseBridgeJSON(releases)).toEqual({ diff --git a/packages/connect/src/data/analyticsInfo.ts b/packages/connect/src/data/analyticsInfo.ts index da59ded02ef..b6cdf34b55b 100644 --- a/packages/connect/src/data/analyticsInfo.ts +++ b/packages/connect/src/data/analyticsInfo.ts @@ -1,4 +1,5 @@ import { EventType } from '@trezor/connect-analytics'; + import { CoreEventMessage, UI_REQUEST } from '../events'; import type { Device } from '../types'; diff --git a/packages/connect/src/data/coinInfo.ts b/packages/connect/src/data/coinInfo.ts index e937b9c08fc..92216cdf56c 100644 --- a/packages/connect/src/data/coinInfo.ts +++ b/packages/connect/src/data/coinInfo.ts @@ -1,5 +1,6 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/data/CoinInfo.js import { cloneObject } from '@trezor/utils'; + import { getBitcoinFeeLevels, getEthereumFeeLevels, getMiscFeeLevels } from './defaultFeeLevels'; import { ERRORS } from '../constants'; import { toHardened, fromHardened } from '../utils/pathUtils'; diff --git a/packages/connect/src/data/deviceAuthenticityConfigTypes.ts b/packages/connect/src/data/deviceAuthenticityConfigTypes.ts index 7f61ba02d1a..004b30612c8 100644 --- a/packages/connect/src/data/deviceAuthenticityConfigTypes.ts +++ b/packages/connect/src/data/deviceAuthenticityConfigTypes.ts @@ -1,4 +1,5 @@ import { Static, Type } from '@trezor/schema-utils'; + import { PROTO } from '../constants'; type CertPubKeys = Static; diff --git a/packages/connect/src/data/firmwareInfo.ts b/packages/connect/src/data/firmwareInfo.ts index de9b904a450..76fd97eace7 100644 --- a/packages/connect/src/data/firmwareInfo.ts +++ b/packages/connect/src/data/firmwareInfo.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/data/FirmwareInfo.js import { versionUtils } from '@trezor/utils'; + import { filterSafeListByFirmware, filterSafeListByBootloader, diff --git a/packages/connect/src/device/Device.ts b/packages/connect/src/device/Device.ts index b3cab76ca38..fae95036bb3 100644 --- a/packages/connect/src/device/Device.ts +++ b/packages/connect/src/device/Device.ts @@ -1,4 +1,6 @@ // original file https://github.com/trezor/connect/blob/develop/src/js/device/Device.js +import { randomBytes } from 'crypto'; + import { versionUtils, createDeferred, @@ -8,6 +10,8 @@ import { } from '@trezor/utils'; import { Session } from '@trezor/transport'; import { TransportProtocol, v1 as v1Protocol } from '@trezor/protocol'; +import { type Transport, type Descriptor, TRANSPORT_ERROR } from '@trezor/transport'; + import { DeviceCommands } from './DeviceCommands'; import { PROTO, ERRORS, FIRMWARE } from '../constants'; import { @@ -28,7 +32,6 @@ import { ensureInternalModelFeature, } from '../utils/deviceFeaturesUtils'; import { initLog } from '../utils/debug'; -import { type Transport, type Descriptor, TRANSPORT_ERROR } from '@trezor/transport'; import { Device as DeviceTyped, DeviceFirmwareStatus, @@ -51,7 +54,6 @@ import { checkFirmwareRevision } from './checkFirmwareRevision'; import { IStateStorage } from './StateStorage'; import type { PromptCallback } from './prompts'; import { calculateFirmwareHash, getBinaryOptional, stripFwHeaders } from '../api/firmware'; -import { randomBytes } from 'crypto'; // custom log const _log = initLog('Device'); diff --git a/packages/connect/src/device/DeviceCommands.ts b/packages/connect/src/device/DeviceCommands.ts index 1a879d3b999..3612410b4ea 100644 --- a/packages/connect/src/device/DeviceCommands.ts +++ b/packages/connect/src/device/DeviceCommands.ts @@ -1,9 +1,12 @@ // original file https://github.com/trezor/connect/blob/develop/src/js/device/DeviceCommands.js import { randomBytes } from 'crypto'; + import { Transport, Session } from '@trezor/transport'; import { MessagesSchema as Messages } from '@trezor/protobuf'; import { createTimeoutPromise, versionUtils } from '@trezor/utils'; +import { Assert } from '@trezor/schema-utils'; + import { ERRORS } from '../constants'; import { DEVICE } from '../events'; import * as hdnodeUtils from '../utils/hdnodeUtils'; @@ -11,11 +14,9 @@ import { isTaprootPath, getSerializedPath, getScriptType, toHardened } from '../ import { getAccountAddressN } from '../utils/accountUtils'; import { getSegwitNetwork, getBech32Network } from '../data/coinInfo'; import { initLog } from '../utils/debug'; - import { Device } from './Device'; import type { CoinInfo, BitcoinNetworkInfo, Network } from '../types'; import type { HDNodeResponse } from '../types/api/getPublicKey'; -import { Assert } from '@trezor/schema-utils'; import { resolveDescriptorForTaproot } from './resolveDescriptorForTaproot'; import { promptPin, promptPassphrase, promptWord, cancelPrompt } from './prompts'; diff --git a/packages/connect/src/device/DeviceList.ts b/packages/connect/src/device/DeviceList.ts index 401a883a91b..476d8ad60b6 100644 --- a/packages/connect/src/device/DeviceList.ts +++ b/packages/connect/src/device/DeviceList.ts @@ -10,16 +10,16 @@ import { TRANSPORT, isTransportInstance, } from '@trezor/transport'; +import { Descriptor, PathPublic } from '@trezor/transport/src/types'; + import { ERRORS } from '../constants'; import { DEVICE, TransportInfo } from '../events'; import { Device } from './Device'; import { ConnectSettings, DeviceUniquePath, Device as DeviceTyped } from '../types'; - import { getBridgeInfo } from '../data/transportInfo'; import { initLog } from '../utils/debug'; import { resolveAfter } from '../utils/promiseUtils'; import { typedObjectKeys } from '../types/utils'; -import { Descriptor, PathPublic } from '@trezor/transport/src/types'; // custom log const _log = initLog('DeviceList'); diff --git a/packages/connect/src/device/StateStorage.ts b/packages/connect/src/device/StateStorage.ts index f030c0c0007..7b13cd5a794 100644 --- a/packages/connect/src/device/StateStorage.ts +++ b/packages/connect/src/device/StateStorage.ts @@ -1,6 +1,7 @@ +import { storage } from '@trezor/connect-common'; + import { DeviceState } from '../types'; import { Device } from './Device'; -import { storage } from '@trezor/connect-common'; export interface IStateStorage { saveState(device: Device, state: DeviceState): void; diff --git a/packages/connect/src/device/__tests__/checkFirmwareRevision.test.ts b/packages/connect/src/device/__tests__/checkFirmwareRevision.test.ts index d5ad53d5c91..e54f5350669 100644 --- a/packages/connect/src/device/__tests__/checkFirmwareRevision.test.ts +++ b/packages/connect/src/device/__tests__/checkFirmwareRevision.test.ts @@ -1,6 +1,7 @@ import { FetchError } from 'node-fetch'; import { DeviceModelInternal } from '@trezor/protobuf'; + import { checkFirmwareRevision, CheckFirmwareRevisionParams } from '../checkFirmwareRevision'; import { FirmwareRelease, FirmwareRevisionCheckResult } from '../../exports'; import * as utilsAssets from '../../utils/assets'; diff --git a/packages/connect/src/device/__tests__/resolveDescriptorForTaproot.test.ts b/packages/connect/src/device/__tests__/resolveDescriptorForTaproot.test.ts index 4d2fe5ccb67..b7e2a936a0a 100644 --- a/packages/connect/src/device/__tests__/resolveDescriptorForTaproot.test.ts +++ b/packages/connect/src/device/__tests__/resolveDescriptorForTaproot.test.ts @@ -1,6 +1,7 @@ +import { MessagesSchema as Messages } from '@trezor/protobuf'; + import { resolveDescriptorForTaproot } from '../resolveDescriptorForTaproot'; import { HDNodeResponse } from '../../types/api/getPublicKey'; -import { MessagesSchema as Messages } from '@trezor/protobuf'; const originalResponse: HDNodeResponse = { path: [2147483734, 2147483648, 2147483648], diff --git a/packages/connect/src/device/calculateRevisionForDevice.ts b/packages/connect/src/device/calculateRevisionForDevice.ts index a8d46948dae..93cfd5283b0 100644 --- a/packages/connect/src/device/calculateRevisionForDevice.ts +++ b/packages/connect/src/device/calculateRevisionForDevice.ts @@ -1,4 +1,5 @@ import { isNewer } from '@trezor/utils/src/versionUtils'; + import { VersionArray } from '../exports'; type calculateRevisionForDeviceParams = { diff --git a/packages/connect/src/device/checkFirmwareRevision.ts b/packages/connect/src/device/checkFirmwareRevision.ts index ade88aa48f1..e7da0dcdfc4 100644 --- a/packages/connect/src/device/checkFirmwareRevision.ts +++ b/packages/connect/src/device/checkFirmwareRevision.ts @@ -1,4 +1,5 @@ import { isEqual } from '@trezor/utils/src/versionUtils'; + import { PROTO } from '../constants'; import { downloadReleasesMetadata } from '../data/downloadReleasesMetadata'; import { FirmwareRelease, VersionArray } from '../types'; diff --git a/packages/connect/src/device/resolveDescriptorForTaproot.ts b/packages/connect/src/device/resolveDescriptorForTaproot.ts index 275212c437d..28bb8ec2e74 100644 --- a/packages/connect/src/device/resolveDescriptorForTaproot.ts +++ b/packages/connect/src/device/resolveDescriptorForTaproot.ts @@ -1,6 +1,7 @@ -import { HDNodeResponse } from '../types/api/getPublicKey'; import { MessagesSchema as Messages } from '@trezor/protobuf'; +import { HDNodeResponse } from '../types/api/getPublicKey'; + interface Params { response: HDNodeResponse; publicKey: Messages.PublicKey; diff --git a/packages/connect/src/events/blockchain.ts b/packages/connect/src/events/blockchain.ts index a7a3cecb20b..624c7a06aed 100644 --- a/packages/connect/src/events/blockchain.ts +++ b/packages/connect/src/events/blockchain.ts @@ -4,6 +4,7 @@ import type { FiatRatesBySymbol, NotificationEvent, } from '@trezor/blockchain-link'; + import type { CoinInfo } from '../types/coinInfo'; import type { MessageFactoryFn } from '../types/utils'; diff --git a/packages/connect/src/events/transport.ts b/packages/connect/src/events/transport.ts index 38cb887e3be..b1157bbbbce 100644 --- a/packages/connect/src/events/transport.ts +++ b/packages/connect/src/events/transport.ts @@ -1,8 +1,9 @@ +import type { Transport } from '@trezor/transport'; +import { TRANSPORT } from '@trezor/transport/src/constants'; + import { serializeError } from '../constants/errors'; import type { MessageFactoryFn } from '../types/utils'; -import type { Transport } from '@trezor/transport'; -import { TRANSPORT } from '@trezor/transport/src/constants'; export { TRANSPORT } from '@trezor/transport/src/constants'; diff --git a/packages/connect/src/events/ui-promise.ts b/packages/connect/src/events/ui-promise.ts index 6604a6b7e2e..af125d0d9c7 100644 --- a/packages/connect/src/events/ui-promise.ts +++ b/packages/connect/src/events/ui-promise.ts @@ -1,4 +1,5 @@ import type { Deferred } from '@trezor/utils'; + import type { DEVICE } from './device'; import type { Device } from '../device/Device'; import type { UiResponseEvent } from './ui-response'; diff --git a/packages/connect/src/factory.ts b/packages/connect/src/factory.ts index b948447e2b9..5fec9ca04ff 100644 --- a/packages/connect/src/factory.ts +++ b/packages/connect/src/factory.ts @@ -1,5 +1,6 @@ -import { UI } from './events'; import type { EventEmitter } from 'events'; + +import { UI } from './events'; import type { TrezorConnect } from './types'; import type { CallMethod } from './events/call'; import type { InitType } from './types/api/init'; diff --git a/packages/connect/src/impl/dynamic.ts b/packages/connect/src/impl/dynamic.ts index f39393648ea..30a13f388f7 100644 --- a/packages/connect/src/impl/dynamic.ts +++ b/packages/connect/src/impl/dynamic.ts @@ -4,7 +4,6 @@ import { ConnectFactoryDependencies } from '../factory'; import type { Manifest } from '../types/settings'; import { CallMethodPayload } from '../events'; import { ERRORS } from '../constants'; - import { ProxyEventEmitter } from '../utils/proxy-event-emitter'; import { InitFullSettings } from '../types/api/init'; diff --git a/packages/connect/src/types/api/applySettings.ts b/packages/connect/src/types/api/applySettings.ts index e004e802b75..cd46568e8f3 100644 --- a/packages/connect/src/types/api/applySettings.ts +++ b/packages/connect/src/types/api/applySettings.ts @@ -1,4 +1,5 @@ import { Type, Static } from '@trezor/schema-utils'; + import { PROTO } from '../../constants'; import type { Params, Response } from '../params'; diff --git a/packages/connect/src/types/api/authenticateDevice.ts b/packages/connect/src/types/api/authenticateDevice.ts index f81852dc68e..8a0cd30485c 100644 --- a/packages/connect/src/types/api/authenticateDevice.ts +++ b/packages/connect/src/types/api/authenticateDevice.ts @@ -1,4 +1,5 @@ import { Static, Type } from '@trezor/schema-utils'; + import type { Params, Response } from '../params'; import { DeviceAuthenticityConfig } from '../../data/deviceAuthenticityConfigTypes'; diff --git a/packages/connect/src/types/api/authorizeCoinjoin.ts b/packages/connect/src/types/api/authorizeCoinjoin.ts index a1aea105f65..ed0b47b17a9 100644 --- a/packages/connect/src/types/api/authorizeCoinjoin.ts +++ b/packages/connect/src/types/api/authorizeCoinjoin.ts @@ -1,6 +1,6 @@ -import type { Params, Response } from '../params'; - import { Static, Type } from '@trezor/schema-utils'; + +import type { Params, Response } from '../params'; import { DerivationPath } from '../params'; import { PROTO } from '../../constants'; diff --git a/packages/connect/src/types/api/binance/index.ts b/packages/connect/src/types/api/binance/index.ts index 503c1ef1038..89497418438 100644 --- a/packages/connect/src/types/api/binance/index.ts +++ b/packages/connect/src/types/api/binance/index.ts @@ -1,6 +1,7 @@ +import { Type, Static } from '@trezor/schema-utils'; + import { PROTO } from '../../../constants'; import { DerivationPath } from '../../params'; -import { Type, Static } from '@trezor/schema-utils'; // BinanceSDKTransaction from https://github.com/binance-chain/javascript-sdk/blob/master/src/tx/index.js diff --git a/packages/connect/src/types/api/bitcoin/index.ts b/packages/connect/src/types/api/bitcoin/index.ts index 4877c0189bb..d7a1c33974e 100644 --- a/packages/connect/src/types/api/bitcoin/index.ts +++ b/packages/connect/src/types/api/bitcoin/index.ts @@ -1,9 +1,10 @@ import type { AccountAddresses } from '@trezor/blockchain-link'; import type { Transaction as BlockbookTransaction } from '@trezor/blockchain-link-types/src/blockbook'; +import { Static, Type } from '@trezor/schema-utils'; + import type { PROTO } from '../../../constants'; import type { AccountTransaction } from '../../account'; import { DerivationPath, ProtoWithDerivationPath } from '../../params'; -import { Static, Type } from '@trezor/schema-utils'; // signMessage diff --git a/packages/connect/src/types/api/blockchainEstimateFee.ts b/packages/connect/src/types/api/blockchainEstimateFee.ts index a3e36f5efb5..e46fa9ebcaa 100644 --- a/packages/connect/src/types/api/blockchainEstimateFee.ts +++ b/packages/connect/src/types/api/blockchainEstimateFee.ts @@ -1,4 +1,5 @@ import type { BlockchainLinkParams, BlockchainLinkResponse } from '@trezor/blockchain-link'; + import type { FeeLevel, FeeInfo } from '../fees'; import type { CommonParamsWithCoin, Response } from '../params'; diff --git a/packages/connect/src/types/api/blockchainEvmRpcCall.ts b/packages/connect/src/types/api/blockchainEvmRpcCall.ts index 5c0f7874582..4573be6583c 100644 --- a/packages/connect/src/types/api/blockchainEvmRpcCall.ts +++ b/packages/connect/src/types/api/blockchainEvmRpcCall.ts @@ -1,4 +1,5 @@ import { BlockchainLinkParams, BlockchainLinkResponse } from '@trezor/blockchain-link'; + import type { CommonParamsWithCoin, Response } from '../params'; export declare function blockchainEvmRpcCall( diff --git a/packages/connect/src/types/api/blockchainGetAccountBalanceHistory.ts b/packages/connect/src/types/api/blockchainGetAccountBalanceHistory.ts index f2782d7f292..7e61b91450f 100644 --- a/packages/connect/src/types/api/blockchainGetAccountBalanceHistory.ts +++ b/packages/connect/src/types/api/blockchainGetAccountBalanceHistory.ts @@ -1,4 +1,5 @@ import type { BlockchainLinkParams, BlockchainLinkResponse } from '@trezor/blockchain-link'; + import type { CommonParamsWithCoin, Response } from '../params'; export declare function blockchainGetAccountBalanceHistory( diff --git a/packages/connect/src/types/api/blockchainGetCurrentFiatRates.ts b/packages/connect/src/types/api/blockchainGetCurrentFiatRates.ts index 08035337f1e..d98612dbd4a 100644 --- a/packages/connect/src/types/api/blockchainGetCurrentFiatRates.ts +++ b/packages/connect/src/types/api/blockchainGetCurrentFiatRates.ts @@ -1,4 +1,5 @@ import type { BlockchainLinkParams, BlockchainLinkResponse } from '@trezor/blockchain-link'; + import type { CommonParamsWithCoin, Response } from '../params'; export declare function blockchainGetCurrentFiatRates( diff --git a/packages/connect/src/types/api/blockchainGetFiatRatesForTimestamps.ts b/packages/connect/src/types/api/blockchainGetFiatRatesForTimestamps.ts index 6f9617afdd3..0c44f7c06c6 100644 --- a/packages/connect/src/types/api/blockchainGetFiatRatesForTimestamps.ts +++ b/packages/connect/src/types/api/blockchainGetFiatRatesForTimestamps.ts @@ -1,4 +1,5 @@ import type { BlockchainLinkParams, BlockchainLinkResponse } from '@trezor/blockchain-link'; + import type { CommonParamsWithCoin, Response } from '../params'; export declare function blockchainGetFiatRatesForTimestamps( diff --git a/packages/connect/src/types/api/blockchainGetTransactions.ts b/packages/connect/src/types/api/blockchainGetTransactions.ts index 51c2a9eeaed..294cef72b98 100644 --- a/packages/connect/src/types/api/blockchainGetTransactions.ts +++ b/packages/connect/src/types/api/blockchainGetTransactions.ts @@ -1,4 +1,5 @@ import type { Transaction } from '@trezor/blockchain-link'; + import type { CommonParamsWithCoin, Response } from '../params'; export type BlockchainGetTransactions = CommonParamsWithCoin & { diff --git a/packages/connect/src/types/api/blockchainSubscribe.ts b/packages/connect/src/types/api/blockchainSubscribe.ts index 63be8510669..ab66828cd3b 100644 --- a/packages/connect/src/types/api/blockchainSubscribe.ts +++ b/packages/connect/src/types/api/blockchainSubscribe.ts @@ -1,4 +1,5 @@ import type { SubscriptionAccountInfo, BlockchainLinkResponse } from '@trezor/blockchain-link'; + import type { CommonParamsWithCoin, Response } from '../params'; export type BlockchainSubscribe = CommonParamsWithCoin & { diff --git a/packages/connect/src/types/api/blockchainSubscribeFiatRates.ts b/packages/connect/src/types/api/blockchainSubscribeFiatRates.ts index 77c2312baa1..13e0d01af11 100644 --- a/packages/connect/src/types/api/blockchainSubscribeFiatRates.ts +++ b/packages/connect/src/types/api/blockchainSubscribeFiatRates.ts @@ -1,4 +1,5 @@ import type { BlockchainLinkResponse } from '@trezor/blockchain-link'; + import type { CommonParamsWithCoin, Response } from '../params'; export type BlockchainSubscribeFiatRates = CommonParamsWithCoin & { diff --git a/packages/connect/src/types/api/blockchainUnsubscribe.ts b/packages/connect/src/types/api/blockchainUnsubscribe.ts index 66c1290ea90..4b30fa3088a 100644 --- a/packages/connect/src/types/api/blockchainUnsubscribe.ts +++ b/packages/connect/src/types/api/blockchainUnsubscribe.ts @@ -1,4 +1,5 @@ import type { BlockchainLinkResponse } from '@trezor/blockchain-link'; + import type { Response } from '../params'; import type { BlockchainSubscribe } from './blockchainSubscribe'; diff --git a/packages/connect/src/types/api/blockchainUnsubscribeFiatRates.ts b/packages/connect/src/types/api/blockchainUnsubscribeFiatRates.ts index f7b5052e83f..88e8d87dd17 100644 --- a/packages/connect/src/types/api/blockchainUnsubscribeFiatRates.ts +++ b/packages/connect/src/types/api/blockchainUnsubscribeFiatRates.ts @@ -1,4 +1,5 @@ import type { BlockchainLinkResponse } from '@trezor/blockchain-link'; + import type { Response } from '../params'; import type { BlockchainSubscribeFiatRates } from './blockchainSubscribeFiatRates'; diff --git a/packages/connect/src/types/api/cancelCoinjoinAuthorization.ts b/packages/connect/src/types/api/cancelCoinjoinAuthorization.ts index 56de14b2300..c8faf394f3c 100644 --- a/packages/connect/src/types/api/cancelCoinjoinAuthorization.ts +++ b/packages/connect/src/types/api/cancelCoinjoinAuthorization.ts @@ -1,4 +1,5 @@ import { Static, Type } from '@trezor/schema-utils'; + import type { PROTO } from '../../constants'; import type { Params, Response } from '../params'; diff --git a/packages/connect/src/types/api/cardano/index.ts b/packages/connect/src/types/api/cardano/index.ts index 7170a522713..8a836516863 100644 --- a/packages/connect/src/types/api/cardano/index.ts +++ b/packages/connect/src/types/api/cardano/index.ts @@ -1,4 +1,5 @@ import { Type, Static } from '@trezor/schema-utils'; + import { PROTO } from '../../../constants'; import { GetPublicKey, PublicKey, DerivationPath } from '../../params'; diff --git a/packages/connect/src/types/api/cardanoComposeTransaction.ts b/packages/connect/src/types/api/cardanoComposeTransaction.ts index a9f01b7eef1..418d45f7e07 100644 --- a/packages/connect/src/types/api/cardanoComposeTransaction.ts +++ b/packages/connect/src/types/api/cardanoComposeTransaction.ts @@ -1,4 +1,5 @@ import type { types, trezorUtils } from '@fivebinaries/coin-selection'; + import type { AccountAddresses, AccountUtxo } from '../../exports'; import type { Params, Response } from '../params'; import type { CardanoCertificate, CardanoInput, CardanoOutput } from './cardano'; diff --git a/packages/connect/src/types/api/changeLanguage.ts b/packages/connect/src/types/api/changeLanguage.ts index 5709faaf2bf..1d1d2a37e52 100644 --- a/packages/connect/src/types/api/changeLanguage.ts +++ b/packages/connect/src/types/api/changeLanguage.ts @@ -1,4 +1,5 @@ import { Type, Static } from '@trezor/schema-utils'; + import type { Params, Response } from '../params'; import { PROTO } from '../../constants'; diff --git a/packages/connect/src/types/api/cipherKeyValue.ts b/packages/connect/src/types/api/cipherKeyValue.ts index dff6e40e849..1a652d5b76a 100644 --- a/packages/connect/src/types/api/cipherKeyValue.ts +++ b/packages/connect/src/types/api/cipherKeyValue.ts @@ -1,6 +1,7 @@ -import { Params, BundledParams, Response, DerivationPath } from '../params'; import { Static, Type } from '@trezor/schema-utils'; +import { Params, BundledParams, Response, DerivationPath } from '../params'; + export type CipherKeyValue = Static; export const CipherKeyValue = Type.Object({ path: DerivationPath, diff --git a/packages/connect/src/types/api/composeTransaction.ts b/packages/connect/src/types/api/composeTransaction.ts index 72180c477c6..fae24cb4adb 100644 --- a/packages/connect/src/types/api/composeTransaction.ts +++ b/packages/connect/src/types/api/composeTransaction.ts @@ -11,6 +11,7 @@ import type { ComposeResultNonFinal as ComposeResultNonFinalBase, TransactionInputOutputSortingStrategy, } from '@trezor/utxo-lib'; + import type { PROTO } from '../../constants'; import type { Params, Response } from '../params'; diff --git a/packages/connect/src/types/api/eos/index.ts b/packages/connect/src/types/api/eos/index.ts index 468b0405dee..2e005b1578c 100644 --- a/packages/connect/src/types/api/eos/index.ts +++ b/packages/connect/src/types/api/eos/index.ts @@ -1,6 +1,7 @@ +import { Type, Static } from '@trezor/schema-utils'; + import { PROTO } from '../../../constants'; import { DerivationPath } from '../../params'; -import { Type, Static } from '@trezor/schema-utils'; // eosGetPublicKey diff --git a/packages/connect/src/types/api/ethereum/index.ts b/packages/connect/src/types/api/ethereum/index.ts index 777a78055f4..97de567044f 100644 --- a/packages/connect/src/types/api/ethereum/index.ts +++ b/packages/connect/src/types/api/ethereum/index.ts @@ -1,4 +1,5 @@ import { Type, Static } from '@trezor/schema-utils'; + import { DerivationPath } from '../../params'; // ethereumSignMessage diff --git a/packages/connect/src/types/api/firmwareUpdate.ts b/packages/connect/src/types/api/firmwareUpdate.ts index b2aaf881692..ff5238e53af 100644 --- a/packages/connect/src/types/api/firmwareUpdate.ts +++ b/packages/connect/src/types/api/firmwareUpdate.ts @@ -1,4 +1,5 @@ import { Static, Type } from '@trezor/schema-utils'; + import type { Params, Response } from '../params'; export type FirmwareUpdate = Static; diff --git a/packages/connect/src/types/api/getAccountDescriptor.ts b/packages/connect/src/types/api/getAccountDescriptor.ts index f80e193e8a7..80f043b37fe 100644 --- a/packages/connect/src/types/api/getAccountDescriptor.ts +++ b/packages/connect/src/types/api/getAccountDescriptor.ts @@ -1,4 +1,5 @@ import { Static, Type } from '@trezor/schema-utils'; + import { PROTO } from '../../constants'; import { Params, BundledParams, Response, DerivationPath } from '../params'; diff --git a/packages/connect/src/types/api/getAccountInfo.ts b/packages/connect/src/types/api/getAccountInfo.ts index 4c607b989d9..5d0d540d7a0 100644 --- a/packages/connect/src/types/api/getAccountInfo.ts +++ b/packages/connect/src/types/api/getAccountInfo.ts @@ -1,4 +1,5 @@ import type { BlockchainLinkParams } from '@trezor/blockchain-link'; + import type { PROTO } from '../../constants'; import type { Params, BundledParams, Response } from '../params'; import type { AccountInfo, DiscoveryAccountType } from '../account'; diff --git a/packages/connect/src/types/api/getAddress.ts b/packages/connect/src/types/api/getAddress.ts index 6ab2e1e2b1f..162196f3407 100644 --- a/packages/connect/src/types/api/getAddress.ts +++ b/packages/connect/src/types/api/getAddress.ts @@ -1,4 +1,5 @@ import { Static, Type } from '@trezor/schema-utils'; + import { PROTO } from '../../constants'; import { GetAddress as GetAddressShared, diff --git a/packages/connect/src/types/api/getOwnershipId.ts b/packages/connect/src/types/api/getOwnershipId.ts index 81e7b77e057..9d7b4cda194 100644 --- a/packages/connect/src/types/api/getOwnershipId.ts +++ b/packages/connect/src/types/api/getOwnershipId.ts @@ -1,4 +1,5 @@ import { Static, Type } from '@trezor/schema-utils'; + import { PROTO } from '../../constants'; import { Params, BundledParams, Response, DerivationPath } from '../params'; diff --git a/packages/connect/src/types/api/getOwnershipProof.ts b/packages/connect/src/types/api/getOwnershipProof.ts index a14d1879050..682588682a2 100644 --- a/packages/connect/src/types/api/getOwnershipProof.ts +++ b/packages/connect/src/types/api/getOwnershipProof.ts @@ -1,4 +1,5 @@ import { Static, Type } from '@trezor/schema-utils'; + import { PROTO } from '../../constants'; import { Params, BundledParams, Response, DerivationPath } from '../params'; diff --git a/packages/connect/src/types/api/getPublicKey.ts b/packages/connect/src/types/api/getPublicKey.ts index a7a07d115b7..2d0eaacb7a9 100644 --- a/packages/connect/src/types/api/getPublicKey.ts +++ b/packages/connect/src/types/api/getPublicKey.ts @@ -1,6 +1,7 @@ +import { Type, Static } from '@trezor/schema-utils'; + import { PROTO } from '../../constants'; import { GetPublicKey as GetPublicKeyShared, Params, BundledParams, Response } from '../params'; -import { Type, Static } from '@trezor/schema-utils'; export type GetPublicKey = Static; export const GetPublicKey = Type.Intersect([ diff --git a/packages/connect/src/types/api/nem/index.ts b/packages/connect/src/types/api/nem/index.ts index 4aac576f3ea..56b13a9f8e7 100644 --- a/packages/connect/src/types/api/nem/index.ts +++ b/packages/connect/src/types/api/nem/index.ts @@ -1,6 +1,7 @@ +import { Type, Static } from '@trezor/schema-utils'; + import { PROTO, NEM } from '../../../constants'; import { DerivationPath } from '../../params'; -import { Type, Static } from '@trezor/schema-utils'; // NEM types from nem-sdk // https://nemproject.github.io/#transferTransaction diff --git a/packages/connect/src/types/api/nemGetAddress.ts b/packages/connect/src/types/api/nemGetAddress.ts index 9c4c25041b5..80d10b409e0 100644 --- a/packages/connect/src/types/api/nemGetAddress.ts +++ b/packages/connect/src/types/api/nemGetAddress.ts @@ -1,4 +1,5 @@ import { Static, Type } from '@trezor/schema-utils'; + import { GetAddress, Address, Params, BundledParams, Response } from '../params'; export type NEMGetAddress = Static; diff --git a/packages/connect/src/types/api/pushTransaction.ts b/packages/connect/src/types/api/pushTransaction.ts index f62a9abaf76..aa991098b95 100644 --- a/packages/connect/src/types/api/pushTransaction.ts +++ b/packages/connect/src/types/api/pushTransaction.ts @@ -3,6 +3,7 @@ * Broadcasts the transaction to the selected network. */ import { Static, Type } from '@trezor/schema-utils'; + import type { Params, Response } from '../params'; export type PushTransaction = Static; diff --git a/packages/connect/src/types/api/recoveryDevice.ts b/packages/connect/src/types/api/recoveryDevice.ts index e1cd1350607..1316f77ca99 100644 --- a/packages/connect/src/types/api/recoveryDevice.ts +++ b/packages/connect/src/types/api/recoveryDevice.ts @@ -3,6 +3,7 @@ */ import { Static, Type } from '@trezor/schema-utils'; + import { PROTO } from '../../constants'; import type { Params, Response } from '../params'; diff --git a/packages/connect/src/types/api/requestLogin.ts b/packages/connect/src/types/api/requestLogin.ts index f5acbd76a8b..ba6acf441e8 100644 --- a/packages/connect/src/types/api/requestLogin.ts +++ b/packages/connect/src/types/api/requestLogin.ts @@ -6,6 +6,7 @@ */ import { Static, Type } from '@trezor/schema-utils'; + import type { Params, Response } from '../params'; export type LoginChallenge = Static; diff --git a/packages/connect/src/types/api/ripple/index.ts b/packages/connect/src/types/api/ripple/index.ts index fa9d3955344..6ccf8d4f524 100644 --- a/packages/connect/src/types/api/ripple/index.ts +++ b/packages/connect/src/types/api/ripple/index.ts @@ -1,6 +1,7 @@ -import { DerivationPath } from '../../params'; import { Type, Static } from '@trezor/schema-utils'; +import { DerivationPath } from '../../params'; + export type RipplePayment = Static; export const RipplePayment = Type.Object({ amount: Type.String(), diff --git a/packages/connect/src/types/api/solana/index.ts b/packages/connect/src/types/api/solana/index.ts index 1e9e5d2b1a2..f1498e78359 100644 --- a/packages/connect/src/types/api/solana/index.ts +++ b/packages/connect/src/types/api/solana/index.ts @@ -1,6 +1,7 @@ -import { PublicKey } from '../../params'; import { Type, Static } from '@trezor/schema-utils'; +import { PublicKey } from '../../params'; + // solanaGetPublicKey export type SolanaPublicKey = Static; diff --git a/packages/connect/src/types/api/stellar/index.ts b/packages/connect/src/types/api/stellar/index.ts index bf26040150c..33247e2f72b 100644 --- a/packages/connect/src/types/api/stellar/index.ts +++ b/packages/connect/src/types/api/stellar/index.ts @@ -1,9 +1,10 @@ // Stellar types from stellar-sdk // https://github.com/stellar/js-stellar-base +import { Type, Static } from '@trezor/schema-utils'; + import { PROTO } from '../../../constants'; import { DerivationPath } from '../../params'; -import { Type, Static } from '@trezor/schema-utils'; export type StellarAsset = Static; export const StellarAsset = Type.Object({ diff --git a/packages/connect/src/types/api/tezos/index.ts b/packages/connect/src/types/api/tezos/index.ts index 4f50db8e2d7..7630a640a34 100644 --- a/packages/connect/src/types/api/tezos/index.ts +++ b/packages/connect/src/types/api/tezos/index.ts @@ -1,6 +1,7 @@ -import { DerivationPath } from '../../params'; import { Type, Static } from '@trezor/schema-utils'; +import { DerivationPath } from '../../params'; + export type TezosRevealOperation = Static; export const TezosRevealOperation = Type.Object({ source: Type.String(), diff --git a/packages/connect/src/types/api/unlockPath.ts b/packages/connect/src/types/api/unlockPath.ts index 9e83ed30a5b..705648e71d3 100644 --- a/packages/connect/src/types/api/unlockPath.ts +++ b/packages/connect/src/types/api/unlockPath.ts @@ -1,4 +1,5 @@ import { Static, Type } from '@trezor/schema-utils'; + import { Params, Response, DerivationPath } from '../params'; import type { PROTO } from '../../constants'; diff --git a/packages/connect/src/types/coinInfo.ts b/packages/connect/src/types/coinInfo.ts index f7afdf736d7..933d67595a5 100644 --- a/packages/connect/src/types/coinInfo.ts +++ b/packages/connect/src/types/coinInfo.ts @@ -1,4 +1,5 @@ import { Type, Static } from '@trezor/schema-utils'; + import { FeeLevel } from './fees'; import { DeviceModelInternal } from './device'; diff --git a/packages/connect/src/types/device.ts b/packages/connect/src/types/device.ts index 55f5ecb5d29..405a9c2a477 100644 --- a/packages/connect/src/types/device.ts +++ b/packages/connect/src/types/device.ts @@ -1,4 +1,5 @@ import { Descriptor } from '@trezor/transport'; + import type { PROTO } from '../constants'; import type { ReleaseInfo } from './firmware'; diff --git a/packages/connect/src/types/params.ts b/packages/connect/src/types/params.ts index 7d8ad171dff..21b86638679 100644 --- a/packages/connect/src/types/params.ts +++ b/packages/connect/src/types/params.ts @@ -1,6 +1,7 @@ // API params import { Type, TSchema, Static } from '@trezor/schema-utils'; + import { DeviceState, DeviceUniquePath } from './device'; import { ErrorCode } from '../constants/errors'; diff --git a/packages/connect/src/utils/__fixtures__/accountUtils.ts b/packages/connect/src/utils/__fixtures__/accountUtils.ts index bb875aacee5..367b60e0154 100644 --- a/packages/connect/src/utils/__fixtures__/accountUtils.ts +++ b/packages/connect/src/utils/__fixtures__/accountUtils.ts @@ -2,7 +2,6 @@ import coinsJSON from '@trezor/connect-common/files/coins.json'; import coinsJSONEth from '@trezor/connect-common/files/coins-eth.json'; import { getAccountLabel, isUtxoBased } from '../accountUtils'; - import { parseCoinsJson, getBitcoinNetwork, diff --git a/packages/connect/src/utils/__fixtures__/ethereumUtils.ts b/packages/connect/src/utils/__fixtures__/ethereumUtils.ts index d796759e323..cb2e164f79d 100644 --- a/packages/connect/src/utils/__fixtures__/ethereumUtils.ts +++ b/packages/connect/src/utils/__fixtures__/ethereumUtils.ts @@ -2,7 +2,6 @@ import coinsJSON from '@trezor/connect-common/files/coins.json'; import coinsJSONEth from '@trezor/connect-common/files/coins-eth.json'; import { getNetworkLabel } from '../ethereumUtils'; - import { parseCoinsJson, getEthereumNetwork } from '../../data/coinInfo'; parseCoinsJson({ diff --git a/packages/connect/src/utils/__fixtures__/formatUtils.ts b/packages/connect/src/utils/__fixtures__/formatUtils.ts index 52d9a6fd123..1bcab841b21 100644 --- a/packages/connect/src/utils/__fixtures__/formatUtils.ts +++ b/packages/connect/src/utils/__fixtures__/formatUtils.ts @@ -1,7 +1,6 @@ import coinsJSON from '@trezor/connect-common/files/coins.json'; import { formatAmount } from '../formatUtils'; - import { parseCoinsJson, getBitcoinNetwork } from '../../data/coinInfo'; parseCoinsJson(coinsJSON); diff --git a/packages/connect/src/utils/__tests__/accountUtils.test.ts b/packages/connect/src/utils/__tests__/accountUtils.test.ts index 34453f8db5d..6136ef991a1 100644 --- a/packages/connect/src/utils/__tests__/accountUtils.test.ts +++ b/packages/connect/src/utils/__tests__/accountUtils.test.ts @@ -1,5 +1,4 @@ import { getAccountLabel, isUtxoBased } from '../accountUtils'; - import * as fixtures from '../__fixtures__/accountUtils'; describe('utils/accountUtils', () => { diff --git a/packages/connect/src/utils/__tests__/addressUtils.test.ts b/packages/connect/src/utils/__tests__/addressUtils.test.ts index 392d87fb38f..2676b5e00d4 100644 --- a/packages/connect/src/utils/__tests__/addressUtils.test.ts +++ b/packages/connect/src/utils/__tests__/addressUtils.test.ts @@ -1,4 +1,5 @@ import coinsJSON from '@trezor/connect-common/files/coins.json'; + import { parseCoinsJson, getBitcoinNetwork } from '../../data/coinInfo'; import * as utils from '../addressUtils'; import * as fixtures from '../__fixtures__/addressUtils'; diff --git a/packages/connect/src/utils/__tests__/deviceFeaturesUtils.test.ts b/packages/connect/src/utils/__tests__/deviceFeaturesUtils.test.ts index 768d7dbc8e1..5f851c0450e 100644 --- a/packages/connect/src/utils/__tests__/deviceFeaturesUtils.test.ts +++ b/packages/connect/src/utils/__tests__/deviceFeaturesUtils.test.ts @@ -2,7 +2,6 @@ import coinsJSON from '@trezor/connect-common/files/coins.json'; import coinsJSONEth from '@trezor/connect-common/files/coins-eth.json'; import { parseCoinsJson, getAllNetworks } from '../../data/coinInfo'; - import { getUnavailableCapabilities, parseCapabilities, diff --git a/packages/connect/src/utils/__tests__/ethereumUtils.test.ts b/packages/connect/src/utils/__tests__/ethereumUtils.test.ts index b2b628f5594..4d9eff7f02c 100644 --- a/packages/connect/src/utils/__tests__/ethereumUtils.test.ts +++ b/packages/connect/src/utils/__tests__/ethereumUtils.test.ts @@ -1,5 +1,4 @@ import { getNetworkLabel } from '../ethereumUtils'; - import * as fixtures from '../__fixtures__/ethereumUtils'; describe('utils/ethereumUtils', () => { diff --git a/packages/connect/src/utils/__tests__/formatUtils.test.ts b/packages/connect/src/utils/__tests__/formatUtils.test.ts index a37413155c5..5d9d24ecbc7 100644 --- a/packages/connect/src/utils/__tests__/formatUtils.test.ts +++ b/packages/connect/src/utils/__tests__/formatUtils.test.ts @@ -1,5 +1,4 @@ import { formatAmount } from '../formatUtils'; - import * as fixtures from '../__fixtures__/formatUtils'; describe('utils/formatUtils', () => { diff --git a/packages/connect/src/utils/addressUtils.ts b/packages/connect/src/utils/addressUtils.ts index 7355dc8a2f6..fe6d45f6518 100644 --- a/packages/connect/src/utils/addressUtils.ts +++ b/packages/connect/src/utils/addressUtils.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/utils/addressUtils.js import { address as BitcoinJSAddress } from '@trezor/utxo-lib'; + import type { BitcoinNetworkInfo } from '../types'; // Base58 diff --git a/packages/connect/src/utils/assetUtils.ts b/packages/connect/src/utils/assetUtils.ts index c8d3a88720b..1a6b182bc47 100644 --- a/packages/connect/src/utils/assetUtils.ts +++ b/packages/connect/src/utils/assetUtils.ts @@ -1,4 +1,5 @@ import { isArrayMember } from '@trezor/utils'; + import { DeviceModelInternal } from '../types'; const isDeviceModel = (model: string): model is DeviceModelInternal => diff --git a/packages/connect/src/utils/assets.ts b/packages/connect/src/utils/assets.ts index ac62bf5b07d..457970ada86 100644 --- a/packages/connect/src/utils/assets.ts +++ b/packages/connect/src/utils/assets.ts @@ -2,6 +2,7 @@ import fetch from 'cross-fetch'; import { promises as fs } from 'fs'; + import { httpRequest as browserHttpRequest } from './assets-browser'; import { tryLocalAssetRequire } from './assetUtils'; diff --git a/packages/connect/src/utils/deviceFeaturesUtils.ts b/packages/connect/src/utils/deviceFeaturesUtils.ts index e48d51cb2c7..84fbc4f002e 100644 --- a/packages/connect/src/utils/deviceFeaturesUtils.ts +++ b/packages/connect/src/utils/deviceFeaturesUtils.ts @@ -1,4 +1,5 @@ import { isArrayMember, versionUtils } from '@trezor/utils'; + import { PROTO } from '../constants'; import { config } from '../data/config'; import { Features, CoinInfo, UnavailableCapabilities, DeviceModelInternal } from '../types'; diff --git a/packages/connect/src/utils/firmwareUtils.ts b/packages/connect/src/utils/firmwareUtils.ts index 73d82126e05..85a7656fccf 100644 --- a/packages/connect/src/utils/firmwareUtils.ts +++ b/packages/connect/src/utils/firmwareUtils.ts @@ -1,4 +1,5 @@ import { versionUtils } from '@trezor/utils'; + import type { Features, StrictFeatures, FirmwareRelease, VersionArray } from '../types'; export const isStrictFeatures = (extFeatures: Features): extFeatures is StrictFeatures => diff --git a/packages/connect/src/utils/formatUtils.ts b/packages/connect/src/utils/formatUtils.ts index 47d92ae34f5..dce493ca259 100644 --- a/packages/connect/src/utils/formatUtils.ts +++ b/packages/connect/src/utils/formatUtils.ts @@ -1,6 +1,7 @@ // origin: https://github.com/trezor/connect/blob/develop/src/js/utils/formatUtils.js import { BigNumber } from '@trezor/utils/src/bigNumber'; + import type { CoinInfo } from '../types'; export const formatAmount = (n: string, coinInfo: CoinInfo) => diff --git a/packages/connect/src/utils/hdnodeUtils.ts b/packages/connect/src/utils/hdnodeUtils.ts index 6f4b29f5067..87a4c2e92b5 100644 --- a/packages/connect/src/utils/hdnodeUtils.ts +++ b/packages/connect/src/utils/hdnodeUtils.ts @@ -2,6 +2,7 @@ import { bip32 } from '@trezor/utxo-lib'; import type { Network, BIP32Interface } from '@trezor/utxo-lib'; + import { PROTO, ERRORS } from '../constants'; const pubNode2bjsNode = (node: PROTO.HDNodeType, network?: Network) => { diff --git a/packages/connect/src/utils/uiPromiseManager.ts b/packages/connect/src/utils/uiPromiseManager.ts index 6f6a7ad8e37..18c73e37b68 100644 --- a/packages/connect/src/utils/uiPromiseManager.ts +++ b/packages/connect/src/utils/uiPromiseManager.ts @@ -1,5 +1,6 @@ -import { DEVICE, UiPromise, AnyUiPromise, UiPromiseCreator, UiPromiseResponse } from '../events'; import { createDeferred, arrayPartition } from '@trezor/utils'; + +import { DEVICE, UiPromise, AnyUiPromise, UiPromiseCreator, UiPromiseResponse } from '../events'; import { DeviceUniquePath } from '../types/device'; export const createUiPromiseManager = (interactionTimeout: () => void) => { diff --git a/packages/product-components/src/components/AssetShareIndicator/AssetShareIndicator.tsx b/packages/product-components/src/components/AssetShareIndicator/AssetShareIndicator.tsx index 83d2984c9c8..f9c7aa89215 100644 --- a/packages/product-components/src/components/AssetShareIndicator/AssetShareIndicator.tsx +++ b/packages/product-components/src/components/AssetShareIndicator/AssetShareIndicator.tsx @@ -1,11 +1,14 @@ import { SVGProps } from 'react'; + import { motion, AnimationProps, SVGMotionProps } from 'framer-motion'; import styled, { useTheme } from 'styled-components'; + import { coinsColors } from '@trezor/theme'; -import { CoinLogo, CoinLogoProps } from '../CoinLogo/CoinLogo'; import { motionEasing } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import { CoinLogo, CoinLogoProps } from '../CoinLogo/CoinLogo'; + const Container = styled.div` position: relative; align-items: center; diff --git a/packages/product-components/src/components/CoinLogo/CoinLogo.stories.tsx b/packages/product-components/src/components/CoinLogo/CoinLogo.stories.tsx index a3ee39f8c51..c98a9adee7e 100644 --- a/packages/product-components/src/components/CoinLogo/CoinLogo.stories.tsx +++ b/packages/product-components/src/components/CoinLogo/CoinLogo.stories.tsx @@ -1,5 +1,6 @@ import styled from 'styled-components'; import { Meta, StoryObj } from '@storybook/react'; + import { CoinLogo as CoinLogoComponent } from '../../index'; import { COINS } from './coins'; import { CoinLogoProps } from './CoinLogo'; diff --git a/packages/product-components/src/components/CoinLogo/CoinLogo.tsx b/packages/product-components/src/components/CoinLogo/CoinLogo.tsx index 33d59b114d3..7f60f9927a2 100644 --- a/packages/product-components/src/components/CoinLogo/CoinLogo.tsx +++ b/packages/product-components/src/components/CoinLogo/CoinLogo.tsx @@ -1,9 +1,12 @@ import { ImgHTMLAttributes } from 'react'; import { ReactSVG } from 'react-svg'; + import styled from 'styled-components'; -import { COINS, LegacyNetworkSymbol } from './coins'; + import { NetworkSymbol } from '@suite-common/wallet-config'; +import { COINS, LegacyNetworkSymbol } from './coins'; + export interface CoinLogoProps extends ImgHTMLAttributes { symbol: NetworkSymbol | LegacyNetworkSymbol; className?: string; diff --git a/packages/product-components/src/components/CoinLogo/coinLogos.stories.tsx b/packages/product-components/src/components/CoinLogo/coinLogos.stories.tsx index 0df5feb64f6..04218cb39d2 100644 --- a/packages/product-components/src/components/CoinLogo/coinLogos.stories.tsx +++ b/packages/product-components/src/components/CoinLogo/coinLogos.stories.tsx @@ -1,10 +1,13 @@ import styled from 'styled-components'; import { Meta, StoryObj } from '@storybook/react'; -import { CoinLogo } from '../../index'; + import { StoryColumn } from '@trezor/components'; -import { COINS } from './coins'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import { CoinLogo } from '../../index'; +import { COINS } from './coins'; + + const CoinName = styled.div` margin-bottom: 0.5rem; color: ${({ theme }) => theme.legacy.TYPE_LIGHT_GREY}; diff --git a/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDevice.stories.tsx b/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDevice.stories.tsx index c4f92df9694..95ea5762569 100644 --- a/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDevice.stories.tsx +++ b/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDevice.stories.tsx @@ -1,8 +1,10 @@ import { Meta, StoryFn } from '@storybook/react'; + import { DeviceModelInternal } from '@trezor/connect'; -import { ConfirmOnDevice as ConfirmOnDeviceComponent } from './ConfirmOnDevice'; import { StoryColumn } from '@trezor/components'; +import { ConfirmOnDevice as ConfirmOnDeviceComponent } from './ConfirmOnDevice'; + const meta: Meta = { title: 'ConfirmOnDevice', parameters: { diff --git a/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDevice.tsx b/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDevice.tsx index 4e188c2363d..15cbb77f71b 100644 --- a/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDevice.tsx +++ b/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDevice.tsx @@ -1,9 +1,11 @@ import { ReactNode } from 'react'; + import styled, { css, keyframes } from 'styled-components'; + import { DeviceModelInternal } from '@trezor/connect'; import { borders, spacingsPx } from '@trezor/theme'; - import { ElevationUp } from '@trezor/components'; + import { ConfirmOnDeviceContent } from './ConfirmOnDeviceContent'; enum AnimationDirection { diff --git a/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDeviceContent.tsx b/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDeviceContent.tsx index a255793cb07..db4dd80d225 100644 --- a/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDeviceContent.tsx +++ b/packages/product-components/src/components/ConfirmOnDevice/ConfirmOnDeviceContent.tsx @@ -1,5 +1,7 @@ import { ReactNode } from 'react'; + import styled, { css, useTheme } from 'styled-components'; + import { Icon, useElevation } from '@trezor/components'; import { DeviceModelInternal } from '@trezor/connect'; import { @@ -9,6 +11,7 @@ import { spacingsPx, typography, } from '@trezor/theme'; + import { RotateDeviceImage } from '../RotateDeviceImage/RotateDeviceImage'; const Column = styled.div` diff --git a/packages/product-components/src/components/PassphraseTypeCard/EnterOnTrezorButton.tsx b/packages/product-components/src/components/PassphraseTypeCard/EnterOnTrezorButton.tsx index e578675beb5..ec7a22d5f2f 100644 --- a/packages/product-components/src/components/PassphraseTypeCard/EnterOnTrezorButton.tsx +++ b/packages/product-components/src/components/PassphraseTypeCard/EnterOnTrezorButton.tsx @@ -1,5 +1,7 @@ import { FormattedMessage } from 'react-intl'; + import styled, { useTheme } from 'styled-components'; + import { Image, Card, Text, Row, Icon } from '@trezor/components'; import { DeviceModelInternal } from '@trezor/connect'; import { spacings } from '@trezor/theme'; diff --git a/packages/product-components/src/components/PassphraseTypeCard/NonAsciiBanner.tsx b/packages/product-components/src/components/PassphraseTypeCard/NonAsciiBanner.tsx index 05a4ec58118..1d328866a43 100644 --- a/packages/product-components/src/components/PassphraseTypeCard/NonAsciiBanner.tsx +++ b/packages/product-components/src/components/PassphraseTypeCard/NonAsciiBanner.tsx @@ -1,6 +1,8 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; + import styled from 'styled-components'; + import { Banner, Button, Code, Text } from '@trezor/components'; import { BannerVariant } from '@trezor/components/src/components/Banner/types'; import { borders, spacingsPx, typography } from '@trezor/theme'; diff --git a/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCard.stories.tsx b/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCard.stories.tsx index 53cbfe46649..c9dfae10a63 100644 --- a/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCard.stories.tsx +++ b/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCard.stories.tsx @@ -1,9 +1,11 @@ import { IntlProvider } from 'react-intl'; + +import { Meta, StoryObj } from '@storybook/react'; + import { PassphraseTypeCard as PassphraseTypeCardComponent, PassphraseTypeCardProps, } from './PassphraseTypeCard'; -import { Meta, StoryObj } from '@storybook/react'; const meta: Meta = { title: 'PassphraseTypeCard', diff --git a/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCard.tsx b/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCard.tsx index 7ca579ae4c4..699bcfa4680 100644 --- a/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCard.tsx +++ b/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCard.tsx @@ -1,18 +1,21 @@ import { ReactNode, useCallback, useEffect, useRef, useState } from 'react'; + import { AnimatePresence } from 'framer-motion'; +import styled, { css } from 'styled-components'; + import { useKeyPress } from '@trezor/react-utils'; import { setCaretPosition } from '@trezor/dom-utils'; -import styled, { css } from 'styled-components'; import { countBytesInString } from '@trezor/utils'; import { formInputsMaxLength } from '@suite-common/validators'; import { TooltipProps } from '@trezor/components'; -import { EnterOnTrezorButton } from './EnterOnTrezorButton'; import { DeviceModelInternal, Features } from '@trezor/connect'; +import { borders, spacingsPx } from '@trezor/theme'; + +import { EnterOnTrezorButton } from './EnterOnTrezorButton'; import { PassphraseTypeCardHeading } from './PassphraseTypeCardHeading'; import { WalletType } from './types'; import { PassphraseTypeCardContent } from './PassphraseTypeCardContent'; import { DOT } from './consts'; -import { borders, spacingsPx } from '@trezor/theme'; import { useNonAsciiChars } from './useNonAsciiChars'; import { getSubmitLabel } from './getSubmitLabel'; diff --git a/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardContent.tsx b/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardContent.tsx index 7de621161e1..75790169091 100644 --- a/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardContent.tsx +++ b/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardContent.tsx @@ -1,14 +1,17 @@ -import { isAndroid } from '@trezor/env-utils'; -import { AnimatePresence, motion } from 'framer-motion'; import { FormattedMessage, useIntl } from 'react-intl'; +import { ChangeEvent, MutableRefObject, ReactNode, RefObject } from 'react'; + +import { AnimatePresence, motion } from 'framer-motion'; +import styled, { useTheme } from 'styled-components'; + +import { isAndroid } from '@trezor/env-utils'; import { Button, Card, Column, Icon, Input, motionAnimation, Row } from '@trezor/components'; import { ButtonVariant } from '@trezor/components/src/components/buttons/buttonStyleUtils'; import { BannerVariant } from '@trezor/components/src/components/Banner/types'; -import { PasswordStrengthIndicator } from '../PasswordStrengthIndicator/PasswordStrengthIndicator'; -import styled, { useTheme } from 'styled-components'; import { spacings, spacingsPx, typography } from '@trezor/theme'; import { useKeyPress } from '@trezor/react-utils'; -import { ChangeEvent, MutableRefObject, ReactNode, RefObject } from 'react'; + +import { PasswordStrengthIndicator } from '../PasswordStrengthIndicator/PasswordStrengthIndicator'; import { WalletType } from './types'; import { DOT } from './consts'; import { NonAsciiBanner } from './NonAsciiBanner'; diff --git a/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardHeading.tsx b/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardHeading.tsx index a4b4f913cc6..f3e2f3131a2 100644 --- a/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardHeading.tsx +++ b/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardHeading.tsx @@ -1,9 +1,13 @@ -import { borders, spacings, spacingsPx, typography } from '@trezor/theme'; import { FormattedMessage } from 'react-intl'; +import { ReactNode } from 'react'; + import styled, { useTheme } from 'styled-components'; + +import { borders, spacings, spacingsPx, typography } from '@trezor/theme'; import { Tooltip, TooltipProps, Column, Row, Icon } from '@trezor/components'; + import { WalletType } from './types'; -import { ReactNode } from 'react'; + const IconWrapper = styled.div<{ $type: WalletType }>` width: 38px; diff --git a/packages/product-components/src/components/PassphraseTypeCard/useNonAsciiChars.ts b/packages/product-components/src/components/PassphraseTypeCard/useNonAsciiChars.ts index b57c583ce7c..292ffe3d426 100644 --- a/packages/product-components/src/components/PassphraseTypeCard/useNonAsciiChars.ts +++ b/packages/product-components/src/components/PassphraseTypeCard/useNonAsciiChars.ts @@ -1,4 +1,5 @@ import { useEffect, useMemo, useState } from 'react'; + import { getNonAsciiChars } from '@trezor/utils'; export const useNonAsciiChars = (value: string) => { diff --git a/packages/product-components/src/components/PasswordStrengthIndicator/PasswordStrengthIndicator.stories.tsx b/packages/product-components/src/components/PasswordStrengthIndicator/PasswordStrengthIndicator.stories.tsx index 2cfa25c4087..c6a4dcd54d4 100644 --- a/packages/product-components/src/components/PasswordStrengthIndicator/PasswordStrengthIndicator.stories.tsx +++ b/packages/product-components/src/components/PasswordStrengthIndicator/PasswordStrengthIndicator.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { PasswordStrengthIndicatorProps, PasswordStrengthIndicator as PasswordStrengthIndicatorComponent, diff --git a/packages/product-components/src/components/PasswordStrengthIndicator/PasswordStrengthIndicator.tsx b/packages/product-components/src/components/PasswordStrengthIndicator/PasswordStrengthIndicator.tsx index b9ce15f084e..97c06047cca 100644 --- a/packages/product-components/src/components/PasswordStrengthIndicator/PasswordStrengthIndicator.tsx +++ b/packages/product-components/src/components/PasswordStrengthIndicator/PasswordStrengthIndicator.tsx @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react'; -import styled from 'styled-components'; +import styled from 'styled-components'; import type { ZXCVBNScore } from 'zxcvbn'; interface WrapperProps { diff --git a/packages/product-components/src/components/RotateDeviceImage/RotateDeviceImage.stories.tsx b/packages/product-components/src/components/RotateDeviceImage/RotateDeviceImage.stories.tsx index 6103f698957..797c7d210ec 100644 --- a/packages/product-components/src/components/RotateDeviceImage/RotateDeviceImage.stories.tsx +++ b/packages/product-components/src/components/RotateDeviceImage/RotateDeviceImage.stories.tsx @@ -1,9 +1,11 @@ import { Meta, StoryObj } from '@storybook/react'; + +import { DeviceModelInternal } from '@trezor/connect'; + import { RotateDeviceImage as RotateDeviceImageComponent, RotateDeviceImageProps, } from './RotateDeviceImage'; -import { DeviceModelInternal } from '@trezor/connect'; const meta: Meta = { title: 'RotateDeviceImage', diff --git a/packages/product-components/src/components/RotateDeviceImage/RotateDeviceImage.tsx b/packages/product-components/src/components/RotateDeviceImage/RotateDeviceImage.tsx index 3340ca80c65..7c6407a3dc0 100644 --- a/packages/product-components/src/components/RotateDeviceImage/RotateDeviceImage.tsx +++ b/packages/product-components/src/components/RotateDeviceImage/RotateDeviceImage.tsx @@ -1,7 +1,9 @@ import React from 'react'; + +import styled from 'styled-components'; + import { DeviceAnimation, Image } from '@trezor/components'; import { DeviceModelInternal } from '@trezor/connect'; -import styled from 'styled-components'; export type RotateDeviceImageProps = { deviceModel?: DeviceModelInternal; diff --git a/packages/product-components/src/components/SelectAssetModal/AssetItem.tsx b/packages/product-components/src/components/SelectAssetModal/AssetItem.tsx index f0e060b91ef..a547042bf9e 100644 --- a/packages/product-components/src/components/SelectAssetModal/AssetItem.tsx +++ b/packages/product-components/src/components/SelectAssetModal/AssetItem.tsx @@ -1,6 +1,7 @@ +import styled, { useTheme } from 'styled-components'; + import { spacings, spacingsPx } from '@trezor/theme'; import { Badge, Column, Icon, Row, Text } from '@trezor/components'; -import styled, { useTheme } from 'styled-components'; const ClickableContainer = styled.div` cursor: pointer; diff --git a/packages/product-components/src/components/SelectAssetModal/AssetItemNotFound.tsx b/packages/product-components/src/components/SelectAssetModal/AssetItemNotFound.tsx index dd49d68e646..dc74a0bbc0a 100644 --- a/packages/product-components/src/components/SelectAssetModal/AssetItemNotFound.tsx +++ b/packages/product-components/src/components/SelectAssetModal/AssetItemNotFound.tsx @@ -1,8 +1,11 @@ -import { Column, Paragraph, Text } from '@trezor/components'; import { FormattedMessage } from 'react-intl'; -import { SelectAssetNetworkProps, SelectAssetSearchCategoryType } from './SelectAssetModal'; + +import { Column, Paragraph, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { SelectAssetNetworkProps, SelectAssetSearchCategoryType } from './SelectAssetModal'; + + interface AssetItemNotFoundProps { searchCategory: SelectAssetSearchCategoryType; networkCategories: SelectAssetNetworkProps[]; diff --git a/packages/product-components/src/components/SelectAssetModal/CheckableTag.tsx b/packages/product-components/src/components/SelectAssetModal/CheckableTag.tsx index 60d836cba8b..2ad8fc28648 100644 --- a/packages/product-components/src/components/SelectAssetModal/CheckableTag.tsx +++ b/packages/product-components/src/components/SelectAssetModal/CheckableTag.tsx @@ -1,3 +1,5 @@ +import styled, { DefaultTheme } from 'styled-components'; + import { UIVariant } from '@trezor/components/src/config/types'; import { borders, @@ -7,7 +9,6 @@ import { spacingsPx, typography, } from '@trezor/theme'; -import styled, { DefaultTheme } from 'styled-components'; export const tagVariants = ['primary', 'tertiary'] as const; export type TagVariant = Extract; diff --git a/packages/product-components/src/components/SelectAssetModal/NetworkTabs.tsx b/packages/product-components/src/components/SelectAssetModal/NetworkTabs.tsx index 9792e71f9c3..ddfe9308405 100644 --- a/packages/product-components/src/components/SelectAssetModal/NetworkTabs.tsx +++ b/packages/product-components/src/components/SelectAssetModal/NetworkTabs.tsx @@ -1,8 +1,11 @@ +import { FormattedMessage } from 'react-intl'; + +import styled from 'styled-components'; + import { AssetLogo, Row, Tooltip, useElevation } from '@trezor/components'; import { Elevation, mapElevationToBorder, spacings, spacingsPx } from '@trezor/theme'; + import { SelectAssetNetworkProps, SelectAssetSearchCategoryType } from './SelectAssetModal'; -import styled from 'styled-components'; -import { FormattedMessage } from 'react-intl'; import { CheckableTag } from './CheckableTag'; interface NetworkTabsWrapperProps { diff --git a/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.stories.tsx b/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.stories.tsx index 6a74a3394bf..8047029142d 100644 --- a/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.stories.tsx +++ b/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.stories.tsx @@ -1,9 +1,12 @@ +import { IntlProvider } from 'react-intl'; + import { Meta, StoryObj } from '@storybook/react'; -import { SelectAssetModal as SelectAssetModalComponent, SelectAssetModalProps } from '../../index'; import { ThemeProvider } from 'styled-components'; -import { intermediaryTheme, NewModal } from '@trezor/components'; import { action } from '@storybook/addon-actions'; -import { IntlProvider } from 'react-intl'; + +import { intermediaryTheme, NewModal } from '@trezor/components'; + +import { SelectAssetModal as SelectAssetModalComponent, SelectAssetModalProps } from '../../index'; import { selectAssetModalOptions, selectAssetModalNetworks } from './mockData'; const meta: Meta = { diff --git a/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.tsx b/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.tsx index f47e9a3acdc..d169d6b5b0d 100644 --- a/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.tsx +++ b/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.tsx @@ -1,4 +1,6 @@ import { useMemo, useState } from 'react'; +import { useIntl } from 'react-intl'; + import { AssetLogo, Column, @@ -9,11 +11,12 @@ import { VirtualizedList, } from '@trezor/components'; import { mapElevationToBackgroundToken, spacings } from '@trezor/theme'; +import { getNetworkByCoingeckoId, Network } from '@suite-common/wallet-config'; + import { AssetItem } from './AssetItem'; import { NetworkTabs } from './NetworkTabs'; -import { useIntl } from 'react-intl'; import { AssetItemNotFound } from './AssetItemNotFound'; -import { getNetworkByCoingeckoId, Network } from '@suite-common/wallet-config'; + export interface SelectAssetOptionCurrencyProps { type: 'currency'; diff --git a/packages/product-components/src/components/TokenIconSet/TokenIconSet.stories.tsx b/packages/product-components/src/components/TokenIconSet/TokenIconSet.stories.tsx index 0b8705b9356..9593ac33187 100644 --- a/packages/product-components/src/components/TokenIconSet/TokenIconSet.stories.tsx +++ b/packages/product-components/src/components/TokenIconSet/TokenIconSet.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { TokenIconSet as TokenIconSetComponent, TokenIconSetProps } from './TokenIconSet'; const getToken = (contract: string, symbol: string, decimals: number) => ({ diff --git a/packages/product-components/src/components/TokenIconSet/TokenIconSet.tsx b/packages/product-components/src/components/TokenIconSet/TokenIconSet.tsx index 29157d8d551..4a23a768c6f 100644 --- a/packages/product-components/src/components/TokenIconSet/TokenIconSet.tsx +++ b/packages/product-components/src/components/TokenIconSet/TokenIconSet.tsx @@ -1,9 +1,9 @@ +import styled, { css } from 'styled-components'; + import { AssetLogo, useElevation } from '@trezor/components'; import { getCoingeckoId, NetworkSymbol } from '@suite-common/wallet-config'; import { TokenInfo } from '@trezor/connect'; import { getContractAddressForNetwork } from '@suite-common/wallet-utils'; - -import styled, { css } from 'styled-components'; import { borders, Elevation, mapElevationToBackground, mapElevationToBorder } from '@trezor/theme'; export type TokenIconSetProps = { diff --git a/packages/product-components/src/components/TrezorLogo/TrezorLogo.stories.tsx b/packages/product-components/src/components/TrezorLogo/TrezorLogo.stories.tsx index 35990acb837..88e043b585b 100644 --- a/packages/product-components/src/components/TrezorLogo/TrezorLogo.stories.tsx +++ b/packages/product-components/src/components/TrezorLogo/TrezorLogo.stories.tsx @@ -1,4 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; + import { TrezorLogoProps, TrezorLogo as TrezorLogoComponent } from './TrezorLogo'; const meta: Meta = { diff --git a/packages/product-components/src/components/TrezorLogo/TrezorLogo.tsx b/packages/product-components/src/components/TrezorLogo/TrezorLogo.tsx index 5d94bf063eb..056cb3429a3 100644 --- a/packages/product-components/src/components/TrezorLogo/TrezorLogo.tsx +++ b/packages/product-components/src/components/TrezorLogo/TrezorLogo.tsx @@ -1,5 +1,7 @@ import { ReactSVG } from 'react-svg'; + import styled, { useTheme } from 'styled-components'; + import { LOGOS } from './trezorLogos'; export type TrezorLogoType = diff --git a/packages/product-components/src/components/TrezorLogo/trezorLogos.stories.tsx b/packages/product-components/src/components/TrezorLogo/trezorLogos.stories.tsx index 53415f80ee5..494737ab363 100644 --- a/packages/product-components/src/components/TrezorLogo/trezorLogos.stories.tsx +++ b/packages/product-components/src/components/TrezorLogo/trezorLogos.stories.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; import { Meta, StoryObj } from '@storybook/react'; -import { TrezorLogo } from './TrezorLogo'; + import { StoryColumn } from '@trezor/components'; +import { TrezorLogo } from './TrezorLogo'; + interface WrapperProps { isDark?: boolean; } diff --git a/packages/product-components/styled.d.ts b/packages/product-components/styled.d.ts index ff56311cfb2..83b3a85013a 100644 --- a/packages/product-components/styled.d.ts +++ b/packages/product-components/styled.d.ts @@ -1,6 +1,7 @@ // import original module declarations import 'styled-components'; import { BoxShadows, Colors } from '@trezor/theme'; + import { SuiteThemeColors } from './src/config/colors'; declare module 'styled-components' { diff --git a/packages/request-manager/e2e/identities-stress.ts b/packages/request-manager/e2e/identities-stress.ts index e8d2bc647e5..7d32df87dca 100644 --- a/packages/request-manager/e2e/identities-stress.ts +++ b/packages/request-manager/e2e/identities-stress.ts @@ -1,4 +1,5 @@ import path from 'path'; + import { createInterceptor, TorController } from '../src'; import { torRunner } from './torRunner'; diff --git a/packages/request-manager/src/httpPool.ts b/packages/request-manager/src/httpPool.ts index 7bf2450b825..fd678cc7756 100644 --- a/packages/request-manager/src/httpPool.ts +++ b/packages/request-manager/src/httpPool.ts @@ -1,4 +1,5 @@ import http from 'http'; + import { InterceptorOptions } from './types'; export const createRequestPool = (interceptorOptions: InterceptorOptions) => { diff --git a/packages/request-manager/src/interceptor.ts b/packages/request-manager/src/interceptor.ts index 00af5aef024..63afdabd7d5 100644 --- a/packages/request-manager/src/interceptor.ts +++ b/packages/request-manager/src/interceptor.ts @@ -2,7 +2,9 @@ import net from 'net'; import http from 'http'; import https from 'https'; import tls from 'tls'; + import { getWeakRandomId } from '@trezor/utils'; + import { TorIdentities } from './torIdentities'; import { InterceptorOptions } from './types'; import { createRequestPool } from './httpPool'; diff --git a/packages/request-manager/src/torControlPort.ts b/packages/request-manager/src/torControlPort.ts index 0803129aedb..c4462819add 100644 --- a/packages/request-manager/src/torControlPort.ts +++ b/packages/request-manager/src/torControlPort.ts @@ -3,7 +3,9 @@ import fs from 'fs'; import crypto from 'crypto'; import util from 'util'; import path from 'path'; + import { promiseAllSequence } from '@trezor/utils'; + import { TorConnectionOptions, TorCommandResponse } from './types'; const readFile = util.promisify(fs.readFile); diff --git a/packages/request-manager/src/torIdentities.ts b/packages/request-manager/src/torIdentities.ts index fd593ef17f0..0039c36d4a2 100644 --- a/packages/request-manager/src/torIdentities.ts +++ b/packages/request-manager/src/torIdentities.ts @@ -1,4 +1,5 @@ import { SocksProxyAgent } from 'socks-proxy-agent'; + import type { TorSettings } from './types'; export class TorIdentities { diff --git a/packages/suite-data/src/guide/parser.ts b/packages/suite-data/src/guide/parser.ts index 3762ce66821..6e2b25ea4a7 100644 --- a/packages/suite-data/src/guide/parser.ts +++ b/packages/suite-data/src/guide/parser.ts @@ -1,9 +1,10 @@ import { join } from 'path'; import * as fs from 'fs-extra'; +import type { GuideNode, GuideCategory } from '@suite-common/suite-types'; + import { GITBOOK_ASSETS_DIR_PREFIX } from './constants'; import { transformImagesMarkdown } from './transformer'; -import type { GuideNode, GuideCategory } from '@suite-common/suite-types'; /** @returns true if given path is a directory. */ const isDirectory = (path: string): boolean => fs.lstatSync(path).isDirectory(); diff --git a/packages/suite-desktop-api/src/__tests__/ipcRenderer.ts b/packages/suite-desktop-api/src/__tests__/ipcRenderer.ts index 4e7378355ca..16e27430450 100644 --- a/packages/suite-desktop-api/src/__tests__/ipcRenderer.ts +++ b/packages/suite-desktop-api/src/__tests__/ipcRenderer.ts @@ -1,7 +1,8 @@ import { EventEmitter } from 'events'; -import { StrictIpcRenderer } from '../ipc'; import type { IpcRendererEvent } from 'electron'; +import { StrictIpcRenderer } from '../ipc'; + class IpcRendererMock extends EventEmitter implements StrictIpcRenderer { send(..._args: any[]) {} invoke(...args: any[]) { diff --git a/packages/suite-desktop-api/src/factory.ts b/packages/suite-desktop-api/src/factory.ts index d4bbf4c07e4..4c04d51e30f 100644 --- a/packages/suite-desktop-api/src/factory.ts +++ b/packages/suite-desktop-api/src/factory.ts @@ -1,4 +1,5 @@ import type { IpcRendererEvent } from 'electron'; + import { DesktopApi, RendererChannels } from './api'; import { StrictIpcRenderer } from './ipc'; import * as validation from './validation'; diff --git a/packages/suite-storage/src/native/index.ts b/packages/suite-storage/src/native/index.ts index 6cf170be1c8..99f803780ff 100644 --- a/packages/suite-storage/src/native/index.ts +++ b/packages/suite-storage/src/native/index.ts @@ -7,6 +7,7 @@ import { IDBPDatabase, IDBPTransaction, } from 'idb'; + import { StorageMessageEvent } from './types'; export type OnUpgradeFunc = ( diff --git a/packages/suite-storage/src/web/index.ts b/packages/suite-storage/src/web/index.ts index 7fb56c31f6c..59dce9af61e 100644 --- a/packages/suite-storage/src/web/index.ts +++ b/packages/suite-storage/src/web/index.ts @@ -11,6 +11,7 @@ import { deleteDB, } from 'idb'; import { BroadcastChannel } from 'broadcast-channel'; + import { isFirefox } from '@trezor/env-utils'; import { createLazy } from '@trezor/utils'; diff --git a/packages/suite-web/e2e/cypress.config.ts b/packages/suite-web/e2e/cypress.config.ts index 38fd9d6da4a..7e992ade4b4 100644 --- a/packages/suite-web/e2e/cypress.config.ts +++ b/packages/suite-web/e2e/cypress.config.ts @@ -1,14 +1,12 @@ import { defineConfig } from 'cypress'; - import fs from 'fs'; import path from 'path'; import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin'; + import { BridgeTransport } from '@trezor/transport'; import * as messages from '@trezor/protobuf/src/messages'; - import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; import * as metadataUtils from '@trezor/suite/src/utils/suite/metadata'; - import { TrezorBridgeMock, DropboxMock, diff --git a/packages/suite-web/e2e/run_tests.ts b/packages/suite-web/e2e/run_tests.ts index 05a22837623..199f38f503e 100644 --- a/packages/suite-web/e2e/run_tests.ts +++ b/packages/suite-web/e2e/run_tests.ts @@ -7,6 +7,7 @@ import child_process from 'child_process'; import yargs from 'yargs/yargs'; import path from 'path'; import fs from 'fs'; + import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; import cypressConfig from './cypress.config'; diff --git a/packages/suite-web/e2e/support/commands.ts b/packages/suite-web/e2e/support/commands.ts index db31c32eadb..6df886c3848 100644 --- a/packages/suite-web/e2e/support/commands.ts +++ b/packages/suite-web/e2e/support/commands.ts @@ -1,6 +1,8 @@ /* eslint-disable @typescript-eslint/no-namespace */ /* eslint-disable @typescript-eslint/no-var-requires */ +import { SuiteAnalyticsEvent } from '@trezor/suite-analytics'; + import { onboardingShouldLoad, dashboardShouldLoad, @@ -30,7 +32,6 @@ import { clearInput, } from './utils/shortcuts'; import { interceptInvityApi } from './utils/intercept-invity-api'; -import { SuiteAnalyticsEvent } from '@trezor/suite-analytics'; import { EventPayload, Requests } from './types'; const command = require('cypress-image-snapshot/command'); diff --git a/packages/suite-web/e2e/support/utils/shortcuts.ts b/packages/suite-web/e2e/support/utils/shortcuts.ts index eaa5023ad20..cf8f47200a1 100644 --- a/packages/suite-web/e2e/support/utils/shortcuts.ts +++ b/packages/suite-web/e2e/support/utils/shortcuts.ts @@ -1,6 +1,7 @@ import { SuiteAnalyticsEvent } from '@trezor/suite-analytics'; import { urlSearchParams } from '@trezor/suite/src/utils/suite/metadata'; import { SUITE as SuiteActions } from '@trezor/suite/src/actions/suite/constants'; + import { EventPayload, Requests } from '../types'; import { onNavBar } from '../pageObjects/topBarObject'; diff --git a/packages/suite-web/e2e/tests/analytics/events.test.ts b/packages/suite-web/e2e/tests/analytics/events.test.ts index ec87ce0d797..e7d55f7c943 100644 --- a/packages/suite-web/e2e/tests/analytics/events.test.ts +++ b/packages/suite-web/e2e/tests/analytics/events.test.ts @@ -3,6 +3,7 @@ // @retry=2 import { EventType } from '@trezor/suite-analytics'; + import { ExtractByEventType, Requests } from '../../support/types'; import { onNavBar } from '../../support/pageObjects/topBarObject'; import { forceLightMode } from '../../support/utils/shortcuts'; diff --git a/packages/suite-web/e2e/tests/analytics/toggle.test.ts b/packages/suite-web/e2e/tests/analytics/toggle.test.ts index 97762f77f14..12ffc12e00f 100644 --- a/packages/suite-web/e2e/tests/analytics/toggle.test.ts +++ b/packages/suite-web/e2e/tests/analytics/toggle.test.ts @@ -3,6 +3,7 @@ import { EventType } from '@trezor/suite-analytics'; import { urlSearchParams } from '@trezor/suite/src/utils/suite/metadata'; + import { onNavBar } from '../../support/pageObjects/topBarObject'; type Requests = ReturnType[]; diff --git a/packages/suite-web/e2e/tests/backup/t2t1-fail.test.ts b/packages/suite-web/e2e/tests/backup/t2t1-fail.test.ts index 019ea0a1379..636ca378a06 100644 --- a/packages/suite-web/e2e/tests/backup/t2t1-fail.test.ts +++ b/packages/suite-web/e2e/tests/backup/t2t1-fail.test.ts @@ -1,4 +1,5 @@ import { EventType } from '@trezor/suite-analytics'; + import { ExtractByEventType, Requests } from '../../support/types'; // @group_device-management diff --git a/packages/suite-web/e2e/tests/backup/t2t1-success.test.ts b/packages/suite-web/e2e/tests/backup/t2t1-success.test.ts index d969fa7bccd..df63e5243e0 100644 --- a/packages/suite-web/e2e/tests/backup/t2t1-success.test.ts +++ b/packages/suite-web/e2e/tests/backup/t2t1-success.test.ts @@ -1,4 +1,5 @@ import { EventType } from '@trezor/suite-analytics'; + import { ExtractByEventType, Requests } from '../../support/types'; // @group_device-management diff --git a/packages/suite-web/e2e/tests/dashboard/assets.test.ts b/packages/suite-web/e2e/tests/dashboard/assets.test.ts index ba070871341..d3760702813 100644 --- a/packages/suite-web/e2e/tests/dashboard/assets.test.ts +++ b/packages/suite-web/e2e/tests/dashboard/assets.test.ts @@ -2,6 +2,7 @@ // @retry=2 import { EventType } from '@trezor/suite-analytics'; + import { ExtractByEventType, Requests } from '../../support/types'; import { onNavBar } from '../../support/pageObjects/topBarObject'; diff --git a/packages/suite-web/e2e/tests/dashboard/discreet-mode.test.ts b/packages/suite-web/e2e/tests/dashboard/discreet-mode.test.ts index a872815465d..7f88d021a3b 100644 --- a/packages/suite-web/e2e/tests/dashboard/discreet-mode.test.ts +++ b/packages/suite-web/e2e/tests/dashboard/discreet-mode.test.ts @@ -2,6 +2,7 @@ // @retry=2 import { EventType } from '@trezor/suite-analytics'; + import { ExtractByEventType, Requests } from '../../support/types'; let requests: Requests; diff --git a/packages/suite-web/e2e/tests/settings/coins.test.ts b/packages/suite-web/e2e/tests/settings/coins.test.ts index 061aff3b6e2..84827cc992a 100644 --- a/packages/suite-web/e2e/tests/settings/coins.test.ts +++ b/packages/suite-web/e2e/tests/settings/coins.test.ts @@ -2,6 +2,7 @@ // @retry=2 import { EventType } from '@trezor/suite-analytics'; + import { ExtractByEventType, Requests } from '../../support/types'; import { onNavBar } from '../../support/pageObjects/topBarObject'; diff --git a/packages/suite-web/e2e/tests/settings/general.test.ts b/packages/suite-web/e2e/tests/settings/general.test.ts index bebcc949876..644cc5ef681 100644 --- a/packages/suite-web/e2e/tests/settings/general.test.ts +++ b/packages/suite-web/e2e/tests/settings/general.test.ts @@ -3,6 +3,7 @@ // @retry=2 import { EventType } from '@trezor/suite-analytics'; + import { ExtractByEventType, Requests } from '../../support/types'; import { onNavBar } from '../../support/pageObjects/topBarObject'; import { onSettingGeneralPage } from '../../support/pageObjects/settings/settingsGeneralObject'; diff --git a/packages/suite-web/e2e/tests/suite/passphrase.test.ts b/packages/suite-web/e2e/tests/suite/passphrase.test.ts index 6c7bb33332f..68d127f90e6 100644 --- a/packages/suite-web/e2e/tests/suite/passphrase.test.ts +++ b/packages/suite-web/e2e/tests/suite/passphrase.test.ts @@ -1,6 +1,7 @@ // @group_passphrase // @retry=2 import { EventType } from '@trezor/suite-analytics'; + import { ExtractByEventType, Requests } from '../../support/types'; let requests: Requests; diff --git a/packages/suite-web/e2e/tests/wallet/add-account-types.test.ts b/packages/suite-web/e2e/tests/wallet/add-account-types.test.ts index f1780b29533..628e529743f 100644 --- a/packages/suite-web/e2e/tests/wallet/add-account-types.test.ts +++ b/packages/suite-web/e2e/tests/wallet/add-account-types.test.ts @@ -1,11 +1,12 @@ // @group_wallet // @retry=2 +import { NetworkSymbol } from '@suite-common/wallet-config'; +import { EventType } from '@trezor/suite-analytics'; + import { onAccountsPage } from '../../support/pageObjects/accountsObject'; import { onSettingsCryptoPage } from '../../support/pageObjects/settings/settingsCryptoObject'; import { onNavBar } from '../../support/pageObjects/topBarObject'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import { EventType } from '@trezor/suite-analytics'; import { ExtractByEventType, Requests } from '../../support/types'; let requests: Requests; diff --git a/packages/suite-web/e2e/tests/wallet/check-coins-xpub.test.ts b/packages/suite-web/e2e/tests/wallet/check-coins-xpub.test.ts index f2410270e93..def19b1f335 100644 --- a/packages/suite-web/e2e/tests/wallet/check-coins-xpub.test.ts +++ b/packages/suite-web/e2e/tests/wallet/check-coins-xpub.test.ts @@ -2,6 +2,7 @@ // @retry=2 import { NetworkSymbol } from '@suite-common/wallet-config'; + import { onAccountsPage } from '../../support/pageObjects/accountsObject'; describe('Check coins XPUB', () => { diff --git a/packages/suite-web/e2e/tests/wallet/export-transactions.test.ts b/packages/suite-web/e2e/tests/wallet/export-transactions.test.ts index a6f103b2723..5159a39681c 100644 --- a/packages/suite-web/e2e/tests/wallet/export-transactions.test.ts +++ b/packages/suite-web/e2e/tests/wallet/export-transactions.test.ts @@ -2,6 +2,7 @@ // @retry=2 import { NetworkSymbol } from '@suite-common/wallet-config'; + import { onAccountsPage } from '../../support/pageObjects/accountsObject'; import { onSettingsCryptoPage } from '../../support/pageObjects/settings/settingsCryptoObject'; diff --git a/packages/suite-web/src/Main.tsx b/packages/suite-web/src/Main.tsx index 3edcda628c4..9b13e15d91e 100644 --- a/packages/suite-web/src/Main.tsx +++ b/packages/suite-web/src/Main.tsx @@ -1,12 +1,15 @@ -import { createRoot } from 'react-dom/client'; import { Provider as ReduxProvider } from 'react-redux'; import { Router as RouterProvider } from 'react-router-dom'; +import { HelmetProvider } from 'react-helmet-async'; + +import { createRoot } from 'react-dom/client'; import { init as initSentry } from '@sentry/browser'; -import { initStore } from 'src/reducers/store'; -import { preloadStore } from 'src/support/suite/preloadStore'; import { SENTRY_CONFIG } from '@suite-common/sentry'; +import { FormatterProvider } from '@suite-common/formatters'; +import { initStore } from 'src/reducers/store'; +import { preloadStore } from 'src/support/suite/preloadStore'; import { Metadata, Preloader, ToastContainer } from 'src/components/suite'; import { ConnectedIntlProvider } from 'src/support/suite/ConnectedIntlProvider'; import Resize from 'src/support/suite/Resize'; @@ -24,8 +27,8 @@ import { ModalContextProvider } from 'src/support/suite/ModalContext'; import AppRouter from './support/Router'; import { useCypress } from './support/useCypress'; -import { FormatterProvider } from '@suite-common/formatters'; -import { HelmetProvider } from 'react-helmet-async'; + + const Main = () => { useCypress(); diff --git a/packages/suite-web/src/support/Router.tsx b/packages/suite-web/src/support/Router.tsx index 2a4a8054c1c..5e09600f4b3 100644 --- a/packages/suite-web/src/support/Router.tsx +++ b/packages/suite-web/src/support/Router.tsx @@ -1,9 +1,10 @@ import { lazy, memo, Suspense, LazyExoticComponent, ComponentType } from 'react'; import { Switch, Route } from 'react-router-dom'; +import { PageName } from '@suite-common/suite-types'; + import routes from 'src/constants/suite/routes'; import { BundleLoader } from 'src/components/suite'; -import { PageName } from '@suite-common/suite-types'; const components: Record>> = { 'suite-index': lazy(() => diff --git a/packages/suite-web/src/support/useCypress.ts b/packages/suite-web/src/support/useCypress.ts index 504deccd289..f350a472f15 100644 --- a/packages/suite-web/src/support/useCypress.ts +++ b/packages/suite-web/src/support/useCypress.ts @@ -1,7 +1,8 @@ import { useEffect } from 'react'; -import TrezorConnect from '@trezor/connect'; import { useStore } from 'react-redux'; +import TrezorConnect from '@trezor/connect'; + /** * Utility for running tests in Cypress. * Used to augment window object with redux store and TrezorConnect instance to make it accessible in tests diff --git a/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts b/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts index d1155e68cd8..900caae8c0b 100644 --- a/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts +++ b/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts @@ -1,11 +1,11 @@ import { configureStore } from 'src/support/tests/configureStore'; - import onboardingReducer from 'src/reducers/onboarding/onboardingReducer'; import suiteReducer from 'src/reducers/suite/suiteReducer'; import recoveryReducer from 'src/reducers/recovery/recoveryReducer'; +import { Action } from 'src/types/suite'; + import fixtures from '../__fixtures__/onboardingActions'; -import { Action } from 'src/types/suite'; // todo fighting with typescript here. How to keep string literal being exported from fixtures and not converted // to string? if exported as const, it makes all properties readonly and thus not assignable to reducer which diff --git a/packages/suite/src/actions/recovery/recoveryActions.ts b/packages/suite/src/actions/recovery/recoveryActions.ts index 991ae26435d..512f52e43b1 100644 --- a/packages/suite/src/actions/recovery/recoveryActions.ts +++ b/packages/suite/src/actions/recovery/recoveryActions.ts @@ -8,6 +8,7 @@ import * as routerActions from 'src/actions/suite/routerActions'; import { Dispatch, GetState } from 'src/types/suite'; import { WordCount } from 'src/types/recovery'; import { DEFAULT_PASSPHRASE_PROTECTION } from 'src/constants/suite/device'; + import { isRecoveryInProgress } from '../../utils/device/isRecoveryInProgress'; export type SeedInputStatus = diff --git a/packages/suite/src/actions/settings/__fixtures__/deviceSettings.ts b/packages/suite/src/actions/settings/__fixtures__/deviceSettings.ts index 2b0acce7d4a..159b6ce2095 100644 --- a/packages/suite/src/actions/settings/__fixtures__/deviceSettings.ts +++ b/packages/suite/src/actions/settings/__fixtures__/deviceSettings.ts @@ -1,3 +1,5 @@ +import assert from 'assert'; + import { testMocks } from '@suite-common/test-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; import { @@ -5,14 +7,13 @@ import { deviceActions, prepareDeviceReducer, } from '@suite-common/wallet-core'; -import suiteReducer from 'src/reducers/suite/suiteReducer'; +import { TrezorDevice } from '@suite-common/suite-types'; +import { Response } from '@trezor/connect'; +import suiteReducer from 'src/reducers/suite/suiteReducer'; import { extraDependencies } from 'src/support/extraDependencies'; import * as deviceSettingsActions from '../deviceSettingsActions'; -import { TrezorDevice } from '@suite-common/suite-types'; -import { Response } from '@trezor/connect'; -import assert from 'assert'; const { getSuiteDevice } = testMocks; diff --git a/packages/suite/src/actions/settings/__tests__/walletSettingsActions.test.ts b/packages/suite/src/actions/settings/__tests__/walletSettingsActions.test.ts index 0c163392e49..54c672f6644 100644 --- a/packages/suite/src/actions/settings/__tests__/walletSettingsActions.test.ts +++ b/packages/suite/src/actions/settings/__tests__/walletSettingsActions.test.ts @@ -3,6 +3,7 @@ import { testMocks } from '@suite-common/test-utils'; import { configureStore } from 'src/support/tests/configureStore'; import settingsReducer from 'src/reducers/wallet/settingsReducer'; import suiteReducer from 'src/reducers/suite/suiteReducer'; + import fixtures from '../__fixtures__/walletSettings'; const getInitialState = (settings?: any) => ({ diff --git a/packages/suite/src/actions/settings/deviceSettingsActions.ts b/packages/suite/src/actions/settings/deviceSettingsActions.ts index 38abe426527..fd9e7a22fc9 100644 --- a/packages/suite/src/actions/settings/deviceSettingsActions.ts +++ b/packages/suite/src/actions/settings/deviceSettingsActions.ts @@ -8,12 +8,13 @@ import * as deviceUtils from '@suite-common/suite-utils'; import TrezorConnect, { ERRORS } from '@trezor/connect'; import { analytics, EventType } from '@trezor/suite-analytics'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { createThunk } from '@suite-common/redux-utils'; import * as modalActions from 'src/actions/suite/modalActions'; import * as routerActions from 'src/actions/suite/routerActions'; import { Dispatch, GetState } from 'src/types/suite'; import * as DEVICE from 'src/constants/suite/device'; -import { createThunk } from '@suite-common/redux-utils'; + import { selectSuiteSettings } from '../../reducers/suite/suiteReducer'; export const applySettings = diff --git a/packages/suite/src/actions/settings/walletSettingsActions.ts b/packages/suite/src/actions/settings/walletSettingsActions.ts index 7629af34b78..f3000ecedac 100644 --- a/packages/suite/src/actions/settings/walletSettingsActions.ts +++ b/packages/suite/src/actions/settings/walletSettingsActions.ts @@ -1,13 +1,14 @@ -import * as suiteActions from 'src/actions/suite/suiteActions'; -import { Dispatch, GetState } from 'src/types/suite'; -import { NetworkSymbol } from '@suite-common/wallet-config'; import { createAction } from '@reduxjs/toolkit'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { UNIT_ABBREVIATIONS } from '@suite-common/suite-constants'; import { FeeLevel, PROTO } from '@trezor/connect'; import { analytics, EventType } from '@trezor/suite-analytics'; import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { Dispatch, GetState } from 'src/types/suite'; +import * as suiteActions from 'src/actions/suite/suiteActions'; + import { WALLET_SETTINGS } from './constants'; export const setLocalCurrency = createAction( diff --git a/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts b/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts index f24104682e7..6b61098f2f9 100644 --- a/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts @@ -1,8 +1,9 @@ +import { prepareAnalyticsReducer, analyticsActions } from '@suite-common/analytics'; + import { extraDependencies } from 'src/support/extraDependencies'; import { configureStore } from 'src/support/tests/configureStore'; import { init } from 'src/actions/suite/analyticsActions'; -import { prepareAnalyticsReducer, analyticsActions } from '@suite-common/analytics'; const analyticsReducer = prepareAnalyticsReducer(extraDependencies); diff --git a/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts b/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts index f56ab070b5c..ff920c45a52 100644 --- a/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts @@ -1,9 +1,9 @@ import { testMocks } from '@suite-common/test-utils'; +import { NETWORK_TO_PROTOCOLS } from '@suite-common/suite-constants'; import { configureStore } from 'src/support/tests/configureStore'; import protocolReducer, { State as ProtocolState } from 'src/reducers/suite/protocolReducer'; -import { NETWORK_TO_PROTOCOLS } from '@suite-common/suite-constants'; import * as protocolActions from '../protocolActions'; import * as protocolConstants from '../constants/protocolConstants'; diff --git a/packages/suite/src/actions/suite/__tests__/resizeActions.test.ts b/packages/suite/src/actions/suite/__tests__/resizeActions.test.ts index a0e82955f65..31a7ab79640 100644 --- a/packages/suite/src/actions/suite/__tests__/resizeActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/resizeActions.test.ts @@ -1,5 +1,4 @@ import { configureStore } from 'src/support/tests/configureStore'; - import resizeReducer, { State as ResizeState } from 'src/reducers/suite/resizeReducer'; import * as resizeActions from 'src/actions/suite/resizeActions'; diff --git a/packages/suite/src/actions/suite/__tests__/routerActions.test.ts b/packages/suite/src/actions/suite/__tests__/routerActions.test.ts index 46d65e32ae5..d3764856667 100644 --- a/packages/suite/src/actions/suite/__tests__/routerActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/routerActions.test.ts @@ -1,12 +1,12 @@ /* eslint-disable @typescript-eslint/no-var-requires */ import { configureStore } from 'src/support/tests/configureStore'; - import suiteReducer from 'src/reducers/suite/suiteReducer'; import routerReducer from 'src/reducers/suite/routerReducer'; import modalReducer from 'src/reducers/suite/modalReducer'; +import { AppState } from 'src/reducers/store'; + import * as fixtures from '../__fixtures__/routerActions'; import * as routerActions from '../routerActions'; -import { AppState } from 'src/reducers/store'; type SuiteState = ReturnType; type RouterState = ReturnType; diff --git a/packages/suite/src/actions/suite/analyticsActions.ts b/packages/suite/src/actions/suite/analyticsActions.ts index 222a4423b6a..066fd4ad3b7 100644 --- a/packages/suite/src/actions/suite/analyticsActions.ts +++ b/packages/suite/src/actions/suite/analyticsActions.ts @@ -3,10 +3,7 @@ * @docs docs/misc/analytics.md */ -import { allowSentryReport, setSentryUser } from 'src/utils/suite/sentry'; import { getEnvironment, getCommitHash, isCodesignBuild } from '@trezor/env-utils'; -import type { Dispatch, GetState } from 'src/types/suite'; - import { analyticsActions, selectHasUserAllowedTracking, @@ -17,6 +14,9 @@ import { import { getTrackingRandomId } from '@trezor/analytics'; import { analytics, EventType } from '@trezor/suite-analytics'; +import type { Dispatch, GetState } from 'src/types/suite'; +import { allowSentryReport, setSentryUser } from 'src/utils/suite/sentry'; + export const enableAnalyticsThunk = () => (dispatch: Dispatch) => { analytics.report({ type: EventType.SettingsAnalytics, payload: { value: true } }); allowSentryReport(true); diff --git a/packages/suite/src/actions/suite/desktopUpdateActions.ts b/packages/suite/src/actions/suite/desktopUpdateActions.ts index 5a3c3c046ba..a57299f39ad 100644 --- a/packages/suite/src/actions/suite/desktopUpdateActions.ts +++ b/packages/suite/src/actions/suite/desktopUpdateActions.ts @@ -1,12 +1,12 @@ import { analytics, AppUpdateEventStatus, EventType } from '@trezor/suite-analytics'; +import { desktopApi, UpdateInfo, UpdateProgress } from '@trezor/suite-desktop-api'; +import { notificationsActions } from '@suite-common/toast-notifications'; import { DESKTOP_UPDATE } from 'src/actions/suite/constants'; import { Dispatch, GetState } from 'src/types/suite'; import { UpdateState, UpdateModalVisibility } from 'src/reducers/suite/desktopUpdateReducer'; import { getAppUpdatePayload } from 'src/utils/suite/analytics'; -import { desktopApi, UpdateInfo, UpdateProgress } from '@trezor/suite-desktop-api'; -import { notificationsActions } from '@suite-common/toast-notifications'; export type DesktopUpdateAction = | { type: typeof DESKTOP_UPDATE.CHECKING } diff --git a/packages/suite/src/actions/suite/guideActions.ts b/packages/suite/src/actions/suite/guideActions.ts index 7f714683ec3..86730ea9534 100644 --- a/packages/suite/src/actions/suite/guideActions.ts +++ b/packages/suite/src/actions/suite/guideActions.ts @@ -1,5 +1,4 @@ import { analytics, EventType } from '@trezor/suite-analytics'; - import type { ActiveView, Feedback, @@ -11,6 +10,7 @@ import { notificationsActions } from '@suite-common/toast-notifications'; import { isCodesignBuild } from '@trezor/env-utils'; import { Dispatch } from 'src/types/suite'; + import { GUIDE } from './constants'; export type GuideAction = diff --git a/packages/suite/src/actions/suite/initAction.ts b/packages/suite/src/actions/suite/initAction.ts index 79ae4741804..4afb3b83757 100644 --- a/packages/suite/src/actions/suite/initAction.ts +++ b/packages/suite/src/actions/suite/initAction.ts @@ -8,6 +8,8 @@ import { updateMissingTxFiatRatesThunk, } from '@suite-common/wallet-core'; import { periodicCheckTokenDefinitionsThunk } from '@suite-common/token-definitions'; +import { desktopApi } from '@trezor/suite-desktop-api'; +import { isDesktop } from '@trezor/env-utils'; import * as routerActions from 'src/actions/suite/routerActions'; import * as analyticsActions from 'src/actions/suite/analyticsActions'; @@ -17,8 +19,6 @@ import type { Dispatch, GetState } from 'src/types/suite'; import { SUITE } from './constants'; import { onSuiteReady, setFlag } from './suiteActions'; -import { desktopApi } from '@trezor/suite-desktop-api'; -import { isDesktop } from '@trezor/env-utils'; export const init = () => async (dispatch: Dispatch, getState: GetState) => { const { diff --git a/packages/suite/src/actions/suite/metadataActions.ts b/packages/suite/src/actions/suite/metadataActions.ts index 2cb84a30e0f..d38735df649 100644 --- a/packages/suite/src/actions/suite/metadataActions.ts +++ b/packages/suite/src/actions/suite/metadataActions.ts @@ -1,6 +1,8 @@ import { createAction } from '@reduxjs/toolkit'; import { selectDevices } from '@suite-common/wallet-core'; +import { Account } from '@suite-common/wallet-types'; +import { StaticSessionId } from '@trezor/connect'; import { METADATA, METADATA_LABELING } from 'src/actions/suite/constants'; import { Dispatch, GetState } from 'src/types/suite'; @@ -14,9 +16,8 @@ import { } from 'src/types/suite/metadata'; import * as metadataUtils from 'src/utils/suite/metadata'; import { selectSelectedProviderForLabels } from 'src/reducers/suite/metadataReducer'; -import { Account } from '@suite-common/wallet-types'; import type { AbstractMetadataProvider, PasswordManagerState } from 'src/types/suite/metadata'; -import { StaticSessionId } from '@trezor/connect'; + export type MetadataAction = | { type: typeof METADATA.ENABLE } diff --git a/packages/suite/src/actions/suite/metadataLabelingActions.ts b/packages/suite/src/actions/suite/metadataLabelingActions.ts index 2f0c1f8c1b7..a46740a0607 100644 --- a/packages/suite/src/actions/suite/metadataLabelingActions.ts +++ b/packages/suite/src/actions/suite/metadataLabelingActions.ts @@ -1,6 +1,5 @@ import TrezorConnect, { StaticSessionId } from '@trezor/connect'; import { cloneObject } from '@trezor/utils'; - import { selectDevices, selectDevice, diff --git a/packages/suite/src/actions/suite/metadataPasswordsActions.ts b/packages/suite/src/actions/suite/metadataPasswordsActions.ts index dc801caa908..d025e3b6126 100644 --- a/packages/suite/src/actions/suite/metadataPasswordsActions.ts +++ b/packages/suite/src/actions/suite/metadataPasswordsActions.ts @@ -12,7 +12,6 @@ import { selectSelectedProviderForPasswords } from 'src/reducers/suite/metadataR import * as metadataActions from './metadataActions'; import * as metadataProviderActions from './metadataProviderActions'; - import type { FetchIntervalTrackingId } from './metadataProviderActions'; export const fetchPasswords = diff --git a/packages/suite/src/actions/suite/metadataProviderActions.ts b/packages/suite/src/actions/suite/metadataProviderActions.ts index e6f7bf0ead0..1dac615e0d2 100644 --- a/packages/suite/src/actions/suite/metadataProviderActions.ts +++ b/packages/suite/src/actions/suite/metadataProviderActions.ts @@ -1,6 +1,7 @@ import { analytics, EventType } from '@trezor/suite-analytics'; import { createDeferred } from '@trezor/utils'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { Device } from '@trezor/connect'; import { METADATA, METADATA_PROVIDER } from 'src/actions/suite/constants'; import { Dispatch, GetState } from 'src/types/suite'; @@ -17,10 +18,9 @@ import * as modalActions from 'src/actions/suite/modalActions'; import DropboxProvider from 'src/services/suite/metadata/DropboxProvider'; import GoogleProvider from 'src/services/suite/metadata/GoogleProvider'; import FileSystemProvider from 'src/services/suite/metadata/FileSystemProvider'; -import { InMemoryTestProvider } from '../../services/suite/metadata/InMemoryTestProvider'; +import { InMemoryTestProvider } from '../../services/suite/metadata/InMemoryTestProvider'; import * as metadataActions from './metadataActions'; -import { Device } from '@trezor/connect'; export type MetadataAction = { type: typeof METADATA.SET_SELECTED_PROVIDER; diff --git a/packages/suite/src/actions/suite/protocolActions.ts b/packages/suite/src/actions/suite/protocolActions.ts index 9d5b6fa994f..66104dda02d 100644 --- a/packages/suite/src/actions/suite/protocolActions.ts +++ b/packages/suite/src/actions/suite/protocolActions.ts @@ -1,13 +1,15 @@ -import { PROTOCOL } from './constants'; -import { CoinProtocolInfo, getProtocolInfo } from 'src/utils/suite/protocol'; -import type { Dispatch } from 'src/types/suite'; import { Protocol } from '@suite-common/suite-constants'; import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import { SUITE_BRIDGE_DEEPLINK } from '@trezor/urls'; +import { CoinProtocolInfo, getProtocolInfo } from 'src/utils/suite/protocol'; +import type { Dispatch } from 'src/types/suite'; import type { SendFormState } from 'src/reducers/suite/protocolReducer'; -import { notificationsActions } from '@suite-common/toast-notifications'; import * as routerActions from 'src/actions/suite/routerActions'; -import { SUITE_BRIDGE_DEEPLINK } from '@trezor/urls'; + + +import { PROTOCOL } from './constants'; export type ProtocolAction = | { diff --git a/packages/suite/src/actions/suite/storageActions.ts b/packages/suite/src/actions/suite/storageActions.ts index 495494d4c44..04d67b5a7a6 100644 --- a/packages/suite/src/actions/suite/storageActions.ts +++ b/packages/suite/src/actions/suite/storageActions.ts @@ -1,13 +1,16 @@ import { FieldValues } from 'react-hook-form'; import { cloneObject } from '@trezor/utils'; - import { Discovery, FormDraftKeyPrefix } from '@suite-common/wallet-types'; import { notificationsActions } from '@suite-common/toast-notifications'; import { selectHistoricRatesByTransactions, getFormDraftKey } from '@suite-common/wallet-utils'; import { FormDraftPrefixKeyValues } from '@suite-common/wallet-constants'; import { isDeviceAcquired } from '@suite-common/suite-utils'; import { selectDevices, deviceActions } from '@suite-common/wallet-core'; +import { NetworkSymbol } from '@suite-common/wallet-config'; +import type { FormState, RatesByTimestamps } from '@suite-common/wallet-types'; +import { MetadataState } from '@suite-common/metadata-types'; +import { DefinitionType, TokenManagementAction } from '@suite-common/token-definitions'; import { db } from 'src/storage'; import { @@ -17,8 +20,6 @@ import { } from 'src/utils/suite/storage'; import type { AppState, Dispatch, GetState, TrezorDevice } from 'src/types/suite'; import type { Account } from 'src/types/wallet'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import type { FormState, RatesByTimestamps } from '@suite-common/wallet-types'; import type { Trade } from 'src/types/wallet/coinmarketCommonTypes'; import type { PreloadStoreAction } from 'src/support/suite/preloadStore'; import { GraphData } from 'src/types/wallet/graph'; @@ -26,8 +27,6 @@ import { deviceGraphDataFilterFn } from 'src/utils/wallet/graph'; import { selectCoinjoinAccountByKey } from 'src/reducers/wallet/coinjoinReducer'; import { STORAGE } from './constants'; -import { MetadataState } from '@suite-common/metadata-types'; -import { DefinitionType, TokenManagementAction } from '@suite-common/token-definitions'; import { selectSuiteSettings } from '../../reducers/suite/suiteReducer'; export type StorageAction = NonNullable; diff --git a/packages/suite/src/actions/wallet/__fixtures__/coinjoinAccountActions.ts b/packages/suite/src/actions/wallet/__fixtures__/coinjoinAccountActions.ts index e7bb0de6411..f47bb195269 100644 --- a/packages/suite/src/actions/wallet/__fixtures__/coinjoinAccountActions.ts +++ b/packages/suite/src/actions/wallet/__fixtures__/coinjoinAccountActions.ts @@ -1,5 +1,6 @@ import { notificationsActions } from '@suite-common/toast-notifications'; import { accountsActions } from '@suite-common/wallet-core'; + import { Account } from 'src/types/wallet'; import * as COINJOIN from 'src/actions/wallet/constants/coinjoinConstants'; diff --git a/packages/suite/src/actions/wallet/__fixtures__/mockCoinjoinService.ts b/packages/suite/src/actions/wallet/__fixtures__/mockCoinjoinService.ts index c0f2af5ea1a..85937678064 100644 --- a/packages/suite/src/actions/wallet/__fixtures__/mockCoinjoinService.ts +++ b/packages/suite/src/actions/wallet/__fixtures__/mockCoinjoinService.ts @@ -1,4 +1,5 @@ import { EventEmitter } from 'events'; + import { NetworkSymbol } from '@suite-common/wallet-config'; export const mockCoinjoinService = () => { diff --git a/packages/suite/src/actions/wallet/__fixtures__/moveLabelsForRbf/moveLabelsForRbfMetadataState.fixture.ts b/packages/suite/src/actions/wallet/__fixtures__/moveLabelsForRbf/moveLabelsForRbfMetadataState.fixture.ts index c1569557cdd..de9bead12bd 100644 --- a/packages/suite/src/actions/wallet/__fixtures__/moveLabelsForRbf/moveLabelsForRbfMetadataState.fixture.ts +++ b/packages/suite/src/actions/wallet/__fixtures__/moveLabelsForRbf/moveLabelsForRbfMetadataState.fixture.ts @@ -1,4 +1,5 @@ import { MetadataState } from '@suite-common/metadata-types'; + import { originalTransactionSpendAccount, chainSpendingReceivedCoins, diff --git a/packages/suite/src/actions/wallet/__fixtures__/moveLabelsForRbf/moveLabelsForRbfTransactions.fixture.ts b/packages/suite/src/actions/wallet/__fixtures__/moveLabelsForRbf/moveLabelsForRbfTransactions.fixture.ts index 90ef5cf22a8..6eeae1c9e02 100644 --- a/packages/suite/src/actions/wallet/__fixtures__/moveLabelsForRbf/moveLabelsForRbfTransactions.fixture.ts +++ b/packages/suite/src/actions/wallet/__fixtures__/moveLabelsForRbf/moveLabelsForRbfTransactions.fixture.ts @@ -1,5 +1,6 @@ import { TransactionsRootState } from '@suite-common/wallet-core'; import { WalletAccountTransaction } from '@suite-common/wallet-types'; + import { accountReceivingCoins, accountSpendingCoins } from './moveLabelsForRbfAccounts.fixture'; export const originalTransactionSpendAccount: WalletAccountTransaction = { diff --git a/packages/suite/src/actions/wallet/__fixtures__/receiveActions.ts b/packages/suite/src/actions/wallet/__fixtures__/receiveActions.ts index 7cb2e22b43e..66f74976dbb 100644 --- a/packages/suite/src/actions/wallet/__fixtures__/receiveActions.ts +++ b/packages/suite/src/actions/wallet/__fixtures__/receiveActions.ts @@ -1,12 +1,12 @@ import { connectInitThunk } from '@suite-common/connect-init'; import { testMocks } from '@suite-common/test-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { confirmAddressOnDeviceThunk } from '@suite-common/wallet-core'; import * as receiveActions from 'src/actions/wallet/receiveActions'; import { MODAL, SUITE } from 'src/actions/suite/constants'; import { RECEIVE } from '../constants'; -import { confirmAddressOnDeviceThunk } from '@suite-common/wallet-core'; const PATH = "m/49'/0'/0'/0/0"; const ADDRESS = 'AddRe5s'; diff --git a/packages/suite/src/actions/wallet/__tests__/cardanoStakingActions.test.ts b/packages/suite/src/actions/wallet/__tests__/cardanoStakingActions.test.ts index fc66de6269a..faea584433b 100644 --- a/packages/suite/src/actions/wallet/__tests__/cardanoStakingActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/cardanoStakingActions.test.ts @@ -1,13 +1,15 @@ +import { getUnixTime } from 'date-fns'; + import { testMocks } from '@suite-common/test-utils'; -import { configureStore } from 'src/support/tests/configureStore'; +import { BlockchainBlock } from '@trezor/connect'; +import { configureStore } from 'src/support/tests/configureStore'; import cardanoStakingReducer from 'src/reducers/wallet/cardanoStakingReducer'; import * as cardanoStakingActions from 'src/actions/wallet/cardanoStakingActions'; -import { CARDANO_STAKING } from '../constants'; import { WalletAccountTransaction } from 'src/types/wallet'; -import { BlockchainBlock } from '@trezor/connect'; import { transactionsReducer } from 'src/reducers/wallet'; -import { getUnixTime } from 'date-fns'; + +import { CARDANO_STAKING } from '../constants'; const { getSuiteDevice } = testMocks; const cardanoAccount = testMocks.getWalletAccount({ diff --git a/packages/suite/src/actions/wallet/__tests__/coinmarketBuyActions.test.ts b/packages/suite/src/actions/wallet/__tests__/coinmarketBuyActions.test.ts index 1a15faaedd5..ca4e4683d0f 100644 --- a/packages/suite/src/actions/wallet/__tests__/coinmarketBuyActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/coinmarketBuyActions.test.ts @@ -1,10 +1,10 @@ -import { configureStore } from 'src/support/tests/configureStore'; +import { BuyTrade, BuyTradeQuoteRequest, CryptoId } from 'invity-api'; +import { configureStore } from 'src/support/tests/configureStore'; import { coinmarketReducer } from 'src/reducers/wallet/coinmarketReducer'; +import invityAPI from 'src/services/suite/invityAPI'; import * as coinmarketBuyActions from '../coinmarketBuyActions'; -import invityAPI from 'src/services/suite/invityAPI'; -import { BuyTrade, BuyTradeQuoteRequest, CryptoId } from 'invity-api'; const getInitialState = () => ({ wallet: { diff --git a/packages/suite/src/actions/wallet/__tests__/coinmarketExchangeActions.test.ts b/packages/suite/src/actions/wallet/__tests__/coinmarketExchangeActions.test.ts index b07aa54a8fa..b8d466dc2f6 100644 --- a/packages/suite/src/actions/wallet/__tests__/coinmarketExchangeActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/coinmarketExchangeActions.test.ts @@ -1,10 +1,10 @@ -import { configureStore } from 'src/support/tests/configureStore'; +import { CryptoId, ExchangeTrade, ExchangeTradeQuoteRequest } from 'invity-api'; +import { configureStore } from 'src/support/tests/configureStore'; import { coinmarketReducer } from 'src/reducers/wallet/coinmarketReducer'; +import invityAPI from 'src/services/suite/invityAPI'; import * as coinmarketExchangeActions from '../coinmarketExchangeActions'; -import invityAPI from 'src/services/suite/invityAPI'; -import { CryptoId, ExchangeTrade, ExchangeTradeQuoteRequest } from 'invity-api'; const getInitialState = () => ({ wallet: { diff --git a/packages/suite/src/actions/wallet/__tests__/discoveryActions.test.ts b/packages/suite/src/actions/wallet/__tests__/discoveryActions.test.ts index 4be1c2bf1fd..4e6c3d03d9a 100644 --- a/packages/suite/src/actions/wallet/__tests__/discoveryActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/discoveryActions.test.ts @@ -18,13 +18,13 @@ import { notificationsActions } from '@suite-common/toast-notifications'; import { DiscoveryStatus } from '@suite-common/wallet-constants'; import * as discoveryActions from '@suite-common/wallet-core'; import TrezorConnect, { ERRORS } from '@trezor/connect'; +import { BITCOIN_ONLY_NETWORKS } from '@suite-common/suite-constants'; import { configureStore, filterThunkActionTypes } from 'src/support/tests/configureStore'; import walletSettingsReducer from 'src/reducers/wallet/settingsReducer'; import { accountsReducer } from 'src/reducers/wallet'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; import { extraDependencies } from 'src/support/extraDependencies'; -import { BITCOIN_ONLY_NETWORKS } from '@suite-common/suite-constants'; import { paramsError, diff --git a/packages/suite/src/actions/wallet/__tests__/formDraftActions.test.ts b/packages/suite/src/actions/wallet/__tests__/formDraftActions.test.ts index 36dfe93a915..501f20050eb 100644 --- a/packages/suite/src/actions/wallet/__tests__/formDraftActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/formDraftActions.test.ts @@ -1,6 +1,6 @@ import { configureStore } from 'src/support/tests/configureStore'; - import formDraftReducer, { FormDraftState } from 'src/reducers/wallet/formDraftReducer'; + import * as formDraftActions from '../formDraftActions'; const getInitialState = (state?: FormDraftState) => ({ diff --git a/packages/suite/src/actions/wallet/__tests__/moveLabelsForRbfActions.test.ts b/packages/suite/src/actions/wallet/__tests__/moveLabelsForRbfActions.test.ts index b7b4f0fcb7f..6ac89d536f4 100644 --- a/packages/suite/src/actions/wallet/__tests__/moveLabelsForRbfActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/moveLabelsForRbfActions.test.ts @@ -1,6 +1,8 @@ import { combineReducers } from '@reduxjs/toolkit'; -import { accountsReducer, transactionsReducer } from '../../../reducers/wallet'; + import { configureMockStore, initPreloadedState } from '@suite-common/test-utils'; + +import { accountsReducer, transactionsReducer } from '../../../reducers/wallet'; import { findLabelsToBeMovedOrDeleted, moveLabelsForRbfAction } from '../moveLabelsForRbfActions'; import { accountReceivingCoins, diff --git a/packages/suite/src/actions/wallet/__tests__/receiveActions.test.ts b/packages/suite/src/actions/wallet/__tests__/receiveActions.test.ts index d317edb0384..bb008ac20b1 100644 --- a/packages/suite/src/actions/wallet/__tests__/receiveActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/receiveActions.test.ts @@ -1,6 +1,8 @@ import { connectInitThunk } from '@suite-common/connect-init'; import { testMocks } from '@suite-common/test-utils'; import { prepareDeviceReducer } from '@suite-common/wallet-core'; +import { AccountKey } from '@suite-common/wallet-types'; +import { NetworkSymbol, NetworkType } from '@suite-common/wallet-config'; import { configureStore } from 'src/support/tests/configureStore'; import receiveReducer from 'src/reducers/wallet/receiveReducer'; @@ -10,8 +12,6 @@ import * as receiveActions from 'src/actions/wallet/receiveActions'; import { extraDependencies } from 'src/support/extraDependencies'; import fixtures from '../__fixtures__/receiveActions'; -import { AccountKey } from '@suite-common/wallet-types'; -import { NetworkSymbol, NetworkType } from '@suite-common/wallet-config'; const { getSuiteDevice } = testMocks; diff --git a/packages/suite/src/actions/wallet/__tests__/selectedAccountActions.test.ts b/packages/suite/src/actions/wallet/__tests__/selectedAccountActions.test.ts index 46629f7da2c..8d647a2a4ba 100644 --- a/packages/suite/src/actions/wallet/__tests__/selectedAccountActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/selectedAccountActions.test.ts @@ -1,5 +1,4 @@ import { configureStore } from 'src/support/tests/configureStore'; - import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; import { syncSelectedAccount } from '../selectedAccountActions'; diff --git a/packages/suite/src/actions/wallet/__tests__/signVerifyActions.test.ts b/packages/suite/src/actions/wallet/__tests__/signVerifyActions.test.ts index 15a3cdccf2c..6d353991fef 100644 --- a/packages/suite/src/actions/wallet/__tests__/signVerifyActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/signVerifyActions.test.ts @@ -1,6 +1,6 @@ import { testMocks } from '@suite-common/test-utils'; -import { showAddress, sign, verify } from 'src/actions/wallet/signVerifyActions'; +import { showAddress, sign, verify } from 'src/actions/wallet/signVerifyActions'; import { configureStore } from 'src/support/tests/configureStore'; const PATH = 'PATH'; diff --git a/packages/suite/src/actions/wallet/__tests__/transactionActions.test.ts b/packages/suite/src/actions/wallet/__tests__/transactionActions.test.ts index 5f84694b24e..df765092bbd 100644 --- a/packages/suite/src/actions/wallet/__tests__/transactionActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/transactionActions.test.ts @@ -1,14 +1,16 @@ -import { transactionsReducer } from 'src/reducers/wallet'; +import { configureStore } from '@reduxjs/toolkit'; + import { getAccountTransactions } from '@suite-common/wallet-utils'; import { transactionsActions, transactionsInitialState, TransactionsState, } from '@suite-common/wallet-core'; -import { configureStore } from '@reduxjs/toolkit'; import { getTxsPerPage } from '@suite-common/suite-utils'; import { testMocks } from '@suite-common/test-utils'; +import { transactionsReducer } from 'src/reducers/wallet'; + const { getWalletTransaction } = testMocks; const initStore = (transactionsState?: TransactionsState) => diff --git a/packages/suite/src/actions/wallet/addWalletThunk.ts b/packages/suite/src/actions/wallet/addWalletThunk.ts index 405973d6bd4..4a51f6039bc 100644 --- a/packages/suite/src/actions/wallet/addWalletThunk.ts +++ b/packages/suite/src/actions/wallet/addWalletThunk.ts @@ -9,9 +9,11 @@ import { selectDevices, } from '@suite-common/wallet-core'; import { WalletType } from '@suite-common/wallet-types'; -import { goto } from '../suite/routerActions'; + import { getBackgroundRoute } from 'src/utils/suite/router'; +import { goto } from '../suite/routerActions'; + export const redirectAfterWalletSelectedThunk = createThunk( `${DEVICE_MODULE_PREFIX}/redirectAfterWalletSelectedThunk`, async (_, { dispatch }) => { diff --git a/packages/suite/src/actions/wallet/cardanoStakingActions.ts b/packages/suite/src/actions/wallet/cardanoStakingActions.ts index 9bfc6a64dc7..21dbd812d01 100644 --- a/packages/suite/src/actions/wallet/cardanoStakingActions.ts +++ b/packages/suite/src/actions/wallet/cardanoStakingActions.ts @@ -1,15 +1,17 @@ +import { getUnixTime } from 'date-fns'; + import { BlockchainBlock } from '@trezor/connect'; import { CARDANO_STAKE_POOL_PREVIEW_URL, CARDANO_STAKE_POOL_MAINNET_URL } from '@trezor/urls'; -import { CARDANO_STAKING } from 'src/actions/wallet/constants'; -import { PendingStakeTx, PoolsResponse, CardanoNetwork } from 'src/types/wallet/cardanoStaking'; -import { Account, WalletAccountTransaction } from 'src/types/wallet'; -import { Dispatch, GetState } from 'src/types/suite'; -import { getUnixTime } from 'date-fns'; import { isPending, getAccountTransactions } from '@suite-common/wallet-utils'; import { CARDANO_DEFAULT_TTL_OFFSET } from '@suite-common/wallet-constants'; import { transactionsActions } from '@suite-common/wallet-core'; import { getNetworkOptional } from '@suite-common/wallet-config'; +import { CARDANO_STAKING } from 'src/actions/wallet/constants'; +import { PendingStakeTx, PoolsResponse, CardanoNetwork } from 'src/types/wallet/cardanoStaking'; +import { Account, WalletAccountTransaction } from 'src/types/wallet'; +import { Dispatch, GetState } from 'src/types/suite'; + export type CardanoStakingAction = | { type: typeof CARDANO_STAKING.ADD_PENDING_STAKE_TX; pendingStakeTx: PendingStakeTx } | { type: typeof CARDANO_STAKING.REMOVE_PENDING_STAKE_TX; accountKey: string } diff --git a/packages/suite/src/actions/wallet/coinjoinClientActions.ts b/packages/suite/src/actions/wallet/coinjoinClientActions.ts index bc3ee929688..003420d86f0 100644 --- a/packages/suite/src/actions/wallet/coinjoinClientActions.ts +++ b/packages/suite/src/actions/wallet/coinjoinClientActions.ts @@ -16,6 +16,7 @@ import { getUtxoOutpoint } from '@suite-common/wallet-utils'; import { Account, AddressDisplayOptions } from '@suite-common/wallet-types'; import { notificationsActions } from '@suite-common/toast-notifications'; import { getDeviceInstances } from '@suite-common/suite-utils'; +import { Feature, selectIsFeatureDisabled } from '@suite-common/message-system'; import { prepareCoinjoinTransaction, @@ -33,11 +34,10 @@ import { selectRoundsDurationInHours, selectCoinjoinAccounts, } from 'src/reducers/wallet/coinjoinReducer'; +import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; import * as COINJOIN from './constants/coinjoinConstants'; -import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; -import { Feature, selectIsFeatureDisabled } from '@suite-common/message-system'; const clientEnable = (symbol: Account['symbol']) => ({ diff --git a/packages/suite/src/actions/wallet/coinmarket/__fixtures__/coinmarketCommonActions/verifyAddress.ts b/packages/suite/src/actions/wallet/coinmarket/__fixtures__/coinmarketCommonActions/verifyAddress.ts index 78b202e285b..2c040bacafc 100644 --- a/packages/suite/src/actions/wallet/coinmarket/__fixtures__/coinmarketCommonActions/verifyAddress.ts +++ b/packages/suite/src/actions/wallet/coinmarket/__fixtures__/coinmarketCommonActions/verifyAddress.ts @@ -1,8 +1,8 @@ import { testMocks } from '@suite-common/test-utils'; +import { AddressDisplayOptions } from '@suite-common/wallet-types'; import { MODAL } from 'src/actions/suite/constants'; import { COINMARKET_BUY, COINMARKET_EXCHANGE } from 'src/actions/wallet/constants'; -import { AddressDisplayOptions } from '@suite-common/wallet-types'; import { BTC_ACCOUNT, ETH_ACCOUNT, diff --git a/packages/suite/src/actions/wallet/coinmarket/__tests__/coinmarketCommonActions.test.ts b/packages/suite/src/actions/wallet/coinmarket/__tests__/coinmarketCommonActions.test.ts index d4f36d79f03..9fa3912867d 100644 --- a/packages/suite/src/actions/wallet/coinmarket/__tests__/coinmarketCommonActions.test.ts +++ b/packages/suite/src/actions/wallet/coinmarket/__tests__/coinmarketCommonActions.test.ts @@ -1,11 +1,11 @@ -import { configureStore } from 'src/support/tests/configureStore'; +import { State as DeviceState } from '@suite-common/wallet-core'; +import type { DeepPartial } from '@trezor/type-utils'; +import { configureStore } from 'src/support/tests/configureStore'; import { coinmarketReducer, ComposedTransactionInfo } from 'src/reducers/wallet/coinmarketReducer'; import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; import { transactionsReducer, accountsReducer } from 'src/reducers/wallet'; -import { State as DeviceState } from '@suite-common/wallet-core'; import { SuiteState } from 'src/reducers/suite/suiteReducer'; -import type { DeepPartial } from '@trezor/type-utils'; import { DEFAULT_STORE } from 'src/actions/wallet/coinmarket/__fixtures__/coinmarketCommonActions/store'; import { VERIFY_BUY_ADDRESS_FIXTURES, diff --git a/packages/suite/src/actions/wallet/coinmarket/coinmarketCommonActions.ts b/packages/suite/src/actions/wallet/coinmarket/coinmarketCommonActions.ts index b50cfa972d1..384e97cc2ba 100644 --- a/packages/suite/src/actions/wallet/coinmarket/coinmarketCommonActions.ts +++ b/packages/suite/src/actions/wallet/coinmarket/coinmarketCommonActions.ts @@ -1,3 +1,5 @@ +import { CryptoId } from 'invity-api'; + import { isDesktop } from '@trezor/env-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; import { PROTO } from '@trezor/connect'; @@ -14,6 +16,7 @@ import { selectDevice, toggleRememberDevice, } from '@suite-common/wallet-core'; + import { GetState, Dispatch } from 'src/types/suite'; import * as modalActions from 'src/actions/suite/modalActions'; import { getUnusedAddressFromAccount } from 'src/utils/wallet/coinmarket/coinmarketUtils'; @@ -22,7 +25,6 @@ import { ComposedTransactionInfo } from 'src/reducers/wallet/coinmarketReducer'; import { submitRequestForm as envSubmitRequestForm } from 'src/utils/suite/env'; import * as formDraftActions from 'src/actions/wallet/formDraftActions'; import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; -import { CryptoId } from 'invity-api'; import { COINMARKET_BUY, COINMARKET_COMMON, diff --git a/packages/suite/src/actions/wallet/coinmarketBuyActions.ts b/packages/suite/src/actions/wallet/coinmarketBuyActions.ts index 74449e4ed76..3d5dedf304a 100644 --- a/packages/suite/src/actions/wallet/coinmarketBuyActions.ts +++ b/packages/suite/src/actions/wallet/coinmarketBuyActions.ts @@ -1,4 +1,3 @@ -import { Account } from 'src/types/wallet'; import { BuyListResponse, BuyProviderInfo, @@ -7,14 +6,17 @@ import { CryptoId, FiatCurrencyCode, } from 'invity-api'; + +import { Account } from 'src/types/wallet'; import invityAPI from 'src/services/suite/invityAPI'; -import { COINMARKET_BUY, COINMARKET_COMMON } from './constants'; import { Dispatch } from 'src/types/suite'; import regional from 'src/constants/wallet/coinmarket/regional'; import * as modalActions from 'src/actions/suite/modalActions'; import { verifyAddress as verifyBuyAddress } from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; import { CoinmarketFiatCurrenciesProps } from 'src/types/coinmarket/coinmarket'; +import { COINMARKET_BUY, COINMARKET_COMMON } from './constants'; + export interface BuyInfo { buyInfo: Omit & { defaultAmountsOfFiatCurrencies: CoinmarketFiatCurrenciesProps; diff --git a/packages/suite/src/actions/wallet/coinmarketExchangeActions.ts b/packages/suite/src/actions/wallet/coinmarketExchangeActions.ts index a1106021b0b..d6aa7c9122c 100644 --- a/packages/suite/src/actions/wallet/coinmarketExchangeActions.ts +++ b/packages/suite/src/actions/wallet/coinmarketExchangeActions.ts @@ -1,5 +1,3 @@ -import { Account } from 'src/types/wallet'; -import { Dispatch } from 'src/types/suite'; import { ExchangeListResponse, ExchangeProviderInfo, @@ -7,11 +5,15 @@ import { ExchangeTrade, CryptoId, } from 'invity-api'; + +import { Account } from 'src/types/wallet'; +import { Dispatch } from 'src/types/suite'; import invityAPI from 'src/services/suite/invityAPI'; -import { COINMARKET_EXCHANGE, COINMARKET_COMMON } from './constants'; import * as modalActions from 'src/actions/suite/modalActions'; import { verifyAddress as verifyExchangeAddress } from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; +import { COINMARKET_EXCHANGE, COINMARKET_COMMON } from './constants'; + export interface ExchangeInfo { exchangeList?: ExchangeListResponse; providerInfos: { [name: string]: ExchangeProviderInfo }; diff --git a/packages/suite/src/actions/wallet/coinmarketInfoActions.ts b/packages/suite/src/actions/wallet/coinmarketInfoActions.ts index 702052fa4e8..cd5da5d503c 100644 --- a/packages/suite/src/actions/wallet/coinmarketInfoActions.ts +++ b/packages/suite/src/actions/wallet/coinmarketInfoActions.ts @@ -1,4 +1,5 @@ import { InfoResponse } from 'invity-api'; + import { COINMARKET_INFO } from 'src/actions/wallet/constants'; import { CoinmarketPaymentMethodListProps } from 'src/types/coinmarket/coinmarket'; diff --git a/packages/suite/src/actions/wallet/coinmarketSellActions.ts b/packages/suite/src/actions/wallet/coinmarketSellActions.ts index 18d0d4924fb..ea62010e220 100644 --- a/packages/suite/src/actions/wallet/coinmarketSellActions.ts +++ b/packages/suite/src/actions/wallet/coinmarketSellActions.ts @@ -1,4 +1,3 @@ -import { Account } from 'src/types/wallet'; import { CryptoId, SellFiatTrade, @@ -6,9 +5,12 @@ import { SellListResponse, SellProviderInfo, } from 'invity-api'; + +import { Account } from 'src/types/wallet'; import { Dispatch } from 'src/types/suite'; import * as modalActions from 'src/actions/suite/modalActions'; import invityAPI from 'src/services/suite/invityAPI'; + import { COINMARKET_COMMON, COINMARKET_SELL } from './constants'; export interface SellInfo { diff --git a/packages/suite/src/actions/wallet/exportTransactionsActions.ts b/packages/suite/src/actions/wallet/exportTransactionsActions.ts index 5613adc20b0..4f686f30113 100644 --- a/packages/suite/src/actions/wallet/exportTransactionsActions.ts +++ b/packages/suite/src/actions/wallet/exportTransactionsActions.ts @@ -8,6 +8,7 @@ import { } from '@suite-common/wallet-core'; import { Account, ExportFileType } from '@suite-common/wallet-types'; import { advancedSearchTransactions, getAccountTransactions } from '@suite-common/wallet-utils'; + import { formatData, getExportedFileName } from 'src/utils/wallet/exportTransactionsUtils'; export const exportTransactionsThunk = createThunk( diff --git a/packages/suite/src/actions/wallet/formDraftActions.ts b/packages/suite/src/actions/wallet/formDraftActions.ts index c58cb085a44..9ade4f324ec 100644 --- a/packages/suite/src/actions/wallet/formDraftActions.ts +++ b/packages/suite/src/actions/wallet/formDraftActions.ts @@ -1,10 +1,13 @@ import { FieldValues } from 'react-hook-form'; -import { Dispatch, GetState } from 'src/types/suite'; import { getFormDraftKey } from '@suite-common/wallet-utils'; -import { FORM_DRAFT } from './constants'; import type { FormDraftKeyPrefix } from '@suite-common/wallet-types'; +import { Dispatch, GetState } from 'src/types/suite'; + +import { FORM_DRAFT } from './constants'; + + export type FormDraftAction = | { type: typeof FORM_DRAFT.STORE_DRAFT; diff --git a/packages/suite/src/actions/wallet/graphActions.ts b/packages/suite/src/actions/wallet/graphActions.ts index c41759871e8..2486b9d52cf 100644 --- a/packages/suite/src/actions/wallet/graphActions.ts +++ b/packages/suite/src/actions/wallet/graphActions.ts @@ -1,10 +1,19 @@ import { isWithinInterval, fromUnixTime } from 'date-fns'; -import { Dispatch, GetState } from 'src/types/suite'; -import { Account } from 'src/types/wallet'; import { tryGetAccountIdentity, isTrezorConnectBackendType } from '@suite-common/wallet-utils'; - import TrezorConnect, { StaticSessionId } from '@trezor/connect'; +import { selectIsElectrumBackendSelected } from '@suite-common/wallet-core'; + +import { Dispatch, GetState } from 'src/types/suite'; +import { Account } from 'src/types/wallet'; +import { GraphData, GraphRange, GraphScale } from 'src/types/wallet/graph'; +import { + ensureHistoryRates, + enhanceBlockchainAccountHistory, + accountGraphDataFilterFn, + deviceGraphDataFilterFn, +} from 'src/utils/wallet/graph'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { ACCOUNT_GRAPH_SUCCESS, @@ -15,15 +24,7 @@ import { SET_SELECTED_RANGE, SET_SELECTED_VIEW, } from './constants/graphConstants'; -import { GraphData, GraphRange, GraphScale } from 'src/types/wallet/graph'; -import { - ensureHistoryRates, - enhanceBlockchainAccountHistory, - accountGraphDataFilterFn, - deviceGraphDataFilterFn, -} from 'src/utils/wallet/graph'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { selectIsElectrumBackendSelected } from '@suite-common/wallet-core'; + export type GraphAction = | { diff --git a/packages/suite/src/actions/wallet/moveLabelsForRbfActions.ts b/packages/suite/src/actions/wallet/moveLabelsForRbfActions.ts index 17e5aba9fad..fd3c16db986 100644 --- a/packages/suite/src/actions/wallet/moveLabelsForRbfActions.ts +++ b/packages/suite/src/actions/wallet/moveLabelsForRbfActions.ts @@ -1,9 +1,10 @@ -import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; import { findChainedTransactions, findTransactions } from '@suite-common/wallet-utils'; -import { Dispatch, GetState } from 'src/types/suite'; -import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; import { AccountLabels, AccountOutputLabels } from '@suite-common/metadata-types'; import { AccountKey, WalletAccountTransaction } from '@suite-common/wallet-types'; + +import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; +import { Dispatch, GetState } from 'src/types/suite'; +import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; import { RbfLabelsToBeUpdated } from 'src/types/wallet/sendForm'; type DeleteAllOutputLabelsParams = { diff --git a/packages/suite/src/actions/wallet/receiveActions.ts b/packages/suite/src/actions/wallet/receiveActions.ts index 9f3f5d4f544..34e70d93995 100644 --- a/packages/suite/src/actions/wallet/receiveActions.ts +++ b/packages/suite/src/actions/wallet/receiveActions.ts @@ -1,12 +1,11 @@ import { notificationsActions } from '@suite-common/toast-notifications'; import { UserContextPayload } from '@suite-common/suite-types'; import { confirmAddressOnDeviceThunk, selectDevice } from '@suite-common/wallet-core'; +import { AddressDisplayOptions } from '@suite-common/wallet-types'; import { RECEIVE } from 'src/actions/wallet/constants'; import * as modalActions from 'src/actions/suite/modalActions'; import { GetState, Dispatch } from 'src/types/suite'; -import { AddressDisplayOptions } from '@suite-common/wallet-types'; - import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; export type ReceiveAction = diff --git a/packages/suite/src/actions/wallet/send/sendFormThunks.ts b/packages/suite/src/actions/wallet/send/sendFormThunks.ts index fcaffdb7259..f7d80adc09b 100644 --- a/packages/suite/src/actions/wallet/send/sendFormThunks.ts +++ b/packages/suite/src/actions/wallet/send/sendFormThunks.ts @@ -26,12 +26,13 @@ import { selectSelectedAccountKey, selectIsSelectedAccountLoaded, } from 'src/reducers/wallet/selectedAccountReducer'; -import { findLabelsToBeMovedOrDeleted, moveLabelsForRbfAction } from '../moveLabelsForRbfActions'; import { selectMetadata } from 'src/reducers/suite/metadataReducer'; import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; import * as modalActions from 'src/actions/suite/modalActions'; import { RbfLabelsToBeUpdated } from 'src/types/wallet/sendForm'; +import { findLabelsToBeMovedOrDeleted, moveLabelsForRbfAction } from '../moveLabelsForRbfActions'; + export const MODULE_PREFIX = '@send'; export const saveSendFormDraftThunk = createThunk( diff --git a/packages/suite/src/actions/wallet/signVerifyActions.ts b/packages/suite/src/actions/wallet/signVerifyActions.ts index a45a769c094..8e17b2937c3 100644 --- a/packages/suite/src/actions/wallet/signVerifyActions.ts +++ b/packages/suite/src/actions/wallet/signVerifyActions.ts @@ -1,14 +1,14 @@ import TrezorConnect, { Unsuccessful, Success } from '@trezor/connect'; import { notificationsActions } from '@suite-common/toast-notifications'; import { selectDevice } from '@suite-common/wallet-core'; +import { AddressDisplayOptions } from '@suite-common/wallet-types'; import type { Dispatch, GetState, TrezorDevice } from 'src/types/suite'; import type { Account } from 'src/types/wallet'; +import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; import { SIGN_VERIFY } from './constants'; -import { AddressDisplayOptions } from '@suite-common/wallet-types'; -import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; export type SignVerifyAction = | { type: typeof SIGN_VERIFY.SIGN_SUCCESS; signSignature: string } diff --git a/packages/suite/src/actions/wallet/stake/stakeFormEthereumActions.ts b/packages/suite/src/actions/wallet/stake/stakeFormEthereumActions.ts index d88001c459d..81842b4fc9c 100644 --- a/packages/suite/src/actions/wallet/stake/stakeFormEthereumActions.ts +++ b/packages/suite/src/actions/wallet/stake/stakeFormEthereumActions.ts @@ -1,6 +1,6 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; import { toWei } from 'web3-utils'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import TrezorConnect, { FeeLevel } from '@trezor/connect'; import { notificationsActions } from '@suite-common/toast-notifications'; import { @@ -26,17 +26,16 @@ import { MIN_ETH_FOR_WITHDRAWALS, } from '@suite-common/wallet-constants'; import { selectDevice, ComposeActionContext } from '@suite-common/wallet-core'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { Dispatch, GetState } from 'src/types/suite'; import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; - import { getStakeTxGasLimit, prepareClaimEthTx, prepareStakeEthTx, prepareUnstakeEthTx, } from 'src/utils/suite/stake'; -import { NetworkSymbol } from '@suite-common/wallet-config'; const calculate = ( availableBalance: string, diff --git a/packages/suite/src/actions/wallet/stakeActions.ts b/packages/suite/src/actions/wallet/stakeActions.ts index fff7a40d6be..af0a0640b14 100644 --- a/packages/suite/src/actions/wallet/stakeActions.ts +++ b/packages/suite/src/actions/wallet/stakeActions.ts @@ -1,5 +1,4 @@ import { BigNumber } from '@trezor/utils/src/bigNumber'; - import TrezorConnect from '@trezor/connect'; import { selectDevice, @@ -14,12 +13,11 @@ import { isRbfTransaction, tryGetAccountIdentity, } from '@suite-common/wallet-utils'; - import { StakeFormState, PrecomposedTransactionFinal, StakeType } from '@suite-common/wallet-types'; -import * as modalActions from '../suite/modalActions'; import { Dispatch, GetState } from 'src/types/suite'; +import * as modalActions from '../suite/modalActions'; import * as stakeFormEthereumActions from './stake/stakeFormEthereumActions'; import { openModal } from '../suite/modalActions'; diff --git a/packages/suite/src/actions/wallet/tokenActions.ts b/packages/suite/src/actions/wallet/tokenActions.ts index 18299fa783b..62879e3a62b 100644 --- a/packages/suite/src/actions/wallet/tokenActions.ts +++ b/packages/suite/src/actions/wallet/tokenActions.ts @@ -1,12 +1,13 @@ import { TokenInfo } from '@trezor/connect'; -import { Account } from 'src/types/wallet'; -import { Dispatch } from 'src/types/suite'; import * as accountUtils from '@suite-common/wallet-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; import { accountsActions, updateFiatRatesThunk } from '@suite-common/wallet-core'; import { Timestamp, TokenAddress } from '@suite-common/wallet-types'; import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { Dispatch } from 'src/types/suite'; +import { Account } from 'src/types/wallet'; + export const addToken = (account: Account, tokenInfo: TokenInfo[], localCurrency: FiatCurrencyCode) => (dispatch: Dispatch) => { diff --git a/packages/suite/src/components/backup/AfterBackupCheckboxes.tsx b/packages/suite/src/components/backup/AfterBackupCheckboxes.tsx index ca81527ff97..5f43007379f 100644 --- a/packages/suite/src/components/backup/AfterBackupCheckboxes.tsx +++ b/packages/suite/src/components/backup/AfterBackupCheckboxes.tsx @@ -1,8 +1,9 @@ +import { spacings } from '@trezor/theme'; +import { Card, Column } from '@trezor/components'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { CheckItem, Translation } from 'src/components/suite'; import { ConfirmKey, toggleCheckboxByKey } from 'src/actions/backup/backupActions'; -import { spacings } from '@trezor/theme'; -import { Card, Column } from '@trezor/components'; export const AfterBackupCheckboxes = () => { const backup = useSelector(state => state.backup); diff --git a/packages/suite/src/components/backup/BackupSeedCard.tsx b/packages/suite/src/components/backup/BackupSeedCard.tsx index 1d72c28d27f..84a505a4f34 100644 --- a/packages/suite/src/components/backup/BackupSeedCard.tsx +++ b/packages/suite/src/components/backup/BackupSeedCard.tsx @@ -1,5 +1,7 @@ import { ReactNode, SyntheticEvent } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { variables, Checkbox, Card, Icon, IconName } from '@trezor/components'; import { spacingsPx, typography } from '@trezor/theme'; diff --git a/packages/suite/src/components/backup/BackupSeedCards.tsx b/packages/suite/src/components/backup/BackupSeedCards.tsx index 1099a079594..5b8e7e05069 100644 --- a/packages/suite/src/components/backup/BackupSeedCards.tsx +++ b/packages/suite/src/components/backup/BackupSeedCards.tsx @@ -1,9 +1,11 @@ import styled from 'styled-components'; +import { variables } from '@trezor/components'; + import { ConfirmKey, toggleCheckboxByKey } from 'src/actions/backup/backupActions'; import { Translation } from 'src/components/suite/Translation'; -import { variables } from '@trezor/components'; import { useSelector, useDispatch } from 'src/hooks/suite'; + import { BackupSeedCard } from './BackupSeedCard'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/backup/PreBackupCheckboxes.tsx b/packages/suite/src/components/backup/PreBackupCheckboxes.tsx index 4b9e223805a..58859f487cf 100644 --- a/packages/suite/src/components/backup/PreBackupCheckboxes.tsx +++ b/packages/suite/src/components/backup/PreBackupCheckboxes.tsx @@ -1,8 +1,9 @@ +import { Card, Column } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { CheckItem, Translation } from 'src/components/suite'; import { ConfirmKey, toggleCheckboxByKey } from 'src/actions/backup/backupActions'; -import { Card, Column } from '@trezor/components'; -import { spacings } from '@trezor/theme'; export const PreBackupCheckboxes = () => { const backup = useSelector(state => state.backup); diff --git a/packages/suite/src/components/dashboard/DashboardSection.tsx b/packages/suite/src/components/dashboard/DashboardSection.tsx index b61741ae248..4057e9f589f 100644 --- a/packages/suite/src/components/dashboard/DashboardSection.tsx +++ b/packages/suite/src/components/dashboard/DashboardSection.tsx @@ -1,5 +1,7 @@ import { Ref, forwardRef, ReactElement, HTMLAttributes } from 'react'; + import styled from 'styled-components'; + import { H3 } from '@trezor/components'; const Wrapper = styled.section` diff --git a/packages/suite/src/components/firmware/Buttons/FirmwareButtonsRow.tsx b/packages/suite/src/components/firmware/Buttons/FirmwareButtonsRow.tsx index 76e5036e5d2..4ce97813349 100644 --- a/packages/suite/src/components/firmware/Buttons/FirmwareButtonsRow.tsx +++ b/packages/suite/src/components/firmware/Buttons/FirmwareButtonsRow.tsx @@ -1,9 +1,10 @@ import styled from 'styled-components'; -import { FirmwareCloseButton } from './FirmwareCloseButton'; import { spacingsPx } from '@trezor/theme'; import { breakpointMediaQueries } from '@trezor/styles'; +import { FirmwareCloseButton } from './FirmwareCloseButton'; + const Row = styled.div` display: flex; gap: ${spacingsPx.lg}; diff --git a/packages/suite/src/components/firmware/Buttons/FirmwareCloseButton.tsx b/packages/suite/src/components/firmware/Buttons/FirmwareCloseButton.tsx index 716d04b8c61..a13359bc188 100644 --- a/packages/suite/src/components/firmware/Buttons/FirmwareCloseButton.tsx +++ b/packages/suite/src/components/firmware/Buttons/FirmwareCloseButton.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Button, ButtonProps } from '@trezor/components'; + import { Translation } from 'src/components/suite'; export const FirmwareCloseButton = (props: Omit) => ( diff --git a/packages/suite/src/components/firmware/Buttons/FirmwareContinueButton.tsx b/packages/suite/src/components/firmware/Buttons/FirmwareContinueButton.tsx index 10c3df4998a..5096c722ca0 100644 --- a/packages/suite/src/components/firmware/Buttons/FirmwareContinueButton.tsx +++ b/packages/suite/src/components/firmware/Buttons/FirmwareContinueButton.tsx @@ -1,6 +1,9 @@ import React from 'react'; + import styled from 'styled-components'; + import { Button, ButtonProps } from '@trezor/components'; + import { Translation } from 'src/components/suite'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/components/firmware/Buttons/FirmwareInstallButton.tsx b/packages/suite/src/components/firmware/Buttons/FirmwareInstallButton.tsx index 15c67471a69..1bc17b4b813 100644 --- a/packages/suite/src/components/firmware/Buttons/FirmwareInstallButton.tsx +++ b/packages/suite/src/components/firmware/Buttons/FirmwareInstallButton.tsx @@ -1,4 +1,5 @@ import { Button, ButtonProps, Tooltip } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useTranslation } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/firmware/Buttons/FirmwareRetryButton.tsx b/packages/suite/src/components/firmware/Buttons/FirmwareRetryButton.tsx index 2262a180e8c..49c100ab877 100644 --- a/packages/suite/src/components/firmware/Buttons/FirmwareRetryButton.tsx +++ b/packages/suite/src/components/firmware/Buttons/FirmwareRetryButton.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Button, ButtonProps } from '@trezor/components'; + import { Translation } from 'src/components/suite'; export const FirmwareRetryButton = (props: Omit) => ( diff --git a/packages/suite/src/components/firmware/CheckSeedStep.tsx b/packages/suite/src/components/firmware/CheckSeedStep.tsx index 18981e8912d..494d29bf1f9 100644 --- a/packages/suite/src/components/firmware/CheckSeedStep.tsx +++ b/packages/suite/src/components/firmware/CheckSeedStep.tsx @@ -1,17 +1,20 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { Button, Checkbox, variables } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; import { selectDeviceLabelOrName } from '@suite-common/wallet-core'; + import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { OnboardingStepBox } from 'src/components/onboarding'; -import { FirmwareButtonsRow } from './Buttons/FirmwareButtonsRow'; -import { FirmwareSwitchWarning } from './FirmwareSwitchWarning'; import { goto } from 'src/actions/suite/routerActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { FirmwareButtonsRow } from './Buttons/FirmwareButtonsRow'; +import { FirmwareSwitchWarning } from './FirmwareSwitchWarning'; + // eslint-disable-next-line local-rules/no-override-ds-component const StyledCheckbox = styled(Checkbox)` margin: ${spacingsPx.md} 0; diff --git a/packages/suite/src/components/firmware/Fingerprint.tsx b/packages/suite/src/components/firmware/Fingerprint.tsx index f31c0731e80..6c95c65aab2 100644 --- a/packages/suite/src/components/firmware/Fingerprint.tsx +++ b/packages/suite/src/components/firmware/Fingerprint.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { TrezorDevice } from 'src/types/suite'; import { getFormattedFingerprint } from 'src/utils/firmware'; diff --git a/packages/suite/src/components/firmware/FirmwareInitial.tsx b/packages/suite/src/components/firmware/FirmwareInitial.tsx index c0239a19497..ffdeac9c2ba 100644 --- a/packages/suite/src/components/firmware/FirmwareInitial.tsx +++ b/packages/suite/src/components/firmware/FirmwareInitial.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { ExtendedMessageDescriptor } from '@suite-common/intl-types'; @@ -8,14 +9,15 @@ import { AcquiredDevice } from '@suite-common/suite-types'; import { getFirmwareVersion, isBitcoinOnlyDevice } from '@trezor/device-utils'; import { FirmwareType } from '@trezor/connect'; import { selectDevices } from '@suite-common/wallet-core'; +import { spacingsPx } from '@trezor/theme'; import { OnboardingStepBox, OnboardingButtonSkip } from 'src/components/onboarding'; -import { PrerequisitesGuide, Translation } from '../suite'; import { useDevice, useFirmware, useOnboarding, useSelector } from 'src/hooks/suite'; import { FirmwareInstallButton, FirmwareOffer } from 'src/components/firmware'; + +import { PrerequisitesGuide, Translation } from '../suite'; import { FirmwareButtonsRow } from './Buttons/FirmwareButtonsRow'; import { FirmwareSwitchWarning } from './FirmwareSwitchWarning'; -import { spacingsPx } from '@trezor/theme'; const Description = styled.div` align-items: center; diff --git a/packages/suite/src/components/firmware/FirmwareInstallation.tsx b/packages/suite/src/components/firmware/FirmwareInstallation.tsx index 30253aa0b0b..bb6232c3b38 100644 --- a/packages/suite/src/components/firmware/FirmwareInstallation.tsx +++ b/packages/suite/src/components/firmware/FirmwareInstallation.tsx @@ -1,5 +1,8 @@ +import styled from 'styled-components'; + import { Button } from '@trezor/components'; import { UI } from '@trezor/connect'; +import { spacingsPx } from '@trezor/theme'; import { Translation, WebUsbButton } from 'src/components/suite'; import { useFirmware } from 'src/hooks/suite'; @@ -8,8 +11,6 @@ import { OnboardingStepBox } from 'src/components/onboarding'; import { TrezorDevice } from 'src/types/suite'; import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; import { useSelector } from 'src/hooks/suite/useSelector'; -import styled from 'styled-components'; -import { spacingsPx } from '@trezor/theme'; const SelectDevice = styled.div` display: flex; diff --git a/packages/suite/src/components/firmware/FirmwareOffer.tsx b/packages/suite/src/components/firmware/FirmwareOffer.tsx index 074199e4f65..351c7c92bcc 100644 --- a/packages/suite/src/components/firmware/FirmwareOffer.tsx +++ b/packages/suite/src/components/firmware/FirmwareOffer.tsx @@ -8,11 +8,11 @@ import { import { Icon, Markdown, Tooltip, variables } from '@trezor/components'; import { getFirmwareVersion } from '@trezor/device-utils'; import { FirmwareType } from '@trezor/connect'; +import { spacingsPx } from '@trezor/theme'; import { Translation, TrezorLink } from 'src/components/suite'; import { useFirmware, useTranslation, useSelector } from 'src/hooks/suite'; import { getSuiteFirmwareTypeString } from 'src/utils/firmware'; -import { spacingsPx } from '@trezor/theme'; const FwVersionWrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/firmware/FirmwareProgressBar.tsx b/packages/suite/src/components/firmware/FirmwareProgressBar.tsx index c8319520b73..e27f541b66e 100644 --- a/packages/suite/src/components/firmware/FirmwareProgressBar.tsx +++ b/packages/suite/src/components/firmware/FirmwareProgressBar.tsx @@ -1,6 +1,8 @@ -import { Icon, ProgressBar, variables } from '@trezor/components'; import styled, { useTheme } from 'styled-components'; + +import { Icon, ProgressBar, variables } from '@trezor/components'; import { borders, spacingsPx } from '@trezor/theme'; + import { useFirmware } from 'src/hooks/suite'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/firmware/FirmwareUpdateHashCheckError.tsx b/packages/suite/src/components/firmware/FirmwareUpdateHashCheckError.tsx index 14541955d7b..14e2ebb6263 100644 --- a/packages/suite/src/components/firmware/FirmwareUpdateHashCheckError.tsx +++ b/packages/suite/src/components/firmware/FirmwareUpdateHashCheckError.tsx @@ -1,4 +1,5 @@ import { INVALID_HASH_ERROR } from '@suite-common/wallet-core'; + import { OnboardingStepBox } from '../onboarding'; import { Translation } from '../suite'; diff --git a/packages/suite/src/components/firmware/ReconnectDevicePrompt.tsx b/packages/suite/src/components/firmware/ReconnectDevicePrompt.tsx index 3756b4ada79..afbc8a49c81 100644 --- a/packages/suite/src/components/firmware/ReconnectDevicePrompt.tsx +++ b/packages/suite/src/components/firmware/ReconnectDevicePrompt.tsx @@ -1,15 +1,17 @@ import * as semver from 'semver'; + import { getFirmwareVersion } from '@trezor/device-utils'; import { H2, DeviceAnimation, NewModal, Paragraph, List, Column } from '@trezor/components'; import { DEVICE, Device, DeviceModelInternal, UI } from '@trezor/connect'; -import { Translation, WebUsbButton } from 'src/components/suite'; -import { DeviceConfirmImage } from 'src/components/suite/DeviceConfirmImage'; -import { useDevice, useFirmware, useSelector } from 'src/hooks/suite'; import { ConfirmOnDevice } from '@trezor/product-components'; import { TranslationKey } from '@suite-common/intl-types'; import { spacings } from '@trezor/theme'; import { selectDeviceLabelOrName } from '@suite-common/wallet-core'; +import { useDevice, useFirmware, useSelector } from 'src/hooks/suite'; +import { DeviceConfirmImage } from 'src/components/suite/DeviceConfirmImage'; +import { Translation, WebUsbButton } from 'src/components/suite'; + const RebootDeviceGraphics = ({ device, isManualRebootRequired, diff --git a/packages/suite/src/components/firmware/SelectCustomFirmware.tsx b/packages/suite/src/components/firmware/SelectCustomFirmware.tsx index 4cd4b9e15ed..38bc670263e 100644 --- a/packages/suite/src/components/firmware/SelectCustomFirmware.tsx +++ b/packages/suite/src/components/firmware/SelectCustomFirmware.tsx @@ -1,4 +1,5 @@ import { Dispatch, SetStateAction } from 'react'; + import styled from 'styled-components'; import { Button } from '@trezor/components'; diff --git a/packages/suite/src/components/guide/Feedback.tsx b/packages/suite/src/components/guide/Feedback.tsx index a0e3b8e59c9..e308e35fc03 100644 --- a/packages/suite/src/components/guide/Feedback.tsx +++ b/packages/suite/src/components/guide/Feedback.tsx @@ -1,13 +1,10 @@ import { useState, useCallback, ReactNode, ChangeEvent } from 'react'; + import styled, { css } from 'styled-components'; + import { analytics, EventType } from '@trezor/suite-analytics'; import { getFirmwareVersion } from '@trezor/device-utils'; - -import { Translation } from 'src/components/suite'; import { Textarea, Select, variables, Button, CollapsibleBox } from '@trezor/components'; -import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; -import { sendFeedback, setView } from 'src/actions/suite/guideActions'; -import { GuideViewWrapper, GuideHeader, GuideContent } from 'src/components/guide'; import { Rating, FeedbackCategory, FeedbackType, UserData } from '@suite-common/suite-types'; import { getEnvironment, @@ -20,6 +17,12 @@ import { } from '@trezor/env-utils'; import { spacingsPx } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; +import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; +import { sendFeedback, setView } from 'src/actions/suite/guideActions'; +import { GuideViewWrapper, GuideHeader, GuideContent } from 'src/components/guide'; + + const Headline = styled.div` font-size: ${variables.FONT_SIZE.TINY}; font-weight: ${variables.FONT_WEIGHT.DEMI_BOLD}; diff --git a/packages/suite/src/components/guide/Guide.tsx b/packages/suite/src/components/guide/Guide.tsx index 3f128b3fbc2..7636ec73778 100644 --- a/packages/suite/src/components/guide/Guide.tsx +++ b/packages/suite/src/components/guide/Guide.tsx @@ -1,7 +1,11 @@ import { useState } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { analytics, EventType } from '@trezor/suite-analytics'; import { spacingsPx, typography, zIndices } from '@trezor/theme'; +import { Column, Divider, Icon } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { setView } from 'src/actions/suite/guideActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; @@ -12,7 +16,6 @@ import { GuideCategories, GuideSearch, } from 'src/components/guide'; -import { Column, Divider, Icon } from '@trezor/components'; const FeedbackLinkWrapper = styled.div` padding: ${spacingsPx.md}; diff --git a/packages/suite/src/components/guide/GuideArticle.tsx b/packages/suite/src/components/guide/GuideArticle.tsx index 8b91eb2ba99..07d1e47f2fe 100644 --- a/packages/suite/src/components/guide/GuideArticle.tsx +++ b/packages/suite/src/components/guide/GuideArticle.tsx @@ -1,11 +1,12 @@ import styled from 'styled-components'; +import { spacingsPx } from '@trezor/theme'; + import { useSelector } from 'src/hooks/suite'; import { GuideHeader, GuideContent, GuideViewWrapper, GuideMarkdown } from 'src/components/guide'; import { Translation } from 'src/components/suite'; import { useGuideLoadArticle } from 'src/hooks/guide'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; -import { spacingsPx } from '@trezor/theme'; const ArticleWrapper = styled.div` padding-bottom: ${spacingsPx.xxl}; diff --git a/packages/suite/src/components/guide/GuideButton.tsx b/packages/suite/src/components/guide/GuideButton.tsx index f2fe52fc22e..c6c04abacff 100644 --- a/packages/suite/src/components/guide/GuideButton.tsx +++ b/packages/suite/src/components/guide/GuideButton.tsx @@ -1,9 +1,11 @@ +import { FreeFocusInside } from 'react-focus-lock'; + import styled from 'styled-components'; import { Icon, useElevation } from '@trezor/components'; import { Elevation, mapElevationToBackground, mapElevationToBorder, zIndices } from '@trezor/theme'; + import { useGuide } from 'src/hooks/guide'; -import { FreeFocusInside } from 'react-focus-lock'; const Wrapper = styled.button<{ $isGuideOpen: boolean; $elevation: Elevation }>` display: flex; diff --git a/packages/suite/src/components/guide/GuideCategories.tsx b/packages/suite/src/components/guide/GuideCategories.tsx index ee47cbca51f..cb1a1e2dcf0 100644 --- a/packages/suite/src/components/guide/GuideCategories.tsx +++ b/packages/suite/src/components/guide/GuideCategories.tsx @@ -1,8 +1,10 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; import { variables } from '@trezor/components'; import { GuideCategory } from '@suite-common/suite-types'; + import { GuideNode } from 'src/components/guide'; const Section = styled.section` diff --git a/packages/suite/src/components/guide/GuideCategory.tsx b/packages/suite/src/components/guide/GuideCategory.tsx index 1801db0543d..ed040e3c6ae 100644 --- a/packages/suite/src/components/guide/GuideCategory.tsx +++ b/packages/suite/src/components/guide/GuideCategory.tsx @@ -1,6 +1,7 @@ import styled from 'styled-components'; import { variables } from '@trezor/components'; + import { GuideHeader, GuideContent, diff --git a/packages/suite/src/components/guide/GuideContent.tsx b/packages/suite/src/components/guide/GuideContent.tsx index 70794a3c5a2..3392bd1fda2 100644 --- a/packages/suite/src/components/guide/GuideContent.tsx +++ b/packages/suite/src/components/guide/GuideContent.tsx @@ -1,5 +1,7 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { spacingsPx } from '@trezor/theme'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/guide/GuideHeader.tsx b/packages/suite/src/components/guide/GuideHeader.tsx index 12a40ab9d60..e42b70364b2 100644 --- a/packages/suite/src/components/guide/GuideHeader.tsx +++ b/packages/suite/src/components/guide/GuideHeader.tsx @@ -1,13 +1,16 @@ import { useContext } from 'react'; + import styled, { css } from 'styled-components'; import { transparentize } from 'polished'; + import { analytics, EventType } from '@trezor/suite-analytics'; +import { IconButton, variables } from '@trezor/components'; +import { typography, zIndices } from '@trezor/theme'; import { close } from 'src/actions/suite/guideActions'; import { useDispatch } from 'src/hooks/suite'; -import { IconButton, variables } from '@trezor/components'; import { HeaderBreadcrumb, ContentScrolledContext } from 'src/components/guide'; -import { typography, zIndices } from '@trezor/theme'; + const HeaderWrapper = styled.div<{ $noLabel?: boolean; $isScrolled: boolean }>` display: flex; diff --git a/packages/suite/src/components/guide/GuideHint.tsx b/packages/suite/src/components/guide/GuideHint.tsx index 718e300740f..2ac7e6472f5 100644 --- a/packages/suite/src/components/guide/GuideHint.tsx +++ b/packages/suite/src/components/guide/GuideHint.tsx @@ -1,4 +1,5 @@ import { Children, BlockquoteHTMLAttributes, cloneElement, isValidElement } from 'react'; + import styled from 'styled-components'; import { Banner } from '@trezor/components'; diff --git a/packages/suite/src/components/guide/GuideMarkdown.tsx b/packages/suite/src/components/guide/GuideMarkdown.tsx index b44a417ff13..333009a02ce 100644 --- a/packages/suite/src/components/guide/GuideMarkdown.tsx +++ b/packages/suite/src/components/guide/GuideMarkdown.tsx @@ -1,6 +1,9 @@ import { useEffect, useRef } from 'react'; + import { Markdown } from '@trezor/components'; + import { useGuideOpenNode } from 'src/hooks/guide'; + import { GuideHint } from './GuideHint'; import { TrezorLink } from '../suite'; diff --git a/packages/suite/src/components/guide/GuideNode.tsx b/packages/suite/src/components/guide/GuideNode.tsx index 5025b4fc82d..e8483c31c93 100644 --- a/packages/suite/src/components/guide/GuideNode.tsx +++ b/packages/suite/src/components/guide/GuideNode.tsx @@ -1,14 +1,16 @@ import { ReactNode } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { analytics, EventType } from '@trezor/suite-analytics'; import { resolveStaticPath } from '@suite-common/suite-utils'; - import { Icon, variables } from '@trezor/components'; +import { GuideNode as GuideNodeType } from '@suite-common/suite-types'; +import { borders, spacings } from '@trezor/theme'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { openNode } from 'src/actions/suite/guideActions'; -import { GuideNode as GuideNodeType } from '@suite-common/suite-types'; import { getNodeTitle } from 'src/utils/suite/guide'; -import { borders, spacings } from '@trezor/theme'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; const NodeButton = styled.button` diff --git a/packages/suite/src/components/guide/GuideRouter.tsx b/packages/suite/src/components/guide/GuideRouter.tsx index faccbed45f0..b748d7c0e70 100644 --- a/packages/suite/src/components/guide/GuideRouter.tsx +++ b/packages/suite/src/components/guide/GuideRouter.tsx @@ -1,9 +1,12 @@ +import { FreeFocusInside } from 'react-focus-lock'; + import styled, { css, keyframes } from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; -import { FreeFocusInside } from 'react-focus-lock'; import { variables, Backdrop } from '@trezor/components'; import { useOnce } from '@trezor/react-utils'; +import { zIndices } from '@trezor/theme'; + import { useSelector } from 'src/hooks/suite'; import { SupportFeedbackSelection, @@ -13,7 +16,6 @@ import { Feedback, } from 'src/components/guide'; import { useGuide, GUIDE_ANIMATION_DURATION_MS } from 'src/hooks/guide'; -import { zIndices } from '@trezor/theme'; const fullHeightStyle = css` position: absolute; diff --git a/packages/suite/src/components/guide/GuideSearch.tsx b/packages/suite/src/components/guide/GuideSearch.tsx index c7bea547f47..c8f3e22d535 100644 --- a/packages/suite/src/components/guide/GuideSearch.tsx +++ b/packages/suite/src/components/guide/GuideSearch.tsx @@ -1,13 +1,16 @@ import { useState, useEffect } from 'react'; + import styled from 'styled-components'; + import { Icon, Input, Spinner, variables } from '@trezor/components'; +import type { GuideCategory } from '@suite-common/suite-types'; +import { spacingsPx } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useTranslation } from 'src/hooks/suite'; import { GuideNode } from 'src/components/guide'; import { useGuideSearch } from 'src/hooks/guide'; -import type { GuideCategory } from '@suite-common/suite-types'; -import { spacingsPx } from '@trezor/theme'; const Wrapper = styled.div` margin-bottom: ${spacingsPx.xs}; diff --git a/packages/suite/src/components/guide/GuideViewWrapper.tsx b/packages/suite/src/components/guide/GuideViewWrapper.tsx index a73a099cbf9..dd3c2839f5d 100644 --- a/packages/suite/src/components/guide/GuideViewWrapper.tsx +++ b/packages/suite/src/components/guide/GuideViewWrapper.tsx @@ -1,5 +1,7 @@ import { createContext, useCallback, useState, ReactNode, UIEventHandler } from 'react'; + import styled from 'styled-components'; + import { variables } from '@trezor/components'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/guide/HeaderBreadcrumb.tsx b/packages/suite/src/components/guide/HeaderBreadcrumb.tsx index af68d428aa3..ade4f6acd67 100644 --- a/packages/suite/src/components/guide/HeaderBreadcrumb.tsx +++ b/packages/suite/src/components/guide/HeaderBreadcrumb.tsx @@ -1,16 +1,16 @@ import styled from 'styled-components'; import { darken } from 'polished'; + import { analytics, EventType } from '@trezor/suite-analytics'; +import { variables } from '@trezor/components'; +import type { GuideCategory } from '@suite-common/suite-types'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { openNode, setView } from 'src/actions/suite/guideActions'; -import { variables } from '@trezor/components'; import { Translation } from 'src/components/suite'; // importing directly, otherwise unit tests fail, seems to be a styled-components issue import { TrezorLink } from 'src/components/suite/TrezorLink'; import { findAncestorNodes, getNodeTitle } from 'src/utils/suite/guide'; - -import type { GuideCategory } from '@suite-common/suite-types'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; const BreadcrumbWrapper = styled.span` diff --git a/packages/suite/src/components/guide/OpenGuideFromTooltip.tsx b/packages/suite/src/components/guide/OpenGuideFromTooltip.tsx index 9c07ae849a1..03eebc2f149 100644 --- a/packages/suite/src/components/guide/OpenGuideFromTooltip.tsx +++ b/packages/suite/src/components/guide/OpenGuideFromTooltip.tsx @@ -1,11 +1,13 @@ import { MouseEvent } from 'react'; + import styled, { useTheme } from 'styled-components'; import { transparentize } from 'polished'; import { borders, spacingsPx, typography } from '@trezor/theme'; +import { Icon } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useGuideOpenNode } from 'src/hooks/guide'; -import { Icon } from '@trezor/components'; const OpenGuideLink = styled.span` display: flex; diff --git a/packages/suite/src/components/guide/SupportFeedbackSelection.tsx b/packages/suite/src/components/guide/SupportFeedbackSelection.tsx index 00e0ca87e45..4f3abe17aca 100644 --- a/packages/suite/src/components/guide/SupportFeedbackSelection.tsx +++ b/packages/suite/src/components/guide/SupportFeedbackSelection.tsx @@ -7,13 +7,13 @@ import { Icon, Link, variables } from '@trezor/components'; import { isDesktop } from '@trezor/env-utils'; import { getFirmwareVersion } from '@trezor/device-utils'; import { selectDevice } from '@suite-common/wallet-core'; +import { borders } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { setView } from 'src/actions/suite/guideActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { GuideViewWrapper, GuideHeader, GuideContent } from 'src/components/guide'; import { UpdateState } from 'src/reducers/suite/desktopUpdateReducer'; -import { borders } from '@trezor/theme'; const Section = styled.div` & + & { diff --git a/packages/suite/src/components/onboarding/Buttons/OnboardingButtonBack.tsx b/packages/suite/src/components/onboarding/Buttons/OnboardingButtonBack.tsx index d0cce6dc6ad..88e5ed3a1de 100644 --- a/packages/suite/src/components/onboarding/Buttons/OnboardingButtonBack.tsx +++ b/packages/suite/src/components/onboarding/Buttons/OnboardingButtonBack.tsx @@ -1,4 +1,5 @@ import { Button, ButtonProps } from '@trezor/components'; + import { Translation } from 'src/components/suite'; export const OnboardingButtonBack = (props: Omit) => ( diff --git a/packages/suite/src/components/onboarding/Buttons/OnboardingButtonCta.tsx b/packages/suite/src/components/onboarding/Buttons/OnboardingButtonCta.tsx index 9a5e5ea68b4..e0889c411f5 100644 --- a/packages/suite/src/components/onboarding/Buttons/OnboardingButtonCta.tsx +++ b/packages/suite/src/components/onboarding/Buttons/OnboardingButtonCta.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { Button, ButtonProps } from '@trezor/components'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/components/onboarding/Buttons/OnboardingButtonSkip.tsx b/packages/suite/src/components/onboarding/Buttons/OnboardingButtonSkip.tsx index 5750beeaf4f..881b646a7d0 100644 --- a/packages/suite/src/components/onboarding/Buttons/OnboardingButtonSkip.tsx +++ b/packages/suite/src/components/onboarding/Buttons/OnboardingButtonSkip.tsx @@ -1,5 +1,7 @@ import { HtmlHTMLAttributes } from 'react'; + import styled from 'styled-components'; + import { variables } from '@trezor/components'; const StyledSpan = styled.span` diff --git a/packages/suite/src/components/onboarding/CollapsibleOnboardingCard.tsx b/packages/suite/src/components/onboarding/CollapsibleOnboardingCard.tsx index c37bd1e7480..ed544405b8c 100644 --- a/packages/suite/src/components/onboarding/CollapsibleOnboardingCard.tsx +++ b/packages/suite/src/components/onboarding/CollapsibleOnboardingCard.tsx @@ -1,6 +1,8 @@ import { ReactNode, HTMLAttributes } from 'react'; + import styled, { css } from 'styled-components'; import { motion } from 'framer-motion'; + import { Elevation, borders, mapElevationToBackground, zIndices, spacings } from '@trezor/theme'; import { ElevationUp, diff --git a/packages/suite/src/components/onboarding/Hologram.tsx b/packages/suite/src/components/onboarding/Hologram.tsx index ab2cdd10e3b..e8e54cb6048 100644 --- a/packages/suite/src/components/onboarding/Hologram.tsx +++ b/packages/suite/src/components/onboarding/Hologram.tsx @@ -1,15 +1,17 @@ +import { useRef } from 'react'; + import styled from 'styled-components'; import { selectDevice } from '@suite-common/wallet-core'; import { getPackagingUrl } from '@suite-common/suite-utils'; import { DeviceAnimation, Banner, variables } from '@trezor/components'; import { TREZOR_RESELLERS_URL, TREZOR_SUPPORT_URL } from '@trezor/urls'; +import { typography } from '@trezor/theme'; +import { DeviceModelInternal } from '@trezor/connect'; import { Translation, TrezorLink } from 'src/components/suite'; -import { useRef } from 'react'; import { useSelector } from 'src/hooks/suite'; -import { typography } from '@trezor/theme'; -import { DeviceModelInternal } from '@trezor/connect'; + const HologramSubHeading = styled.span` font-size: ${variables.FONT_SIZE.SMALL}; diff --git a/packages/suite/src/components/onboarding/OnboardingLayout.tsx b/packages/suite/src/components/onboarding/OnboardingLayout.tsx index 67b5b929ab2..8e778461530 100644 --- a/packages/suite/src/components/onboarding/OnboardingLayout.tsx +++ b/packages/suite/src/components/onboarding/OnboardingLayout.tsx @@ -1,19 +1,23 @@ import { useMemo, ReactNode } from 'react'; + import styled from 'styled-components'; import { Button, variables } from '@trezor/components'; import { TrezorLogo } from '@trezor/product-components'; import { TREZOR_SUPPORT_URL } from '@trezor/urls'; +import { selectBannerMessage } from '@suite-common/message-system'; +import { spacingsPx, zIndices } from '@trezor/theme'; + import { TrezorLink, Translation } from 'src/components/suite'; import { OnboardingProgressBar } from 'src/components/onboarding'; import { useSelector, useOnboarding } from 'src/hooks/suite'; import { MAX_ONBOARDING_WIDTH } from 'src/constants/suite/layout'; import steps from 'src/config/onboarding/steps'; import { GuideButton, GuideRouter } from 'src/components/guide'; -import { selectBannerMessage } from '@suite-common/message-system'; import { MessageSystemBanner } from 'src/components/suite/banners'; import { ModalContextProvider } from 'src/support/suite/ModalContext'; -import { spacingsPx, zIndices } from '@trezor/theme'; + + import { TrafficLightOffset } from '../suite/TrafficLightOffset'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/onboarding/OnboardingOption.tsx b/packages/suite/src/components/onboarding/OnboardingOption.tsx index 40d69739865..f73377d27d9 100644 --- a/packages/suite/src/components/onboarding/OnboardingOption.tsx +++ b/packages/suite/src/components/onboarding/OnboardingOption.tsx @@ -1,5 +1,7 @@ import { ReactNode, HTMLAttributes } from 'react'; + import styled, { css } from 'styled-components'; + import { Icon, IconName, useElevation, variables } from '@trezor/components'; import { Elevation, diff --git a/packages/suite/src/components/onboarding/OnboardingProgressBar.tsx b/packages/suite/src/components/onboarding/OnboardingProgressBar.tsx index 900ae75b2ce..c264037019e 100644 --- a/packages/suite/src/components/onboarding/OnboardingProgressBar.tsx +++ b/packages/suite/src/components/onboarding/OnboardingProgressBar.tsx @@ -1,5 +1,7 @@ import { ReactNode, Fragment } from 'react'; + import styled, { css, useTheme } from 'styled-components'; + import { Icon, variables } from '@trezor/components'; import { spacingsPx, typography } from '@trezor/theme'; diff --git a/packages/suite/src/components/onboarding/OnboardingStepBox.tsx b/packages/suite/src/components/onboarding/OnboardingStepBox.tsx index 0aa0b0beaf7..43530aa48ba 100644 --- a/packages/suite/src/components/onboarding/OnboardingStepBox.tsx +++ b/packages/suite/src/components/onboarding/OnboardingStepBox.tsx @@ -1,17 +1,22 @@ import { ReactNode } from 'react'; +import { useIntl } from 'react-intl'; + import styled from 'styled-components'; + import TrezorConnect from '@trezor/connect'; import { Backdrop } from '@trezor/components'; +import { TrezorDevice } from '@suite-common/suite-types'; +import { spacingsPx, zIndices } from '@trezor/theme'; +import { ConfirmOnDevice } from '@trezor/product-components'; + import { Translation } from 'src/components/suite'; -import { useIntl } from 'react-intl'; import messages from 'src/support/messages'; + import { CollapsibleOnboardingCard, CollapsibleOnboardingCardProps, } from './CollapsibleOnboardingCard'; -import { TrezorDevice } from '@suite-common/suite-types'; -import { spacingsPx, zIndices } from '@trezor/theme'; -import { ConfirmOnDevice } from '@trezor/product-components'; + const WrapperWrapper = styled.div` z-index: ${zIndices.onboardingForeground}; diff --git a/packages/suite/src/components/onboarding/SkipStepConfirmation.tsx b/packages/suite/src/components/onboarding/SkipStepConfirmation.tsx index 3c31bcd46d9..86b33aacf10 100644 --- a/packages/suite/src/components/onboarding/SkipStepConfirmation.tsx +++ b/packages/suite/src/components/onboarding/SkipStepConfirmation.tsx @@ -1,7 +1,9 @@ import { ReactNode } from 'react'; + +import { NewModal } from '@trezor/components'; + import * as STEP from 'src/constants/onboarding/steps'; import { AnyStepId } from 'src/types/onboarding'; -import { NewModal } from '@trezor/components'; import { Translation } from 'src/components/suite'; import { useOnboarding } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/onboarding/index.ts b/packages/suite/src/components/onboarding/index.ts index 32f74581ed9..1c2f868ddbe 100644 --- a/packages/suite/src/components/onboarding/index.ts +++ b/packages/suite/src/components/onboarding/index.ts @@ -1,9 +1,7 @@ import { OnboardingOption, OptionsWrapper, OptionsDivider } from './OnboardingOption'; - import { OnboardingButtonCta } from './Buttons/OnboardingButtonCta'; import { OnboardingButtonBack } from './Buttons/OnboardingButtonBack'; import { OnboardingButtonSkip } from './Buttons/OnboardingButtonSkip'; - import { OnboardingLayout } from './OnboardingLayout'; import { Hologram } from './Hologram'; import { OnboardingStepBox, type OnboardingStepBoxProps } from './OnboardingStepBox'; diff --git a/packages/suite/src/components/settings/DeviceBanner.tsx b/packages/suite/src/components/settings/DeviceBanner.tsx index f5cfd353d76..5b3ef7c8fb6 100644 --- a/packages/suite/src/components/settings/DeviceBanner.tsx +++ b/packages/suite/src/components/settings/DeviceBanner.tsx @@ -1,11 +1,13 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { Card, LottieAnimation, Paragraph, Row, variables, Text } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { useDevice, useSelector } from 'src/hooks/suite'; import { isWebUsb } from 'src/utils/suite/transport'; import { WebUsbButton } from 'src/components/suite/WebUsbButton'; -import { spacings } from '@trezor/theme'; // eslint-disable-next-line local-rules/no-override-ds-component const StyledLottieAnimation = styled(LottieAnimation)` diff --git a/packages/suite/src/components/settings/SettingsLayout.tsx b/packages/suite/src/components/settings/SettingsLayout.tsx index 2b4169c657b..a4e1788ede1 100644 --- a/packages/suite/src/components/settings/SettingsLayout.tsx +++ b/packages/suite/src/components/settings/SettingsLayout.tsx @@ -1,4 +1,5 @@ import { ReactNode, useMemo } from 'react'; + import { useDiscovery, useDispatch, useLayout, useSelector } from 'src/hooks/suite'; import { SettingsLoading } from 'src/views/settings/SettingsLoader'; import { diff --git a/packages/suite/src/components/settings/SettingsSection.tsx b/packages/suite/src/components/settings/SettingsSection.tsx index 71755c19a57..68684f25675 100644 --- a/packages/suite/src/components/settings/SettingsSection.tsx +++ b/packages/suite/src/components/settings/SettingsSection.tsx @@ -1,5 +1,7 @@ import { ReactNode, ReactElement } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { Paragraph, IconName, Icon, H3, Card, Column } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; import { breakpointMediaQueries } from '@trezor/styles'; diff --git a/packages/suite/src/components/suite/AccountLabel.tsx b/packages/suite/src/components/suite/AccountLabel.tsx index c4d55ae4c56..cbe0a4f48c2 100644 --- a/packages/suite/src/components/suite/AccountLabel.tsx +++ b/packages/suite/src/components/suite/AccountLabel.tsx @@ -1,10 +1,13 @@ import styled from 'styled-components'; + import { BadgeSize, Row, TOOLTIP_DELAY_LONG, TruncateWithTooltip } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { AccountType, NetworkSymbol, Bip43Path, NetworkType } from '@suite-common/wallet-config'; -import { AccountTypeBadge } from './AccountTypeBadge'; + import { useDefaultAccountLabel } from 'src/hooks/suite'; +import { AccountTypeBadge } from './AccountTypeBadge'; + const TabularNums = styled.span` font-variant-numeric: tabular-nums; text-overflow: ellipsis; diff --git a/packages/suite/src/components/suite/AccountTypeBadge.tsx b/packages/suite/src/components/suite/AccountTypeBadge.tsx index 3a822cc3b78..1f84ba86562 100644 --- a/packages/suite/src/components/suite/AccountTypeBadge.tsx +++ b/packages/suite/src/components/suite/AccountTypeBadge.tsx @@ -1,8 +1,9 @@ import { Badge, BadgeSize } from '@trezor/components'; -import { Translation } from './Translation'; import { getAccountTypeName } from '@suite-common/wallet-utils'; import { AccountType, Bip43Path, NetworkType } from '@suite-common/wallet-config'; +import { Translation } from './Translation'; + type AccountTypeBadgeProps = { accountType?: AccountType; path?: Bip43Path; diff --git a/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx b/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx index 5f38dd15719..5ab3bf08591 100644 --- a/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx +++ b/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx @@ -1,11 +1,16 @@ import { MouseEvent, ReactNode } from 'react'; + import styled from 'styled-components'; + import { TOOLTIP_DELAY_NONE, TOOLTIP_DELAY_NORMAL, Tooltip } from '@trezor/components'; -import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { NetworkSymbol } from '@suite-common/wallet-config'; -import { Translation } from './Translation'; import { mediaQueries } from '@trezor/styles'; +import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; + +import { Translation } from './Translation'; + + const Container = styled.div` position: relative; display: flex; diff --git a/packages/suite/src/components/suite/AppNavigation/AppNavigationTooltip.tsx b/packages/suite/src/components/suite/AppNavigation/AppNavigationTooltip.tsx index 0316a0d162e..21c41ebeaca 100644 --- a/packages/suite/src/components/suite/AppNavigation/AppNavigationTooltip.tsx +++ b/packages/suite/src/components/suite/AppNavigation/AppNavigationTooltip.tsx @@ -1,8 +1,9 @@ import { ReactNode } from 'react'; +import { Tooltip } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; -import { Tooltip } from '@trezor/components'; interface AppNavigationTooltipProps { children: ReactNode; diff --git a/packages/suite/src/components/suite/ChangeDeviceLabel.tsx b/packages/suite/src/components/suite/ChangeDeviceLabel.tsx index a773df1d086..ba0582c1b98 100644 --- a/packages/suite/src/components/suite/ChangeDeviceLabel.tsx +++ b/packages/suite/src/components/suite/ChangeDeviceLabel.tsx @@ -1,17 +1,19 @@ import { useState, ChangeEventHandler } from 'react'; -import { analytics, EventType } from '@trezor/suite-analytics'; + import styled from 'styled-components'; +import { analytics, EventType } from '@trezor/suite-analytics'; import { Button, Input } from '@trezor/components'; -import { Translation } from 'src/components/suite'; -import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; -import { applySettings } from 'src/actions/settings/deviceSettingsActions'; -import { MAX_LABEL_LENGTH } from 'src/constants/suite/device'; import { isAscii } from '@trezor/utils'; import { spacingsPx } from '@trezor/theme'; import { breakpointMediaQueries } from '@trezor/styles'; import { selectDeviceLabel, selectDeviceName } from '@suite-common/wallet-core'; +import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; +import { applySettings } from 'src/actions/settings/deviceSettingsActions'; +import { MAX_LABEL_LENGTH } from 'src/constants/suite/device'; + const Container = styled.div<{ $isVertical?: boolean }>` display: flex; flex-direction: ${({ $isVertical }) => ($isVertical ? 'column' : 'row')}; diff --git a/packages/suite/src/components/suite/CoinGroup/CoinGroup.tsx b/packages/suite/src/components/suite/CoinGroup/CoinGroup.tsx index fb9d1f9ba90..7efd47c2d3a 100644 --- a/packages/suite/src/components/suite/CoinGroup/CoinGroup.tsx +++ b/packages/suite/src/components/suite/CoinGroup/CoinGroup.tsx @@ -1,11 +1,13 @@ import { useState } from 'react'; + import styled from 'styled-components'; +import { Network, NetworkSymbol } from '@suite-common/wallet-config'; + import { useDispatch } from 'src/hooks/suite'; import { changeCoinVisibility } from 'src/actions/settings/walletSettingsActions'; import { openModal } from 'src/actions/suite/modalActions'; import { CoinList } from 'src/components/suite'; -import { Network, NetworkSymbol } from '@suite-common/wallet-config'; import { CoinGroupHeader } from './CoinGroupHeader'; import { CoinListProps } from '../CoinList/CoinList'; diff --git a/packages/suite/src/components/suite/CoinGroup/CoinGroupHeader.tsx b/packages/suite/src/components/suite/CoinGroup/CoinGroupHeader.tsx index f88f5b30ca7..98b345d4ded 100644 --- a/packages/suite/src/components/suite/CoinGroup/CoinGroupHeader.tsx +++ b/packages/suite/src/components/suite/CoinGroup/CoinGroupHeader.tsx @@ -1,6 +1,8 @@ import { transparentize } from 'polished'; import styled, { css } from 'styled-components'; + import { Icon, variables } from '@trezor/components'; + import { Translation } from 'src/components/suite'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/CoinList/Coin.tsx b/packages/suite/src/components/suite/CoinList/Coin.tsx index 6af07736a08..bef1a6c126a 100644 --- a/packages/suite/src/components/suite/CoinList/Coin.tsx +++ b/packages/suite/src/components/suite/CoinList/Coin.tsx @@ -1,13 +1,16 @@ import { MouseEvent } from 'react'; + import { transparentize } from 'polished'; import styled, { css, useTheme } from 'styled-components'; + import { variables, Icon } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { typography } from '@trezor/theme'; import { TranslationKey } from '@suite-common/intl-types'; import { CoinLogo } from '@trezor/product-components'; +import { Translation } from 'src/components/suite'; + const SettingsWrapper = styled.div<{ $toggled: boolean; onClick: ((e: MouseEvent) => void) | undefined; diff --git a/packages/suite/src/components/suite/CoinList/CoinList.tsx b/packages/suite/src/components/suite/CoinList/CoinList.tsx index 94b6f6e132f..4efa7a15d97 100644 --- a/packages/suite/src/components/suite/CoinList/CoinList.tsx +++ b/packages/suite/src/components/suite/CoinList/CoinList.tsx @@ -4,13 +4,13 @@ import { getCoinUnavailabilityMessage } from '@suite-common/suite-utils'; import { Tooltip } from '@trezor/components'; import { getFirmwareVersion, isDeviceInBootloaderMode } from '@trezor/device-utils'; import { versionUtils } from '@trezor/utils'; +import { Network, NetworkSymbol } from '@suite-common/wallet-config'; import { Translation } from 'src/components/suite'; import { useDevice, useDiscovery, useSelector } from 'src/hooks/suite'; -import { Network, NetworkSymbol } from '@suite-common/wallet-config'; +import { getCoinLabel } from 'src/utils/suite/getCoinLabel'; import { Coin } from './Coin'; -import { getCoinLabel } from 'src/utils/suite/getCoinLabel'; const Wrapper = styled.div` width: 100%; diff --git a/packages/suite/src/components/suite/ConnectDevicePrompt.tsx b/packages/suite/src/components/suite/ConnectDevicePrompt.tsx index 20427495e70..70c7ac7acbb 100644 --- a/packages/suite/src/components/suite/ConnectDevicePrompt.tsx +++ b/packages/suite/src/components/suite/ConnectDevicePrompt.tsx @@ -1,4 +1,5 @@ import styled, { useTheme } from 'styled-components'; +import { motion } from 'framer-motion'; import { variables, @@ -9,11 +10,11 @@ import { Icon, } from '@trezor/components'; import { isDesktop } from '@trezor/env-utils'; +import { Elevation, mapElevationToBackground, mapElevationToBorder } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useDevice } from 'src/hooks/suite'; import type { PrerequisiteType } from 'src/types/suite'; -import { motion } from 'framer-motion'; -import { Elevation, mapElevationToBackground, mapElevationToBorder } from '@trezor/theme'; const Wrapper = styled(motion.div)<{ $elevation: Elevation }>` display: flex; diff --git a/packages/suite/src/components/suite/CountdownTimer.tsx b/packages/suite/src/components/suite/CountdownTimer.tsx index 6f46690b8e6..c97a42485be 100644 --- a/packages/suite/src/components/suite/CountdownTimer.tsx +++ b/packages/suite/src/components/suite/CountdownTimer.tsx @@ -1,9 +1,14 @@ -import styled from 'styled-components'; import { FormattedNumber } from 'react-intl'; -import { Translation } from './Translation'; + +import styled from 'styled-components'; + + import { TranslationKey } from '@suite-common/intl-types'; + import { useCountdownTimer } from 'src/hooks/suite'; +import { Translation } from './Translation'; + const UnitWrapper = styled.span` font-variant-numeric: tabular-nums; `; diff --git a/packages/suite/src/components/suite/DeviceAuthenticationExplainer.tsx b/packages/suite/src/components/suite/DeviceAuthenticationExplainer.tsx index 2910cf06a7d..0064216452c 100644 --- a/packages/suite/src/components/suite/DeviceAuthenticationExplainer.tsx +++ b/packages/suite/src/components/suite/DeviceAuthenticationExplainer.tsx @@ -1,9 +1,9 @@ import styled, { css } from 'styled-components'; import { Icon, IconName, variables } from '@trezor/components'; +import { TranslationKey } from '@suite-common/intl-types'; import { Translation } from 'src/components/suite'; -import { TranslationKey } from '@suite-common/intl-types'; const Item = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/DeviceDisplay/DeviceDisplay.tsx b/packages/suite/src/components/suite/DeviceDisplay/DeviceDisplay.tsx index 3713200ca41..05e82cbbaf9 100644 --- a/packages/suite/src/components/suite/DeviceDisplay/DeviceDisplay.tsx +++ b/packages/suite/src/components/suite/DeviceDisplay/DeviceDisplay.tsx @@ -1,13 +1,16 @@ -import styled from 'styled-components'; import { ReactNode } from 'react'; -import { useSelector } from 'src/hooks/suite/useSelector'; +import styled from 'styled-components'; + import { selectDeviceInternalModel } from '@suite-common/wallet-core'; import { DeviceModelInternal } from '@trezor/connect'; + +import { useSelector } from 'src/hooks/suite/useSelector'; +import { DisplayMode } from 'src/types/suite'; + import { DisplayChunks } from './DisplayChunks'; import { DisplayPaginatedText } from './DisplayPaginatedText'; import { DisplaySinglePageWrapText } from './DisplaySinglePageWrapText'; -import { DisplayMode } from 'src/types/suite'; const Display = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/DeviceDisplay/DisplayChunks.tsx b/packages/suite/src/components/suite/DeviceDisplay/DisplayChunks.tsx index ccfa29eeec3..b49afb8afd7 100644 --- a/packages/suite/src/components/suite/DeviceDisplay/DisplayChunks.tsx +++ b/packages/suite/src/components/suite/DeviceDisplay/DisplayChunks.tsx @@ -1,8 +1,11 @@ import styled from 'styled-components'; -import { DeviceDisplayText } from './DeviceDisplayText'; + import { splitStringEveryNCharacters } from '@trezor/utils'; + import { handleOnCopy } from 'src/utils/suite/deviceDisplay'; +import { DeviceDisplayText } from './DeviceDisplayText'; + const Row = styled.div<{ $isAlignedRight?: boolean }>` display: flex; align-items: center; diff --git a/packages/suite/src/components/suite/DeviceDisplay/DisplayPageSeparator.tsx b/packages/suite/src/components/suite/DeviceDisplay/DisplayPageSeparator.tsx index 0c100251e2d..d2d0fdd7bd0 100644 --- a/packages/suite/src/components/suite/DeviceDisplay/DisplayPageSeparator.tsx +++ b/packages/suite/src/components/suite/DeviceDisplay/DisplayPageSeparator.tsx @@ -1,7 +1,9 @@ import styled from 'styled-components'; -import { Translation } from '../Translation'; + import { typography } from '@trezor/theme'; +import { Translation } from '../Translation'; + const SEPARATOR_LINE_HEIGHT = 32; const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/DeviceDisplay/DisplayPaginatedText.tsx b/packages/suite/src/components/suite/DeviceDisplay/DisplayPaginatedText.tsx index 1bffda3c618..eedf007e7bf 100644 --- a/packages/suite/src/components/suite/DeviceDisplay/DisplayPaginatedText.tsx +++ b/packages/suite/src/components/suite/DeviceDisplay/DisplayPaginatedText.tsx @@ -1,12 +1,13 @@ import styled from 'styled-components'; import { DeviceModelInternal } from '@trezor/connect'; +import { Icon, IconName, IconProps } from '@trezor/components'; + +import { handleOnCopy } from 'src/utils/suite/deviceDisplay'; import { ResultRow, parseTextToPagesAndLines } from './parseTextToPagesAndLines'; import { DeviceDisplayText } from './DeviceDisplayText'; import { DisplayPageSeparator } from './DisplayPageSeparator'; -import { handleOnCopy } from 'src/utils/suite/deviceDisplay'; -import { Icon, IconName, IconProps } from '@trezor/components'; // eslint-disable-next-line local-rules/no-override-ds-component const StyledNextIcon = styled(Icon)<{ $isPixelType: boolean }>` diff --git a/packages/suite/src/components/suite/DeviceDisplay/DisplaySinglePageWrapText.tsx b/packages/suite/src/components/suite/DeviceDisplay/DisplaySinglePageWrapText.tsx index ac0fb52f0fb..96e2f0c3d44 100644 --- a/packages/suite/src/components/suite/DeviceDisplay/DisplaySinglePageWrapText.tsx +++ b/packages/suite/src/components/suite/DeviceDisplay/DisplaySinglePageWrapText.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { DeviceDisplayText } from './DeviceDisplayText'; const TextWrapper = styled.div<{ $isPixelType: boolean }>` diff --git a/packages/suite/src/components/suite/DeviceDisplay/__tests__/DeviceDisplay.test.tsx b/packages/suite/src/components/suite/DeviceDisplay/__tests__/DeviceDisplay.test.tsx index 48b1e93442a..3c3563211f2 100644 --- a/packages/suite/src/components/suite/DeviceDisplay/__tests__/DeviceDisplay.test.tsx +++ b/packages/suite/src/components/suite/DeviceDisplay/__tests__/DeviceDisplay.test.tsx @@ -1,11 +1,12 @@ -import { DisplayMode } from '../../../../types/suite'; -import { DeviceDisplay } from '../DeviceDisplay'; -import { renderWithProviders } from '../../../../support/tests/hooksHelper'; import { configureMockStore } from '@suite-common/test-utils'; import { prepareDeviceReducer } from '@suite-common/wallet-core'; -import { extraDependencies } from '../../../../support/extraDependencies'; import { DeviceModelInternal } from '@trezor/connect'; import { DeepPartial } from '@trezor/type-utils'; + +import { DisplayMode } from '../../../../types/suite'; +import { DeviceDisplay } from '../DeviceDisplay'; +import { renderWithProviders } from '../../../../support/tests/hooksHelper'; +import { extraDependencies } from '../../../../support/extraDependencies'; import suiteReducer from '../../../../reducers/suite/suiteReducer'; const deviceReducer = prepareDeviceReducer(extraDependencies); diff --git a/packages/suite/src/components/suite/DeviceDisplay/__tests__/parseTextToPagesAndLines.test.ts b/packages/suite/src/components/suite/DeviceDisplay/__tests__/parseTextToPagesAndLines.test.ts index 07007d9babb..45988eac512 100644 --- a/packages/suite/src/components/suite/DeviceDisplay/__tests__/parseTextToPagesAndLines.test.ts +++ b/packages/suite/src/components/suite/DeviceDisplay/__tests__/parseTextToPagesAndLines.test.ts @@ -1,4 +1,5 @@ import { DeviceModelInternal } from '@trezor/connect'; + import { ParseTextToLinesParams, ParseTextToLinesResult, diff --git a/packages/suite/src/components/suite/DeviceMatrixExplanation.tsx b/packages/suite/src/components/suite/DeviceMatrixExplanation.tsx index 19206df20b9..a6ee0bcf7e7 100644 --- a/packages/suite/src/components/suite/DeviceMatrixExplanation.tsx +++ b/packages/suite/src/components/suite/DeviceMatrixExplanation.tsx @@ -1,9 +1,12 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { Icon, IconName, IconProps, Image, variables } from '@trezor/components'; -import { useGuide } from 'src/hooks/guide'; import { DeviceModelInternal } from '@trezor/connect'; +import { useGuide } from 'src/hooks/guide'; + const Wrapper = styled.div<{ $isGuideOpen?: boolean }>` display: flex; flex-direction: column; diff --git a/packages/suite/src/components/suite/DropZone.tsx b/packages/suite/src/components/suite/DropZone.tsx index 5acb62bacee..31f3b87a0fb 100644 --- a/packages/suite/src/components/suite/DropZone.tsx +++ b/packages/suite/src/components/suite/DropZone.tsx @@ -1,9 +1,12 @@ import { useRef, useCallback, useMemo, useState, MouseEvent, DragEvent, ChangeEvent } from 'react'; + import styled from 'styled-components'; + import { Icon, IconName, Paragraph } from '@trezor/components'; +import { borders, spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import type { ExtendedMessageDescriptor } from 'src/types/suite'; -import { borders, spacings } from '@trezor/theme'; interface DropZoneProps { // 'accept' attribute for underlying HTML file input diff --git a/packages/suite/src/components/suite/Error.tsx b/packages/suite/src/components/suite/Error.tsx index cf56148e0e3..e621b9e03c5 100644 --- a/packages/suite/src/components/suite/Error.tsx +++ b/packages/suite/src/components/suite/Error.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { H2, Paragraph, Button, variables } from '@trezor/components'; + import { db } from 'src/storage'; import { reloadApp } from 'src/utils/suite/reload'; diff --git a/packages/suite/src/components/suite/FiatValue.tsx b/packages/suite/src/components/suite/FiatValue.tsx index b1c2d9f6b8f..e11c5b164e9 100644 --- a/packages/suite/src/components/suite/FiatValue.tsx +++ b/packages/suite/src/components/suite/FiatValue.tsx @@ -1,18 +1,22 @@ import { ReactElement } from 'react'; + import styled from 'styled-components'; -import { HiddenPlaceholder } from 'src/components/suite'; -import { useFormatters } from '@suite-common/formatters'; import type { FormatNumberOptions } from '@formatjs/intl'; + +import { useFormatters } from '@suite-common/formatters'; +import { SkeletonRectangle } from '@trezor/components'; +import { selectIsSpecificCoinDefinitionKnown } from '@suite-common/token-definitions'; +import { NetworkSymbol } from '@suite-common/wallet-config'; +import { TokenAddress } from '@suite-common/wallet-types'; + +import { useLoadingSkeleton, useSelector } from 'src/hooks/suite'; import { useFiatFromCryptoValue, useFiatFromCryptoValueParams, } from 'src/hooks/suite/useFiatFromCryptoValue'; +import { HiddenPlaceholder } from 'src/components/suite'; + import { HiddenPlaceholderProps } from './HiddenPlaceholder'; -import { useLoadingSkeleton, useSelector } from 'src/hooks/suite'; -import { SkeletonRectangle } from '@trezor/components'; -import { selectIsSpecificCoinDefinitionKnown } from '@suite-common/token-definitions'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import { TokenAddress } from '@suite-common/wallet-types'; const StyledHiddenPlaceholder = styled((props: HiddenPlaceholderProps) => ( diff --git a/packages/suite/src/components/suite/FormFractionButtons.tsx b/packages/suite/src/components/suite/FormFractionButtons.tsx index 66ff9f3e03d..5a565888fed 100644 --- a/packages/suite/src/components/suite/FormFractionButtons.tsx +++ b/packages/suite/src/components/suite/FormFractionButtons.tsx @@ -1,10 +1,12 @@ import styled from 'styled-components'; -import { Translation } from 'src/components/suite'; + import { Button, Tooltip } from '@trezor/components'; import { BigNumber } from '@trezor/utils/src/bigNumber'; import { MIN_ETH_AMOUNT_FOR_STAKING } from '@suite-common/wallet-constants'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import { Translation } from 'src/components/suite'; + const Flex = styled.div` display: flex; gap: 4px; diff --git a/packages/suite/src/components/suite/FormattedCryptoAmount.tsx b/packages/suite/src/components/suite/FormattedCryptoAmount.tsx index 3d245971feb..ba12cf3f3cb 100644 --- a/packages/suite/src/components/suite/FormattedCryptoAmount.tsx +++ b/packages/suite/src/components/suite/FormattedCryptoAmount.tsx @@ -1,9 +1,6 @@ import styled from 'styled-components'; -import { HiddenPlaceholder, Sign } from 'src/components/suite'; -import { getNetworkOptional, NetworkSymbol } from '@suite-common/wallet-config'; -import { useSelector } from 'src/hooks/suite'; -import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; +import { getNetworkOptional, NetworkSymbol } from '@suite-common/wallet-config'; import { SignValue } from '@suite-common/suite-types'; import { formatCoinBalance, @@ -11,6 +8,10 @@ import { networkAmountToSmallestUnit, } from '@suite-common/wallet-utils'; import { isSignValuePositive } from '@suite-common/formatters'; + +import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; +import { useSelector } from 'src/hooks/suite'; +import { HiddenPlaceholder, Sign } from 'src/components/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; import { BlurUrls } from 'src/views/wallet/tokens/common/BlurUrls'; diff --git a/packages/suite/src/components/suite/FormattedNftAmount.tsx b/packages/suite/src/components/suite/FormattedNftAmount.tsx index 4388c714ebf..771592ca1ef 100644 --- a/packages/suite/src/components/suite/FormattedNftAmount.tsx +++ b/packages/suite/src/components/suite/FormattedNftAmount.tsx @@ -3,12 +3,12 @@ import styled from 'styled-components'; import { SignValue } from '@suite-common/suite-types'; import { getNftTokenId } from '@suite-common/wallet-utils'; import { TokenTransfer } from '@trezor/connect'; +import { variables } from '@trezor/components'; import { HiddenPlaceholder, Sign } from 'src/components/suite'; // importing directly, otherwise unit tests fail, seems to be a styled-components issue import { TrezorLink } from 'src/components/suite/TrezorLink'; import { useSelector } from 'src/hooks/suite/useSelector'; -import { variables } from '@trezor/components'; const Container = styled.div` max-width: 100%; diff --git a/packages/suite/src/components/suite/HiddenPlaceholder.tsx b/packages/suite/src/components/suite/HiddenPlaceholder.tsx index de3158f2af7..5a62a264d31 100644 --- a/packages/suite/src/components/suite/HiddenPlaceholder.tsx +++ b/packages/suite/src/components/suite/HiddenPlaceholder.tsx @@ -1,8 +1,11 @@ import { ReactNode, useLayoutEffect, useRef, useState } from 'react'; + import styled, { css } from 'styled-components'; + +import { RedactNumbersContext } from '@suite-common/wallet-utils'; + import { useSelector } from 'src/hooks/suite'; import { selectIsDiscreteModeActive } from 'src/reducers/wallet/settingsReducer'; -import { RedactNumbersContext } from '@suite-common/wallet-utils'; type WrapperProps = { $intensity: number; diff --git a/packages/suite/src/components/suite/HoverAnimation.tsx b/packages/suite/src/components/suite/HoverAnimation.tsx index 4f593a02cb0..e4d1b79e166 100644 --- a/packages/suite/src/components/suite/HoverAnimation.tsx +++ b/packages/suite/src/components/suite/HoverAnimation.tsx @@ -1,5 +1,7 @@ import { ReactNode } from 'react'; + import styled, { css } from 'styled-components'; + import { borders } from '@trezor/theme'; const Wrapper = styled.div<{ $size?: string; $isHoverable?: boolean }>` diff --git a/packages/suite/src/components/suite/InstructionStep.tsx b/packages/suite/src/components/suite/InstructionStep.tsx index 34fc9698330..36c4476d417 100644 --- a/packages/suite/src/components/suite/InstructionStep.tsx +++ b/packages/suite/src/components/suite/InstructionStep.tsx @@ -1,5 +1,7 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { variables } from '@trezor/components'; const Container = styled.div` diff --git a/packages/suite/src/components/suite/LearnMoreButton.tsx b/packages/suite/src/components/suite/LearnMoreButton.tsx index b385c653f98..43caa0b64e1 100644 --- a/packages/suite/src/components/suite/LearnMoreButton.tsx +++ b/packages/suite/src/components/suite/LearnMoreButton.tsx @@ -1,9 +1,10 @@ import { ReactNode } from 'react'; import { Button, ButtonProps } from '@trezor/components'; +import { Url } from '@trezor/urls'; import { Translation } from 'src/components/suite'; -import { Url } from '@trezor/urls'; + import { useExternalLink } from '../../hooks/suite'; interface LearnMoreButtonProps extends Omit { diff --git a/packages/suite/src/components/suite/Loading.tsx b/packages/suite/src/components/suite/Loading.tsx index d1705b10005..2b237e01254 100644 --- a/packages/suite/src/components/suite/Loading.tsx +++ b/packages/suite/src/components/suite/Loading.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { Spinner } from '@trezor/components'; const LoaderWrapper = styled.div` diff --git a/packages/suite/src/components/suite/Metadata.tsx b/packages/suite/src/components/suite/Metadata.tsx index 333b593a183..85b1a43a0f0 100644 --- a/packages/suite/src/components/suite/Metadata.tsx +++ b/packages/suite/src/components/suite/Metadata.tsx @@ -1,6 +1,8 @@ -import { SUITE_URL } from '@trezor/urls'; import { Helmet } from 'react-helmet-async'; import { useIntl } from 'react-intl'; + +import { SUITE_URL } from '@trezor/urls'; + import messages from 'src/support/messages'; type MetadataProps = { diff --git a/packages/suite/src/components/suite/NotificationCard.tsx b/packages/suite/src/components/suite/NotificationCard.tsx index 1f5daef2324..5e6cb4001ca 100644 --- a/packages/suite/src/components/suite/NotificationCard.tsx +++ b/packages/suite/src/components/suite/NotificationCard.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled, { DefaultTheme, useTheme } from 'styled-components'; import { @@ -12,9 +13,10 @@ import { Icon, } from '@trezor/components'; import { Elevation, borders, spacingsPx, typography } from '@trezor/theme'; -import { TrezorLink } from './TrezorLink'; import { UIVariant } from '@trezor/components/src/config/types'; +import { TrezorLink } from './TrezorLink'; + // TODO: move to components type ButtonType = ButtonProps & { href?: string }; diff --git a/packages/suite/src/components/suite/NumberInput.tsx b/packages/suite/src/components/suite/NumberInput.tsx index b44df569929..237b9af0ff1 100644 --- a/packages/suite/src/components/suite/NumberInput.tsx +++ b/packages/suite/src/components/suite/NumberInput.tsx @@ -7,15 +7,15 @@ import { ClipboardEvent, FormEvent, } from 'react'; - import { Control, FieldValues, useController, UseControllerProps } from 'react-hook-form'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Input, InputProps } from '@trezor/components'; import { localizeNumber } from '@suite-common/wallet-utils'; +import { getLocaleSeparators } from '@trezor/utils'; + import { Locale } from 'src/config/suite/languages'; import { useSelector } from 'src/hooks/suite'; -import { getLocaleSeparators } from '@trezor/utils'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; const isValidDecimalString = (value: string) => /^([^.]*)\.[^.]+$/.test(value); diff --git a/packages/suite/src/components/suite/PinMatrix/PinInput/InputPin.tsx b/packages/suite/src/components/suite/PinMatrix/PinInput/InputPin.tsx index d2b09b649e3..53c7e459188 100644 --- a/packages/suite/src/components/suite/PinMatrix/PinInput/InputPin.tsx +++ b/packages/suite/src/components/suite/PinMatrix/PinInput/InputPin.tsx @@ -1,5 +1,7 @@ import { MouseEvent } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { variables, Icon, Input } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; diff --git a/packages/suite/src/components/suite/PinMatrix/PinInput/PinInput.tsx b/packages/suite/src/components/suite/PinMatrix/PinInput/PinInput.tsx index 4bfb6f551d2..6617b7a7e42 100644 --- a/packages/suite/src/components/suite/PinMatrix/PinInput/PinInput.tsx +++ b/packages/suite/src/components/suite/PinMatrix/PinInput/PinInput.tsx @@ -1,10 +1,13 @@ import { useCallback, useEffect, useState } from 'react'; + import styled, { css } from 'styled-components'; import { formInputsMaxLength } from '@suite-common/validators'; import { Button, KEYBOARD_CODE, PinButton } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { usePin } from 'src/hooks/suite/usePinModal'; + import { InputPin } from './InputPin'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/PinMatrix/PinMatrix.tsx b/packages/suite/src/components/suite/PinMatrix/PinMatrix.tsx index 525ed9f6a9f..38a4dafeecc 100644 --- a/packages/suite/src/components/suite/PinMatrix/PinMatrix.tsx +++ b/packages/suite/src/components/suite/PinMatrix/PinMatrix.tsx @@ -1,12 +1,16 @@ import { useState, useEffect } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { DeviceModelInternal } from '@trezor/connect'; import { HELP_CENTER_PIN_URL } from '@trezor/urls'; import { variables } from '@trezor/components'; + import { DeviceMatrixExplanation, Translation, TrezorLink } from 'src/components/suite'; import { TrezorDevice } from 'src/types/suite'; import { onPinSubmit } from 'src/actions/suite/modalActions'; import { useDispatch } from 'src/hooks/suite'; + import { PinInput } from './PinInput/PinInput'; export const PIN_MATRIX_MAX_WIDTH = '316px'; diff --git a/packages/suite/src/components/suite/Preloader/InitialLoading.tsx b/packages/suite/src/components/suite/Preloader/InitialLoading.tsx index 64698f7d734..3ee1e5aaadc 100644 --- a/packages/suite/src/components/suite/Preloader/InitialLoading.tsx +++ b/packages/suite/src/components/suite/Preloader/InitialLoading.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from 'react'; + import styled from 'styled-components'; import { Loading } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/Preloader/Preloader.tsx b/packages/suite/src/components/suite/Preloader/Preloader.tsx index 1e77dd4b58d..235ff32a8a2 100644 --- a/packages/suite/src/components/suite/Preloader/Preloader.tsx +++ b/packages/suite/src/components/suite/Preloader/Preloader.tsx @@ -1,14 +1,16 @@ import { FC, useEffect, PropsWithChildren } from 'react'; +import { + selectDevice, + selectIsFirmwareAuthenticityCheckDismissed, +} from '@suite-common/wallet-core'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { Onboarding } from 'src/views/onboarding'; import { ErrorPage } from 'src/views/suite/ErrorPage'; import { useGuideKeyboard } from 'src/hooks/guide'; import { init } from 'src/actions/suite/initAction'; import type { AppState } from 'src/types/suite'; -import { SuiteLayout } from '../layouts/SuiteLayout/SuiteLayout'; -import { InitialLoading } from './InitialLoading'; -import { DatabaseUpgradeModal } from './DatabaseUpgradeModal'; import { selectPrerequisite, selectIsLoggedOut, @@ -16,14 +18,14 @@ import { selectIsFirmwareAuthenticityCheckEnabledAndFailed, } from 'src/reducers/suite/suiteReducer'; import { SuiteStart } from 'src/views/start/SuiteStart'; +import { ViewOnlyPromo } from 'src/views/view-only/ViewOnlyPromo'; + +import { SuiteLayout } from '../layouts/SuiteLayout/SuiteLayout'; +import { InitialLoading } from './InitialLoading'; +import { DatabaseUpgradeModal } from './DatabaseUpgradeModal'; import { PrerequisitesGuide } from '../PrerequisitesGuide/PrerequisitesGuide'; import { LoggedOutLayout } from '../layouts/LoggedOutLayout'; import { WelcomeLayout } from '../layouts/WelcomeLayout/WelcomeLayout'; -import { ViewOnlyPromo } from 'src/views/view-only/ViewOnlyPromo'; -import { - selectDevice, - selectIsFirmwareAuthenticityCheckDismissed, -} from '@suite-common/wallet-core'; import { DeviceCompromised } from '../SecurityCheck/DeviceCompromised'; import { RouterAppWithParams } from '../../../constants/suite/routes'; diff --git a/packages/suite/src/components/suite/Preloader/__tests__/Preloader.test.tsx b/packages/suite/src/components/suite/Preloader/__tests__/Preloader.test.tsx index 6f1a0096517..6704decb8e0 100644 --- a/packages/suite/src/components/suite/Preloader/__tests__/Preloader.test.tsx +++ b/packages/suite/src/components/suite/Preloader/__tests__/Preloader.test.tsx @@ -1,11 +1,11 @@ import * as envUtils from '@trezor/env-utils'; +import { DeepPartial } from '@trezor/type-utils'; import { configureStore } from 'src/support/tests/configureStore'; import { renderWithProviders, findByTestId } from 'src/support/tests/hooksHelper'; import { Preloader } from '../Preloader'; import { AppState } from '../../../../reducers/store'; -import { DeepPartial } from '@trezor/type-utils'; // render only Translation.id in data-test attribute jest.mock('src/components/suite/Translation', () => ({ diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceInitialize.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceInitialize.tsx index a9a34b71a6d..1d96e2cc70b 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceInitialize.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceInitialize.tsx @@ -1,5 +1,7 @@ import { MouseEvent } from 'react'; + import { Button } from '@trezor/components'; + import { Translation, TroubleshootingTips } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceNoFirmware.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceNoFirmware.tsx index 23a02c05101..a0ec44ad5a6 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceNoFirmware.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceNoFirmware.tsx @@ -1,4 +1,5 @@ import { MouseEventHandler } from 'react'; + import { Button } from '@trezor/components'; import { Translation, TroubleshootingTips } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceRecoveryMode.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceRecoveryMode.tsx index 9d5e01a1d95..b059028093c 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceRecoveryMode.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceRecoveryMode.tsx @@ -1,5 +1,7 @@ import { MouseEventHandler } from 'react'; + import { Button } from '@trezor/components'; + import { Translation, TroubleshootingTips } from 'src/components/suite'; import { rerun } from 'src/actions/recovery/recoveryActions'; import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUnreadable.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUnreadable.tsx index 96e44fda89d..f406ab225de 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUnreadable.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUnreadable.tsx @@ -1,4 +1,5 @@ import { useState, MouseEvent } from 'react'; + import { Button } from '@trezor/components'; import { desktopApi } from '@trezor/suite-desktop-api'; import { isDesktop, isLinux } from '@trezor/env-utils'; diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUpdateRequired.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUpdateRequired.tsx index d2a079630b4..166a2405940 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUpdateRequired.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUpdateRequired.tsx @@ -1,4 +1,5 @@ import { MouseEventHandler } from 'react'; + import { Button } from '@trezor/components'; import { Translation, TroubleshootingTips } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx index a79186be769..3a9a7c6ddc2 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx @@ -10,6 +10,8 @@ import { selectDevices, selectDevice } from '@suite-common/wallet-core'; import { ConnectDevicePrompt, Translation } from 'src/components/suite'; import { isWebUsb } from 'src/utils/suite/transport'; import { useDispatch, useSelector } from 'src/hooks/suite'; +import { selectPrerequisite } from 'src/reducers/suite/suiteReducer'; +import { goto } from 'src/actions/suite/routerActions'; import { Transport } from './Transport'; import { DeviceConnect } from './DeviceConnect'; @@ -23,9 +25,8 @@ import { DeviceBootloader } from './DeviceBootloader'; import { DeviceNoFirmware } from './DeviceNoFirmware'; import { DeviceUpdateRequired } from './DeviceUpdateRequired'; import { DeviceDisconnectRequired } from './DeviceDisconnectRequired'; -import { selectPrerequisite } from 'src/reducers/suite/suiteReducer'; import { MultiShareBackupInProgress } from './MultiShareBackupInProgress'; -import { goto } from 'src/actions/suite/routerActions'; + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/Transport.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/Transport.tsx index 7832438f60e..204b67aba78 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/Transport.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/Transport.tsx @@ -1,5 +1,4 @@ import { Translation, TroubleshootingTips } from 'src/components/suite'; - import { TROUBLESHOOTING_TIP_SUITE_DESKTOP, TROUBLESHOOTING_TIP_RESTART_COMPUTER, diff --git a/packages/suite/src/components/suite/QrCode.tsx b/packages/suite/src/components/suite/QrCode.tsx index ff9603cc611..1e36a30755e 100644 --- a/packages/suite/src/components/suite/QrCode.tsx +++ b/packages/suite/src/components/suite/QrCode.tsx @@ -2,9 +2,10 @@ import { QRCodeSVG } from 'qrcode.react'; import styled from 'styled-components'; import { Icon, Tooltip, variables, intermediaryTheme } from '@trezor/components'; -import { Translation } from './Translation'; import { CSSColor } from '@trezor/theme'; +import { Translation } from './Translation'; + export const QRCODE_SIZE = 384; export const QRCODE_PADDING = 12; diff --git a/packages/suite/src/components/suite/QuestionTooltip.tsx b/packages/suite/src/components/suite/QuestionTooltip.tsx index b2e40b141bd..ab4ccc58c93 100644 --- a/packages/suite/src/components/suite/QuestionTooltip.tsx +++ b/packages/suite/src/components/suite/QuestionTooltip.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { Tooltip, H3 } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { ExtendedMessageDescriptor } from 'src/types/suite'; diff --git a/packages/suite/src/components/suite/ReadMoreLink.tsx b/packages/suite/src/components/suite/ReadMoreLink.tsx index 3e188a95b59..7f3c04bc961 100644 --- a/packages/suite/src/components/suite/ReadMoreLink.tsx +++ b/packages/suite/src/components/suite/ReadMoreLink.tsx @@ -1,4 +1,5 @@ import * as URLS from '@trezor/urls'; + import { Translation, TrezorLink } from 'src/components/suite'; import { ExtendedMessageDescriptor } from 'src/types/suite'; diff --git a/packages/suite/src/components/suite/SecurityCheck/DeviceCompromised.tsx b/packages/suite/src/components/suite/SecurityCheck/DeviceCompromised.tsx index a5d71060c31..aa07f5bade0 100644 --- a/packages/suite/src/components/suite/SecurityCheck/DeviceCompromised.tsx +++ b/packages/suite/src/components/suite/SecurityCheck/DeviceCompromised.tsx @@ -1,4 +1,5 @@ import { useEffect } from 'react'; + import { deviceActions } from '@suite-common/wallet-core'; import { Card } from '@trezor/components'; import { getFirmwareVersion } from '@trezor/device-utils'; @@ -11,6 +12,7 @@ import { selectFirmwareHashCheckError, selectFirmwareRevisionCheckError, } from 'src/reducers/suite/suiteReducer'; + import { SecurityCheckFail, SecurityCheckFailProps } from './SecurityCheckFail'; import { softFailureChecklistItems } from './checklistItems'; diff --git a/packages/suite/src/components/suite/SecurityCheck/SecurityCheckFail.tsx b/packages/suite/src/components/suite/SecurityCheck/SecurityCheckFail.tsx index 80c86c7154b..8b1e1fc8b2a 100644 --- a/packages/suite/src/components/suite/SecurityCheck/SecurityCheckFail.tsx +++ b/packages/suite/src/components/suite/SecurityCheck/SecurityCheckFail.tsx @@ -8,6 +8,7 @@ import { Url } from '@trezor/urls'; import { Translation } from 'src/components/suite'; import { SecurityChecklist } from 'src/views/onboarding/steps/SecurityCheck/SecurityChecklist'; import { SecurityChecklistItem } from 'src/views/onboarding/steps/SecurityCheck/types'; + import { SecurityCheckLayout } from './SecurityCheckLayout'; import { hardFailureChecklistItems } from './checklistItems'; diff --git a/packages/suite/src/components/suite/SecurityCheck/checklistItems.tsx b/packages/suite/src/components/suite/SecurityCheck/checklistItems.tsx index 20efc41d08e..8a102333646 100644 --- a/packages/suite/src/components/suite/SecurityCheck/checklistItems.tsx +++ b/packages/suite/src/components/suite/SecurityCheck/checklistItems.tsx @@ -1,6 +1,7 @@ -import { Translation } from '../Translation'; import { SecurityChecklistItem } from 'src/views/onboarding/steps/SecurityCheck/types'; +import { Translation } from '../Translation'; + export const hardFailureChecklistItems: SecurityChecklistItem[] = [ { icon: 'plugs', diff --git a/packages/suite/src/components/suite/Sign.tsx b/packages/suite/src/components/suite/Sign.tsx index 7e5259942fa..3355380e982 100644 --- a/packages/suite/src/components/suite/Sign.tsx +++ b/packages/suite/src/components/suite/Sign.tsx @@ -1,4 +1,5 @@ import styled, { useTheme } from 'styled-components'; + import { SignValue } from '@suite-common/suite-types'; import { isSignValuePositive } from '@suite-common/formatters'; diff --git a/packages/suite/src/components/suite/StakeAmountWrapper.tsx b/packages/suite/src/components/suite/StakeAmountWrapper.tsx index 1dcb76b5443..42637b68fdc 100644 --- a/packages/suite/src/components/suite/StakeAmountWrapper.tsx +++ b/packages/suite/src/components/suite/StakeAmountWrapper.tsx @@ -1,11 +1,15 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { Tooltip, TOOLTIP_DELAY_NONE, TOOLTIP_DELAY_NORMAL } from '@trezor/components'; import { mediaQueries } from '@trezor/styles'; -import { Translation } from './Translation'; + import { goto } from 'src/actions/suite/routerActions'; import { useDispatch } from 'src/hooks/suite'; +import { Translation } from './Translation'; + const Container = styled.div` position: relative; display: flex; diff --git a/packages/suite/src/components/suite/StakingFeature.tsx b/packages/suite/src/components/suite/StakingFeature.tsx index afc5beb2216..cc420a7713f 100644 --- a/packages/suite/src/components/suite/StakingFeature.tsx +++ b/packages/suite/src/components/suite/StakingFeature.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import { H3, Paragraph, IconCircle, IconName } from '@trezor/components'; import { spacings } from '@trezor/theme'; diff --git a/packages/suite/src/components/suite/StakingProcess/InfoRow.tsx b/packages/suite/src/components/suite/StakingProcess/InfoRow.tsx index f7e9b5c9140..6f7ecd6ff5c 100644 --- a/packages/suite/src/components/suite/StakingProcess/InfoRow.tsx +++ b/packages/suite/src/components/suite/StakingProcess/InfoRow.tsx @@ -1,4 +1,5 @@ import { Badge, Column, List, Paragraph, Row } from '@trezor/components'; + import { Subheading } from './Subheading'; import { RowContent, RowSubheading } from './types'; diff --git a/packages/suite/src/components/suite/StakingProcess/StakingInfo.tsx b/packages/suite/src/components/suite/StakingProcess/StakingInfo.tsx index c31d46c826f..6a9cc01263d 100644 --- a/packages/suite/src/components/suite/StakingProcess/StakingInfo.tsx +++ b/packages/suite/src/components/suite/StakingProcess/StakingInfo.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import { useSelector } from 'react-redux'; + import { selectAccountStakeTransactions, selectValidatorsQueue, @@ -6,12 +8,13 @@ import { StakeRootState, selectPoolStatsApyData, } from '@suite-common/wallet-core'; -import { useSelector } from 'react-redux'; + import { Translation } from 'src/components/suite'; import { getDaysToAddToPool } from 'src/utils/suite/stake'; -import { InfoRow } from './InfoRow'; import { CoinjoinRootState } from 'src/reducers/wallet/coinjoinReducer'; +import { InfoRow } from './InfoRow'; + interface StakingInfoProps { isExpanded?: boolean; } diff --git a/packages/suite/src/components/suite/StakingProcess/Subheading.tsx b/packages/suite/src/components/suite/StakingProcess/Subheading.tsx index 31890dff730..0ebca05a2b9 100644 --- a/packages/suite/src/components/suite/StakingProcess/Subheading.tsx +++ b/packages/suite/src/components/suite/StakingProcess/Subheading.tsx @@ -1,6 +1,7 @@ import { Icon, Paragraph, Row } from '@trezor/components'; -import { Translation } from '../Translation'; import { spacings } from '@trezor/theme'; + +import { Translation } from '../Translation'; import { RowSubheading } from './types'; interface SubheadingProps { diff --git a/packages/suite/src/components/suite/StakingProcess/UnstakingInfo.tsx b/packages/suite/src/components/suite/StakingProcess/UnstakingInfo.tsx index 11c9b4387ec..9b73787a541 100644 --- a/packages/suite/src/components/suite/StakingProcess/UnstakingInfo.tsx +++ b/packages/suite/src/components/suite/StakingProcess/UnstakingInfo.tsx @@ -1,16 +1,19 @@ import React from 'react'; +import { useSelector } from 'react-redux'; + import { selectAccountUnstakeTransactions, selectValidatorsQueue, TransactionsRootState, StakeRootState, } from '@suite-common/wallet-core'; + import { Translation } from 'src/components/suite'; -import { InfoRow } from './InfoRow'; -import { useSelector } from 'react-redux'; import { getDaysToUnstake } from 'src/utils/suite/stake'; import { CoinjoinRootState } from 'src/reducers/wallet/coinjoinReducer'; +import { InfoRow } from './InfoRow'; + interface UnstakingInfoProps { isExpanded?: boolean; } diff --git a/packages/suite/src/components/suite/StatusLight.tsx b/packages/suite/src/components/suite/StatusLight.tsx index 14839cb2a29..54c9fa625d1 100644 --- a/packages/suite/src/components/suite/StatusLight.tsx +++ b/packages/suite/src/components/suite/StatusLight.tsx @@ -1,6 +1,7 @@ +import styled, { DefaultTheme } from 'styled-components'; + import { UIVariant } from '@trezor/components/src/config/types'; import { CSSColor, Color } from '@trezor/theme'; -import styled, { DefaultTheme } from 'styled-components'; type StatusLightVariant = Extract; diff --git a/packages/suite/src/components/suite/Ticker/LastUpdateTooltip.tsx b/packages/suite/src/components/suite/Ticker/LastUpdateTooltip.tsx index c56391f0505..99291d926df 100644 --- a/packages/suite/src/components/suite/Ticker/LastUpdateTooltip.tsx +++ b/packages/suite/src/components/suite/Ticker/LastUpdateTooltip.tsx @@ -1,10 +1,13 @@ -import { Translation } from 'src/components/suite'; -import styled from 'styled-components'; -import { Tooltip } from '@trezor/components'; import { FormattedRelativeTime } from 'react-intl'; import { ReactNode } from 'react'; + +import styled from 'styled-components'; import { differenceInMinutes } from 'date-fns'; +import { Tooltip } from '@trezor/components'; + +import { Translation } from 'src/components/suite'; + const LastUpdate = styled.div` text-transform: none; `; diff --git a/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx b/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx index fd5c8155900..5040c22aa47 100644 --- a/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx +++ b/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx @@ -1,8 +1,12 @@ -import { Translation, TooltipSymbol } from 'src/components/suite'; import styled, { useTheme } from 'styled-components'; -import { TranslationKey } from '../Translation'; + import { typography } from '@trezor/theme'; +import { Translation, TooltipSymbol } from 'src/components/suite'; + +import { TranslationKey } from '../Translation'; + + const NoRatesMessage = styled.div` ${typography.label}; display: flex; diff --git a/packages/suite/src/components/suite/Ticker/PriceTicker.tsx b/packages/suite/src/components/suite/Ticker/PriceTicker.tsx index 50923f3755c..f53c9047d26 100644 --- a/packages/suite/src/components/suite/Ticker/PriceTicker.tsx +++ b/packages/suite/src/components/suite/Ticker/PriceTicker.tsx @@ -1,10 +1,13 @@ import styled from 'styled-components'; +import { typography } from '@trezor/theme'; +import { TokenAddress } from '@suite-common/wallet-types'; + import { FiatValue } from 'src/components/suite'; + import { NoRatesTooltip } from './NoRatesTooltip'; -import { typography } from '@trezor/theme'; import { LastUpdateTooltip } from './LastUpdateTooltip'; -import { TokenAddress } from '@suite-common/wallet-types'; + const FiatRateWrapper = styled.span` ${typography.callout} diff --git a/packages/suite/src/components/suite/Ticker/TrendTicker.tsx b/packages/suite/src/components/suite/Ticker/TrendTicker.tsx index bfdf14c0f2d..e196ff808d9 100644 --- a/packages/suite/src/components/suite/Ticker/TrendTicker.tsx +++ b/packages/suite/src/components/suite/Ticker/TrendTicker.tsx @@ -11,6 +11,7 @@ import { FiatValue } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; + import { NoRatesTooltip } from './NoRatesTooltip'; const PercentageWrapper = styled.div<{ $isRateGoingUp: boolean }>` diff --git a/packages/suite/src/components/suite/TooltipSymbol.tsx b/packages/suite/src/components/suite/TooltipSymbol.tsx index 12371c14bf1..719d2dec381 100644 --- a/packages/suite/src/components/suite/TooltipSymbol.tsx +++ b/packages/suite/src/components/suite/TooltipSymbol.tsx @@ -1,5 +1,7 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { Icon, IconName, Tooltip } from '@trezor/components'; import { CSSColor } from '@trezor/theme'; diff --git a/packages/suite/src/components/suite/TorLoader/TorLoader.tsx b/packages/suite/src/components/suite/TorLoader/TorLoader.tsx index 545451f8e42..4b12b1b1903 100644 --- a/packages/suite/src/components/suite/TorLoader/TorLoader.tsx +++ b/packages/suite/src/components/suite/TorLoader/TorLoader.tsx @@ -1,14 +1,15 @@ import { useState, useEffect, ComponentType } from 'react'; import styled from 'styled-components'; -import { TorStatus } from 'src/types/suite'; +import { Button, ModalProps } from '@trezor/components'; + +import { TorStatus } from 'src/types/suite'; import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectTorState } from 'src/reducers/suite/suiteReducer'; import { toggleTor, updateTorStatus } from 'src/actions/suite/suiteActions'; -import { Button, ModalProps } from '@trezor/components'; import { TorProgressBar } from './TorProgressBar'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/components/suite/TorLoader/TorProgressBar.tsx b/packages/suite/src/components/suite/TorLoader/TorProgressBar.tsx index 50b7ec4a0e3..179ac4b8d8f 100644 --- a/packages/suite/src/components/suite/TorLoader/TorProgressBar.tsx +++ b/packages/suite/src/components/suite/TorLoader/TorProgressBar.tsx @@ -1,9 +1,9 @@ import styled from 'styled-components'; import { Button, ProgressBar, Icon, variables } from '@trezor/components'; +import { borders } from '@trezor/theme'; import { Translation } from 'src/components/suite'; -import { borders } from '@trezor/theme'; const IconWrapper = styled.div` width: 120px; diff --git a/packages/suite/src/components/suite/TrafficLightOffset.tsx b/packages/suite/src/components/suite/TrafficLightOffset.tsx index 42e398f1a59..92f9356b0f1 100644 --- a/packages/suite/src/components/suite/TrafficLightOffset.tsx +++ b/packages/suite/src/components/suite/TrafficLightOffset.tsx @@ -1,7 +1,9 @@ -import { isDesktop, isMacOs } from '@trezor/env-utils'; import React from 'react'; + import styled from 'styled-components'; +import { isDesktop, isMacOs } from '@trezor/env-utils'; + type Props = { children?: React.ReactNode; offset?: number; diff --git a/packages/suite/src/components/suite/TrezorLink.tsx b/packages/suite/src/components/suite/TrezorLink.tsx index 5554a240efa..41bfdfa616b 100644 --- a/packages/suite/src/components/suite/TrezorLink.tsx +++ b/packages/suite/src/components/suite/TrezorLink.tsx @@ -1,4 +1,5 @@ import { Link, LinkProps } from '@trezor/components'; + import { useExternalLink } from 'src/hooks/suite'; export const TrezorLink = (props: LinkProps) => { diff --git a/packages/suite/src/components/suite/UdevDownload.tsx b/packages/suite/src/components/suite/UdevDownload.tsx index a383ad52053..b6c05a8499c 100644 --- a/packages/suite/src/components/suite/UdevDownload.tsx +++ b/packages/suite/src/components/suite/UdevDownload.tsx @@ -1,9 +1,13 @@ import { useState } from 'react'; + import styled from 'styled-components'; + import { DATA_URL, HELP_CENTER_UDEV_URL } from '@trezor/urls'; -import { Translation } from 'src/components/suite'; import { variables, Button, Select, Link, Spinner } from '@trezor/components'; + +import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; + import { LearnMoreButton } from './LearnMoreButton'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/UnstakingTxAmount.tsx b/packages/suite/src/components/suite/UnstakingTxAmount.tsx index 32652de2f5c..c84fdf0ebe0 100644 --- a/packages/suite/src/components/suite/UnstakingTxAmount.tsx +++ b/packages/suite/src/components/suite/UnstakingTxAmount.tsx @@ -1,10 +1,12 @@ import React from 'react'; + import { WalletAccountTransaction } from '@suite-common/wallet-types'; import { formatNetworkAmount, isUnstakeTx, getUnstakeAmountByEthereumDataHex, } from '@suite-common/wallet-utils'; + import { FormattedCryptoAmount } from './FormattedCryptoAmount'; interface UnstakingTxAmountProps { diff --git a/packages/suite/src/components/suite/WebUsbButton.tsx b/packages/suite/src/components/suite/WebUsbButton.tsx index 20ed0d7cf17..dd65fe3ac91 100644 --- a/packages/suite/src/components/suite/WebUsbButton.tsx +++ b/packages/suite/src/components/suite/WebUsbButton.tsx @@ -1,6 +1,7 @@ import TrezorConnect from '@trezor/connect'; import type TrezorConnectWeb from '@trezor/connect-web'; import { ButtonProps, Button, IconButton, Tooltip } from '@trezor/components'; + import { Translation, TranslationKey } from './Translation'; interface WebUsbButtonProps extends Omit { diff --git a/packages/suite/src/components/suite/WordInput.tsx b/packages/suite/src/components/suite/WordInput.tsx index c8ebdf1e69a..f842cbded50 100644 --- a/packages/suite/src/components/suite/WordInput.tsx +++ b/packages/suite/src/components/suite/WordInput.tsx @@ -1,14 +1,17 @@ import { useEffect, useRef, memo, Children, ReactElement } from 'react'; import { FixedSizeList as List } from 'react-window'; import { MenuListProps, SelectInstance, createFilter } from 'react-select'; +import { useKeyPress } from 'react-use'; + import styled from 'styled-components'; + import { Select, variables } from '@trezor/components'; import { bip39 } from '@trezor/crypto-utils'; -import { useTranslation } from 'src/hooks/suite/useTranslation'; -import { useKeyPress } from 'react-use'; import TrezorConnect, { UI } from '@trezor/connect'; import { createTimeoutPromise } from '@trezor/utils'; +import { useTranslation } from 'src/hooks/suite/useTranslation'; + const options = bip39.map(item => ({ label: item, value: item })); const SelectWrapper = styled.div` diff --git a/packages/suite/src/components/suite/WordInputAdvanced.tsx b/packages/suite/src/components/suite/WordInputAdvanced.tsx index 24b6391837b..04d249577ff 100644 --- a/packages/suite/src/components/suite/WordInputAdvanced.tsx +++ b/packages/suite/src/components/suite/WordInputAdvanced.tsx @@ -1,11 +1,14 @@ import { useEffect, useCallback } from 'react'; + import styled from 'styled-components'; + import { HELP_CENTER_ADVANCED_RECOVERY_URL } from '@trezor/urls'; import { Button, PinButton, KEYBOARD_CODE } from '@trezor/components'; -import { Translation, TrezorLink, DeviceMatrixExplanation } from 'src/components/suite'; import { createTimeoutPromise } from '@trezor/utils'; import TrezorConnect, { DeviceModelInternal, UI } from '@trezor/connect'; +import { Translation, TrezorLink, DeviceMatrixExplanation } from 'src/components/suite'; + const Wrapper = styled.div` display: flex; height: 100%; diff --git a/packages/suite/src/components/suite/__tests__/NumberInput.test.tsx b/packages/suite/src/components/suite/__tests__/NumberInput.test.tsx index 949e4831435..0c8870d3a76 100644 --- a/packages/suite/src/components/suite/__tests__/NumberInput.test.tsx +++ b/packages/suite/src/components/suite/__tests__/NumberInput.test.tsx @@ -1,12 +1,16 @@ -import { render } from '@testing-library/react'; import { Provider } from 'react-redux'; +import { useForm } from 'react-hook-form'; + +import { render } from '@testing-library/react'; import { Store } from 'redux'; import userEvent from '@testing-library/user-event'; -import { useForm } from 'react-hook-form'; -import suiteReducer, { SuiteState } from 'src/reducers/suite/suiteReducer'; + import { configureMockStore } from '@suite-common/test-utils'; + +import suiteReducer, { SuiteState } from 'src/reducers/suite/suiteReducer'; import { ThemeProvider } from 'src/support/suite/ThemeProvider'; import { Locale } from 'src/config/suite/languages'; + import { NumberInput } from '../NumberInput'; const onChangeMock = jest.fn(); diff --git a/packages/suite/src/components/suite/__tests__/Translation.test.tsx b/packages/suite/src/components/suite/__tests__/Translation.test.tsx index ebb796060ee..a10da772870 100644 --- a/packages/suite/src/components/suite/__tests__/Translation.test.tsx +++ b/packages/suite/src/components/suite/__tests__/Translation.test.tsx @@ -1,4 +1,5 @@ import createComponentWithIntl from 'src/support/tests/IntlHelper'; + import { Translation } from '../Translation'; const messages = { diff --git a/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx b/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx index b65a2b8e7c8..cc5243143a8 100644 --- a/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx +++ b/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx @@ -1,12 +1,14 @@ import { useMemo } from 'react'; -import { goto } from 'src/actions/suite/routerActions'; + import { messageSystemActions } from '@suite-common/message-system'; import { Message } from '@suite-common/suite-types'; +import { Row, Banner as WarningComponent, Banner } from '@trezor/components'; + +import { goto } from 'src/actions/suite/routerActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { getTorUrlIfAvailable } from 'src/utils/suite/tor'; - import { selectLanguage, selectTorState } from 'src/reducers/suite/suiteReducer'; -import { Row, Banner as WarningComponent, Banner } from '@trezor/components'; + type MessageSystemBannerProps = { message: Message; diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/FailedBackupBanner.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/FailedBackupBanner.tsx index e4b54e044d7..371ee225593 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/FailedBackupBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/FailedBackupBanner.tsx @@ -1,7 +1,8 @@ +import { Banner } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { goto } from 'src/actions/suite/routerActions'; import { useDispatch } from 'src/hooks/suite'; -import { Banner } from '@trezor/components'; import { SettingsAnchor } from 'src/constants/suite/anchors'; export const FailedBackup = () => { diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/FirmwareHashMismatchBanner.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/FirmwareHashMismatchBanner.tsx index 117cb026534..66f1cf3712b 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/FirmwareHashMismatchBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/FirmwareHashMismatchBanner.tsx @@ -1,6 +1,7 @@ -import { Translation } from 'src/components/suite'; import { Banner } from '@trezor/components'; +import { Translation } from 'src/components/suite'; + export const FirmwareHashMismatch = () => ( diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/NoBackupBanner.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/NoBackupBanner.tsx index d1e4f325069..7057c4f5eb2 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/NoBackupBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/NoBackupBanner.tsx @@ -1,7 +1,8 @@ +import { Banner } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { goto } from 'src/actions/suite/routerActions'; import { useDispatch, useTranslation } from 'src/hooks/suite'; -import { Banner } from '@trezor/components'; export const NoBackup = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/NoConnectionBanner.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/NoConnectionBanner.tsx index 1ec6e9209f6..541f23983a0 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/NoConnectionBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/NoConnectionBanner.tsx @@ -1,6 +1,7 @@ -import { Translation } from 'src/components/suite'; import { Banner } from '@trezor/components'; +import { Translation } from 'src/components/suite'; + export const NoConnectionBanner = () => ( diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/SafetyChecksBanner.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/SafetyChecksBanner.tsx index 26be76c1aad..9fdaebd1d5b 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/SafetyChecksBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/SafetyChecksBanner.tsx @@ -1,8 +1,9 @@ +import { Row, Banner as WarningComponent, Banner } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { Row, Banner as WarningComponent, Banner } from '@trezor/components'; interface SafetyChecksBannerProps { onDismiss?: () => void; diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/SuiteBanners.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/SuiteBanners.tsx index 149799e33e3..f69a07db1b4 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/SuiteBanners.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/SuiteBanners.tsx @@ -1,4 +1,5 @@ import { useState, useEffect } from 'react'; + import styled from 'styled-components'; import { selectBannerMessage } from '@suite-common/message-system'; @@ -15,6 +16,7 @@ import { selectFirmwareHashCheckError, selectFirmwareRevisionCheckError, } from 'src/reducers/suite/suiteReducer'; + import { MessageSystemBanner } from '../MessageSystemBanner'; import { NoConnectionBanner } from './NoConnectionBanner'; import { UpdateBridge } from './UpdateBridgeBanner'; diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/TranslationModeBanner.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/TranslationModeBanner.tsx index 4f25737742b..ddd44771981 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/TranslationModeBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/TranslationModeBanner.tsx @@ -1,6 +1,7 @@ -import { setTranslationMode } from 'src/utils/suite/l10n'; import { Banner } from '@trezor/components'; +import { setTranslationMode } from 'src/utils/suite/l10n'; + export const TranslationMode = () => ( { const dispatch = useDispatch(); diff --git a/packages/suite/src/components/suite/graph/GraphRangeSelector.tsx b/packages/suite/src/components/suite/graph/GraphRangeSelector.tsx index 20a7ac78388..5847a244763 100644 --- a/packages/suite/src/components/suite/graph/GraphRangeSelector.tsx +++ b/packages/suite/src/components/suite/graph/GraphRangeSelector.tsx @@ -1,8 +1,6 @@ import { useState, useRef } from 'react'; import styled, { css } from 'styled-components'; -import { Translation } from 'src/components/suite'; -import { useGraph, useLocales } from 'src/hooks/suite'; import { startOfDay, startOfToday, @@ -14,6 +12,9 @@ import { } from 'date-fns'; import { variables, Dropdown, DropdownRef, Timerange, intermediaryTheme } from '@trezor/components'; + +import { Translation } from 'src/components/suite'; +import { useGraph, useLocales } from 'src/hooks/suite'; import { GraphRange } from 'src/types/wallet/graph'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/graph/GraphScaleDropdownItem.tsx b/packages/suite/src/components/suite/graph/GraphScaleDropdownItem.tsx index 11a62d8cf4a..b387f43993c 100644 --- a/packages/suite/src/components/suite/graph/GraphScaleDropdownItem.tsx +++ b/packages/suite/src/components/suite/graph/GraphScaleDropdownItem.tsx @@ -1,7 +1,7 @@ +import { SelectBar, SelectBarProps } from '@trezor/components'; + import { useGraph } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; - -import { SelectBar, SelectBarProps } from '@trezor/components'; import { GraphScale } from 'src/types/wallet/graph'; export const GraphScaleDropdownItem = (props: Omit, 'options'>) => { diff --git a/packages/suite/src/components/suite/graph/GraphSkeleton.tsx b/packages/suite/src/components/suite/graph/GraphSkeleton.tsx index d1f75832d28..c03a2614397 100644 --- a/packages/suite/src/components/suite/graph/GraphSkeleton.tsx +++ b/packages/suite/src/components/suite/graph/GraphSkeleton.tsx @@ -1,4 +1,5 @@ import { ComponentProps } from 'react'; + import styled from 'styled-components'; import { SkeletonRectangle, SkeletonSpread, SkeletonStack, variables } from '@trezor/components'; diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx index 7c120192182..bf97271f1ff 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx @@ -1,14 +1,16 @@ import styled from 'styled-components'; import { TooltipProps } from 'recharts'; -import { FormattedCryptoAmount } from 'src/components/suite/FormattedCryptoAmount'; -import { NetworkSymbol } from '@suite-common/wallet-config'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { Formatters, useFormatters } from '@suite-common/formatters'; +import { SignOperator } from '@suite-common/suite-types'; + +import { FormattedCryptoAmount } from 'src/components/suite/FormattedCryptoAmount'; +import { CommonAggregatedHistory, GraphRange } from 'src/types/wallet/graph'; import type { CryptoGraphProps } from './TransactionsGraph'; import { GraphTooltipBase } from './GraphTooltipBase'; -import { CommonAggregatedHistory, GraphRange } from 'src/types/wallet/graph'; -import { SignOperator } from '@suite-common/suite-types'; + const StyledCryptoAmount = styled(FormattedCryptoAmount)` margin-right: 2px; diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipBase.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipBase.tsx index 7ddf7779e04..88837f7daa9 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipBase.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipBase.tsx @@ -1,4 +1,5 @@ import { useEffect } from 'react'; + import styled from 'styled-components'; import { TooltipProps } from 'recharts'; diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphXAxisTick.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphXAxisTick.tsx index 93912bde74c..f59e6d2e6d6 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphXAxisTick.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphXAxisTick.tsx @@ -1,7 +1,8 @@ -import { useTheme } from 'styled-components'; import { FormattedDate } from 'react-intl'; +import { useTheme } from 'styled-components'; import { differenceInMonths } from 'date-fns'; + import { GraphRange } from 'src/types/wallet/graph'; const getFormattedDate = (range: GraphRange, date: Date) => { diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx index b56a28949da..2279b12993c 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx @@ -1,9 +1,13 @@ -import { useTheme } from 'styled-components'; import { useRef, useLayoutEffect } from 'react'; -import { FormattedCryptoAmount } from 'src/components/suite'; + +import { useTheme } from 'styled-components'; + + import { useFormatters } from '@suite-common/formatters'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import { FormattedCryptoAmount } from 'src/components/suite'; + interface CommonProps { setWidth: (n: number) => void; [k: string]: any; diff --git a/packages/suite/src/components/suite/labeling/AccountLabeling.tsx b/packages/suite/src/components/suite/labeling/AccountLabeling.tsx index 7b34b083045..568bbe84984 100644 --- a/packages/suite/src/components/suite/labeling/AccountLabeling.tsx +++ b/packages/suite/src/components/suite/labeling/AccountLabeling.tsx @@ -1,6 +1,7 @@ import { findAccountDevice } from '@suite-common/wallet-utils'; import { isSelectedDevice } from '@suite-common/suite-utils'; import { selectDevices, selectDevice } from '@suite-common/wallet-core'; +import { BadgeProps } from '@trezor/components'; import { AccountLabel } from 'src/components/suite'; import { Account as WalletAccount } from 'src/types/wallet'; @@ -8,7 +9,6 @@ import { useSelector } from 'src/hooks/suite'; import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; import { WalletLabeling } from './WalletLabeling'; -import { BadgeProps } from '@trezor/components'; interface AccountProps { account: WalletAccount | WalletAccount[]; diff --git a/packages/suite/src/components/suite/labeling/AddressLabeling.tsx b/packages/suite/src/components/suite/labeling/AddressLabeling.tsx index 66160ef5cdc..00995d8a25d 100644 --- a/packages/suite/src/components/suite/labeling/AddressLabeling.tsx +++ b/packages/suite/src/components/suite/labeling/AddressLabeling.tsx @@ -1,7 +1,9 @@ import { findAccountsByAddress } from '@suite-common/wallet-utils'; +import { NetworkSymbol } from '@suite-common/wallet-config'; + import { useSelector } from 'src/hooks/suite'; + import { AccountLabeling } from './AccountLabeling'; -import { NetworkSymbol } from '@suite-common/wallet-config'; type AddressLabelingProps = { networkSymbol: NetworkSymbol; diff --git a/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx b/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx index 5206f5e1068..65e2a6f8561 100644 --- a/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx +++ b/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx @@ -1,21 +1,25 @@ import { useEffect, useState, useMemo, useRef } from 'react'; + import styled from 'styled-components'; import { Button, DropdownMenuItemProps, Row } from '@trezor/components'; +import type { Timeout } from '@trezor/type-utils'; +import { StaticSessionId } from '@trezor/connect'; + import { useDiscovery, useDispatch, useSelector } from 'src/hooks/suite'; import { addMetadata, init, setEditing } from 'src/actions/suite/metadataLabelingActions'; import { MetadataAddPayload } from 'src/types/suite/metadata'; import { Translation } from 'src/components/suite'; -import { Props, ExtendedProps } from './definitions'; -import { withEditable } from './withEditable'; -import { withDropdown } from './withDropdown'; import { selectIsLabelingAvailableForEntity, selectIsLabelingInitPossible, } from 'src/reducers/suite/metadataReducer'; -import type { Timeout } from '@trezor/type-utils'; + +import { Props, ExtendedProps } from './definitions'; +import { withEditable } from './withEditable'; +import { withDropdown } from './withDropdown'; import { AccountTypeBadge } from '../../AccountTypeBadge'; -import { StaticSessionId } from '@trezor/connect'; + const LabelValue = styled.div` overflow: hidden; diff --git a/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts b/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts index 6991ffdd152..a01776c289b 100644 --- a/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts +++ b/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts @@ -1,8 +1,10 @@ import { ReactNode } from 'react'; + import { DropdownMenuItemProps } from '@trezor/components'; -import { MetadataAddPayload } from 'src/types/suite/metadata'; import { AccountType, Bip43Path, NetworkType } from '@suite-common/wallet-config'; +import { MetadataAddPayload } from 'src/types/suite/metadata'; + export interface Props { accountType?: AccountType; networkType?: NetworkType; diff --git a/packages/suite/src/components/suite/labeling/MetadataLabeling/withDropdown.tsx b/packages/suite/src/components/suite/labeling/MetadataLabeling/withDropdown.tsx index 2b55c810a50..105f203d17e 100644 --- a/packages/suite/src/components/suite/labeling/MetadataLabeling/withDropdown.tsx +++ b/packages/suite/src/components/suite/labeling/MetadataLabeling/withDropdown.tsx @@ -1,10 +1,12 @@ import { FC } from 'react'; + import styled from 'styled-components'; import { Dropdown } from '@trezor/components'; -import { ExtendedProps } from './definitions'; import { RequiredKey } from '@trezor/type-utils'; +import { ExtendedProps } from './definitions'; + // eslint-disable-next-line local-rules/no-override-ds-component const StyledDropdown = styled(Dropdown)` display: flex; diff --git a/packages/suite/src/components/suite/labeling/MetadataLabeling/withEditable.tsx b/packages/suite/src/components/suite/labeling/MetadataLabeling/withEditable.tsx index afd3e8e8607..e7752c8bbee 100644 --- a/packages/suite/src/components/suite/labeling/MetadataLabeling/withEditable.tsx +++ b/packages/suite/src/components/suite/labeling/MetadataLabeling/withEditable.tsx @@ -8,6 +8,7 @@ import { } from 'react'; import styled, { useTheme } from 'styled-components'; + import { Icon } from '@trezor/components'; import { AutoScalingInput } from '@trezor/components/src/components/AutoScalingInput/AutoScalingInput'; diff --git a/packages/suite/src/components/suite/labeling/WalletLabeling.tsx b/packages/suite/src/components/suite/labeling/WalletLabeling.tsx index 5c477995b88..f0a34b5dd60 100644 --- a/packages/suite/src/components/suite/labeling/WalletLabeling.tsx +++ b/packages/suite/src/components/suite/labeling/WalletLabeling.tsx @@ -1,10 +1,14 @@ +import { useCallback } from 'react'; + +import styled from 'styled-components'; + +import { selectDeviceLabelOrName } from '@suite-common/wallet-core'; + import { TrezorDevice } from 'src/types/suite'; import { useTranslation } from 'src/hooks/suite/useTranslation'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer'; -import { useCallback } from 'react'; -import styled from 'styled-components'; -import { selectDeviceLabelOrName } from '@suite-common/wallet-core'; + interface WalletLabellingProps { device: TrezorDevice; diff --git a/packages/suite/src/components/suite/layouts/LoggedOutLayout.tsx b/packages/suite/src/components/suite/layouts/LoggedOutLayout.tsx index 9f7e51c1ee5..0a84a0979cd 100644 --- a/packages/suite/src/components/suite/layouts/LoggedOutLayout.tsx +++ b/packages/suite/src/components/suite/layouts/LoggedOutLayout.tsx @@ -1,10 +1,14 @@ import { ReactNode, useRef, useState } from 'react'; + +import { ElevationContext, ElevationUp } from '@trezor/components'; + import { LayoutContext, LayoutContextPayload } from 'src/support/suite/LayoutContext'; import { ModalContextProvider } from 'src/support/suite/ModalContext'; import { useResetScrollOnUrl } from 'src/hooks/suite/useResetScrollOnUrl'; import { GuideButton, GuideRouter } from 'src/components/guide'; import { useLayoutSize } from 'src/hooks/suite'; import { useClearAnchorHighlightOnClick } from 'src/hooks/suite/useClearAnchorHighlightOnClick'; + import { Metadata } from '../Metadata'; import { ModalSwitcher } from '../modals/ModalSwitcher/ModalSwitcher'; import { @@ -15,7 +19,6 @@ import { PageWrapper, Wrapper, } from './SuiteLayout/SuiteLayout'; -import { ElevationContext, ElevationUp } from '@trezor/components'; import { TrafficLightOffset } from '../TrafficLightOffset'; interface LoggedOutLayout { diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/CoinjoinBars/CoinjoinBars.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/CoinjoinBars/CoinjoinBars.tsx index c461eaadff8..2707a1c6e55 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/CoinjoinBars/CoinjoinBars.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/CoinjoinBars/CoinjoinBars.tsx @@ -1,7 +1,9 @@ import { useMemo } from 'react'; -import { CoinjoinStatusBar } from './CoinjoinStatusBar'; + import { useSelector } from 'src/hooks/suite'; +import { CoinjoinStatusBar } from './CoinjoinStatusBar'; + export const CoinjoinBars = () => { const coinjoinAccounts = useSelector(state => state.wallet.coinjoin.accounts); diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx index dc4886b62e1..fe9a5518180 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx @@ -1,15 +1,20 @@ import { useState, useEffect, useRef } from 'react'; + import styled, { css } from 'styled-components'; + import { selectDevicesCount, selectDevice } from '@suite-common/wallet-core'; import type { Timeout } from '@trezor/type-utils'; +import { borders, spacingsPx } from '@trezor/theme'; +import { focusStyleTransition, getFocusShadowStyle } from '@trezor/components/src/utils/utils'; +import { Icon } from '@trezor/components'; + import { SHAKE } from 'src/support/suite/styles/animations'; import { goto } from 'src/actions/suite/routerActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { borders, spacingsPx } from '@trezor/theme'; -import { focusStyleTransition, getFocusShadowStyle } from '@trezor/components/src/utils/utils'; -import { SidebarDeviceStatus } from './SidebarDeviceStatus'; import { ViewOnlyTooltip } from 'src/views/view-only/ViewOnlyTooltip'; -import { Icon } from '@trezor/components'; + +import { SidebarDeviceStatus } from './SidebarDeviceStatus'; + const CaretContainer = styled.div` background: transparent; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceStatus.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceStatus.tsx index 8c0b32d5bef..ff6618ce9b5 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceStatus.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceStatus.tsx @@ -1,14 +1,16 @@ +import { MouseEventHandler } from 'react'; + import styled from 'styled-components'; import { DeviceModelInternal } from '@trezor/connect'; -import { DeviceDetail } from 'src/views/suite/SwitchDevice/DeviceItem/DeviceDetail'; -import { MouseEventHandler } from 'react'; -import { TrezorDevice } from 'src/types/suite'; import { spacings } from '@trezor/theme'; import { Row } from '@trezor/components'; import { RotateDeviceImage } from '@trezor/product-components'; -import { DeviceStatusText } from 'src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText'; import { selectDeviceLabelOrNameById } from '@suite-common/wallet-core'; + +import { DeviceStatusText } from 'src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText'; +import { TrezorDevice } from 'src/types/suite'; +import { DeviceDetail } from 'src/views/suite/SwitchDevice/DeviceItem/DeviceDetail'; import { useSelector } from 'src/hooks/suite'; type DeviceStatusProps = { diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/SidebarDeviceStatus.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/SidebarDeviceStatus.tsx index ef6b70e100c..99e28147351 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/SidebarDeviceStatus.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/SidebarDeviceStatus.tsx @@ -1,7 +1,10 @@ import { MouseEventHandler } from 'react'; + import { acquireDevice, selectDevice, selectDevices } from '@suite-common/wallet-core'; import * as deviceUtils from '@suite-common/suite-utils'; + import { TrezorDevice } from 'src/types/suite'; + import { useDispatch, useSelector } from '../../../../../hooks/suite'; import { DeviceStatus } from './DeviceStatus'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileActionItem.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileActionItem.tsx index e8e917b5a9f..e412e0bae12 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileActionItem.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileActionItem.tsx @@ -1,5 +1,7 @@ import { useMemo, ReactNode, HTMLAttributes } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { Icon, IconName, variables } from '@trezor/components'; import { FADE_IN } from '@trezor/components/src/config/animations'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenu.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenu.tsx index d909a14b102..22d31307d99 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenu.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenu.tsx @@ -1,8 +1,10 @@ import { useState } from 'react'; + import styled, { useTheme } from 'styled-components'; import { zIndices } from '@trezor/theme'; import { Icon, variables } from '@trezor/components'; + import { DeviceSelector } from '../DeviceSelector/DeviceSelector'; import { MobileNavigation } from './MobileNavigation'; import { MobileMenuActions } from './MobileMenuActions'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenuActions.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenuActions.tsx index 74779218350..f0397fae8c0 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenuActions.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenuActions.tsx @@ -10,10 +10,10 @@ import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { useGuide } from 'src/hooks/guide/useGuide'; import { selectIsDiscreteModeActive } from 'src/reducers/wallet/settingsReducer'; +import { selectRouteName } from 'src/reducers/suite/routerReducer'; import { MobileActionItem } from './MobileActionItem'; import { useEnabledBackends } from '../utils'; -import { selectRouteName } from 'src/reducers/suite/routerReducer'; const MobileWrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx index 9e258fb9aec..0cab65a72a5 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx @@ -1,13 +1,15 @@ import { transparentize } from 'polished'; import styled, { css } from 'styled-components'; -import { findRouteByName } from 'src/utils/suite/router'; import { variables } from '@trezor/components'; +import { typography } from '@trezor/theme'; + +import { findRouteByName } from 'src/utils/suite/router'; import { HoverAnimation, Translation } from 'src/components/suite'; import { MAIN_MENU_ITEMS } from 'src/constants/suite/menu'; import { useAccountSearch, useSelector, useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; -import { typography } from '@trezor/theme'; + interface ComponentProps { isActive: boolean; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActionButton.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActionButton.tsx index 0edda90bf7e..40473d1228b 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActionButton.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActionButton.tsx @@ -1,4 +1,5 @@ import { Button, ButtonProps, IconButton, IconButtonProps } from '@trezor/components'; + import { useSelector } from 'src/hooks/suite'; export const HeaderActionButton = ({ diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActions.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActions.tsx index 0d048bcb728..e10ba724bba 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActions.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActions.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; + import { EventType, analytics } from '@trezor/suite-analytics'; import { ButtonGroup, Dropdown, DropdownMenuItemProps, IconName } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; import { hasNetworkFeatures } from '@suite-common/wallet-utils'; + import { WalletParams } from 'src/types/wallet'; import { Translation } from 'src/components/suite/Translation'; import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageHeader.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageHeader.tsx index 87d9bbf5d88..ed17cffffd1 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageHeader.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageHeader.tsx @@ -1,14 +1,17 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; import { Route } from '@suite-common/suite-types'; import { spacingsPx, zIndices } from '@trezor/theme'; + import { useSelector } from 'src/hooks/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { selectIsAccountTabPage, selectRouteName } from 'src/reducers/suite/routerReducer'; +import { TradeActions } from 'src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions'; + import { HeaderActions } from './HeaderActions'; import { PageName } from './PageNames/PageName'; -import { TradeActions } from 'src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions'; const HEADER_HEIGHT = 64; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountDetails.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountDetails.tsx index 522d1cf85da..bcd487fa5b0 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountDetails.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountDetails.tsx @@ -1,8 +1,13 @@ import { useState, useEffect } from 'react'; + import styled, { keyframes } from 'styled-components'; + import { Account } from '@suite-common/wallet-types'; import { spacingsPx, zIndices, typography } from '@trezor/theme'; import { H2 } from '@trezor/components'; +import { CoinLogo } from '@trezor/product-components'; +import { isTestnet } from '@suite-common/wallet-utils'; + import { MetadataLabeling, AccountLabel, @@ -12,8 +17,6 @@ import { } from 'src/components/suite'; import { useDefaultAccountLabel, useSelector } from 'src/hooks/suite'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; -import { CoinLogo } from '@trezor/product-components'; -import { isTestnet } from '@suite-common/wallet-utils'; const rotateIn = keyframes` from { diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountName.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountName.tsx index c81529afaa9..bea86202091 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountName.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountName.tsx @@ -1,7 +1,10 @@ import { useEffect, useState } from 'react'; + import { spacings } from '@trezor/theme'; import { Account } from '@suite-common/wallet-types'; + import { ACCOUNT_INFO_HEIGHT } from 'src/components/wallet/WalletLayout/AccountTopPanel/AccountTopPanel'; + import { AccountDetails } from './AccountDetails'; import { SCROLL_WRAPPER_ID } from '../../../SuiteLayout'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountSubpageName.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountSubpageName.tsx index 1454512628a..57b82b335ba 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountSubpageName.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/AccountName/AccountSubpageName.tsx @@ -1,11 +1,14 @@ import styled from 'styled-components'; + import { IconButton } from '@trezor/components'; import { Account } from '@suite-common/wallet-types'; import { spacingsPx } from '@trezor/theme'; +import { Route } from '@suite-common/suite-types'; + import { useDispatch } from 'src/hooks/suite'; -import { AccountDetails } from './AccountDetails'; import { goto } from 'src/actions/suite/routerActions'; -import { Route } from '@suite-common/suite-types'; + +import { AccountDetails } from './AccountDetails'; const Container = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/BasicName.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/BasicName.tsx index 38af0ff431c..15b93699918 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/BasicName.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/BasicName.tsx @@ -1,6 +1,8 @@ import styled from 'styled-components'; + import { H2 } from '@trezor/components'; import { TranslationKey } from '@suite-common/intl-types'; + import { Translation } from 'src/components/suite'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/PageName.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/PageName.tsx index fb49d8a5add..d1d60c89f99 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/PageName.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/PageName.tsx @@ -1,4 +1,5 @@ import { Route } from '@suite-common/suite-types'; + import { useSelector } from 'src/hooks/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { selectIsAccountTabPage } from 'src/reducers/suite/routerReducer'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/SettingsName.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/SettingsName.tsx index 5fdcb1d4915..6a9cc4d8825 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/SettingsName.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/SettingsName.tsx @@ -1,13 +1,17 @@ import { useState } from 'react'; + import styled from 'styled-components'; + import { desktopApi } from '@trezor/suite-desktop-api'; import { IconButton } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; + import { setDebugMode } from 'src/actions/suite/suiteActions'; import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsDebugModeActive, selectIsLoggedOut } from 'src/reducers/suite/suiteReducer'; import { goto } from 'src/actions/suite/routerActions'; + import { HeaderHeading } from './BasicName'; const Container = styled.div` diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions.tsx index bf59b18ec62..aedea0a871f 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions.tsx @@ -1,15 +1,17 @@ +import styled, { css } from 'styled-components'; + import { Row, variables } from '@trezor/components'; import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; import { analytics, EventType } from '@trezor/suite-analytics'; +import { selectDevice } from '@suite-common/wallet-core'; +import { spacings } from '@trezor/theme'; +import { SelectedAccountStatus } from '@suite-common/wallet-types'; + import { goto } from 'src/actions/suite/routerActions'; import { AppNavigationTooltip } from 'src/components/suite/AppNavigation/AppNavigationTooltip'; import { Translation } from 'src/components/suite/Translation'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import styled, { css } from 'styled-components'; import { HeaderActionButton } from 'src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActionButton'; -import { selectDevice } from '@suite-common/wallet-core'; -import { spacings } from '@trezor/theme'; -import { SelectedAccountStatus } from '@suite-common/wallet-types'; import { selectIsAccountTabPage, selectRouteName } from 'src/reducers/suite/routerReducer'; // instant without computing the layout diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Navigation.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Navigation.tsx index dc81baea00d..9c6bcde8168 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Navigation.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Navigation.tsx @@ -1,11 +1,15 @@ import { FC } from 'react'; + import styled from 'styled-components'; + import { spacingsPx } from '@trezor/theme'; -import { NavigationItem, NavigationItemProps } from './NavigationItem'; -import { NotificationDropdown } from './NotificationDropdown'; + import { useSelector } from 'src/hooks/suite'; import { selectHasExperimentalFeature } from 'src/reducers/suite/suiteReducer'; +import { NavigationItem, NavigationItemProps } from './NavigationItem'; +import { NotificationDropdown } from './NotificationDropdown'; + const Nav = styled.nav` display: flex; flex-direction: column; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx index f532de1306b..39c0302b74b 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx @@ -1,3 +1,5 @@ +import { MouseEvent } from 'react'; + import styled, { css, useTheme } from 'styled-components'; import { ExtendedMessageDescriptor, TranslationKey } from '@suite-common/intl-types'; @@ -9,13 +11,14 @@ import { TypographyStyle, } from '@trezor/theme'; import { getFocusShadowStyle } from '@trezor/components/src/utils/utils'; -import { Translation } from 'src/components/suite/Translation'; import { Route } from '@suite-common/suite-types'; +import { Icon, IconName, IconSize, useElevation, Paragraph } from '@trezor/components'; + +import { Translation } from 'src/components/suite/Translation'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; -import { MouseEvent } from 'react'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; -import { Icon, IconName, IconSize, useElevation, Paragraph } from '@trezor/components'; + export const NavigationItemBase = styled.div.attrs(() => ({ tabIndex: 0, diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NotificationDropdown.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NotificationDropdown.tsx index bbf2988d770..97b5b75f7b3 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NotificationDropdown.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NotificationDropdown.tsx @@ -1,11 +1,15 @@ import { useRef, useCallback } from 'react'; + import styled, { css } from 'styled-components'; + import { breakpointMediaQueries } from '@trezor/styles'; import { DropdownRef, Dropdown } from '@trezor/components'; import { analytics, EventType } from '@trezor/suite-analytics'; import { notificationsActions } from '@suite-common/toast-notifications'; + import { Notifications } from 'src/components/suite/notifications'; import { useDispatch } from 'src/hooks/suite'; + import { NavigationItem, NavigationItemProps } from './NavigationItem'; const NotificationsWrapper = styled.div` diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/CustomBackend.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/CustomBackend.tsx index a7bdcd5cbd2..9dec46e258d 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/CustomBackend.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/CustomBackend.tsx @@ -1,7 +1,9 @@ import { useTheme } from 'styled-components'; + +import { ComponentWithSubIcon, Icon, iconSizes } from '@trezor/components'; + import { useTranslation } from '../../../../../../hooks/suite'; import { useEnabledBackends } from '../../utils'; -import { ComponentWithSubIcon, Icon, iconSizes } from '@trezor/components'; import { NavBackends } from './NavBackends'; import { QuickActionButton } from './QuickActionButton'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/DebugAndExperimental.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/DebugAndExperimental.tsx index 6847a110e05..d9715a6e11a 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/DebugAndExperimental.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/DebugAndExperimental.tsx @@ -1,11 +1,14 @@ +import styled from 'styled-components'; + import { Column, getIconSize, Icon, iconSizes } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; + import { QuickActionButton } from './QuickActionButton'; -import styled from 'styled-components'; import { TooltipRow } from './TooltipRow'; -import { spacings } from '@trezor/theme'; import { Translation } from '../../../../Translation'; type DebugAndExperimentalTooltipProps = { diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/HideBalances.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/HideBalances.tsx index 721e1e08032..923b9d115e3 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/HideBalances.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/HideBalances.tsx @@ -1,4 +1,5 @@ import { Icon, iconSizes } from '@trezor/components'; + import { setDiscreetMode } from '../../../../../../actions/settings/walletSettingsActions'; import { useDispatch, useSelector, useTranslation } from '../../../../../../hooks/suite'; import { selectIsDiscreteModeActive } from '../../../../../../reducers/wallet/settingsReducer'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/NavBackends.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/NavBackends.tsx index 827f2bf538f..1233bb57198 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/NavBackends.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/NavBackends.tsx @@ -1,15 +1,18 @@ import React, { ReactNode, useRef, useState } from 'react'; + import styled from 'styled-components'; import { Dropdown, DropdownRef } from '@trezor/components'; +import { BlockchainState } from '@suite-common/wallet-core'; +import { spacingsPx, typography } from '@trezor/theme'; +import { CoinLogo } from '@trezor/product-components'; + import { Translation, StatusLight } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; -import { BlockchainState } from '@suite-common/wallet-core'; import type { CustomBackend } from 'src/types/wallet'; import { openModal } from 'src/actions/suite/modalActions'; -import { spacingsPx, typography } from '@trezor/theme'; -import { CoinLogo } from '@trezor/product-components'; + // eslint-disable-next-line local-rules/no-override-ds-component const StyledDropdown = styled(Dropdown)` diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/QuickActionButton.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/QuickActionButton.tsx index 68ada7d9318..5ee6b62005a 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/QuickActionButton.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/QuickActionButton.tsx @@ -1,7 +1,9 @@ import React, { ReactNode } from 'react'; -import { Tooltip } from '@trezor/components'; + import styled from 'styled-components'; +import { Tooltip } from '@trezor/components'; + const Container = styled.div` height: 44px; flex: 1; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/QuickActions.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/QuickActions.tsx index 9684cf39040..687faf8847c 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/QuickActions.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/QuickActions.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { spacingsPx } from '@trezor/theme'; import { Tor } from './Tor'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/TooltipRow.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/TooltipRow.tsx index aeafeca1484..0d0ced88f10 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/TooltipRow.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/TooltipRow.tsx @@ -1,4 +1,7 @@ +import { ReactNode } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { Column, Row, @@ -9,7 +12,6 @@ import { IconVariant, IconName, } from '@trezor/components'; -import { ReactNode } from 'react'; import { borders, spacings, spacingsPx } from '@trezor/theme'; type IconCircleWrapperProps = { diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Tor.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Tor.tsx index 113b4e2f2fa..240147c0351 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Tor.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Tor.tsx @@ -1,7 +1,5 @@ -import { goto } from 'src/actions/suite/routerActions'; -import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { selectTorState } from '../../../../../../reducers/suite/suiteReducer'; +import { useTheme } from 'styled-components'; + import { isDesktop } from '@trezor/env-utils'; import { Column, @@ -11,10 +9,15 @@ import { iconSizes, IconVariant, } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + +import { goto } from 'src/actions/suite/routerActions'; +import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { TorStatus } from 'src/types/suite'; -import { useTheme } from 'styled-components'; + +import { selectTorState } from '../../../../../../reducers/suite/suiteReducer'; import { QuickActionButton } from './QuickActionButton'; -import { spacings } from '@trezor/theme'; import { TooltipRow } from './TooltipRow'; import { Translation, TranslationKey } from '../../../../Translation'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateIconGroup.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateIconGroup.tsx index 1d639468b24..f57fe1054c0 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateIconGroup.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateIconGroup.tsx @@ -1,5 +1,7 @@ -import { spacingsPx } from '@trezor/theme'; import styled, { css } from 'styled-components'; + +import { spacingsPx } from '@trezor/theme'; + import { mapVariantToIconBackground, UpdateVariant } from './updateQuickActionTypes'; type UpdateIconGroupProps = { diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateNotificationBanner.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateNotificationBanner.tsx index f42295dfabe..8436a0e8323 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateNotificationBanner.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateNotificationBanner.tsx @@ -1,6 +1,10 @@ +import { MouseEvent } from 'react'; + import styled from 'styled-components'; + import { Column, ElevationContext, Icon, Row, Text } from '@trezor/components'; import { borders, Elevation, mapElevationToBackground, spacingsPx } from '@trezor/theme'; + import { UpdateStatus, UpdateStatusSuite, @@ -10,7 +14,6 @@ import { } from './updateQuickActionTypes'; import { Translation, TranslationKey } from '../../../../../Translation'; import { useDispatch } from '../../../../../../../hooks/suite'; -import { MouseEvent } from 'react'; type ContainerProps = { $elevation: Elevation }; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateStatusActionBarIcon.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateStatusActionBarIcon.tsx index fb53e397bac..b4889bfa6ca 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateStatusActionBarIcon.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateStatusActionBarIcon.tsx @@ -1,9 +1,15 @@ +import { useDispatch } from 'react-redux'; + import styled, { css, DefaultTheme, useTheme } from 'styled-components'; -import { useDevice } from '../../../../../../../hooks/suite'; + import { ComponentWithSubIcon, getIconSize, Icon, IconSize, iconSizes } from '@trezor/components'; +import { borders, Color, CSSColor } from '@trezor/theme'; +import { isDesktop } from '@trezor/env-utils'; +import { mapTrezorModelToIcon } from '@trezor/product-components'; + +import { useDevice } from '../../../../../../../hooks/suite'; import { QuickActionButton } from '../QuickActionButton'; import { UpdateIconGroup } from './UpdateIconGroup'; -import { borders, Color, CSSColor } from '@trezor/theme'; import { useUpdateStatus } from './useUpdateStatus'; import { UpdateTooltip } from './UpdateTooltip'; import { @@ -14,9 +20,7 @@ import { UpdateStatus, UpdateVariant, } from './updateQuickActionTypes'; -import { isDesktop } from '@trezor/env-utils'; -import { useDispatch } from 'react-redux'; -import { mapTrezorModelToIcon } from '@trezor/product-components'; + type MapArgs = { $variant: UpdateVariant; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateTooltip.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateTooltip.tsx index a48c9a71478..584677903d2 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateTooltip.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateTooltip.tsx @@ -1,6 +1,13 @@ import styled, { useTheme } from 'styled-components'; -import { useDevice, useSelector } from '../../../../../../../hooks/suite'; + import { Column, getIconSize, Icon, IconSize, iconSizes } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { TranslationKey } from '@suite-common/intl-types'; +import { getFirmwareVersion } from '@trezor/device-utils'; +import { isDesktop } from '@trezor/env-utils'; +import { mapTrezorModelToIcon } from '@trezor/product-components'; + +import { Translation } from '../../../../../Translation'; import { mapUpdateStatusToIcon, mapUpdateStatusToVariant, @@ -8,12 +15,7 @@ import { UpdateStatusSuite, UpdateStatusDevice, } from './updateQuickActionTypes'; -import { Translation } from '../../../../../Translation'; -import { spacings } from '@trezor/theme'; -import { TranslationKey } from '@suite-common/intl-types'; -import { getFirmwareVersion } from '@trezor/device-utils'; -import { isDesktop } from '@trezor/env-utils'; -import { mapTrezorModelToIcon } from '@trezor/product-components'; +import { useDevice, useSelector } from '../../../../../../../hooks/suite'; import { TooltipRow } from '../TooltipRow'; const SuiteIconRectangle = styled.div<{ $size: IconSize }>` diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/updateQuickActionTypes.ts b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/updateQuickActionTypes.ts index 938651a2f03..4bf7a90698b 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/updateQuickActionTypes.ts +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/updateQuickActionTypes.ts @@ -1,7 +1,9 @@ +import { DefaultTheme } from 'styled-components'; + import { IconName } from '@trezor/components'; import { UIVariant } from '@trezor/components/src/config/types'; import { Color, CSSColor } from '@trezor/theme'; -import { DefaultTheme } from 'styled-components'; + import { goto } from '../../../../../../../actions/suite/routerActions'; import { installUpdate, diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Sidebar.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Sidebar.tsx index c55dd90541e..a50d0ab128e 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Sidebar.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Sidebar.tsx @@ -1,13 +1,17 @@ import React, { useState } from 'react'; + import styled from 'styled-components'; -import { DeviceSelector } from '../DeviceSelector/DeviceSelector'; -import { Navigation } from './Navigation'; -import { AccountsMenu } from 'src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu'; -import { QuickActions } from './QuickActions/QuickActions'; + import { ElevationUp, ResizableBox, useElevation } from '@trezor/components'; import { Elevation, mapElevationToBackground, mapElevationToBorder, zIndices } from '@trezor/theme'; + +import { AccountsMenu } from 'src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu'; import { useActions, useSelector } from 'src/hooks/suite'; import * as suiteActions from 'src/actions/suite/suiteActions'; + +import { QuickActions } from './QuickActions/QuickActions'; +import { Navigation } from './Navigation'; +import { DeviceSelector } from '../DeviceSelector/DeviceSelector'; import { TrafficLightOffset } from '../../../TrafficLightOffset'; import { UpdateNotificationBanner } from './QuickActions/Update/UpdateNotificationBanner'; import { useUpdateStatus } from './QuickActions/Update/useUpdateStatus'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/SubpageNavigation.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/SubpageNavigation.tsx index def22331241..c224ea429c4 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/SubpageNavigation.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/SubpageNavigation.tsx @@ -1,14 +1,17 @@ import styled from 'styled-components'; import { LayoutGroup, motion } from 'framer-motion'; + import { spacingsPx, zIndices } from '@trezor/theme'; import { motionEasing, variables } from '@trezor/components'; +import { Route } from '@suite-common/suite-types'; + import { useSelector } from 'src/hooks/suite'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; import { SUBPAGE_NAV_HEIGHT } from 'src/constants/suite/layout'; import { selectIsLoggedOut } from 'src/reducers/suite/suiteReducer'; + import { HoverAnimation } from '../../HoverAnimation'; import { AppNavigationTooltip } from '../../AppNavigation/AppNavigationTooltip'; -import { Route } from '@suite-common/suite-types'; const Container = styled.div<{ $isFullWidth: boolean }>` position: sticky; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/SuiteLayout.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/SuiteLayout.tsx index 7937741f67e..bc24b5b84f7 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/SuiteLayout.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/SuiteLayout.tsx @@ -1,4 +1,5 @@ import { useRef, useState, ReactNode } from 'react'; + import styled from 'styled-components'; import { @@ -9,6 +10,7 @@ import { variables, } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; + import { SuiteBanners } from 'src/components/suite/banners'; import { Metadata } from 'src/components/suite'; import { GuideRouter, GuideButton } from 'src/components/guide'; @@ -19,12 +21,13 @@ import { LayoutContext, LayoutContextPayload } from 'src/support/suite/LayoutCon import { useResetScrollOnUrl } from 'src/hooks/suite/useResetScrollOnUrl'; import { useClearAnchorHighlightOnClick } from 'src/hooks/suite/useClearAnchorHighlightOnClick'; import { ModalContextProvider } from 'src/support/suite/ModalContext'; +import { MobileAccountsMenu } from 'src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; + import { ModalSwitcher } from '../../modals/ModalSwitcher/ModalSwitcher'; import { MobileMenu } from './MobileMenu/MobileMenu'; import { Sidebar } from './Sidebar/Sidebar'; import { CoinjoinBars } from './CoinjoinBars/CoinjoinBars'; -import { MobileAccountsMenu } from 'src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { useAppShortcuts } from './useAppShortcuts'; export const SCROLL_WRAPPER_ID = 'layout-scroll'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/useAppShortcuts.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/useAppShortcuts.tsx index 92fb0072db3..7f058414dc9 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/useAppShortcuts.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/useAppShortcuts.tsx @@ -1,9 +1,12 @@ -import { selectDevice } from '@suite-common/wallet-core'; import { useEvent } from 'react-use'; + +import { selectDevice } from '@suite-common/wallet-core'; +import { KEYBOARD_CODE } from '@trezor/components'; + import { closeModalApp, goto } from 'src/actions/suite/routerActions'; import { addWalletThunk } from 'src/actions/wallet/addWalletThunk'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { KEYBOARD_CODE } from '@trezor/components'; + export const useAppShortcuts = () => { const selectedDevice = useSelector(selectDevice); diff --git a/packages/suite/src/components/suite/layouts/WelcomeLayout/NavSettings.tsx b/packages/suite/src/components/suite/layouts/WelcomeLayout/NavSettings.tsx index a157ffeb581..af81685d8fd 100644 --- a/packages/suite/src/components/suite/layouts/WelcomeLayout/NavSettings.tsx +++ b/packages/suite/src/components/suite/layouts/WelcomeLayout/NavSettings.tsx @@ -1,4 +1,5 @@ import { IconButton } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; diff --git a/packages/suite/src/components/suite/layouts/WelcomeLayout/WelcomeLayout.tsx b/packages/suite/src/components/suite/layouts/WelcomeLayout/WelcomeLayout.tsx index 5f794f4b073..f707f5f5d15 100644 --- a/packages/suite/src/components/suite/layouts/WelcomeLayout/WelcomeLayout.tsx +++ b/packages/suite/src/components/suite/layouts/WelcomeLayout/WelcomeLayout.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; @@ -13,22 +14,25 @@ import { Column, } from '@trezor/components'; import { useOnce } from '@trezor/react-utils'; +import { selectBannerMessage } from '@suite-common/message-system'; +import { isWeb } from '@trezor/env-utils'; +import { TREZOR_URL, SUITE_URL } from '@trezor/urls'; +import { resolveStaticPath } from '@suite-common/suite-utils'; +import { Elevation, mapElevationToBackground, spacingsPx } from '@trezor/theme'; +import { TrezorLogo } from '@trezor/product-components'; + import { Translation } from 'src/components/suite'; // importing directly, otherwise unit tests fail, seems to be a styled-components issue import { TrezorLink } from 'src/components/suite/TrezorLink'; import { useSelector } from 'src/hooks/suite'; -import { selectBannerMessage } from '@suite-common/message-system'; import { MessageSystemBanner } from 'src/components/suite/banners'; -import { isWeb } from '@trezor/env-utils'; -import { TREZOR_URL, SUITE_URL } from '@trezor/urls'; -import { resolveStaticPath } from '@suite-common/suite-utils'; import { GuideButton, GuideRouter } from 'src/components/guide'; import { useGuide } from 'src/hooks/guide'; import { MAX_ONBOARDING_WIDTH } from 'src/constants/suite/layout'; + import { NavSettings } from './NavSettings'; -import { Elevation, mapElevationToBackground, spacingsPx } from '@trezor/theme'; import { TrafficLightOffset } from '../../TrafficLightOffset'; -import { TrezorLogo } from '@trezor/product-components'; + const MessageContainer = styled.div` margin: ${spacingsPx.xxs} ${spacingsPx.xs} ${spacingsPx.xs}; diff --git a/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx b/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx index 1ee8ab1596c..8c5b3361ecb 100644 --- a/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx +++ b/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx @@ -1,16 +1,18 @@ import styled from 'styled-components'; -import { Translation } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { Image, NewModal, Paragraph } from '@trezor/components'; -import { onCancel } from 'src/actions/suite/modalActions'; import { Account } from '@suite-common/wallet-types'; import { networks } from '@suite-common/wallet-config'; -import { TranslationKey } from 'src/components/suite/Translation'; -import { SUITE } from 'src/actions/suite/constants'; import { spacings } from '@trezor/theme'; import { CoinLogo } from '@trezor/product-components'; +import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { onCancel } from 'src/actions/suite/modalActions'; +import { TranslationKey } from 'src/components/suite/Translation'; +import { SUITE } from 'src/actions/suite/constants'; + + const ImageWrapper = styled.div` position: relative; width: 97.5%; diff --git a/packages/suite/src/components/suite/modals/Modal/DefaultRenderer.tsx b/packages/suite/src/components/suite/modals/Modal/DefaultRenderer.tsx index 4a450e33f71..387b8b94196 100644 --- a/packages/suite/src/components/suite/modals/Modal/DefaultRenderer.tsx +++ b/packages/suite/src/components/suite/modals/Modal/DefaultRenderer.tsx @@ -1,9 +1,12 @@ import { ReactPortal } from 'react'; import { createPortal } from 'react-dom'; + import { Modal, ModalProps, Icon, intermediaryTheme } from '@trezor/components'; + import { useGuide } from 'src/hooks/guide'; import { useLayoutSize } from 'src/hooks/suite/useLayoutSize'; import { useModalTarget } from 'src/support/suite/ModalContext'; + import { ModalEnvironment } from '../ModalEnvironment'; /** diff --git a/packages/suite/src/components/suite/modals/Modal/DialogRenderer.tsx b/packages/suite/src/components/suite/modals/Modal/DialogRenderer.tsx index d7b7367f2c2..043638a9229 100644 --- a/packages/suite/src/components/suite/modals/Modal/DialogRenderer.tsx +++ b/packages/suite/src/components/suite/modals/Modal/DialogRenderer.tsx @@ -1,7 +1,10 @@ -import { DialogModal as BaseDialogModal, DialogModalProps } from '@trezor/components'; import { ReactPortal } from 'react'; import { createPortal } from 'react-dom'; + +import { DialogModal as BaseDialogModal, DialogModalProps } from '@trezor/components'; + import { useModalTarget } from 'src/support/suite/ModalContext'; + import { ModalEnvironment } from '../ModalEnvironment'; import { ModalProps, Modal } from './Modal'; diff --git a/packages/suite/src/components/suite/modals/Modal/Modal.tsx b/packages/suite/src/components/suite/modals/Modal/Modal.tsx index 50c12435053..6aff6f9f55b 100644 --- a/packages/suite/src/components/suite/modals/Modal/Modal.tsx +++ b/packages/suite/src/components/suite/modals/Modal/Modal.tsx @@ -1,5 +1,7 @@ import { ComponentType } from 'react'; + import { Modal as TrezorModal, ModalProps as TrezorModalProps } from '@trezor/components'; + import { DefaultRenderer } from './DefaultRenderer'; export type ModalProps = TrezorModalProps & { diff --git a/packages/suite/src/components/suite/modals/ModalEnvironment.tsx b/packages/suite/src/components/suite/modals/ModalEnvironment.tsx index cdb952c751c..f7ddaaba023 100644 --- a/packages/suite/src/components/suite/modals/ModalEnvironment.tsx +++ b/packages/suite/src/components/suite/modals/ModalEnvironment.tsx @@ -1,5 +1,6 @@ import { ReactNode } from 'react'; import FocusLock from 'react-focus-lock'; + import { Backdrop, ModalAlignment } from '@trezor/components'; type ModalEnvironmentProps = { diff --git a/packages/suite/src/components/suite/modals/ModalSwitcher/DiscoveryLoader.tsx b/packages/suite/src/components/suite/modals/ModalSwitcher/DiscoveryLoader.tsx index b4e39c8356f..642adb33a3e 100644 --- a/packages/suite/src/components/suite/modals/ModalSwitcher/DiscoveryLoader.tsx +++ b/packages/suite/src/components/suite/modals/ModalSwitcher/DiscoveryLoader.tsx @@ -1,10 +1,11 @@ import { H3, Spinner, Column } from '@trezor/components'; +import { selectDevice } from '@suite-common/wallet-core'; +import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { CardWithDevice } from 'src/views/suite/SwitchDevice/CardWithDevice'; import { SwitchDeviceModal } from 'src/views/suite/SwitchDevice/SwitchDeviceModal'; import { useSelector } from 'src/hooks/suite'; -import { selectDevice } from '@suite-common/wallet-core'; -import { spacings } from '@trezor/theme'; export const DiscoveryLoader = () => { const device = useSelector(selectDevice); diff --git a/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx b/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx index 3a422142ceb..632aa6ed3f4 100644 --- a/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx +++ b/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx @@ -1,3 +1,5 @@ +import { FunctionComponent } from 'react'; + import { FirmwareUpdate } from 'src/views/firmware/FirmwareUpdate'; import { FirmwareCustom } from 'src/views/firmware/FirmwareCustom'; import { Recovery } from 'src/views/recovery'; @@ -9,10 +11,11 @@ import { UdevRules } from 'src/views/suite/udev'; import { Version } from 'src/views/suite/version'; import { SwitchDevice } from 'src/views/suite/SwitchDevice/SwitchDevice'; import type { ForegroundAppRoute } from 'src/types/suite'; -import { FunctionComponent } from 'react'; -import { MultiShareBackupModal } from '../ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal'; import { BridgeRequested } from 'src/views/suite/bridge-requested'; +import { MultiShareBackupModal } from '../ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal'; + + // would not work if defined directly in the switch const FirmwareType = () => ; diff --git a/packages/suite/src/components/suite/modals/ModalSwitcher/ModalSwitcher.tsx b/packages/suite/src/components/suite/modals/ModalSwitcher/ModalSwitcher.tsx index 840952b9e0e..be17cf14e3e 100644 --- a/packages/suite/src/components/suite/modals/ModalSwitcher/ModalSwitcher.tsx +++ b/packages/suite/src/components/suite/modals/ModalSwitcher/ModalSwitcher.tsx @@ -1,4 +1,5 @@ import { usePreferredModal } from 'src/hooks/suite/usePreferredModal'; + import { ReduxModal } from '../ReduxModal/ReduxModal'; import { ForegroundAppModal } from './ForegroundAppModal'; import { DiscoveryLoader } from './DiscoveryLoader'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmAddressModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmAddressModal.tsx index ad0cfd45a9a..642078cf3a8 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmAddressModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmAddressModal.tsx @@ -1,4 +1,5 @@ import { useCallback } from 'react'; + import { showAddress } from 'src/actions/wallet/receiveActions'; import { Translation } from 'src/components/suite'; import { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/ConfirmValueModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/ConfirmValueModal.tsx index 48e78a0b828..076227fbcd8 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/ConfirmValueModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/ConfirmValueModal.tsx @@ -13,18 +13,20 @@ import { } from '@trezor/components'; import { copyToClipboard } from '@trezor/dom-utils'; import { selectDevice, selectDeviceLabelOrName } from '@suite-common/wallet-core'; +import { Account } from '@suite-common/wallet-types'; +import { palette, spacings } from '@trezor/theme'; +import { getNetworkFeatures } from '@suite-common/wallet-config'; +import { ConfirmOnDevice } from '@trezor/product-components'; + import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; import { QrCode } from 'src/components/suite/QrCode'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { MODAL } from 'src/actions/suite/constants'; import { DisplayMode, ThunkAction } from 'src/types/suite'; + import { TransactionReviewStepIndicator } from '../TransactionReviewModal/TransactionReviewOutputList/TransactionReviewStepIndicator'; import { TransactionReviewOutputElement } from '../TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputElement'; -import { Account } from '@suite-common/wallet-types'; -import { palette, spacings } from '@trezor/theme'; -import { getNetworkFeatures } from '@suite-common/wallet-config'; -import { ConfirmOnDevice } from '@trezor/product-components'; export interface ConfirmValueModalProps extends Pick { account: Account; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/DeviceDisconnected.tsx b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/DeviceDisconnected.tsx index cd51299d28f..fcfb3f256dd 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/DeviceDisconnected.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/DeviceDisconnected.tsx @@ -1,9 +1,10 @@ import styled from 'styled-components'; import { Paragraph, Image, variables } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { borders } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; + const Wrapper = styled.div` display: flex; text-align: left; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmXpubModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmXpubModal.tsx index 0533d6bf25d..1cd75690bb5 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmXpubModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmXpubModal.tsx @@ -1,11 +1,12 @@ import { Translation } from 'src/components/suite'; -import { ConfirmValueModal, ConfirmValueModalProps } from './ConfirmValueModal/ConfirmValueModal'; import { showXpub } from 'src/actions/wallet/publicKeyActions'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; import { useSelector } from 'src/hooks/suite'; import { DisplayMode } from 'src/types/suite'; +import { ConfirmValueModal, ConfirmValueModalProps } from './ConfirmValueModal/ConfirmValueModal'; + export const ConfirmXpubModal = ( props: Pick, ) => { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/CopyAddressModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/CopyAddressModal.tsx index 9a7dab5aede..22c88220ec2 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/CopyAddressModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/CopyAddressModal.tsx @@ -1,12 +1,13 @@ +import { useState } from 'react'; + import { copyToClipboard } from '@trezor/dom-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; - -import { Translation } from 'src/components/suite'; -import { useDispatch } from 'src/hooks/suite/useDispatch'; import { H2, Card, Paragraph, NewModal, Checkbox } from '@trezor/components'; import { AddressType } from '@suite-common/wallet-types'; import { spacings } from '@trezor/theme'; -import { useState } from 'react'; + +import { useDispatch } from 'src/hooks/suite/useDispatch'; +import { Translation } from 'src/components/suite'; import { setFlag } from 'src/actions/suite/suiteActions'; const getAddressTypeText = (addressType: AddressType) => { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx index 59cc0a88f1e..1d3304920fe 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx @@ -1,10 +1,12 @@ +import { NewModal, Paragraph, H2 } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { onReceiveConfirmation } from 'src/actions/suite/modalActions'; import { goto } from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite/useDispatch'; -import { NewModal, Paragraph, H2 } from '@trezor/components'; import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { spacings } from '@trezor/theme'; + export const NoBackupModal = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmActionModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmActionModal.tsx index 12a11c35444..1a83d6c6f21 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmActionModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmActionModal.tsx @@ -1,13 +1,15 @@ -import styled from 'styled-components'; import { useIntl } from 'react-intl'; +import styled from 'styled-components'; + import TrezorConnect from '@trezor/connect'; import { H2, NewModal } from '@trezor/components'; import { ConfirmOnDevice } from '@trezor/product-components'; +import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite/Translation'; import { DeviceConfirmImage } from 'src/components/suite'; import { TrezorDevice } from 'src/types/suite'; -import { spacings } from '@trezor/theme'; import messages from 'src/support/messages'; const ImageWrapper = styled.div` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmFingerprintModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmFingerprintModal.tsx index 8c2b356bc7d..3fdc5ded1ed 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmFingerprintModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmFingerprintModal.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; + +import { ConfirmOnDevice } from '@trezor/product-components'; + import { Translation, Modal, ModalProps } from 'src/components/suite'; import { TrezorDevice } from 'src/types/suite'; import { Fingerprint } from 'src/components/firmware'; -import { ConfirmOnDevice } from '@trezor/product-components'; const StyledModal = styled(Modal)` width: 360px; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/DeviceContextModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/DeviceContextModal.tsx index 2ab21feae58..7ae08c00a0e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/DeviceContextModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/DeviceContextModal.tsx @@ -2,6 +2,7 @@ import { useIntl } from 'react-intl'; import TrezorConnect, { UI } from '@trezor/connect'; import { selectDevice } from '@suite-common/wallet-core'; + import messages from 'src/support/messages'; import { MODAL } from 'src/actions/suite/constants'; import { useSelector } from 'src/hooks/suite'; @@ -18,6 +19,7 @@ import { ConfirmAddressModal, ConfirmXpubModal, } from 'src/components/suite/modals'; + import type { ReduxModalProps } from '../ReduxModal'; /** Modals requested by Device from `trezor-connect` */ diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseModal.tsx index b39fe31d3f7..703bea9e817 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseModal.tsx @@ -10,15 +10,17 @@ import TrezorConnect from '@trezor/connect'; import { spacings } from '@trezor/theme'; import { HELP_CENTER_PASSPHRASE_URL } from '@trezor/urls'; import { PassphraseTypeCard } from '@trezor/product-components'; + import { useSelector, useDispatch } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import type { TrezorDevice } from 'src/types/suite'; import { OpenGuideFromTooltip } from 'src/components/guide'; import { CardWithDevice } from 'src/views/suite/SwitchDevice/CardWithDevice'; -import { PassphraseWalletConfirmation } from './PassphraseWalletConfirmation'; import { SwitchDeviceModal } from 'src/views/suite/SwitchDevice/SwitchDeviceModal'; import { TrezorLink } from 'src/components/suite/TrezorLink'; +import { PassphraseWalletConfirmation } from './PassphraseWalletConfirmation'; + interface PassphraseModalProps { device: TrezorDevice; } diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseOnDeviceModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseOnDeviceModal.tsx index c66bc862992..e73673c53b2 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseOnDeviceModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseOnDeviceModal.tsx @@ -1,6 +1,7 @@ -import styled from 'styled-components'; import { useIntl } from 'react-intl'; +import styled from 'styled-components'; + import { H2, NewModal, Paragraph } from '@trezor/components'; import { ConfirmOnDevice } from '@trezor/product-components'; import { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmation.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmation.tsx index 26ede6c296b..e4761045849 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmation.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmation.tsx @@ -1,7 +1,10 @@ -import { TrezorDevice } from '@suite-common/suite-types'; import { Dispatch, SetStateAction, useState } from 'react'; + +import { TrezorDevice } from '@suite-common/suite-types'; + import { CardWithDevice } from 'src/views/suite/SwitchDevice/CardWithDevice'; import { SwitchDeviceModal } from 'src/views/suite/SwitchDevice/SwitchDeviceModal'; + import { PassphraseWalletConfirmationStep1 } from './PassphraseWalletConfirmationStep1'; import { PassphraseWalletConfirmationStep2 } from './PassphraseWalletConfirmationStep2'; import { PassphraseWalletConfirmationStep3 } from './PassphraseWalletConfirmationStep3'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep1.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep1.tsx index 3e007e7f4c7..5826a9b82c6 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep1.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep1.tsx @@ -1,4 +1,5 @@ import { Dispatch } from 'react'; + import { spacings } from '@trezor/theme'; import { Column, Card, Row, Button, H3, Paragraph } from '@trezor/components'; import { HELP_CENTER_PASSPHRASE_URL } from '@trezor/urls'; @@ -6,13 +7,14 @@ import { CoinLogo } from '@trezor/product-components'; import { Translation } from 'src/components/suite/Translation'; import { TrezorLink } from 'src/components/suite/TrezorLink'; -import { ContentType } from './types'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; import { onCancel as onCancelModal } from 'src/actions/suite/modalActions'; import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; +import { ContentType } from './types'; + type PassphraseWalletConfirmationStep1Props = { setContentType: Dispatch>; onRetry: () => void; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep2.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep2.tsx index 8b9a34b4602..84006102d63 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep2.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep2.tsx @@ -1,8 +1,11 @@ +import { Dispatch } from 'react'; + import { Button, Text, Banner, Card, Icon, H3, Column, List } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite/Translation'; + import { ContentType } from './types'; -import { Dispatch } from 'react'; -import { spacings } from '@trezor/theme'; type PassphraseWalletConfirmationStep2Props = { setContentType: Dispatch>; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep3.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep3.tsx index da1237c1973..9310dc69f55 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep3.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep3.tsx @@ -1,9 +1,10 @@ import { Banner, Column, H3 } from '@trezor/components'; import { PassphraseTypeCard } from '@trezor/product-components'; import { spacings } from '@trezor/theme'; +import { selectDeviceModel, selectDeviceFeatures } from '@suite-common/wallet-core'; + import { Translation } from 'src/components/suite/Translation'; import { OpenGuideFromTooltip } from 'src/components/guide'; -import { selectDeviceModel, selectDeviceFeatures } from '@suite-common/wallet-core'; import { useSelector } from 'src/hooks/suite'; type PassphraseWalletConfirmationStep3Props = { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinInvalidModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinInvalidModal.tsx index 6c3a50d8c47..e034f3806f0 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinInvalidModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinInvalidModal.tsx @@ -2,6 +2,7 @@ import styled from 'styled-components'; import { selectDeviceLabelOrName } from '@suite-common/wallet-core'; import { Paragraph } from '@trezor/components'; + import { Translation } from 'src/components/suite/Translation'; import { DeviceConfirmImage, Modal, ModalProps } from 'src/components/suite'; import { TrezorDevice } from 'src/types/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinModal.tsx index e4bf5bd6d96..2efa9c811b3 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinModal.tsx @@ -1,7 +1,8 @@ -import TrezorConnect from '@trezor/connect'; import styled from 'styled-components'; +import TrezorConnect from '@trezor/connect'; import { selectDeviceLabelOrName } from '@suite-common/wallet-core'; + import { Modal, ModalProps, PinMatrix, Translation } from 'src/components/suite'; import { PIN_MATRIX_MAX_WIDTH } from 'src/components/suite/PinMatrix/PinMatrix'; import { usePin } from 'src/hooks/suite/usePinModal'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordAdvancedModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordAdvancedModal.tsx index 6b24cd48f1a..5ba6017d01a 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordAdvancedModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordAdvancedModal.tsx @@ -1,7 +1,11 @@ +import { useIntl } from 'react-intl'; + import styled from 'styled-components'; + import TrezorConnect from '@trezor/connect'; import { Paragraph } from '@trezor/components'; import { HELP_CENTER_ADVANCED_RECOVERY_URL } from '@trezor/urls'; + import { Translation, WordInputAdvanced, @@ -9,7 +13,6 @@ import { Modal, ModalProps, } from 'src/components/suite'; -import { useIntl } from 'react-intl'; import messages from 'src/support/messages'; const ContentWrapper = styled.div` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordModal.tsx index a0ea07f7c11..41a6cc7e43e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordModal.tsx @@ -1,7 +1,10 @@ +import { useIntl } from 'react-intl'; + +import styled from 'styled-components'; + import TrezorConnect from '@trezor/connect'; + import { Translation, WordInput, Modal, ModalProps } from 'src/components/suite'; -import styled from 'styled-components'; -import { useIntl } from 'react-intl'; import messages from 'src/support/messages'; const StyledModal = styled(Modal)` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/ReduxModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/ReduxModal.tsx index a8a7d52cc52..debac0d4ce0 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/ReduxModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/ReduxModal.tsx @@ -1,5 +1,6 @@ import { MODAL } from 'src/actions/suite/constants'; import type { AppState } from 'src/types/suite'; + import type { ModalProps } from '../Modal/Modal'; import { DeviceContextModal } from './DeviceContextModal/DeviceContextModal'; import { DeviceConfirmationModal } from './DeviceConfirmationModal/DeviceConfirmationModal'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewEvmExplanation.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewEvmExplanation.tsx index 641730b86d7..02077fb292d 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewEvmExplanation.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewEvmExplanation.tsx @@ -1,10 +1,11 @@ import { Banner } from '@trezor/components'; -import { Translation } from 'src/components/suite'; -import { Account } from 'src/types/wallet'; import { networks } from '@suite-common/wallet-config'; import { spacings } from '@trezor/theme'; import { StakeType } from '@suite-common/wallet-types'; +import { Account } from 'src/types/wallet'; +import { Translation } from 'src/components/suite'; + type TransactionReviewEvmExplanationProps = { account: Account; ethereumStakeType: StakeType | null; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModal.tsx index 47d29fbc8ca..8cea753405d 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModal.tsx @@ -1,9 +1,11 @@ import { UserContextPayload } from '@suite-common/suite-types'; import { selectStake, cancelSignSendFormTransactionThunk } from '@suite-common/wallet-core'; + import { cancelSignTx as cancelSignStakingTx } from 'src/actions/wallet/stakeActions'; -import { TransactionReviewModalContent } from './TransactionReviewModalContent'; import { useDispatch, useSelector } from 'src/hooks/suite'; +import { TransactionReviewModalContent } from './TransactionReviewModalContent'; + // This modal is opened either in Device (button request) or User (push tx) context // contexts are distinguished by `type` prop type TransactionReviewModalProps = diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx index 31ecb7f23a9..e6552baa8f2 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx @@ -1,5 +1,7 @@ import { useState } from 'react'; + import styled from 'styled-components'; + import { variables } from '@trezor/components'; import { Deferred } from '@trezor/utils'; import { @@ -17,16 +19,19 @@ import { isRbfTransaction, getTxStakeNameByDataHex, } from '@suite-common/wallet-utils'; +import { ConfirmOnDevice } from '@trezor/product-components'; +import { networks } from '@suite-common/wallet-config'; + import { useSelector } from 'src/hooks/suite'; import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; import { getTransactionReviewModalActionText } from 'src/utils/suite/transactionReview'; import { Modal, Translation } from 'src/components/suite'; +import { selectAccountIncludingChosenInCoinmarket } from 'src/reducers/wallet/selectedAccountReducer'; + import { TransactionReviewSummary } from './TransactionReviewSummary'; import { TransactionReviewOutputList } from './TransactionReviewOutputList/TransactionReviewOutputList'; import { TransactionReviewEvmExplanation } from './TransactionReviewEvmExplanation'; -import { ConfirmOnDevice } from '@trezor/product-components'; -import { networks } from '@suite-common/wallet-config'; -import { selectAccountIncludingChosenInCoinmarket } from 'src/reducers/wallet/selectedAccountReducer'; + const StyledModal = styled(Modal)` ${Modal.Body} { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewDetails.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewDetails.tsx index 546f9669abc..ef47c1ed585 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewDetails.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewDetails.tsx @@ -1,10 +1,11 @@ import styled, { useTheme } from 'styled-components'; -import { Translation } from 'src/components/suite'; import { variables, Card, Icon } from '@trezor/components'; import { GeneralPrecomposedTransactionFinal } from '@suite-common/wallet-types'; import { borders, typography, zIndices } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; + const TransactionDetailsWrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutput.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutput.tsx index 8694dacf71b..95eab9ff959 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutput.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutput.tsx @@ -1,10 +1,16 @@ import { ReactNode, forwardRef } from 'react'; + import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Translation } from 'src/components/suite'; import { formatNetworkAmount, formatAmount, isTestnet } from '@suite-common/wallet-utils'; import { BTC_LOCKTIME_VALUE } from '@suite-common/wallet-constants'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { ReviewOutput, StakeType } from '@suite-common/wallet-types'; +import { TranslationKey } from '@suite-common/intl-types'; + +import type { Account } from 'src/types/wallet'; +import { useDisplayMode, useTranslation } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; + import { TransactionReviewStepIndicator, TransactionReviewStepIndicatorProps, @@ -13,9 +19,8 @@ import { TransactionReviewOutputElement, OutputElementLine, } from './TransactionReviewOutputElement'; -import type { Account } from 'src/types/wallet'; -import { useDisplayMode, useTranslation } from 'src/hooks/suite'; -import { TranslationKey } from '@suite-common/intl-types'; + + const getFeeLabel = (networkType: Account['networkType']) => { switch (networkType) { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputElement.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputElement.tsx index dc37416b82e..ab6a1bbb3c5 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputElement.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputElement.tsx @@ -1,17 +1,20 @@ import { forwardRef, ReactNode } from 'react'; + import styled from 'styled-components'; import { variables } from '@trezor/components'; -import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; -import { Account } from 'src/types/wallet'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { TokenInfo } from '@trezor/connect'; import { amountToSmallestUnit } from '@suite-common/wallet-utils'; -import { TransactionReviewStepIndicatorProps } from './TransactionReviewStepIndicator'; import { zIndices } from '@trezor/theme'; -import { DeviceDisplay } from '../../../../DeviceDisplay/DeviceDisplay'; + +import { Account } from 'src/types/wallet'; +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { DisplayMode } from 'src/types/suite'; +import { TransactionReviewStepIndicatorProps } from './TransactionReviewStepIndicator'; +import { DeviceDisplay } from '../../../../DeviceDisplay/DeviceDisplay'; + const TYPES_TO_BE_DISPLAYED_IN_SCREEN_BOX = ['address', 'regular_legacy', 'data', 'opreturn']; const OutputWrapper = styled.div` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputList.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputList.tsx index 94480e89c91..604881c1712 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputList.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputList.tsx @@ -1,22 +1,25 @@ import { useEffect, useRef } from 'react'; + import styled from 'styled-components'; import { analytics, EventType } from '@trezor/suite-analytics'; import { Button, variables, Banner } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { notificationsActions } from '@suite-common/toast-notifications'; import { TranslationKey } from '@suite-common/intl-types'; import { copyToClipboard, download } from '@trezor/dom-utils'; -import { useDispatch } from 'src/hooks/suite'; -import { TransactionReviewDetails } from './TransactionReviewDetails'; -import { TransactionReviewOutput } from './TransactionReviewOutput'; -import type { Account } from 'src/types/wallet'; import type { FormState, GeneralPrecomposedTransactionFinal } from '@suite-common/wallet-types'; import { getTransactionReviewOutputState } from '@suite-common/wallet-utils'; -import { TransactionReviewTotalOutput } from './TransactionReviewTotalOutput'; import { ReviewOutput, StakeFormState, StakeType } from '@suite-common/wallet-types'; import { spacingsPx } from '@trezor/theme'; +import type { Account } from 'src/types/wallet'; +import { useDispatch } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; + +import { TransactionReviewTotalOutput } from './TransactionReviewTotalOutput'; +import { TransactionReviewOutput } from './TransactionReviewOutput'; +import { TransactionReviewDetails } from './TransactionReviewDetails'; + const Content = styled.div` display: flex; padding: 0; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewStepIndicator.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewStepIndicator.tsx index 471c2e8fb72..dd7163e9a48 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewStepIndicator.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewStepIndicator.tsx @@ -1,4 +1,5 @@ import styled, { useTheme } from 'styled-components'; + import { Icon } from '@trezor/components'; const IndicatorWrapper = styled.div` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewTotalOutput.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewTotalOutput.tsx index 11be00b6fb2..2e9c18ed4d1 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewTotalOutput.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewTotalOutput.tsx @@ -1,6 +1,6 @@ import { forwardRef } from 'react'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { formatAmount, formatNetworkAmount, @@ -10,16 +10,18 @@ import { getIsUpdatedEthereumSendFlow, } from '@suite-common/wallet-utils'; import { selectDevice } from '@suite-common/wallet-core'; +import { StakeType } from '@suite-common/wallet-types'; + import { TrezorDevice } from 'src/types/suite'; import { Translation } from 'src/components/suite/Translation'; import { useSelector } from 'src/hooks/suite/useSelector'; + import { TransactionReviewStepIndicator } from './TransactionReviewStepIndicator'; import { TransactionReviewOutputElement, OutputElementLine, } from './TransactionReviewOutputElement'; import type { TransactionReviewOutputListProps } from './TransactionReviewOutputList'; -import { StakeType } from '@suite-common/wallet-types'; type StepIndicatorProps = Pick< TransactionReviewOutputListProps, diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx index 68134c5cbfa..2320a7fa48b 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx @@ -1,17 +1,20 @@ import styled, { useTheme } from 'styled-components'; + import { BigNumber } from '@trezor/utils/src/bigNumber'; import { getFeeUnits, formatNetworkAmount, formatAmount, getFee } from '@suite-common/wallet-utils'; import { Icon, variables } from '@trezor/components'; import { formatDuration } from '@suite-common/suite-utils'; import { borders, spacingsPx, typography } from '@trezor/theme'; import { TranslationKey } from '@suite-common/intl-types'; -import { Translation, FormattedCryptoAmount, AccountLabel } from 'src/components/suite'; -import { Account } from 'src/types/wallet'; import { Network, NetworkType } from '@suite-common/wallet-config'; import { GeneralPrecomposedTransactionFinal, StakeType } from '@suite-common/wallet-types'; +import { CoinLogo } from '@trezor/product-components'; + +import { Translation, FormattedCryptoAmount, AccountLabel } from 'src/components/suite'; +import { Account } from 'src/types/wallet'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; -import { CoinLogo } from '@trezor/product-components'; + const Wrapper = styled.div` padding: 20px 15px 12px; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UnhideTokenModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UnhideTokenModal.tsx index 36ec369072b..8f3d5ecd172 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UnhideTokenModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UnhideTokenModal.tsx @@ -1,15 +1,17 @@ -import { Translation } from 'src/components/suite'; -import { useDispatch } from 'src/hooks/suite/useDispatch'; +import { useState } from 'react'; + import { H2, Paragraph, Card, Checkbox, NewModal } from '@trezor/components'; import { DefinitionType, tokenDefinitionsActions, TokenManagementAction, } from '@suite-common/token-definitions'; +import { spacings } from '@trezor/theme'; + +import { Translation } from 'src/components/suite'; +import { useDispatch } from 'src/hooks/suite/useDispatch'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { useSelector } from 'src/hooks/suite'; -import { useState } from 'react'; -import { spacings } from '@trezor/theme'; import { setFlag } from 'src/actions/suite/suiteActions'; interface UnhideTokenModalProps { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription.tsx index 57b76aa36e6..2438a02266f 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription.tsx @@ -1,16 +1,18 @@ import { Paragraph, Column } from '@trezor/components'; import { Bip43PathTemplate, AccountType, NetworkType } from '@suite-common/wallet-config'; -import { Translation } from 'src/components/suite'; import { getAccountTypeDesc, getAccountTypeUrl, getTitleForNetwork, } from '@suite-common/wallet-utils'; -import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; -import { useTranslation } from 'src/hooks/suite'; import { spacings } from '@trezor/theme'; import { Account } from '@suite-common/wallet-types'; +import { Translation } from 'src/components/suite'; +import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; +import { useTranslation } from 'src/hooks/suite'; + + interface AccountTypeDescriptionProps { bip43Path: Bip43PathTemplate; accountType?: AccountType; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeSelect.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeSelect.tsx index 0010667ad81..7a2caf35f7a 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeSelect.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeSelect.tsx @@ -1,11 +1,14 @@ import styled from 'styled-components'; + import { Column, Select } from '@trezor/components'; -import { Translation } from 'src/components/suite/Translation'; import { getAccountTypeName, getAccountTypeTech } from '@suite-common/wallet-utils'; -import { AccountTypeDescription } from './AccountTypeDescription'; import { NetworkAccount, NetworkSymbol, NetworkType } from '@suite-common/wallet-config'; import { spacings, typography } from '@trezor/theme'; +import { Translation } from 'src/components/suite/Translation'; + +import { AccountTypeDescription } from './AccountTypeDescription'; + const LabelWrapper = styled.div` display: flex; align-items: baseline; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddAccountButton.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddAccountButton.tsx index edeae875d3d..6f021f478ba 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddAccountButton.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddAccountButton.tsx @@ -3,10 +3,12 @@ import { useCallback } from 'react'; import { analytics, EventType } from '@trezor/suite-analytics'; import { UnavailableCapability } from '@trezor/connect'; import { selectDevice } from '@suite-common/wallet-core'; -import { Account } from 'src/types/wallet'; import { Network, NetworkAccount } from '@suite-common/wallet-config'; + +import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; import { useAccountSearch, useSelector } from 'src/hooks/suite'; + import { AddCoinjoinAccountButton } from './AddCoinjoinAccountButton'; import { AddButton } from './AddButton'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddButton.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddButton.tsx index 23b990ffcb8..64a40b715b6 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddButton.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddButton.tsx @@ -1,8 +1,10 @@ import { ReactNode } from 'react'; + import { ButtonProps, Tooltip, NewModal } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { Network } from '@suite-common/wallet-config'; +import { Translation } from 'src/components/suite'; + interface AddButtonProps extends Omit { disabledMessage: ReactNode; networkName: Network['name']; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddCoinjoinAccountButton.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddCoinjoinAccountButton.tsx index 5465ffc1f7a..28d53bf7284 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddCoinjoinAccountButton.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountButton/AddCoinjoinAccountButton.tsx @@ -6,6 +6,7 @@ import { isDesktop } from '@trezor/env-utils'; import { isDevEnv } from '@suite-common/suite-utils'; import { RequestEnableTorResponse } from '@suite-common/suite-config'; import { selectDevice } from '@suite-common/wallet-core'; +import { Network, NetworkAccount, NetworkSymbol } from '@suite-common/wallet-config'; import { Translation } from 'src/components/suite'; import { useSelector, useDispatch } from 'src/hooks/suite'; @@ -13,7 +14,6 @@ import { createCoinjoinAccount } from 'src/actions/wallet/coinjoinAccountActions import { toggleTor } from 'src/actions/suite/suiteActions'; import { openDeferredModal, openModal } from 'src/actions/suite/modalActions'; import { Account } from 'src/types/wallet'; -import { Network, NetworkAccount, NetworkSymbol } from '@suite-common/wallet-config'; import { selectTorState } from 'src/reducers/suite/suiteReducer'; import { AddButton } from './AddButton'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountModal.tsx index 264be3a80ed..84db86ee6d1 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AddAccountModal.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { accountsActions, selectDeviceModel } from '@suite-common/wallet-core'; @@ -7,6 +8,8 @@ import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; import { networks, Network, NetworkSymbol, NetworkAccount } from '@suite-common/wallet-config'; import { CollapsibleBox, NewModal, Tooltip } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; +import { DeviceModelInternal } from '@trezor/connect'; + import { Translation, CoinList } from 'src/components/suite'; import { Account } from 'src/types/wallet'; import { TrezorDevice } from 'src/types/suite'; @@ -15,12 +18,12 @@ import { changeCoinVisibility } from 'src/actions/settings/walletSettingsActions import { goto } from 'src/actions/suite/routerActions'; import { selectIsPublic } from 'src/reducers/wallet/coinjoinReducer'; import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; +import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; +import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; + import { AccountTypeSelect } from './AccountTypeSelect/AccountTypeSelect'; import { SelectNetwork } from './SelectNetwork'; import { AddAccountButton } from './AddAccountButton/AddAccountButton'; -import { DeviceModelInternal } from '@trezor/connect'; -import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; -import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; const NetworksWrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddTokenModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddTokenModal.tsx index 7cf9fde30e9..38e2d5eda27 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddTokenModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddTokenModal.tsx @@ -1,13 +1,14 @@ import { useCallback, useEffect, useState, ChangeEvent } from 'react'; + import TrezorConnect, { TokenInfo } from '@trezor/connect'; import { analytics, EventType } from '@trezor/suite-analytics'; - import { Input, Button } from '@trezor/components'; +import { tryGetAccountIdentity, isAddressValid } from '@suite-common/wallet-utils'; + import { addToken } from 'src/actions/wallet/tokenActions'; import { Modal } from 'src/components/suite'; import { Translation } from 'src/components/suite/Translation'; import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; -import { tryGetAccountIdentity, isAddressValid } from '@suite-common/wallet-utils'; import { Account } from 'src/types/wallet'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/AdvancedCoinSettingsModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/AdvancedCoinSettingsModal.tsx index 619c5594a4e..970be85f2e7 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/AdvancedCoinSettingsModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/AdvancedCoinSettingsModal.tsx @@ -1,11 +1,15 @@ import styled from 'styled-components'; + import { variables } from '@trezor/components'; -import { Modal, Translation } from 'src/components/suite'; import { networks, NetworkSymbol } from '@suite-common/wallet-config'; -import { CustomBackends } from './CustomBackends/CustomBackends'; +import { CoinLogo } from '@trezor/product-components'; + +import { Modal, Translation } from 'src/components/suite'; import { getCoinLabel } from 'src/utils/suite/getCoinLabel'; import { useSelector } from 'src/hooks/suite'; -import { CoinLogo } from '@trezor/product-components'; + +import { CustomBackends } from './CustomBackends/CustomBackends'; + const Section = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/BackendInput.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/BackendInput.tsx index 6c4a25052c5..2322144cd89 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/BackendInput.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/BackendInput.tsx @@ -1,4 +1,5 @@ import { Input, Spinner, Tooltip } from '@trezor/components'; + import { Translation, StatusLight } from 'src/components/suite'; const ActiveStatus = ( diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/BackendTypeSelect.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/BackendTypeSelect.tsx index 8e21f3e9098..d03c0fa3fb2 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/BackendTypeSelect.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/BackendTypeSelect.tsx @@ -1,11 +1,12 @@ import { useMemo } from 'react'; + import styled from 'styled-components'; import { Select } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { isDesktop } from '@trezor/env-utils'; - import { Network } from '@suite-common/wallet-config'; + +import { Translation } from 'src/components/suite'; import type { BackendOption } from 'src/hooks/settings/backends'; const Capitalize = styled.span` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/ConnectionInfo.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/ConnectionInfo.tsx index e49f8324784..3543b4ebdad 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/ConnectionInfo.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/ConnectionInfo.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; + import { Paragraph } from '@trezor/components'; +import { NetworkSymbol } from '@suite-common/wallet-config'; + import { useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite/Translation'; -import { NetworkSymbol } from '@suite-common/wallet-config'; // eslint-disable-next-line local-rules/no-override-ds-component const Wrapper = styled(Paragraph)` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/CustomBackends.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/CustomBackends.tsx index be770a2075e..7f4905d801e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/CustomBackends.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/CustomBackends.tsx @@ -1,18 +1,22 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { Input, Button, H3, CollapsibleBox } from '@trezor/components'; +import { Network } from '@suite-common/wallet-config'; +import { spacings } from '@trezor/theme'; + import { Translation, TooltipSymbol } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { toggleTor } from 'src/actions/suite/suiteActions'; import { useDefaultUrls, useBackendsForm } from 'src/hooks/settings/backends'; +import { selectTorState } from 'src/reducers/suite/suiteReducer'; + import ConnectionInfo from './ConnectionInfo'; import { BackendInput } from './BackendInput'; import { BackendTypeSelect } from './BackendTypeSelect'; import { TorModal, TorResult } from './TorModal'; -import { Network } from '@suite-common/wallet-config'; -import { selectTorState } from 'src/reducers/suite/suiteReducer'; -import { spacings } from '@trezor/theme'; + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/TorModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/TorModal.tsx index 61a47dfa928..416052bb980 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/TorModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/TorModal.tsx @@ -1,7 +1,9 @@ import styled from 'styled-components'; + import { Button, Paragraph } from '@trezor/components'; -import { Modal, Translation } from 'src/components/suite'; import { isDesktop } from '@trezor/env-utils'; + +import { Modal, Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; import { getIsTorLoading } from 'src/utils/suite/tor'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ApplicationLogModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ApplicationLogModal.tsx index aa777df045a..20b63bba831 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ApplicationLogModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ApplicationLogModal.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { selectLogs } from '@suite-common/logger'; @@ -14,11 +15,11 @@ import { variables, useScrollShadow, } from '@trezor/components'; +import { spacings, spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { getApplicationInfo, getApplicationLog, prettifyLog } from 'src/utils/suite/logsUtils'; -import { spacings, spacingsPx } from '@trezor/theme'; const ScrollContainer = styled.div` overflow: auto; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceFailModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceFailModal.tsx index 6f58c39d687..9788bc9483a 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceFailModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceFailModal.tsx @@ -1,8 +1,9 @@ import styled from 'styled-components'; +import { TREZOR_SUPPORT_DEVICE_AUTHENTICATION_FAILED_URL } from '@trezor/urls'; + import { Modal } from 'src/components/suite'; import { SecurityCheckFail } from 'src/components/suite/SecurityCheck/SecurityCheckFail'; -import { TREZOR_SUPPORT_DEVICE_AUTHENTICATION_FAILED_URL } from '@trezor/urls'; const StyledModal = styled(Modal)` text-align: left; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CancelCoinjoinModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CancelCoinjoinModal.tsx index ea9e8d7de46..0add1860480 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CancelCoinjoinModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CancelCoinjoinModal.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { Button } from '@trezor/components'; + import { useSelector } from 'src/hooks/suite/useSelector'; import { Modal, Translation } from 'src/components/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimEthForm.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimEthForm.tsx index 7444cdd335d..af99701b6b7 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimEthForm.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimEthForm.tsx @@ -1,16 +1,20 @@ import { useEffect } from 'react'; + import styled from 'styled-components'; + import { Button, Paragraph, Tooltip, Banner } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; +import { getAccountEverstakeStakingPool } from '@suite-common/wallet-utils'; + import { Translation, FiatValue, FormattedCryptoAmount } from 'src/components/suite'; import { useDevice, useSelector } from 'src/hooks/suite'; import { useClaimEthFormContext } from 'src/hooks/wallet/useClaimEthForm'; import { CRYPTO_INPUT } from 'src/types/wallet/stakeForms'; -import { spacingsPx } from '@trezor/theme'; -import ClaimFees from './Fees'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { getAccountEverstakeStakingPool } from '@suite-common/wallet-utils'; import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; +import ClaimFees from './Fees'; + const AmountInfo = styled.div` display: flex; justify-content: space-between; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimModal.tsx index 035b069e14d..ce45d30c33a 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimModal.tsx @@ -1,6 +1,8 @@ import styled from 'styled-components'; + import { useSelector } from 'src/hooks/suite'; import { Modal, Translation } from 'src/components/suite'; + import { ClaimModalContent } from './ClaimModalContent'; const StyledModal = styled(Modal)` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimModalContent.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimModalContent.tsx index 4505fdfbca5..14b23016c5d 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimModalContent.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/ClaimModalContent.tsx @@ -1,5 +1,7 @@ import { SelectedAccountLoaded } from '@suite-common/wallet-types'; + import { ClaimEthFormContext, useClaimEthForm } from 'src/hooks/wallet/useClaimEthForm'; + import { ClaimEthForm } from './ClaimEthForm'; interface ClaimModalContentProps { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/Fees.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/Fees.tsx index b6406676b65..760f7319b75 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/Fees.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ClaimModal/Fees.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { Fees } from 'src/components/wallet/Fees/Fees'; import { useClaimEthFormContext } from 'src/hooks/wallet/useClaimEthForm'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CoinjoinSuccessModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CoinjoinSuccessModal.tsx index 837af051e7a..e3c3f5409d9 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CoinjoinSuccessModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CoinjoinSuccessModal.tsx @@ -1,10 +1,11 @@ import styled from 'styled-components'; -import { useDispatch } from 'src/hooks/suite'; import { transparentize } from 'polished'; import { Button, Icon, variables } from '@trezor/components'; import { selectAccountByKey } from '@suite-common/wallet-core'; import { WalletParams } from '@suite-common/wallet-types'; + +import { useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectRouterParams } from 'src/reducers/suite/routerReducer'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CoinmarketTermsModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CoinmarketTermsModal.tsx index 7e2f6fad30e..059589648f7 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CoinmarketTermsModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CoinmarketTermsModal.tsx @@ -1,9 +1,11 @@ +import { CryptoId } from 'invity-api'; + import { Column, IconCircle, Paragraph, NewModal, List, H4 } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import type { Deferred } from '@trezor/utils'; -import { CryptoId } from 'invity-api'; -import { useDevice } from 'src/hooks/suite'; import { spacings } from '@trezor/theme'; + +import { Translation } from 'src/components/suite'; +import { useDevice } from 'src/hooks/suite'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; type CoinmarketTermsModalProps = { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedAddressModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedAddressModal.tsx index ae6a4a04483..0251ea62dff 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedAddressModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedAddressModal.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react'; import { openAddressModal, showAddress } from 'src/actions/wallet/receiveActions'; + import { ConfirmUnverifiedModal } from './ConfirmUnverifiedModal'; interface ConfirmUnverifiedAddressModalProps { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx index e880097f858..2a31ddb16d6 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx @@ -1,12 +1,15 @@ +import { useEffect } from 'react'; + +import { Button, H3, NewModal, Paragraph } from '@trezor/components'; +import { selectDeviceLabelOrName } from '@suite-common/wallet-core'; + import { Translation } from 'src/components/suite'; import { TranslationKey } from 'src/components/suite/Translation'; import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; import { Dispatch, GetState } from 'src/types/suite'; -import { Button, H3, NewModal, Paragraph } from '@trezor/components'; import { onCancel } from 'src/actions/suite/modalActions'; -import { selectDeviceLabelOrName } from '@suite-common/wallet-core'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; -import { useEffect } from 'react'; + interface ConfirmUnverifiedModalProps { action: { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedProceedModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedProceedModal.tsx index 07f6d76fb9c..87bd02a247c 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedProceedModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedProceedModal.tsx @@ -1,7 +1,8 @@ -import { ConfirmUnverifiedModal } from './ConfirmUnverifiedModal'; import { COINMARKET_BUY } from 'src/actions/wallet/constants'; import { Dispatch } from 'src/types/suite'; +import { ConfirmUnverifiedModal } from './ConfirmUnverifiedModal'; + interface ConfirmUnverifiedProceedModalProps { value: string; } diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedXpubModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedXpubModal.tsx index 2ac4149b6b5..900f9aa0a57 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedXpubModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedXpubModal.tsx @@ -1,8 +1,9 @@ import { useCallback } from 'react'; -import { ConfirmUnverifiedModal } from './ConfirmUnverifiedModal'; import { openXpubModal, showXpub } from 'src/actions/wallet/publicKeyActions'; +import { ConfirmUnverifiedModal } from './ConfirmUnverifiedModal'; + export const ConfirmUnverifiedXpubModal = () => { const event = useCallback(() => openXpubModal(), []); const verifyProcess = useCallback(() => showXpub(), []); diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/AutoStopButton.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/AutoStopButton.tsx index 2ebd19e43da..057a998e77f 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/AutoStopButton.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/AutoStopButton.tsx @@ -1,13 +1,16 @@ import { useState } from 'react'; + import styled, { css, useTheme } from 'styled-components'; + import { Icon, IconName } from '@trezor/components'; import { TranslationKey } from '@suite-common/intl-types'; +import { borders, typography } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectIsSessionAutostopped } from 'src/reducers/wallet/coinjoinReducer'; import { useDispatch } from 'src/hooks/suite/useDispatch'; import { toggleAutostopCoinjoin } from 'src/actions/wallet/coinjoinAccountActions'; -import { borders, typography } from '@trezor/theme'; const TRANSITION_CONFIG = '0.1s ease'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CoinjoinPhaseProgress.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CoinjoinPhaseProgress.tsx index 3643217e56e..0429e72ee79 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CoinjoinPhaseProgress.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CoinjoinPhaseProgress.tsx @@ -1,11 +1,14 @@ import styled, { useTheme } from 'styled-components'; -import { CoinjoinSession, SessionPhase } from 'src/types/wallet/coinjoin'; + import { Spinner, Icon } from '@trezor/components'; +import { RoundPhase } from '@trezor/coinjoin'; +import { spacingsPx, typography } from '@trezor/theme'; + +import { CoinjoinSession, SessionPhase } from 'src/types/wallet/coinjoin'; import { SESSION_PHASE_MESSAGES } from 'src/constants/suite/coinjoin'; import { Translation } from 'src/components/suite/Translation'; import { CountdownTimer } from 'src/components/suite/CountdownTimer'; -import { RoundPhase } from '@trezor/coinjoin'; -import { spacingsPx, typography } from '@trezor/theme'; + const Container = styled.div` padding: ${spacingsPx.xxl} ${spacingsPx.xxxl} 0; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CriticalCoinjoinPhaseModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CriticalCoinjoinPhaseModal.tsx index 10e7030c2d4..6781a3896c4 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CriticalCoinjoinPhaseModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CriticalCoinjoinPhaseModal.tsx @@ -1,13 +1,16 @@ import styled from 'styled-components'; + import { variables, Image } from '@trezor/components'; +import { spacingsPx, typography } from '@trezor/theme'; + import { Modal, Translation } from 'src/components/suite'; import { useSelector, useDevice } from 'src/hooks/suite'; import { selectCoinjoinAccountByKey } from 'src/reducers/wallet/coinjoinReducer'; -import { CoinjoinPhaseProgress } from './CoinjoinPhaseProgress'; import { ROUND_PHASE_MESSAGES } from 'src/constants/suite/coinjoin'; import { useCoinjoinSessionPhase } from 'src/hooks/coinjoin'; + +import { CoinjoinPhaseProgress } from './CoinjoinPhaseProgress'; import { AutoStopButton } from './AutoStopButton'; -import { spacingsPx, typography } from '@trezor/theme'; const StyledModal = styled(Modal)` width: 520px; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DeviceAuthenticityOptOutModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DeviceAuthenticityOptOutModal.tsx index 9eec4af1cc0..f2fd15d65d2 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DeviceAuthenticityOptOutModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DeviceAuthenticityOptOutModal.tsx @@ -1,10 +1,11 @@ import { useState } from 'react'; import { Column, NewModal, Card, Banner, H3, Paragraph } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { Translation, CheckItem } from 'src/components/suite'; import { deviceAuthenticityOptOut } from 'src/actions/suite/suiteActions'; import { useDispatch } from 'src/hooks/suite'; -import { spacings } from '@trezor/theme'; type DeviceAuthenticityOptOutModalProps = { onCancel: () => void; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorModal.tsx index 264bcfdee71..65e745c1d3f 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorModal.tsx @@ -1,17 +1,20 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { Button, H3, Paragraph, variables } from '@trezor/components'; import { getTitleForNetwork } from '@suite-common/wallet-utils'; import { UserContextPayload } from '@suite-common/suite-types'; import { blockchainActions } from '@suite-common/wallet-core'; +import { NetworkSymbol } from '@suite-common/wallet-config'; +import { CoinLogo } from '@trezor/product-components'; + import { Modal, Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { isOnionUrl } from 'src/utils/suite/tor'; import { useCustomBackends } from 'src/hooks/settings/backends'; -import { NetworkSymbol } from '@suite-common/wallet-config'; import { AdvancedCoinSettingsModal } from 'src/components/suite/modals'; -import { CoinLogo } from '@trezor/product-components'; + const BackendRowWrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/FirmwareRevisionOptOutModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/FirmwareRevisionOptOutModal.tsx index 01dc67dc185..aaac59499de 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/FirmwareRevisionOptOutModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/FirmwareRevisionOptOutModal.tsx @@ -1,10 +1,11 @@ import { useState } from 'react'; import { Column, NewModal, Banner, Card, H3, Paragraph } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { Translation, CheckItem } from 'src/components/suite'; import { toggleCheckFirmwareAuthenticity } from 'src/actions/suite/suiteActions'; import { useDispatch } from 'src/hooks/suite'; -import { spacings } from '@trezor/theme'; type DeviceAuthenticityOptOutModalProps = { onCancel: () => void; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/DelimiterForm.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/DelimiterForm.tsx index 73f40710b43..74361ba357b 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/DelimiterForm.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/DelimiterForm.tsx @@ -1,6 +1,9 @@ import { useState, useRef, useEffect } from 'react'; + import styled from 'styled-components'; + import { Switch, Input, variables } from '@trezor/components'; + import { Translation } from 'src/components/suite'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/ExampleCSV.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/ExampleCSV.tsx index 9c7be63c7be..de8f11fdd34 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/ExampleCSV.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/ExampleCSV.tsx @@ -1,11 +1,14 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { motion, AnimatePresence } from 'framer-motion'; + import { Paragraph, Icon, motionAnimation } from '@trezor/components'; +import { borders, spacingsPx, typography } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useSelector, useTranslation } from 'src/hooks/suite'; import { selectIsLabelingAvailable } from 'src/reducers/suite/metadataReducer'; -import { borders, spacingsPx, typography } from '@trezor/theme'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/ImportTransactionModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/ImportTransactionModal.tsx index a9a385fac52..a616945e2ba 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/ImportTransactionModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/ImportTransactionModal.tsx @@ -1,11 +1,14 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { UserContextPayload } from '@suite-common/suite-types'; import { parseCSV } from '@suite-common/wallet-utils'; + import { Translation, Modal } from 'src/components/suite'; import type { ExtendedMessageDescriptor } from 'src/types/suite'; import { DropZone } from 'src/components/suite/DropZone'; + import { DelimiterForm } from './DelimiterForm'; import { ExampleCSV } from './ExampleCSV'; import { TabSelection, TabId } from './TabSelection'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/InputCSV.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/InputCSV.tsx index 47d55a34a81..4f657d3308e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/InputCSV.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/InputCSV.tsx @@ -1,5 +1,7 @@ import { useRef } from 'react'; + import styled from 'styled-components'; + import { Textarea, Button } from '@trezor/components'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/TabSelection.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/TabSelection.tsx index f01e9a69fe3..7d1099cdbf7 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/TabSelection.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ImportTransactionModal/TabSelection.tsx @@ -1,8 +1,11 @@ import { Dispatch, SetStateAction } from 'react'; + import styled from 'styled-components'; -import { Translation } from 'src/components/suite'; + import { variables } from '@trezor/components'; +import { Translation } from 'src/components/suite'; + const TabSelector = styled.div` width: 100%; text-align: left; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MetadataProviderModal/MetadataProviderModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MetadataProviderModal/MetadataProviderModal.tsx index ca502290700..f529a9d0182 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MetadataProviderModal/MetadataProviderModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MetadataProviderModal/MetadataProviderModal.tsx @@ -1,13 +1,16 @@ import { useState } from 'react'; + import { Button, NewModal, Row, Paragraph } from '@trezor/components'; +import type { Deferred } from '@trezor/utils'; +import { isFeatureFlagEnabled } from '@suite-common/suite-utils'; +import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite/index'; import { useDispatch } from 'src/hooks/suite'; import { connectProvider } from 'src/actions/suite/metadataProviderActions'; -import type { Deferred } from '@trezor/utils'; import { MetadataProviderType } from 'src/types/suite/metadata'; -import { isFeatureFlagEnabled } from '@suite-common/suite-utils'; -import { spacings } from '@trezor/theme'; + + import { DropboxLogo } from './DropboxLogo'; import { GoogleDriveLogo } from './GoogleDriveLogo'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MoreRoundsNeededModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MoreRoundsNeededModal.tsx index 9f3fa23802c..68e27f135ca 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MoreRoundsNeededModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MoreRoundsNeededModal.tsx @@ -1,6 +1,8 @@ import styled, { useTheme } from 'styled-components'; -import { useDispatch } from 'src/hooks/suite'; + import { Button, Icon, variables } from '@trezor/components'; + +import { useDispatch } from 'src/hooks/suite'; import { onCancel as closeModal } from 'src/actions/suite/modalActions'; import { Modal, Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/BackupInstructionsCard.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/BackupInstructionsCard.tsx index 7f14a9b9f99..00ee7c35312 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/BackupInstructionsCard.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/BackupInstructionsCard.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled, { css } from 'styled-components'; import { Card, Icon, IconName } from '@trezor/components'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/BackupInstructionsStep.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/BackupInstructionsStep.tsx index 822486030d0..1d0d9baaef2 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/BackupInstructionsStep.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/BackupInstructionsStep.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled, { css } from 'styled-components'; import { TranslationKey } from '@suite-common/intl-types'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal.tsx index fae960a71f4..6766cfc9946 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal.tsx @@ -1,24 +1,26 @@ import { useState } from 'react'; -import { selectDevice } from '@suite-common/wallet-core'; +import { selectDevice } from '@suite-common/wallet-core'; import { Button, ModalProps } from '@trezor/components'; import { HELP_CENTER_KEEPING_SEED_SAFE_URL, TREZOR_SUPPORT_RECOVERY_ISSUES_URL, HELP_CENTER_UPGRADING_TO_MULTI_SHARE_URL, } from '@trezor/urls'; +import TrezorConnect, { PROTO } from '@trezor/connect'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { useSelector } from 'src/hooks/suite'; import { Modal, Translation } from 'src/components/suite'; import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; + import { MultiShareBackupStep1FirstInfo } from './MultiShareBackupStep1FirstInfo'; import { MultiShareBackupStep2SecondInfo } from './MultiShareBackupStep2SecondInfo'; -import TrezorConnect, { PROTO } from '@trezor/connect'; import { MultiShareBackupStep5Done } from './MultiShareBackupStep5Done'; import { isAdditionalShamirBackupInProgress } from '../../../../../../utils/device/isRecoveryInProgress'; import { MultiShareBackupStep3VerifyOwnership } from './MultiShareBackupStep3VerifyOwnership'; import { MultiShareBackupStep4BackupSeed } from './MultiShareBackupStep4BackupSeed'; -import { EventType, analytics } from '@trezor/suite-analytics'; + type Steps = 'first-info' | 'second-info' | 'verify-ownership' | 'backup-seed' | 'done'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep1FirstInfo.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep1FirstInfo.tsx index 43a5e5877ee..e3ab51099c2 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep1FirstInfo.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep1FirstInfo.tsx @@ -1,10 +1,12 @@ import { Dispatch, SetStateAction } from 'react'; + import styled from 'styled-components'; import { Checkbox, Image, Paragraph } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; + import { Body, Section } from './multiShareModalLayout'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5Done.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5Done.tsx index 27a084f6f39..741cf8d7199 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5Done.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5Done.tsx @@ -1,11 +1,15 @@ +import { ReactNode } from 'react'; + +import styled from 'styled-components'; + import { Card, Row, Column, Text, Icon } from '@trezor/components'; +import { borders, spacings, spacingsPx } from '@trezor/theme'; +import { TranslationKey } from '@suite-common/intl-types'; import { Translation } from 'src/components/suite'; + import { Body, Section } from './multiShareModalLayout'; -import { borders, spacings, spacingsPx } from '@trezor/theme'; -import { ReactNode } from 'react'; -import { TranslationKey } from '@suite-common/intl-types'; -import styled from 'styled-components'; + const GradientCallout = styled.div` background-image: linear-gradient( diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/instructionSteps.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/instructionSteps.tsx index 7a70242e4e5..917e52bc47d 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/instructionSteps.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/instructionSteps.tsx @@ -1,10 +1,11 @@ -import { Row, Image, Text } from '@trezor/components'; import styled from 'styled-components'; +import { Row, Image, Text } from '@trezor/components'; import { borders, spacings, spacingsPx } from '@trezor/theme'; import { ESHOP_KEEP_METAL_SINGLE_SHARE_URL, HELP_CENTER_SEED_CARD_URL } from '@trezor/urls'; import { Translation, TrezorLink } from 'src/components/suite'; + import { BackupInstructionsCard } from './BackupInstructionsCard'; import { BackupInstructionsStepProps } from './BackupInstructionsStep'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/multiShareModalLayout.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/multiShareModalLayout.tsx index 9cf32071099..2d4719259da 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/multiShareModalLayout.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/multiShareModalLayout.tsx @@ -1,6 +1,7 @@ +import { ReactNode } from 'react'; + import { Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { ReactNode } from 'react'; export const Body = ({ children }: { children: ReactNode }) => ( diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PassphraseDuplicateModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PassphraseDuplicateModal.tsx index bb65f9c6680..fa905b01333 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PassphraseDuplicateModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PassphraseDuplicateModal.tsx @@ -1,5 +1,4 @@ import { Button, Column, H3, Text } from '@trezor/components'; - import { authorizeDeviceThunk, switchDuplicatedDevice } from '@suite-common/wallet-core'; import { spacings } from '@trezor/theme'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PassphraseMismatchModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PassphraseMismatchModal.tsx index 63e85c150ac..c09273e6559 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PassphraseMismatchModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PassphraseMismatchModal.tsx @@ -1,17 +1,18 @@ import { Button, H3, Column, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { passwordMismatchResetThunk } from '@suite-common/wallet-core'; +import { WalletType } from '@suite-common/wallet-types'; import { useDevice, useDispatch } from 'src/hooks/suite'; import { CardWithDevice } from 'src/views/suite/SwitchDevice/CardWithDevice'; -import { Translation } from '../../../Translation'; -import { passwordMismatchResetThunk } from '@suite-common/wallet-core'; import { addWalletThunk, redirectAfterWalletSelectedThunk, } from 'src/actions/wallet/addWalletThunk'; -import { WalletType } from '@suite-common/wallet-types'; import { SwitchDeviceModal } from 'src/views/suite/SwitchDevice/SwitchDeviceModal'; +import { Translation } from '../../../Translation'; + export const PassphraseMismatchModal = ({ onCancel }: { onCancel: () => void }) => { const { isLocked, device: selectDevice } = useDevice(); const dispatch = useDispatch(); diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PinMismatchModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PinMismatchModal.tsx index 3bbc9353164..ab636e11977 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PinMismatchModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PinMismatchModal.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { Button, Image } from '@trezor/components'; + import { Translation, Modal, ModalProps } from 'src/components/suite'; import { changePin } from 'src/actions/settings/deviceSettingsActions'; import { useDispatch } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/QrScannerModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/QrScannerModal.tsx index 41b3977c20d..66b5bc015ab 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/QrScannerModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/QrScannerModal.tsx @@ -1,4 +1,5 @@ import { lazy, Suspense, useState } from 'react'; + import styled from 'styled-components'; import { UserContextPayload } from '@suite-common/suite-types'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/SafetyChecksModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/SafetyChecksModal.tsx index 3dc206cfd12..b76230c324a 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/SafetyChecksModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/SafetyChecksModal.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { useDevice, useDispatch } from 'src/hooks/suite'; + import { Radio, Paragraph, @@ -10,9 +10,12 @@ import { Card, Text, } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + +import { useDevice, useDispatch } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; -import { spacings } from '@trezor/theme'; + /** * A Modal that allows user to set the `safety_checks` feature of connected Trezor. diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeEthInANutshellModal/StakeEthInANutshellModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeEthInANutshellModal/StakeEthInANutshellModal.tsx index 56ed954761d..36cefc901ab 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeEthInANutshellModal/StakeEthInANutshellModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeEthInANutshellModal/StakeEthInANutshellModal.tsx @@ -13,14 +13,15 @@ import { Divider, CollapsibleBox, } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { TranslationKey } from '@suite-common/intl-types'; +import { spacings } from '@trezor/theme'; +import { selectValidatorsQueueData } from '@suite-common/wallet-core'; + +import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; -import { spacings } from '@trezor/theme'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { getUnstakingPeriodInDays } from 'src/utils/suite/stake'; -import { selectValidatorsQueueData } from '@suite-common/wallet-core'; import { StakingInfo } from 'src/components/suite/StakingProcess/StakingInfo'; import { UnstakingInfo } from 'src/components/suite/StakingProcess/UnstakingInfo'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/AvailableBalance.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/AvailableBalance.tsx index 757935ea0c9..5f0dd2d0520 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/AvailableBalance.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/AvailableBalance.tsx @@ -1,6 +1,8 @@ import React from 'react'; + import { Paragraph, Column, Text } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; + import { Translation, FormattedCryptoAmount, FiatValue } from 'src/components/suite'; interface AvailableBalanceProps { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/ConfirmStakeEthModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/ConfirmStakeEthModal.tsx index dbbc196ee24..ee2d773325d 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/ConfirmStakeEthModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/ConfirmStakeEthModal.tsx @@ -1,12 +1,14 @@ import { useState } from 'react'; + import { Checkbox, NewModal, Column, Banner, Card } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { selectValidatorsQueueData } from '@suite-common/wallet-core'; +import { HELP_CENTER_ETH_STAKING } from '@trezor/urls'; + import { Translation, TrezorLink } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { selectValidatorsQueueData } from '@suite-common/wallet-core'; -import { HELP_CENTER_ETH_STAKING } from '@trezor/urls'; import { getDaysToAddToPoolInitial } from 'src/utils/suite/stake'; interface ConfirmStakeEthModalProps { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/Inputs.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/Inputs.tsx index 86a64debbbc..022ff65a8e0 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/Inputs.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/Inputs.tsx @@ -1,8 +1,12 @@ import styled from 'styled-components'; + import { Icon, Banner, Column, Text } from '@trezor/components'; import { getInputState } from '@suite-common/wallet-utils'; import { useFormatters } from '@suite-common/formatters'; import { formInputsMaxLength } from '@suite-common/validators'; +import { MIN_ETH_FOR_WITHDRAWALS } from '@suite-common/wallet-constants'; +import { spacingsPx } from '@trezor/theme'; + import { NumberInput, Translation } from 'src/components/suite'; import { useTranslation } from 'src/hooks/suite'; import { useStakeEthFormContext } from 'src/hooks/wallet/useStakeEthForm'; @@ -13,8 +17,6 @@ import { validateReserveOrBalance, } from 'src/utils/suite/validation'; import { FIAT_INPUT, CRYPTO_INPUT } from 'src/types/wallet/stakeForms'; -import { MIN_ETH_FOR_WITHDRAWALS } from '@suite-common/wallet-constants'; -import { spacingsPx } from '@trezor/theme'; import { validateStakingMax } from 'src/utils/suite/stake'; const IconWrapper = styled.div` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/StakeButton.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/StakeButton.tsx index 610c2c2d5a1..30779454531 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/StakeButton.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/StakeButton.tsx @@ -1,4 +1,5 @@ import { Tooltip, NewModal } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useStakeEthFormContext } from 'src/hooks/wallet/useStakeEthForm'; import { useDevice } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/StakeEthForm.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/StakeEthForm.tsx index bad02bf89c8..c88e12fd329 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/StakeEthForm.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeEthForm/StakeEthForm.tsx @@ -1,10 +1,12 @@ import { Button, Column, Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useStakeEthFormContext } from 'src/hooks/wallet/useStakeEthForm'; import { FormFractionButtons } from 'src/components/suite/FormFractionButtons'; -import { StakeFees } from './StakeFees'; import { CRYPTO_INPUT, FIAT_INPUT } from 'src/types/wallet/stakeForms'; + +import { StakeFees } from './StakeFees'; import { Inputs } from './Inputs'; import { ConfirmStakeEthModal } from './ConfirmStakeEthModal'; import { AvailableBalance } from './AvailableBalance'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeModal.tsx index 6e3d85cdd5b..eb00ab094d1 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakeModal.tsx @@ -1,12 +1,14 @@ import { Grid, NewModal, useMediaQuery, variables } from '@trezor/components'; import { SelectedAccountLoaded } from '@suite-common/wallet-types'; +import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { StakeEthFormContext, useStakeEthForm } from 'src/hooks/wallet/useStakeEthForm'; + import { StakeEthForm } from './StakeEthForm/StakeEthForm'; import { StakeButton } from './StakeEthForm/StakeButton'; import { StakingInfoCards } from './StakingInfoCards/StakingInfoCards'; -import { spacings } from '@trezor/theme'; interface StakeModalModalProps { onCancel?: () => void; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/EstimatedGains.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/EstimatedGains.tsx index d0bc239ea1f..51cd482af25 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/EstimatedGains.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/EstimatedGains.tsx @@ -1,15 +1,19 @@ import React from 'react'; +import { useSelector } from 'react-redux'; + +import styled, { useTheme } from 'styled-components'; + import { selectPoolStatsApyData, StakeRootState } from '@suite-common/wallet-core'; import { Column, Grid, H2, Image, Paragraph, Text } from '@trezor/components'; -import { useSelector } from 'react-redux'; +import { spacings, spacingsPx } from '@trezor/theme'; +import { HELP_CENTER_ETH_STAKING } from '@trezor/urls'; + import { Translation } from 'src/components/suite/Translation'; import { useStakeEthFormContext } from 'src/hooks/wallet/useStakeEthForm'; import { CRYPTO_INPUT } from 'src/types/wallet/stakeForms'; import { FiatValue, FormattedCryptoAmount, TrezorLink } from 'src/components/suite'; -import styled, { useTheme } from 'styled-components'; -import { spacings, spacingsPx } from '@trezor/theme'; import { calculateGains } from 'src/utils/suite/stake'; -import { HELP_CENTER_ETH_STAKING } from '@trezor/urls'; + const Heading = styled.div` margin-bottom: ${spacingsPx.xl}; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/StakingInfoCards.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/StakingInfoCards.tsx index c8a80487ebd..8c4e81ff297 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/StakingInfoCards.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/StakingInfoCards.tsx @@ -1,9 +1,12 @@ -import { Translation } from 'src/components/suite/Translation'; import { Card, CollapsibleBox, Column, H3, List } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { EstimatedGains } from './EstimatedGains'; + +import { Translation } from 'src/components/suite/Translation'; import { StakingInfo } from 'src/components/suite/StakingProcess/StakingInfo'; +import { EstimatedGains } from './EstimatedGains'; + + export const StakingInfoCards = () => { const cards = [ { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AdvancedTxDetails.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AdvancedTxDetails.tsx index 1af6970b025..4495c7705a4 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AdvancedTxDetails.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AdvancedTxDetails.tsx @@ -1,14 +1,18 @@ import { useState } from 'react'; + import styled from 'styled-components'; -import { Translation } from 'src/components/suite'; + import { useElevation, variables } from '@trezor/components'; import { isTestnet } from '@suite-common/wallet-utils'; import { WalletAccountTransaction, ChainedTransactions } from '@suite-common/wallet-types'; import { AccountType, Network } from '@suite-common/wallet-config'; +import { Elevation, mapElevationToBorder, spacingsPx } from '@trezor/theme'; + +import { Translation } from 'src/components/suite'; + import { AmountDetails } from './AmountDetails'; import { IODetails } from './IODetails/IODetails'; import { ChainedTxs } from '../ChainedTxs'; -import { Elevation, mapElevationToBorder, spacingsPx } from '@trezor/theme'; import { Data } from './Data'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AmountDetails.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AmountDetails.tsx index a4ff0fb8a82..6acfeaf6af0 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AmountDetails.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AmountDetails.tsx @@ -1,8 +1,6 @@ import styled from 'styled-components'; + import { variables } from '@trezor/components'; -import { Translation, FormattedCryptoAmount, FiatValue, FormattedDate } from 'src/components/suite'; -import { AmountRow } from './AmountRow'; -import { WalletAccountTransaction } from 'src/types/wallet'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { formatAmount, @@ -17,15 +15,20 @@ import { isStakeTypeTx, } from '@suite-common/wallet-utils'; import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { FormattedNftAmount } from 'src/components/suite/FormattedNftAmount'; -import { useSelector } from 'src/hooks/suite'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { selectHistoricFiatRates, selectHistoricFiatRatesByTimestamp, } from '@suite-common/wallet-core'; import { Timestamp, TokenAddress } from '@suite-common/wallet-types'; +import { FormattedNftAmount } from 'src/components/suite/FormattedNftAmount'; +import { useSelector } from 'src/hooks/suite'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { WalletAccountTransaction } from 'src/types/wallet'; +import { Translation, FormattedCryptoAmount, FiatValue, FormattedDate } from 'src/components/suite'; + +import { AmountRow } from './AmountRow'; + const MainContainer = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AmountRow.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AmountRow.tsx index 7d825a8f74c..7e40cd37400 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AmountRow.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AmountRow.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled, { css } from 'styled-components'; const rightAlignedStyles = css` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/Data.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/Data.tsx index d7e96fe4968..a99c63970f5 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/Data.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/Data.tsx @@ -1,10 +1,13 @@ +import styled from 'styled-components'; + import { WalletAccountTransaction } from '@suite-common/wallet-types'; import { Paragraph, Row } from '@trezor/components'; import { palette, spacingsPx } from '@trezor/theme'; -import styled from 'styled-components'; -import { Translation } from 'src/components/suite'; import { TranslationKey } from '@suite-common/intl-types'; +import { Translation } from 'src/components/suite'; + + const Container = styled.div` display: grid; grid-template-columns: 130px 3fr; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/AnalyzeInExplorerBanner.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/AnalyzeInExplorerBanner.tsx index 40480539305..a741793f422 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/AnalyzeInExplorerBanner.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/AnalyzeInExplorerBanner.tsx @@ -1,12 +1,13 @@ import styled from 'styled-components'; import { variables } from '@trezor/components'; -import { NotificationCard, Translation } from 'src/components/suite'; -import { useSelector } from 'src/hooks/suite'; import { typography } from '@trezor/theme'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { selectBlockchainExplorerBySymbol } from '@suite-common/wallet-core'; +import { useSelector } from 'src/hooks/suite'; +import { NotificationCard, Translation } from 'src/components/suite'; + const TextWrapper = styled.div` display: flex; text-align: start; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/IODetails.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/IODetails.tsx index 4eae47db2dc..8415fb0b7a5 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/IODetails.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/IODetails.tsx @@ -1,18 +1,22 @@ import { ReactElement, ReactNode } from 'react'; + import styled, { css, useTheme } from 'styled-components'; import { spacingsPx, spacings, typography } from '@trezor/theme'; import { WalletAccountTransaction } from '@suite-common/wallet-types'; import { formatAmount, formatNetworkAmount, isNftTokenTransfer } from '@suite-common/wallet-utils'; -import { FormattedCryptoAmount, Translation } from 'src/components/suite'; -import { useSelector } from 'src/hooks/suite/useSelector'; import { AnonymitySet, TokenTransfer } from '@trezor/blockchain-link'; import { Icon, CollapsibleBox, Divider } from '@trezor/components'; +import { NetworkSymbol } from '@suite-common/wallet-config'; + +import { FormattedCryptoAmount, Translation } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite/useSelector'; import { UtxoAnonymity } from 'src/components/wallet'; -import { AnalyzeInExplorerBanner } from './AnalyzeInExplorerBanner'; import { FormattedNftAmount } from 'src/components/suite/FormattedNftAmount'; + +import { AnalyzeInExplorerBanner } from './AnalyzeInExplorerBanner'; import { IOAddress } from '../../IOAddress'; -import { NetworkSymbol } from '@suite-common/wallet-config'; + export const blurFix = css` margin-left: -10px; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/BasicTxDetails.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/BasicTxDetails.tsx index e1f03c5fb0c..44d1055be0f 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/BasicTxDetails.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/BasicTxDetails.tsx @@ -1,12 +1,9 @@ import styled, { useTheme } from 'styled-components'; +import { fromWei } from 'web3-utils'; + import { Icon, variables, H3, useElevation } from '@trezor/components'; -import { Translation, FormattedDateWithBullet } from 'src/components/suite'; -import { WalletAccountTransaction } from 'src/types/wallet'; import { Network } from '@suite-common/wallet-config'; import { getTxIcon, isPending, getFeeUnits, getFeeRate } from '@suite-common/wallet-utils'; -import { TransactionHeader } from 'src/components/wallet/TransactionItem/TransactionHeader'; -import { fromWei } from 'web3-utils'; -import { IOAddress } from './IOAddress'; import { Elevation, borders, @@ -18,6 +15,13 @@ import { } from '@trezor/theme'; import { CoinLogo } from '@trezor/product-components'; +import { Translation, FormattedDateWithBullet } from 'src/components/suite'; +import { WalletAccountTransaction } from 'src/types/wallet'; +import { TransactionHeader } from 'src/components/wallet/TransactionItem/TransactionHeader'; + +import { IOAddress } from './IOAddress'; + + const Wrapper = styled.div<{ $elevation: Elevation }>` background: ${mapElevationToBackground}; padding: ${spacingsPx.lg}; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChainedTxs.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChainedTxs.tsx index 9dcaa4c5877..ce866c50484 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChainedTxs.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChainedTxs.tsx @@ -2,10 +2,11 @@ import styled from 'styled-components'; import { variables } from '@trezor/components'; import { ChainedTransactions } from '@suite-common/wallet-types'; +import { AccountType, Network } from '@suite-common/wallet-config'; import { TrezorLink, Translation } from 'src/components/suite'; import { TransactionItem } from 'src/components/wallet/TransactionItem/TransactionItem'; -import { AccountType, Network } from '@suite-common/wallet-config'; + import { AffectedTransactionItem } from './ChangeFee/AffectedTransactionItem'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/AffectedTransactionItem.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/AffectedTransactionItem.tsx index c997985ccec..2f84d55b040 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/AffectedTransactionItem.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/AffectedTransactionItem.tsx @@ -1,9 +1,11 @@ import styled, { useTheme } from 'styled-components'; + import { Icon, variables } from '@trezor/components'; import { WalletAccountTransaction } from '@suite-common/wallet-types'; +import { truncateMiddle } from '@trezor/utils'; + import { FormattedDate } from 'src/components/suite'; import { useLayoutSize } from 'src/hooks/suite/useLayoutSize'; -import { truncateMiddle } from '@trezor/utils'; const TxRow = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/AffectedTransactions.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/AffectedTransactions.tsx index ed3952b1239..7925d4a7167 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/AffectedTransactions.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/AffectedTransactions.tsx @@ -1,7 +1,10 @@ import styled from 'styled-components'; + import { Button } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useRbfContext } from 'src/hooks/wallet/useRbfForm'; + import { GreyCard } from './GreyCard'; import { WarnHeader } from './WarnHeader'; import { AffectedTransactionItem } from './AffectedTransactionItem'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ChangeFee.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ChangeFee.tsx index acf08d76e88..b0a4a5d6bf7 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ChangeFee.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ChangeFee.tsx @@ -1,16 +1,21 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { variables } from '@trezor/components'; +import { formatNetworkAmount, getFeeUnits } from '@suite-common/wallet-utils'; +import { WalletAccountTransaction } from '@suite-common/wallet-types'; +import { borders } from '@trezor/theme'; + import { Translation, FiatValue, FormattedCryptoAmount } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { useRbf, RbfContext, UseRbfProps } from 'src/hooks/wallet/useRbfForm'; -import { formatNetworkAmount, getFeeUnits } from '@suite-common/wallet-utils'; -import { WalletAccountTransaction } from '@suite-common/wallet-types'; + import { RbfFees } from './RbfFees'; import { AffectedTransactions } from './AffectedTransactions'; import { DecreasedOutputs } from './DecreasedOutputs'; import { ReplaceTxButton } from './ReplaceTxButton'; -import { borders } from '@trezor/theme'; + const Wrapper = styled.div` margin: 12px 0; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/DecreasedOutputs.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/DecreasedOutputs.tsx index 6013bcf9559..fed8d17ec93 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/DecreasedOutputs.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/DecreasedOutputs.tsx @@ -1,14 +1,19 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; + import { Icon, variables, Radio, motionAnimation } from '@trezor/components'; +import { formatNetworkAmount } from '@suite-common/wallet-utils'; +import { spacings } from '@trezor/theme'; + import { FormattedCryptoAmount, HiddenPlaceholder } from 'src/components/suite'; import { Translation, TranslationKey } from 'src/components/suite/Translation'; -import { formatNetworkAmount } from '@suite-common/wallet-utils'; import { useRbfContext } from 'src/hooks/wallet/useRbfForm'; + import { GreyCard } from './GreyCard'; import { WarnHeader } from './WarnHeader'; -import { spacings } from '@trezor/theme'; + const OutputsWrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/GreyCard.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/GreyCard.tsx index 99747bc2ca9..6f9870587ef 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/GreyCard.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/GreyCard.tsx @@ -1,5 +1,7 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { Card, Column } from '@trezor/components'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ReplaceTxButton.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ReplaceTxButton.tsx index c3616d46955..66e70faf50b 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ReplaceTxButton.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ReplaceTxButton.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { Button } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useDevice } from 'src/hooks/suite'; import { useRbfContext } from 'src/hooks/wallet/useRbfForm'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/WarnHeader.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/WarnHeader.tsx index ae798138e56..4effaf18ad0 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/WarnHeader.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/WarnHeader.tsx @@ -1,5 +1,7 @@ import { ReactNode, HTMLAttributes } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { Icon, variables } from '@trezor/components'; const Header = styled.div` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/IOAddress.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/IOAddress.tsx index b47b2b51bea..1e03a6430b4 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/IOAddress.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/IOAddress.tsx @@ -1,9 +1,13 @@ -import { HiddenPlaceholder } from 'src/components/suite/HiddenPlaceholder'; -import { Icon, Link, Paragraph } from '@trezor/components'; import { useState } from 'react'; -import { copyToClipboard } from '@trezor/dom-utils'; + import styled, { css, useTheme } from 'styled-components'; +import { Icon, Link, Paragraph } from '@trezor/components'; +import { copyToClipboard } from '@trezor/dom-utils'; + + +import { HiddenPlaceholder } from 'src/components/suite/HiddenPlaceholder'; + const IconWrapper = styled.div` display: none; padding: 1px; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModal.tsx index dbbc246ac82..101ba9628d0 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModal.tsx @@ -1,22 +1,27 @@ import { useState, useMemo } from 'react'; + import styled from 'styled-components'; + import { Button, NewModal } from '@trezor/components'; import { HELP_CENTER_ZERO_VALUE_ATTACKS } from '@trezor/urls'; import { isPending, findChainedTransactions, getAccountKey } from '@suite-common/wallet-utils'; import { getNetwork } from '@suite-common/wallet-config'; -import { useSelector } from 'src/hooks/suite'; import { selectAccountByKey, selectTransactionConfirmations, selectAllPendingTransactions, selectIsPhishingTransaction, } from '@suite-common/wallet-core'; +import { borders, spacingsPx, typography } from '@trezor/theme'; + +import { useSelector } from 'src/hooks/suite'; import { Translation, TrezorLink } from 'src/components/suite'; import { Account, WalletAccountTransaction } from 'src/types/wallet'; + import { BasicTxDetails } from './BasicTxDetails'; import { AdvancedTxDetails, TabID } from './AdvancedTxDetails/AdvancedTxDetails'; import { ChangeFee } from './ChangeFee/ChangeFee'; -import { borders, spacingsPx, typography } from '@trezor/theme'; + const PhishingBanner = styled.div` margin-bottom: ${spacingsPx.xs}; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnecoCoinjoinModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnecoCoinjoinModal.tsx index f7a3db439e5..88a66fefaef 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnecoCoinjoinModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnecoCoinjoinModal.tsx @@ -3,11 +3,12 @@ import { transparentize } from 'polished'; import { selectIsAccountWithRatesByKey } from '@suite-common/wallet-core'; import { Button, variables } from '@trezor/components'; +import { formatAmount, getAccountDecimals } from '@suite-common/wallet-utils'; + import { FiatValue, FormattedCryptoAmount, Modal, Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite/useDispatch'; import { onCancel } from 'src/actions/suite/modalActions'; import { goto } from 'src/actions/suite/routerActions'; -import { formatAmount, getAccountDecimals } from '@suite-common/wallet-utils'; import { UNECONOMICAL_COINJOIN_THRESHOLD } from 'src/services/coinjoin'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { useSelector } from 'src/hooks/suite/useSelector'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/EverstakeModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/EverstakeModal.tsx index 3d3624eb9ea..5a8db6bacc0 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/EverstakeModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/EverstakeModal.tsx @@ -1,9 +1,11 @@ +import { useState } from 'react'; + import { Checkbox, NewModal, Column, Banner, Card } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; -import { spacings } from '@trezor/theme'; -import { useState } from 'react'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; interface EverstakeModalProps { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Fees.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Fees.tsx index cd73e323f54..309587eb3ff 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Fees.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Fees.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { Fees } from 'src/components/wallet/Fees/Fees'; import { useUnstakeEthFormContext } from 'src/hooks/wallet/useUnstakeEthForm'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Inputs.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Inputs.tsx index 23b4e14d148..65be5014a50 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Inputs.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Inputs.tsx @@ -1,15 +1,18 @@ import styled from 'styled-components'; + import { Icon } from '@trezor/components'; +import { formInputsMaxLength } from '@suite-common/validators'; +import { variables } from '@trezor/components/src/config'; +import { useFormatters } from '@suite-common/formatters'; +import { getInputState, getNonComposeErrorMessage } from '@suite-common/wallet-utils'; + import { NumberInput } from 'src/components/suite'; import { CRYPTO_INPUT, FIAT_INPUT } from 'src/types/wallet/stakeForms'; -import { formInputsMaxLength } from '@suite-common/validators'; import { useSelector, useTranslation } from 'src/hooks/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { variables } from '@trezor/components/src/config'; import { validateDecimals, validateLimitsBigNum, validateMin } from 'src/utils/suite/validation'; import { useUnstakeEthFormContext } from 'src/hooks/wallet/useUnstakeEthForm'; -import { useFormatters } from '@suite-common/formatters'; -import { getInputState, getNonComposeErrorMessage } from '@suite-common/wallet-utils'; + const HStack = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Options.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Options.tsx index a414bad5cb9..a924b9181f4 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Options.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Options.tsx @@ -1,14 +1,17 @@ import styled from 'styled-components'; -import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; + import { Paragraph, Radio } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; -import { Inputs } from './Inputs'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { getAccountEverstakeStakingPool } from '@suite-common/wallet-utils'; + import { useSelector } from 'src/hooks/suite'; import { useUnstakeEthFormContext } from 'src/hooks/wallet/useUnstakeEthForm'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { getAccountEverstakeStakingPool } from '@suite-common/wallet-utils'; +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; + +import { Inputs } from './Inputs'; // eslint-disable-next-line local-rules/no-override-ds-component const GreyP = styled(Paragraph)` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeButton.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeButton.tsx index ea7fa1d89ce..cc1ef2a9596 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeButton.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeButton.tsx @@ -1,4 +1,5 @@ import { Tooltip, Button } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useDevice } from 'src/hooks/suite'; import { CRYPTO_INPUT, FIAT_INPUT } from 'src/types/wallet/stakeForms'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx index 0752a1c9652..0bce3a08a91 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx @@ -1,18 +1,23 @@ import styled from 'styled-components'; + import { Divider, Icon, Paragraph, Tooltip, Banner, Row, Column } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; +import { selectValidatorsQueueData } from '@suite-common/wallet-core'; +import { getAccountEverstakeStakingPool } from '@suite-common/wallet-utils'; +import { BigNumber } from '@trezor/utils'; + import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { useUnstakeEthFormContext } from 'src/hooks/wallet/useUnstakeEthForm'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { CRYPTO_INPUT, FIAT_INPUT } from 'src/types/wallet/stakeForms'; -import { Options } from './Options'; import { getUnstakingPeriodInDays } from 'src/utils/suite/stake'; -import UnstakeFees from './Fees'; -import { selectValidatorsQueueData } from '@suite-common/wallet-core'; -import { getAccountEverstakeStakingPool } from '@suite-common/wallet-utils'; import { ApproximateInstantEthAmount } from 'src/views/wallet/staking/components/EthStakingDashboard/components/ApproximateInstantEthAmount'; -import { BigNumber } from '@trezor/utils'; + +import { Options } from './Options'; +import UnstakeFees from './Fees'; + + const DividerWrapper = styled.div` & > div { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeModal.tsx index 3a7ae643e91..43cd16618b3 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeModal.tsx @@ -1,5 +1,3 @@ -import { useSelector } from 'src/hooks/suite'; -import { Translation } from 'src/components/suite'; import { Card, CollapsibleBox, @@ -12,11 +10,16 @@ import { variables, } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { SelectedAccountLoaded } from '@suite-common/wallet-types'; + +import { useSelector } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; import { UnstakingInfo } from 'src/components/suite/StakingProcess/UnstakingInfo'; -import { UnstakeButton } from './UnstakeEthForm/UnstakeButton'; import { UnstakeEthFormContext, useUnstakeEthForm } from 'src/hooks/wallet/useUnstakeEthForm'; + +import { UnstakeButton } from './UnstakeEthForm/UnstakeButton'; import { UnstakeEthForm } from './UnstakeEthForm/UnstakeEthForm'; -import { SelectedAccountLoaded } from '@suite-common/wallet-types'; + interface UnstakeModalModalProps { onCancel?: () => void; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UserContextModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UserContextModal.tsx index 4d757eb60bc..7295accb954 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UserContextModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UserContextModal.tsx @@ -1,3 +1,5 @@ +import { CryptoId } from 'invity-api'; + import { onCancel as onCancelAction } from 'src/actions/suite/modalActions'; import { MODAL } from 'src/actions/suite/constants'; import { useDispatch } from 'src/hooks/suite'; @@ -42,8 +44,8 @@ import { ConfirmUnverifiedProceedModal, } from 'src/components/suite/modals'; import type { AcquiredDevice } from 'src/types/suite'; + import type { ReduxModalProps } from '../ReduxModal'; -import { CryptoId } from 'invity-api'; import { EverstakeModal } from './UnstakeModal/EverstakeModal'; import { PassphraseMismatchModal } from './PassphraseMismatchModal'; import { FirmwareRevisionOptOutModal } from './FirmwareRevisionOptOutModal'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/WipeDeviceModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/WipeDeviceModal.tsx index f43fe1bc452..02671cd3864 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/WipeDeviceModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/WipeDeviceModal.tsx @@ -1,9 +1,11 @@ import { useState } from 'react'; + import { NewModal, Card, Column, H3, Paragraph } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { Translation, CheckItem } from 'src/components/suite'; import { wipeDevice } from 'src/actions/settings/deviceSettingsActions'; import { useDevice, useDispatch } from 'src/hooks/suite'; -import { spacings } from '@trezor/theme'; type WipeDeviceModalProps = { onCancel: () => void; diff --git a/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx b/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx index 64f885eb395..2576197f7c9 100644 --- a/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx +++ b/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx @@ -1,16 +1,18 @@ import { useRouteMatch } from 'react-router-dom'; + import styled from 'styled-components'; import { CoinLogo } from '@trezor/product-components'; import { capitalizeFirstLetter } from '@trezor/utils'; +import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { fillSendForm, resetProtocol } from 'src/actions/suite/protocolActions'; import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; - import type { NotificationRendererProps } from 'src/components/suite'; -import { NetworkSymbol } from '@suite-common/wallet-config'; + + import { ConditionalActionRenderer } from './ConditionalActionRenderer'; const Row = styled.span` diff --git a/packages/suite/src/components/suite/notifications/NotificationRenderer/ConditionalActionRenderer.tsx b/packages/suite/src/components/suite/notifications/NotificationRenderer/ConditionalActionRenderer.tsx index 183fd6a24ec..ed48fb92f5f 100644 --- a/packages/suite/src/components/suite/notifications/NotificationRenderer/ConditionalActionRenderer.tsx +++ b/packages/suite/src/components/suite/notifications/NotificationRenderer/ConditionalActionRenderer.tsx @@ -1,7 +1,9 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; import { variables } from '@trezor/components'; + import type { ExtendedMessageDescriptor } from 'src/types/suite'; import type { NotificationRendererProps } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx b/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx index b99cf8fcc6d..365d1b59540 100644 --- a/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx +++ b/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx @@ -7,6 +7,7 @@ import { DEVICE } from '@trezor/connect'; import { NotificationViewProps } from 'src/components/suite'; import type { ExtendedMessageDescriptor } from 'src/types/suite'; + import { ActionRenderer } from './ActionRenderer'; import { TransactionRenderer } from './TransactionRenderer'; import { CoinProtocolRenderer } from './CoinProtocolRenderer'; diff --git a/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationGroup.tsx b/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationGroup.tsx index 0c796aa6257..df7f2edde53 100644 --- a/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationGroup.tsx +++ b/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationGroup.tsx @@ -1,9 +1,11 @@ import styled from 'styled-components'; import { variables, Paragraph } from '@trezor/components'; + import { AppState } from 'src/types/suite'; import { Translation } from 'src/components/suite'; import { getSeenAndUnseenNotifications } from 'src/utils/suite/notification'; + import { NotificationList } from './NotificationList/NotificationList'; const SectionHeadline = styled.div` diff --git a/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationList/NotificationList.tsx b/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationList/NotificationList.tsx index 4c04af52d84..018e23df37a 100644 --- a/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationList/NotificationList.tsx +++ b/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationList/NotificationList.tsx @@ -1,9 +1,10 @@ import styled from 'styled-components'; import { NotificationRenderer } from 'src/components/suite'; -import { NotificationView } from './NotificationView'; import type { AppState } from 'src/types/suite'; +import { NotificationView } from './NotificationView'; + const Wrapper = styled.div` display: flex; flex: 1; diff --git a/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationList/NotificationView.tsx b/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationList/NotificationView.tsx index 703da68c10c..8a2b65397c4 100644 --- a/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationList/NotificationView.tsx +++ b/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationList/NotificationView.tsx @@ -2,6 +2,7 @@ import styled from 'styled-components'; import type { NotificationEntry } from '@suite-common/toast-notifications'; import { Button, Icon, ButtonProps, Paragraph, IconName } from '@trezor/components'; + import { Translation, FormattedDateWithBullet } from 'src/components/suite'; import { getNotificationIcon } from 'src/utils/suite/notification'; import { useLayoutSize } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/suite/notifications/Notifications/Notifications.tsx b/packages/suite/src/components/suite/notifications/Notifications/Notifications.tsx index 36724213ffc..158bf2a30e9 100644 --- a/packages/suite/src/components/suite/notifications/Notifications/Notifications.tsx +++ b/packages/suite/src/components/suite/notifications/Notifications/Notifications.tsx @@ -1,9 +1,13 @@ -import { useSelector } from 'src/hooks/suite'; -import { Icon, variables } from '@trezor/components'; import { useState } from 'react'; + import styled, { useTheme } from 'styled-components'; + +import { Icon, variables } from '@trezor/components'; + +import { useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { SETTINGS } from 'src/config/suite'; + import { NotificationGroup } from './NotificationGroup/NotificationGroup'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/notifications/ToastContainer.tsx b/packages/suite/src/components/suite/notifications/ToastContainer.tsx index d5c2b815ede..d3a001ab955 100644 --- a/packages/suite/src/components/suite/notifications/ToastContainer.tsx +++ b/packages/suite/src/components/suite/notifications/ToastContainer.tsx @@ -1,6 +1,7 @@ -import styled from 'styled-components'; import { ToastContainer as BaseToastContainer, Slide } from 'react-toastify'; +import styled from 'styled-components'; + import { borders, zIndices } from '@trezor/theme'; // A set of required styles copied from 'react-toastify/dist/ReactToastify.css' diff --git a/packages/suite/src/components/suite/notifications/ToastNotification.tsx b/packages/suite/src/components/suite/notifications/ToastNotification.tsx index 57c80c4fed0..e4384a154c9 100644 --- a/packages/suite/src/components/suite/notifications/ToastNotification.tsx +++ b/packages/suite/src/components/suite/notifications/ToastNotification.tsx @@ -1,12 +1,17 @@ import { useLayoutEffect, useRef, useState } from 'react'; + import styled, { css, useTheme } from 'styled-components'; + import { Button, Icon, variables } from '@trezor/components'; -import { NotificationRenderer, NotificationViewProps, Translation } from 'src/components/suite'; import { notificationsActions, NotificationEntry } from '@suite-common/toast-notifications'; +import { spacings } from '@trezor/theme'; + +import { NotificationRenderer, NotificationViewProps, Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { getNotificationIcon, getVariantColor } from 'src/utils/suite/notification'; + import { ToastNotificationVariant } from '../../../types/suite'; -import { spacings } from '@trezor/theme'; + const Wrapper = styled.div<{ $variant: ToastNotificationVariant; $isTall: boolean }>` display: flex; diff --git a/packages/suite/src/components/suite/section/SectionItem.tsx b/packages/suite/src/components/suite/section/SectionItem.tsx index 746baf99f23..30bc92a1a02 100644 --- a/packages/suite/src/components/suite/section/SectionItem.tsx +++ b/packages/suite/src/components/suite/section/SectionItem.tsx @@ -1,8 +1,10 @@ import { forwardRef, HTMLAttributes } from 'react'; + import styled from 'styled-components'; import { borders, spacingsPx } from '@trezor/theme'; import { variables } from '@trezor/components'; + import { anchorOutlineStyles } from 'src/utils/suite/anchor'; import { SUBPAGE_NAV_HEIGHT } from 'src/constants/suite/layout'; diff --git a/packages/suite/src/components/suite/section/TextColumn.tsx b/packages/suite/src/components/suite/section/TextColumn.tsx index 5041deb73a3..55af93f4eaf 100644 --- a/packages/suite/src/components/suite/section/TextColumn.tsx +++ b/packages/suite/src/components/suite/section/TextColumn.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; import { variables } from '@trezor/components'; diff --git a/packages/suite/src/components/suite/section/sectionStyles.tsx b/packages/suite/src/components/suite/section/sectionStyles.tsx index eef1a184d07..59036d45380 100644 --- a/packages/suite/src/components/suite/section/sectionStyles.tsx +++ b/packages/suite/src/components/suite/section/sectionStyles.tsx @@ -1,4 +1,5 @@ import styled, { css } from 'styled-components'; + import { Select, variables, Button, SelectProps, ButtonProps } from '@trezor/components'; const { SCREEN_SIZE } = variables; diff --git a/packages/suite/src/components/suite/troubleshooting/TroubleshootingTips.tsx b/packages/suite/src/components/suite/troubleshooting/TroubleshootingTips.tsx index 7bdc208a1c7..4ba64920a12 100644 --- a/packages/suite/src/components/suite/troubleshooting/TroubleshootingTips.tsx +++ b/packages/suite/src/components/suite/troubleshooting/TroubleshootingTips.tsx @@ -1,6 +1,7 @@ import { useMemo, ReactNode } from 'react'; + import styled from 'styled-components'; -import { Translation, TrezorLink } from 'src/components/suite'; + import { variables, Button, CollapsibleBox, useElevation } from '@trezor/components'; import { TREZOR_SUPPORT_DEVICE_URL } from '@trezor/urls'; import TrezorConnect from '@trezor/connect'; @@ -8,6 +9,8 @@ import type TrezorConnectWeb from '@trezor/connect-web'; import { isAndroid } from '@trezor/env-utils'; import { Elevation, mapElevationToBorder } from '@trezor/theme'; +import { Translation, TrezorLink } from 'src/components/suite'; + const ItemLabel = styled.span` color: ${({ theme }) => theme.legacy.TYPE_DARK_GREY}; font-size: ${variables.FONT_SIZE.SMALL}; diff --git a/packages/suite/src/components/suite/troubleshooting/tips/UdevDescription.tsx b/packages/suite/src/components/suite/troubleshooting/tips/UdevDescription.tsx index 6bbcbe8151a..7009d1f3084 100644 --- a/packages/suite/src/components/suite/troubleshooting/tips/UdevDescription.tsx +++ b/packages/suite/src/components/suite/troubleshooting/tips/UdevDescription.tsx @@ -1,9 +1,11 @@ +import styled from 'styled-components'; + +import { typography } from '@trezor/theme'; + import { TrezorLink } from 'src/components/suite'; import { Translation } from 'src/components/suite/Translation'; import { useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; -import { typography } from '@trezor/theme'; -import styled from 'styled-components'; const Wrapper = styled.div` a { diff --git a/packages/suite/src/components/wallet/AccountExceptionLayout.tsx b/packages/suite/src/components/wallet/AccountExceptionLayout.tsx index 240604bbb2d..654f958b42c 100644 --- a/packages/suite/src/components/wallet/AccountExceptionLayout.tsx +++ b/packages/suite/src/components/wallet/AccountExceptionLayout.tsx @@ -1,4 +1,5 @@ import React, { ReactNode } from 'react'; + import { H2, Button, diff --git a/packages/suite/src/components/wallet/AnimationWrapper.tsx b/packages/suite/src/components/wallet/AnimationWrapper.tsx index b12f610fc18..e0ffcae3751 100644 --- a/packages/suite/src/components/wallet/AnimationWrapper.tsx +++ b/packages/suite/src/components/wallet/AnimationWrapper.tsx @@ -1,4 +1,5 @@ import { ReactNode, ReactText } from 'react'; + import { AnimatePresence, motion } from 'framer-motion'; interface AnimationWrapperProps { diff --git a/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/CoinjoinAccountDiscoveryProgress.tsx b/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/CoinjoinAccountDiscoveryProgress.tsx index 26e2e692b84..f295a9a905a 100644 --- a/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/CoinjoinAccountDiscoveryProgress.tsx +++ b/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/CoinjoinAccountDiscoveryProgress.tsx @@ -1,4 +1,5 @@ import { useMemo } from 'react'; + import styled, { useTheme } from 'styled-components'; import { @@ -11,12 +12,14 @@ import { variables, } from '@trezor/components'; import { localizeNumber } from '@suite-common/wallet-utils'; +import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useCoinjoinAccountLoadingProgress } from 'src/hooks/coinjoin'; -import { RotatingFacts } from './RotatingFacts'; import { useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; -import { spacings } from '@trezor/theme'; + +import { RotatingFacts } from './RotatingFacts'; const Subheader = styled.div` display: flex; diff --git a/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/RotatingFacts.tsx b/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/RotatingFacts.tsx index dd6db8d9e50..3258cd2992b 100644 --- a/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/RotatingFacts.tsx +++ b/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/RotatingFacts.tsx @@ -1,7 +1,10 @@ import { useEffect, useState } from 'react'; + import styled from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; + import { motionEasing, variables } from '@trezor/components'; + import { Translation, TranslationKey } from 'src/components/suite/Translation'; const Fact = styled(motion.p)` diff --git a/packages/suite/src/components/wallet/DiscoveryProgress.tsx b/packages/suite/src/components/wallet/DiscoveryProgress.tsx index f089f5b7cfb..0123aca49a2 100644 --- a/packages/suite/src/components/wallet/DiscoveryProgress.tsx +++ b/packages/suite/src/components/wallet/DiscoveryProgress.tsx @@ -1,9 +1,10 @@ import styled from 'styled-components'; -import { useDiscovery } from 'src/hooks/suite'; import { ProgressBar } from '@trezor/components'; import { zIndices } from '@trezor/theme'; +import { useDiscovery } from 'src/hooks/suite'; + // eslint-disable-next-line local-rules/no-override-ds-component const StyledProgressBar = styled(ProgressBar)` height: 0; diff --git a/packages/suite/src/components/wallet/EvmExplanationBox.tsx b/packages/suite/src/components/wallet/EvmExplanationBox.tsx index 5ef8a992c2c..eb51155a74b 100644 --- a/packages/suite/src/components/wallet/EvmExplanationBox.tsx +++ b/packages/suite/src/components/wallet/EvmExplanationBox.tsx @@ -1,8 +1,10 @@ +import { HTMLAttributes, ReactNode, forwardRef } from 'react'; + +import styled, { css } from 'styled-components'; + import { NetworkSymbol } from '@suite-common/wallet-config'; import { Card, CardProps, useElevation, variables } from '@trezor/components'; import { Elevation, mapElevationToBackground } from '@trezor/theme'; -import { HTMLAttributes, ReactNode, forwardRef } from 'react'; -import styled, { css } from 'styled-components'; import { CoinLogo } from '@trezor/product-components'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/components/wallet/Fees/CustomFee.tsx b/packages/suite/src/components/wallet/Fees/CustomFee.tsx index 93c675ef391..da145124a18 100644 --- a/packages/suite/src/components/wallet/Fees/CustomFee.tsx +++ b/packages/suite/src/components/wallet/Fees/CustomFee.tsx @@ -1,5 +1,3 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import styled, { useTheme } from 'styled-components'; import { Control, FieldErrors, @@ -9,6 +7,11 @@ import { UseFormReturn, UseFormSetValue, } from 'react-hook-form'; + +import styled, { useTheme } from 'styled-components'; +import { motion } from 'framer-motion'; + +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Note, Banner, @@ -17,20 +20,23 @@ import { Icon, getInputStateTextColor, } from '@trezor/components'; -import { Translation } from 'src/components/suite'; -import { NumberInput } from 'src/components/suite/NumberInput'; import { getInputState, getFeeUnits, isInteger } from '@suite-common/wallet-utils'; import { FeeInfo, FormState } from '@suite-common/wallet-types'; import { NetworkType } from '@suite-common/wallet-config'; -import { useTranslation } from 'src/hooks/suite'; -import { InputError } from '../InputError'; -import { validateDecimals } from 'src/utils/suite/validation'; -import { motion } from 'framer-motion'; import { BottomText } from '@trezor/components/src/components/form/BottomText'; import { spacings, spacingsPx } from '@trezor/theme'; import { HELP_CENTER_TRANSACTION_FEES_URL } from '@trezor/urls'; + +import { Translation } from 'src/components/suite'; +import { NumberInput } from 'src/components/suite/NumberInput'; +import { useTranslation } from 'src/hooks/suite'; +import { validateDecimals } from 'src/utils/suite/validation'; import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; +import { InputError } from '../InputError'; + + + const Wrapper = styled.div` display: flex; width: 100%; diff --git a/packages/suite/src/components/wallet/Fees/FeeDetails.tsx b/packages/suite/src/components/wallet/Fees/FeeDetails.tsx index 0fe3e2e9cde..9c837e2ffcb 100644 --- a/packages/suite/src/components/wallet/Fees/FeeDetails.tsx +++ b/packages/suite/src/components/wallet/Fees/FeeDetails.tsx @@ -1,18 +1,20 @@ +import { useState, useEffect } from 'react'; + import styled from 'styled-components'; + import { spacingsPx, typography } from '@trezor/theme'; import { FeeLevel } from '@trezor/connect'; -import { Translation } from 'src/components/suite'; import { getFeeUnits } from '@suite-common/wallet-utils'; import { formatDuration } from '@suite-common/suite-utils'; import { NetworkType } from '@suite-common/wallet-config'; - -import { useState, useEffect } from 'react'; import { PrecomposedTransaction, PrecomposedTransactionCardano, FeeInfo, } from '@suite-common/wallet-types'; +import { Translation } from 'src/components/suite'; + const Wrapper = styled.div` display: inline-flex; align-items: baseline; diff --git a/packages/suite/src/components/wallet/Fees/Fees.tsx b/packages/suite/src/components/wallet/Fees/Fees.tsx index 8ff975849d9..2a470c32233 100644 --- a/packages/suite/src/components/wallet/Fees/Fees.tsx +++ b/packages/suite/src/components/wallet/Fees/Fees.tsx @@ -1,5 +1,3 @@ -import styled from 'styled-components'; -import { FeeLevel } from '@trezor/connect'; import { Control, FieldErrors, @@ -8,6 +6,11 @@ import { UseFormReturn, UseFormSetValue, } from 'react-hook-form'; + +import styled from 'styled-components'; +import { AnimatePresence, motion } from 'framer-motion'; + +import { FeeLevel } from '@trezor/connect'; import { Icon, Paragraph, SelectBar, Tooltip, motionEasing, variables } from '@trezor/components'; import { FormState, @@ -17,14 +20,17 @@ import { PrecomposedTransactionFinal, } from '@suite-common/wallet-types'; import { spacingsPx, typography } from '@trezor/theme'; -import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; +import { TranslationKey } from '@suite-common/intl-types'; + +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { Account } from 'src/types/wallet'; import { ExtendedMessageDescriptor } from 'src/types/suite'; + import { CustomFee } from './CustomFee'; import { FeeDetails } from './FeeDetails'; -import { AnimatePresence, motion } from 'framer-motion'; -import { TranslationKey } from '@suite-common/intl-types'; + + const Container = styled.div` overflow: hidden; /* prevent scrollbar when custom fee is opened */ diff --git a/packages/suite/src/components/wallet/FiatHeader.tsx b/packages/suite/src/components/wallet/FiatHeader.tsx index 467d9b66f92..40bd6c75a1b 100644 --- a/packages/suite/src/components/wallet/FiatHeader.tsx +++ b/packages/suite/src/components/wallet/FiatHeader.tsx @@ -1,11 +1,14 @@ +import { PropsWithChildren } from 'react'; + +import styled from 'styled-components'; + import { useFormatters } from '@suite-common/formatters'; import { typography } from '@trezor/theme'; import { useShouldRedactNumbers } from '@suite-common/wallet-utils'; + import { HiddenPlaceholder, RedactNumericalValue } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; -import { PropsWithChildren } from 'react'; -import styled from 'styled-components'; const ValueWrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/wallet/InputError.tsx b/packages/suite/src/components/wallet/InputError.tsx index 424f3b5dbb9..3d30013ba73 100644 --- a/packages/suite/src/components/wallet/InputError.tsx +++ b/packages/suite/src/components/wallet/InputError.tsx @@ -1,11 +1,13 @@ import { MouseEventHandler } from 'react'; + import styled from 'styled-components'; import { Button } from '@trezor/components'; -import { LearnMoreButton } from '../suite/LearnMoreButton'; import { Url } from '@trezor/urls'; import { spacingsPx } from '@trezor/theme'; +import { LearnMoreButton } from '../suite/LearnMoreButton'; + const Wrapper = styled.div` display: flex; align-items: center; diff --git a/packages/suite/src/components/wallet/Pagination.tsx b/packages/suite/src/components/wallet/Pagination.tsx index 920bc952e40..cc144404576 100644 --- a/packages/suite/src/components/wallet/Pagination.tsx +++ b/packages/suite/src/components/wallet/Pagination.tsx @@ -1,8 +1,11 @@ import { useMemo } from 'react'; -import { Translation } from 'src/components/suite'; + import styled, { css } from 'styled-components'; + import { borders, spacingsPx, typography } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; + const Wrapper = styled.div` display: flex; justify-content: center; diff --git a/packages/suite/src/components/wallet/SearchAction.tsx b/packages/suite/src/components/wallet/SearchAction.tsx index 354dadfc313..d5c55fd5472 100644 --- a/packages/suite/src/components/wallet/SearchAction.tsx +++ b/packages/suite/src/components/wallet/SearchAction.tsx @@ -1,11 +1,13 @@ import { useCallback, useRef, Dispatch, SetStateAction, KeyboardEvent } from 'react'; + import styled, { css } from 'styled-components'; + import { Input, Icon, KEYBOARD_CODE, motionEasing, Row } from '@trezor/components'; import { borders, spacingsPx } from '@trezor/theme'; +import { TranslationKey } from '@suite-common/intl-types'; import { useTranslation } from 'src/hooks/suite/useTranslation'; import { TooltipSymbol, Translation } from 'src/components/suite'; -import { TranslationKey } from '@suite-common/intl-types'; const TRANSITION_DURATION = 0.26; const easingValues = motionEasing.transition.join(', '); // TODO: add to motionEasing diff --git a/packages/suite/src/components/wallet/TokenIconSetWrapper.tsx b/packages/suite/src/components/wallet/TokenIconSetWrapper.tsx index 3c728d8723b..70fae7b43d0 100644 --- a/packages/suite/src/components/wallet/TokenIconSetWrapper.tsx +++ b/packages/suite/src/components/wallet/TokenIconSetWrapper.tsx @@ -1,17 +1,18 @@ import { selectCoinDefinitions } from '@suite-common/token-definitions'; +import { TokenIconSet } from '@trezor/product-components'; +import { selectCurrentFiatRates } from '@suite-common/wallet-core'; +import { Account } from '@suite-common/wallet-types'; +import { NetworkSymbol } from '@suite-common/wallet-config'; +import { BigNumber } from '@trezor/utils'; + +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { useSelector } from 'src/hooks/suite'; import { enhanceTokensWithRates, getTokens, sortTokensWithRates, TokensWithRates, } from 'src/utils/wallet/tokenUtils'; -import { TokenIconSet } from '@trezor/product-components'; -import { useSelector } from 'src/hooks/suite'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { selectCurrentFiatRates } from '@suite-common/wallet-core'; -import { Account } from '@suite-common/wallet-types'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import { BigNumber } from '@trezor/utils'; type TokenIconSetWrapperProps = { accounts: Account[]; diff --git a/packages/suite/src/components/wallet/TransactionItem/CoinjoinBatchItem.tsx b/packages/suite/src/components/wallet/TransactionItem/CoinjoinBatchItem.tsx index e05683d36c1..d0482809f4e 100644 --- a/packages/suite/src/components/wallet/TransactionItem/CoinjoinBatchItem.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/CoinjoinBatchItem.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { formatNetworkAmount, getFiatRateKey, @@ -11,6 +11,10 @@ import { } from '@suite-common/wallet-utils'; import { useFormatters } from '@suite-common/formatters'; import { CollapsibleBox } from '@trezor/components'; +import { borders } from '@trezor/theme'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { selectHistoricFiatRates } from '@suite-common/wallet-core'; +import { Timestamp } from '@suite-common/wallet-types'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; @@ -29,10 +33,6 @@ import { TimestampWrapper, TxTypeIconWrapper, } from './CommonComponents'; -import { borders } from '@trezor/theme'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; -import { selectHistoricFiatRates } from '@suite-common/wallet-core'; -import { Timestamp } from '@suite-common/wallet-types'; const CryptoAmount = styled(StyledFormattedCryptoAmount)` width: unset; diff --git a/packages/suite/src/components/wallet/TransactionItem/CommonComponents.tsx b/packages/suite/src/components/wallet/TransactionItem/CommonComponents.tsx index ca57b3b6421..f48d9f748c8 100644 --- a/packages/suite/src/components/wallet/TransactionItem/CommonComponents.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/CommonComponents.tsx @@ -1,6 +1,9 @@ import styled, { css } from 'styled-components'; + import { variables } from '@trezor/components'; + import { FormattedCryptoAmount, FormattedNftAmount, HiddenPlaceholder } from 'src/components/suite'; + import { MIN_ROW_HEIGHT } from './TransactionTargetLayout'; export const TxTypeIconWrapper = styled.div` diff --git a/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx b/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx index f009af1c3c3..9a2bcc34dd4 100644 --- a/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx @@ -1,16 +1,20 @@ -import { Translation, FormattedCryptoAmount } from 'src/components/suite'; -import { WalletAccountTransaction } from 'src/types/wallet'; -import { StakeType } from '@suite-common/wallet-types'; +import { useSelector } from 'react-redux'; +import { memo } from 'react'; -import { Badge, Icon } from '@trezor/components'; import styled from 'styled-components'; + +import { StakeType } from '@suite-common/wallet-types'; +import { Badge, Icon } from '@trezor/components'; import { isNetworkSymbol, NetworkSymbol } from '@suite-common/wallet-config'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; -import { useSelector } from 'react-redux'; +import { spacings, spacingsPx } from '@trezor/theme'; + +import { Translation, FormattedCryptoAmount } from 'src/components/suite'; +import { WalletAccountTransaction } from 'src/types/wallet'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { getInstantStakeType } from 'src/utils/suite/stake'; -import { memo } from 'react'; -import { spacings, spacingsPx } from '@trezor/theme'; + + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionHeader.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionHeader.tsx index acf0331d06d..2d328ff98d8 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionHeader.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionHeader.tsx @@ -1,7 +1,8 @@ -import { Translation } from 'src/components/suite'; import { getTxHeaderSymbol, isSupportedEthStakingNetworkSymbol } from '@suite-common/wallet-utils'; -import { WalletAccountTransaction } from 'src/types/wallet'; import { AccountTransaction } from '@trezor/connect'; + +import { Translation } from 'src/components/suite'; +import { WalletAccountTransaction } from 'src/types/wallet'; import { UnstakingTxAmount } from 'src/components/suite/UnstakingTxAmount'; interface TransactionHeaderProps { diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionHeading.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionHeading.tsx index f18efa887a9..73019478a7d 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionHeading.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionHeading.tsx @@ -1,13 +1,9 @@ import { useState } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { variables, Icon } from '@trezor/components'; import { HELP_CENTER_ZERO_VALUE_ATTACKS } from '@trezor/urls'; -import { - FormattedCryptoAmount, - TooltipSymbol, - Translation, - TrezorLink, -} from 'src/components/suite'; import { formatNetworkAmount, getTargetAmount, @@ -15,11 +11,19 @@ import { getTxOperation, isSupportedEthStakingNetworkSymbol, } from '@suite-common/wallet-utils'; -import { TransactionHeader } from './TransactionHeader'; -import { WalletAccountTransaction } from 'src/types/wallet'; import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { BlurWrapper } from './TransactionItemBlurWrapper'; import { spacingsPx } from '@trezor/theme'; + +import { + FormattedCryptoAmount, + TooltipSymbol, + Translation, + TrezorLink, +} from 'src/components/suite'; +import { WalletAccountTransaction } from 'src/types/wallet'; + +import { TransactionHeader } from './TransactionHeader'; +import { BlurWrapper } from './TransactionItemBlurWrapper'; import { InstantStakeBadge } from './InstantStakeBadge'; const Wrapper = styled.span` diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx index bc03c8e1739..67c6c84d30f 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx @@ -1,20 +1,32 @@ import { memo, useMemo, useState } from 'react'; + import styled, { css } from 'styled-components'; import { AnimatePresence } from 'framer-motion'; + import { selectIsPhishingTransaction } from '@suite-common/wallet-core'; import { variables, Button, Card, Link, Tooltip } from '@trezor/components'; -import { Translation } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { openModal } from 'src/actions/suite/modalActions'; import { formatNetworkAmount, isTestnet, isTxFeePaid, isStakeTypeTx, } from '@suite-common/wallet-utils'; +import { AccountType, Network } from '@suite-common/wallet-config'; +import { HELP_CENTER_REPLACE_BY_FEE } from '@trezor/urls'; + +import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { openModal } from 'src/actions/suite/modalActions'; import { AccountLabels } from 'src/types/suite/metadata'; import { WalletAccountTransaction } from 'src/types/wallet'; -import { AccountType, Network } from '@suite-common/wallet-config'; +import { useAnchor } from 'src/hooks/suite/useAnchor'; +import { AccountTransactionBaseAnchor } from 'src/constants/suite/anchors'; +import { anchorOutlineStyles } from 'src/utils/suite/anchor'; +import { TransactionTimestamp } from 'src/components/wallet/TransactionTimestamp'; +import { SUBPAGE_NAV_HEIGHT } from 'src/constants/suite/layout'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { getInstantStakeType } from 'src/utils/suite/stake'; + import { TransactionTypeIcon } from './TransactionTypeIcon'; import { TransactionHeading } from './TransactionHeading'; import { @@ -31,15 +43,9 @@ import { TimestampWrapper, TxTypeIconWrapper, } from './CommonComponents'; -import { useAnchor } from 'src/hooks/suite/useAnchor'; -import { AccountTransactionBaseAnchor } from 'src/constants/suite/anchors'; -import { anchorOutlineStyles } from 'src/utils/suite/anchor'; -import { TransactionTimestamp } from 'src/components/wallet/TransactionTimestamp'; -import { SUBPAGE_NAV_HEIGHT } from 'src/constants/suite/layout'; import { BlurWrapper } from './TransactionItemBlurWrapper'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { getInstantStakeType } from 'src/utils/suite/stake'; -import { HELP_CENTER_REPLACE_BY_FEE } from '@trezor/urls'; + + // eslint-disable-next-line local-rules/no-override-ds-component const Wrapper = styled(Card)<{ diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx index e518b77fca0..d6471e53243 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx @@ -1,20 +1,24 @@ import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { FiatValue, Translation } from 'src/components/suite'; import { formatCardanoWithdrawal, formatCardanoDeposit, formatNetworkAmount, getFiatRateKey, } from '@suite-common/wallet-utils'; +import { SignOperator } from '@suite-common/suite-types'; +import { Timestamp } from '@suite-common/wallet-types'; +import { selectHistoricFiatRatesByTimestamp } from '@suite-common/wallet-core'; + +import { FiatValue, Translation } from 'src/components/suite'; import { WalletAccountTransaction } from 'src/types/wallet'; -import { TransactionTargetLayout } from './TransactionTargetLayout'; import { ExtendedMessageDescriptor } from 'src/types/suite'; -import { SignOperator } from '@suite-common/suite-types'; -import { StyledFormattedCryptoAmount } from './CommonComponents'; import { useSelector } from 'src/hooks/suite'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { Timestamp } from '@suite-common/wallet-types'; -import { selectHistoricFiatRatesByTimestamp } from '@suite-common/wallet-core'; + +import { TransactionTargetLayout } from './TransactionTargetLayout'; +import { StyledFormattedCryptoAmount } from './CommonComponents'; + + export const CustomRow = ({ transaction, diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx index 92ecee957e1..2173e134ec9 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx @@ -1,9 +1,12 @@ import styled from 'styled-components'; -import { WalletAccountTransaction } from 'src/types/wallet'; + import { ArrayElement } from '@trezor/type-utils'; +import { NetworkSymbol } from '@suite-common/wallet-config'; + +import { WalletAccountTransaction } from 'src/types/wallet'; import { Translation, AddressLabeling } from 'src/components/suite'; import { AccountLabels } from 'src/types/suite/metadata'; -import { NetworkSymbol } from '@suite-common/wallet-config'; + const TruncatedSpan = styled.span<{ $isBlurred?: boolean }>` overflow: hidden; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TokenTransferAddressLabel.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TokenTransferAddressLabel.tsx index a3d1aaf6a7a..283c30e66d8 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TokenTransferAddressLabel.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TokenTransferAddressLabel.tsx @@ -1,8 +1,10 @@ import { ArrayElement } from '@trezor/type-utils'; +import { NetworkSymbol } from '@suite-common/wallet-config'; + import { Translation, AddressLabeling } from 'src/components/suite'; import { WalletAccountTransaction } from 'src/types/wallet'; + import { BlurWrapper } from '../TransactionItemBlurWrapper'; -import { NetworkSymbol } from '@suite-common/wallet-config'; interface TokenTransferAddressLabelProps { networkSymbol: NetworkSymbol; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx index bc59078ec99..0840e5172d1 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx @@ -10,17 +10,20 @@ import { } from '@suite-common/wallet-utils'; import { copyToClipboard } from '@trezor/dom-utils'; import { ArrayElement } from '@trezor/type-utils'; +import { selectHistoricFiatRatesByTimestamp } from '@suite-common/wallet-core'; +import { Timestamp, TokenAddress } from '@suite-common/wallet-types'; + import { FiatValue, Translation, MetadataLabeling, AddressLabeling } from 'src/components/suite'; import { WalletAccountTransaction } from 'src/types/wallet'; import { useDispatch, useSelector } from 'src/hooks/suite'; +import { AccountLabels } from 'src/types/suite/metadata'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; + import { TokenTransferAddressLabel } from './TokenTransferAddressLabel'; import { TargetAddressLabel } from './TargetAddressLabel'; -import { AccountLabels } from 'src/types/suite/metadata'; import { TransactionTargetLayout } from '../TransactionTargetLayout'; import { StyledFormattedCryptoAmount, StyledFormattedNftAmount } from '../CommonComponents'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { selectHistoricFiatRatesByTimestamp } from '@suite-common/wallet-core'; -import { Timestamp, TokenAddress } from '@suite-common/wallet-types'; + interface BaseTransfer { singleRowLayout?: boolean; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionTargetLayout.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionTargetLayout.tsx index ed4067887e0..c8985ea2a65 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTargetLayout.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTargetLayout.tsx @@ -1,10 +1,13 @@ import { ReactNode } from 'react'; + import styled, { css } from 'styled-components'; import { motion } from 'framer-motion'; -import { HiddenPlaceholder } from 'src/components/suite'; + import { motionAnimation } from '@trezor/components'; import { borders, spacingsPx, typography } from '@trezor/theme'; +import { HiddenPlaceholder } from 'src/components/suite'; + export const MIN_ROW_HEIGHT = '23px'; const FiatAmount = styled.span` diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionTypeIcon.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionTypeIcon.tsx index c7e634b2118..74d66ea5fef 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTypeIcon.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTypeIcon.tsx @@ -1,8 +1,10 @@ import styled, { useTheme } from 'styled-components'; -import { WalletAccountTransaction } from 'src/types/wallet'; + import { Icon, IconProps } from '@trezor/components'; import { getTxIcon } from '@suite-common/wallet-utils'; +import { WalletAccountTransaction } from 'src/types/wallet'; + const IconsWrapper = styled.div<{ $isJoint: boolean }>` position: relative; width: 24px; diff --git a/packages/suite/src/components/wallet/TransactionTimestamp.tsx b/packages/suite/src/components/wallet/TransactionTimestamp.tsx index 1c402b02b0b..76471397c3e 100644 --- a/packages/suite/src/components/wallet/TransactionTimestamp.tsx +++ b/packages/suite/src/components/wallet/TransactionTimestamp.tsx @@ -1,7 +1,9 @@ import styled from 'styled-components'; + +import { spacingsPx, typography } from '@trezor/theme'; + import { FormattedDate } from 'src/components/suite'; import { WalletAccountTransaction } from 'src/types/wallet'; -import { spacingsPx, typography } from '@trezor/theme'; const TimestampLink = styled.div` display: block; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx index 78609c0ce74..872250203dc 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx @@ -1,6 +1,12 @@ import styled from 'styled-components'; +import { spacingsPx } from '@trezor/theme'; +import { Context } from '@suite-common/message-system'; +import { isSupportedEthStakingNetworkSymbol } from '@suite-common/wallet-utils'; + import { Account } from 'src/types/wallet'; +import { useSelector } from 'src/hooks/suite'; + import { AuthConfirmFailed } from './AuthConfirmFailed'; import { BackendDisconnected } from './BackendDisconnected'; import { DeviceUnavailable } from './DeviceUnavailable'; @@ -10,12 +16,11 @@ import { AccountOutOfSync } from './AccountOutOfSync'; import { TorDisconnected } from './TorDisconnected'; import { ContextMessage } from './ContextMessage'; import { StakeEthBanner } from './StakeEthBanner'; -import { spacingsPx } from '@trezor/theme'; import { EvmExplanationBanner } from './EvmExplanationBanner'; import { TaprootBanner } from './TaprootBanner'; -import { Context } from '@suite-common/message-system'; -import { useSelector } from 'src/hooks/suite'; -import { isSupportedEthStakingNetworkSymbol } from '@suite-common/wallet-utils'; + + + const BannersWrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BackendDisconnected.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BackendDisconnected.tsx index e02ba198950..5c77737124d 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BackendDisconnected.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BackendDisconnected.tsx @@ -1,7 +1,8 @@ -import { NotificationCard, Translation } from 'src/components/suite'; -import { useSelector } from 'src/hooks/suite'; import { tryGetAccountIdentity, isTrezorConnectBackendType } from '@suite-common/wallet-utils'; import type { NetworkSymbol } from '@suite-common/wallet-config'; + +import { NotificationCard, Translation } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; import { useBackendReconnection } from 'src/hooks/settings/backends'; const DisconnectedNotification = ({ diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BannerPoints.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BannerPoints.tsx index ecc4cfb937c..145dcc413d7 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BannerPoints.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BannerPoints.tsx @@ -1,5 +1,7 @@ import React, { ReactNode } from 'react'; + import styled from 'styled-components'; + import { typography } from '@trezor/theme'; interface BannerPointsProps { diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/CloseableBanner.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/CloseableBanner.tsx index c1c725a65ab..1b4900e600b 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/CloseableBanner.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/CloseableBanner.tsx @@ -1,8 +1,10 @@ -import { Text, Banner, BannerProps, Column } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { ReactNode } from 'react'; + +import { Text, Banner, BannerProps, Column } from '@trezor/components'; import { spacings } from '@trezor/theme/src'; +import { Translation } from 'src/components/suite'; + interface Props { onClose: () => void; variant: BannerProps['variant']; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx index a2af012d55a..79d0f251eed 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx @@ -1,9 +1,12 @@ -import { NotificationCard } from 'src/components/suite'; +import styled from 'styled-components'; + import { Link } from '@trezor/components'; -import { useSelector } from 'src/hooks/suite'; import { selectContextMessageContent, Context } from '@suite-common/message-system'; + +import { NotificationCard } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; -import styled from 'styled-components'; + type ContextMessageProps = { context: (typeof Context)[keyof typeof Context]; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/EvmExplanationBanner.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/EvmExplanationBanner.tsx index 998539cde9f..7f211191a70 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/EvmExplanationBanner.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/EvmExplanationBanner.tsx @@ -1,10 +1,12 @@ -import { Translation } from 'src/components/suite'; -import { CloseableBanner } from './CloseableBanner'; -import { Account } from 'src/types/wallet'; import { networks } from '@suite-common/wallet-config'; + +import { Account } from 'src/types/wallet'; +import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; import { useDispatch } from 'src/hooks/suite/useDispatch'; import { SUITE } from 'src/actions/suite/constants'; + +import { CloseableBanner } from './CloseableBanner'; import { BannerPoints } from './BannerPoints'; interface EvmExplanationBannerProps { diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/StakeEthBanner.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/StakeEthBanner.tsx index 08ec8c5d407..520df0f05d7 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/StakeEthBanner.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/StakeEthBanner.tsx @@ -1,15 +1,18 @@ +import { useTheme } from 'styled-components'; + import { Button, Text, IconButton, Row, Banner, Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { Account } from '@suite-common/wallet-types'; +import { selectPoolStatsApyData } from '@suite-common/wallet-core'; +import { MIN_ETH_AMOUNT_FOR_STAKING } from '@suite-common/wallet-constants'; +import { isSupportedEthStakingNetworkSymbol } from '@suite-common/wallet-utils'; + import { Translation } from 'src/components/suite'; import { goto } from 'src/actions/suite/routerActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { setFlag } from 'src/actions/suite/suiteActions'; + import { selectSuiteFlags } from '../../../../reducers/suite/suiteReducer'; -import { Account } from '@suite-common/wallet-types'; -import { selectPoolStatsApyData } from '@suite-common/wallet-core'; -import { MIN_ETH_AMOUNT_FOR_STAKING } from '@suite-common/wallet-constants'; -import { isSupportedEthStakingNetworkSymbol } from '@suite-common/wallet-utils'; -import { useTheme } from 'styled-components'; interface StakeEthBannerProps { account: Account; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/TaprootBanner.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/TaprootBanner.tsx index 77815e61799..e4084ba554a 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/TaprootBanner.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/TaprootBanner.tsx @@ -1,12 +1,15 @@ +import styled from 'styled-components'; + +import { getBip43Type } from '@suite-common/wallet-utils'; + import { Translation } from 'src/components/suite'; -import { CloseableBanner } from './CloseableBanner'; import { useSelector } from 'src/hooks/suite/useSelector'; import { useDispatch } from 'src/hooks/suite/useDispatch'; import { setFlag } from 'src/actions/suite/suiteActions'; -import { getBip43Type } from '@suite-common/wallet-utils'; import { Account } from 'src/types/wallet'; + +import { CloseableBanner } from './CloseableBanner'; import { BannerPoints } from './BannerPoints'; -import styled from 'styled-components'; import { selectSuiteFlags } from '../../../../reducers/suite/suiteReducer'; interface TaprootBannerProps { diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx index 63a90395b23..d47a8e996d3 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx @@ -1,9 +1,11 @@ import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { NotificationCard, Translation } from 'src/components/suite'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; -import type { Account } from 'src/types/wallet/index'; import { HELP_CENTER_XRP_URL } from '@trezor/urls'; +import { NotificationCard, Translation } from 'src/components/suite'; +import type { Account } from 'src/types/wallet/index'; + + interface XRPReserveProps { account: Account | undefined; } diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotEnabled.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotEnabled.tsx index 5059184036a..6caf9898d53 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotEnabled.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotEnabled.tsx @@ -1,6 +1,7 @@ +import { Network } from '@suite-common/wallet-config'; + import { changeCoinVisibility } from 'src/actions/settings/walletSettingsActions'; import { useDevice, useDispatch } from 'src/hooks/suite'; -import { Network } from '@suite-common/wallet-config'; import { Translation } from 'src/components/suite'; import { AccountExceptionLayout } from 'src/components/wallet'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountNavigation.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountNavigation.tsx index b469dc1f644..9a61238f7b9 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountNavigation.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountNavigation.tsx @@ -1,11 +1,12 @@ +import { hasNetworkFeatures } from '@suite-common/wallet-utils'; +import { getNetworkOptional } from '@suite-common/wallet-config'; +import { EventType, analytics } from '@trezor/suite-analytics'; + import { WalletParams } from 'src/types/wallet'; import { Translation } from 'src/components/suite/Translation'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { hasNetworkFeatures } from '@suite-common/wallet-utils'; -import { getNetworkOptional } from '@suite-common/wallet-config'; import { goto } from 'src/actions/suite/routerActions'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { EventType, analytics } from '@trezor/suite-analytics'; import { NavigationItem, SubpageNavigation } from 'src/components/suite/layouts/SuiteLayout'; export const ACCOUNT_TABS = [ diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountTopPanel.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountTopPanel.tsx index 3ba89671d61..2816ae1afe2 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountTopPanel.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountTopPanel.tsx @@ -1,16 +1,17 @@ -import styled from 'styled-components'; import { forwardRef } from 'react'; +import styled from 'styled-components'; + import { spacingsPx } from '@trezor/theme'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { SkeletonCircle, SkeletonRectangle } from '@trezor/components'; +import { CoinLogo } from '@trezor/product-components'; import { FormattedCryptoAmount, AmountUnitSwitchWrapper } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { FiatHeader } from 'src/components/wallet/FiatHeader'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { useFiatFromCryptoValue } from 'src/hooks/suite/useFiatFromCryptoValue'; -import { CoinLogo } from '@trezor/product-components'; export const ACCOUNT_INFO_HEIGHT = 80; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountGroup.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountGroup.tsx index d4e289c070f..ede3185a339 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountGroup.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountGroup.tsx @@ -1,10 +1,15 @@ import { useState, ReactNode } from 'react'; + import styled from 'styled-components'; -import { Translation } from 'src/components/suite'; + import { Icon, Column } from '@trezor/components'; +import { spacingsPx, spacings, typography } from '@trezor/theme'; + +import { Translation } from 'src/components/suite'; import { Account } from 'src/types/wallet'; + import { AnimationWrapper } from '../../AnimationWrapper'; -import { spacingsPx, spacings, typography } from '@trezor/theme'; + const ICON_SIZE = 18; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem.tsx index 4ece3846b06..9366e2dae47 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem.tsx @@ -1,4 +1,5 @@ import { forwardRef, Ref } from 'react'; + import styled from 'styled-components'; import { isTestnet } from '@suite-common/wallet-utils'; @@ -11,6 +12,8 @@ import { TOOLTIP_DELAY_LONG, TruncateWithTooltip, } from '@trezor/components'; +import { useFormatters } from '@suite-common/formatters'; +import { CoinLogo } from '@trezor/product-components'; import { AccountLabel, @@ -23,9 +26,7 @@ import { useDispatch, useLoadingSkeleton, useSelector } from 'src/hooks/suite'; import { Account, AccountItemType } from 'src/types/wallet'; import { goto } from 'src/actions/suite/routerActions'; import { NavigationItemBase } from 'src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem'; -import { useFormatters } from '@suite-common/formatters'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { CoinLogo } from '@trezor/product-components'; import { TokenIconSetWrapper } from 'src/components/wallet/TokenIconSetWrapper'; const ICON_SIZE = 24; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemSkeleton.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemSkeleton.tsx index 90939ad6f97..b2f3e9e4890 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemSkeleton.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemSkeleton.tsx @@ -1,7 +1,8 @@ -import { useLoadingSkeleton } from 'src/hooks/suite'; import { SkeletonCircle, SkeletonRectangle, Row, Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { useLoadingSkeleton } from 'src/hooks/suite'; + export const AccountItemSkeleton = () => { const { shouldAnimate } = useLoadingSkeleton(); diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx index d75ba96c68a..a47fb9028bf 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx @@ -1,16 +1,20 @@ import styled from 'styled-components'; -import { AccountItem } from './AccountItem'; -import { Account } from 'src/types/wallet'; + import { borders, spacingsPx, spacings } from '@trezor/theme'; -import { useSelector } from 'src/hooks/suite'; import { selectCurrentFiatRates } from '@suite-common/wallet-core'; import { getAccountTotalStakingBalance, getAccountTokensFiatBalance, } from '@suite-common/wallet-utils'; +import { Column } from '@trezor/components'; + +import { Account } from 'src/types/wallet'; +import { useSelector } from 'src/hooks/suite'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; -import { Column } from '@trezor/components'; + + +import { AccountItem } from './AccountItem'; const Section = styled.div<{ $selected?: boolean }>` display: flex; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountSection.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountSection.tsx index e87fe0aa4fd..b9313b0e8c2 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountSection.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountSection.tsx @@ -1,12 +1,14 @@ import { Account } from '@suite-common/wallet-types'; -import { AccountItemsGroup } from './AccountItemsGroup'; -import { AccountItem } from './AccountItem'; -import { useSelector } from 'src/hooks/suite'; import { selectCoinDefinitions } from '@suite-common/token-definitions'; import { selectAccountHasStaked } from '@suite-common/wallet-core'; import { isSupportedEthStakingNetworkSymbol } from '@suite-common/wallet-utils'; + +import { useSelector } from 'src/hooks/suite'; import { getTokens } from 'src/utils/wallet/tokenUtils'; +import { AccountItem } from './AccountItem'; +import { AccountItemsGroup } from './AccountItemsGroup'; + interface AccountSectionProps { account: Account; selected: boolean; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsList.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsList.tsx index d17219371d4..53edde43eac 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsList.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsList.tsx @@ -1,19 +1,21 @@ import { sortByCoin, getFailedAccounts, accountSearchFn } from '@suite-common/wallet-utils'; import { Account } from '@suite-common/wallet-types'; +import { selectAccounts, selectDevice } from '@suite-common/wallet-core'; +import { spacings } from '@trezor/theme'; +import { Column } from '@trezor/components'; + import { useAccountSearch, useDiscovery, useSelector, useDefaultAccountLabel, } from 'src/hooks/suite'; -import { selectAccounts, selectDevice } from '@suite-common/wallet-core'; import { selectAccountLabels } from 'src/reducers/suite/metadataReducer'; import { Translation } from 'src/components/suite'; + import { AccountItemSkeleton } from './AccountItemSkeleton'; import { AccountGroup } from './AccountGroup'; import { AccountsMenuNotice } from './AccountsMenuNotice'; -import { spacings } from '@trezor/theme'; -import { Column } from '@trezor/components'; import { AccountSection } from './AccountSection'; interface AccountListProps { diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx index 6401865d225..3923e2705d3 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx @@ -1,19 +1,22 @@ import React from 'react'; + import styled from 'styled-components'; import { spacings, spacingsPx, zIndices } from '@trezor/theme'; import { selectDevice } from '@suite-common/wallet-core'; +import { getFailedAccounts, sortByCoin } from '@suite-common/wallet-utils'; +import { useScrollShadow, Row } from '@trezor/components'; import { useDiscovery, useSelector } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; + import { AccountSearchBox } from './AccountSearchBox'; import { AddAccountButton } from './AddAccountButton'; import { CoinsFilter } from './CoinsFilter'; import { AccountsList } from './AccountsList'; -import { Translation } from 'src/components/suite'; import { AccountsMenuNotice } from './AccountsMenuNotice'; -import { getFailedAccounts, sortByCoin } from '@suite-common/wallet-utils'; import { RefreshAfterDiscoveryNeeded } from './RefreshAfterDiscoveryNeeded'; -import { useScrollShadow, Row } from '@trezor/components'; + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenuNotice.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenuNotice.tsx index 6ced7d8627c..7ad65a76623 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenuNotice.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenuNotice.tsx @@ -1,6 +1,7 @@ -import { spacingsPx, typography } from '@trezor/theme'; import styled from 'styled-components'; +import { spacingsPx, typography } from '@trezor/theme'; + export const AccountsMenuNotice = styled.div` display: flex; justify-content: center; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx index 67b7d4ae24b..b33cf7488b9 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx @@ -1,10 +1,11 @@ +import { Tooltip, ButtonProps, IconButton, Button } from '@trezor/components'; +import { DiscoveryStatus } from '@suite-common/wallet-constants'; + import { Translation } from 'src/components/suite'; import { TrezorDevice } from 'src/types/suite'; import { useDiscovery, useDispatch } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; -import { Tooltip, ButtonProps, IconButton, Button } from '@trezor/components'; -import { DiscoveryStatus } from '@suite-common/wallet-constants'; const getExplanationMessage = (device: TrezorDevice | undefined, discoveryIsRunning: boolean) => { let message; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu.tsx index e458725deee..36bb4423953 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu.tsx @@ -1,10 +1,14 @@ import { useState } from 'react'; + import styled, { css, useTheme } from 'styled-components'; + import { H2, variables, Icon } from '@trezor/components'; import { zIndices, spacingsPx } from '@trezor/theme'; import { selectDevice } from '@suite-common/wallet-core'; + import { Translation } from 'src/components/suite'; import { useDiscovery, useSelector } from 'src/hooks/suite'; + import { AccountSearchBox } from './AccountSearchBox'; import { AddAccountButton } from './AddAccountButton'; import { CoinsFilter } from './CoinsFilter'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/RefreshAfterDiscoveryNeeded.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/RefreshAfterDiscoveryNeeded.tsx index 0db9cfaa59e..ad60503dd40 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/RefreshAfterDiscoveryNeeded.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/RefreshAfterDiscoveryNeeded.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import styled from 'styled-components'; import { AnimatePresence, MotionProps, motion } from 'framer-motion'; @@ -7,8 +8,8 @@ import { spacingsPx, typography } from '@trezor/theme'; import { selectDevice, startDiscoveryThunk } from '@suite-common/wallet-core'; import { useRediscoveryNeeded, useDispatch, useSelector } from 'src/hooks/suite'; - import { Translation } from 'src/components/suite'; + import { AccountsMenuNotice } from './AccountsMenuNotice'; const DiscoveryButtonContainer = styled(motion.div)` diff --git a/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/CoinjoinAccountDiscovery.tsx b/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/CoinjoinAccountDiscovery.tsx index 696154a93bc..f8c3f0cb6ce 100644 --- a/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/CoinjoinAccountDiscovery.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/CoinjoinAccountDiscovery.tsx @@ -6,6 +6,7 @@ import { isDeviceRemembered } from '@suite-common/suite-utils'; import { useDispatch, useDevice } from 'src/hooks/suite'; import { TrezorDevice } from 'src/types/suite'; import { CoinjoinAccountDiscoveryProgress } from 'src/components/wallet'; + import { RememberWallet } from './RememberWallet'; export const CoinjoinAccountDiscovery = () => { diff --git a/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/RememberWallet.tsx b/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/RememberWallet.tsx index ace43bde614..ec0fc90e211 100644 --- a/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/RememberWallet.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/RememberWallet.tsx @@ -1,8 +1,8 @@ import styled from 'styled-components'; import { spacings, spacingsPx } from '@trezor/theme'; - import { Card, Image, Note, Paragraph, Row, Switch } from '@trezor/components'; + import { Translation } from 'src/components/suite'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/components/wallet/WalletLayout/WalletLayout.tsx b/packages/suite/src/components/wallet/WalletLayout/WalletLayout.tsx index f6be2f0db27..22892c02cda 100644 --- a/packages/suite/src/components/wallet/WalletLayout/WalletLayout.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/WalletLayout.tsx @@ -1,7 +1,9 @@ import { ReactNode, useCallback } from 'react'; + import styled from 'styled-components'; import { SkeletonRectangle } from '@trezor/components'; + import { AppState, ExtendedMessageDescriptor } from 'src/types/suite'; import { useTranslation, useLayout } from 'src/hooks/suite'; import { PageHeader } from 'src/components/suite/layouts/SuiteLayout'; diff --git a/packages/suite/src/components/wallet/WalletLayout/WalletSubpageHeading.tsx b/packages/suite/src/components/wallet/WalletLayout/WalletSubpageHeading.tsx index 40146396d5a..c7bf383426e 100644 --- a/packages/suite/src/components/wallet/WalletLayout/WalletSubpageHeading.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/WalletSubpageHeading.tsx @@ -1,9 +1,12 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { H2 } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; + import type { ExtendedMessageDescriptor } from 'src/types/suite'; import { Translation } from 'src/components/suite'; -import { spacingsPx } from '@trezor/theme'; const HeaderWrapper = styled.div` display: flex; diff --git a/packages/suite/src/config/onboarding/steps.ts b/packages/suite/src/config/onboarding/steps.ts index 948cba577b1..aef8a9bb053 100644 --- a/packages/suite/src/config/onboarding/steps.ts +++ b/packages/suite/src/config/onboarding/steps.ts @@ -1,6 +1,7 @@ +import { DeviceModelInternal } from '@trezor/connect'; + import type { Step } from 'src/types/onboarding'; import * as STEP from 'src/constants/onboarding/steps'; -import { DeviceModelInternal } from '@trezor/connect'; const commonPrerequisites: Step['prerequisites'] = [ 'transport-bridge', diff --git a/packages/suite/src/constants/suite/experimental.ts b/packages/suite/src/constants/suite/experimental.ts index 03c8c49da0d..174d16dcdbb 100644 --- a/packages/suite/src/constants/suite/experimental.ts +++ b/packages/suite/src/constants/suite/experimental.ts @@ -1,6 +1,5 @@ import { TranslationKey } from '@suite-common/intl-types'; import { desktopApi } from '@trezor/suite-desktop-api'; - import { EXPERIMENTAL_PASSWORD_MANAGER_KB_URL, TOR_SNOWFLAKE_PROJECT_URL, Url } from '@trezor/urls'; import { Dispatch } from '../../types/suite'; diff --git a/packages/suite/src/constants/suite/routes.ts b/packages/suite/src/constants/suite/routes.ts index 93e30ecd33a..eae5e34551c 100644 --- a/packages/suite/src/constants/suite/routes.ts +++ b/packages/suite/src/constants/suite/routes.ts @@ -1,8 +1,8 @@ import { ArrayElement } from '@trezor/type-utils'; import { Route } from '@suite-common/suite-types'; import { routes } from '@suite-common/suite-config'; - import { AccountType, NetworkSymbol } from '@suite-common/wallet-config'; + import { RouteParams } from 'src/utils/suite/router'; export type SettingsBackRoute = { diff --git a/packages/suite/src/hooks/coinjoin/useCoinjoinAccountLoadingProgress.ts b/packages/suite/src/hooks/coinjoin/useCoinjoinAccountLoadingProgress.ts index ce93b09aa31..224fd616801 100644 --- a/packages/suite/src/hooks/coinjoin/useCoinjoinAccountLoadingProgress.ts +++ b/packages/suite/src/hooks/coinjoin/useCoinjoinAccountLoadingProgress.ts @@ -1,4 +1,5 @@ import { useEffect, useReducer } from 'react'; + import { ScanProgressInfo } from '@trezor/coinjoin'; import { CoinjoinService } from 'src/services/coinjoin'; diff --git a/packages/suite/src/hooks/coinjoin/useCoinjoinSessionBlockers.ts b/packages/suite/src/hooks/coinjoin/useCoinjoinSessionBlockers.ts index df2d447e5c9..3adac5b8a7b 100644 --- a/packages/suite/src/hooks/coinjoin/useCoinjoinSessionBlockers.ts +++ b/packages/suite/src/hooks/coinjoin/useCoinjoinSessionBlockers.ts @@ -1,7 +1,7 @@ -import { useSelector, useTranslation } from 'src/hooks/suite'; import { Feature, selectFeatureMessageContent } from '@suite-common/message-system'; -import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { useSelector, useTranslation } from 'src/hooks/suite'; +import { selectLanguage } from 'src/reducers/suite/suiteReducer'; import { selectCoinjoinSessionBlockerByAccountKey } from 'src/reducers/wallet/coinjoinReducer'; export const useCoinjoinSessionBlockers = ( diff --git a/packages/suite/src/hooks/coinjoin/useCoinjoinSessionPhase.ts b/packages/suite/src/hooks/coinjoin/useCoinjoinSessionPhase.ts index 248001c28c0..859abe9e2d3 100644 --- a/packages/suite/src/hooks/coinjoin/useCoinjoinSessionPhase.ts +++ b/packages/suite/src/hooks/coinjoin/useCoinjoinSessionPhase.ts @@ -1,4 +1,5 @@ import { useEffect, useState, useCallback } from 'react'; + import { SESSION_PHASE_TRANSITION_DELAY } from 'src/constants/suite/coinjoin'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectSessionByAccountKey } from 'src/reducers/wallet/coinjoinReducer'; diff --git a/packages/suite/src/hooks/guide/useGuide.ts b/packages/suite/src/hooks/guide/useGuide.ts index 4d5cf64bf81..840b2d2cfca 100644 --- a/packages/suite/src/hooks/guide/useGuide.ts +++ b/packages/suite/src/hooks/guide/useGuide.ts @@ -1,6 +1,8 @@ import { useMemo } from 'react'; + import { useDispatch, useSelector, useLayoutSize } from 'src/hooks/suite'; import { close, open } from 'src/actions/suite/guideActions'; + import { usePreferredModal } from '../suite/usePreferredModal'; export const GUIDE_ANIMATION_DURATION_MS = 300; diff --git a/packages/suite/src/hooks/guide/useGuideKeyboard.ts b/packages/suite/src/hooks/guide/useGuideKeyboard.ts index 3aafa38c586..0669651f789 100644 --- a/packages/suite/src/hooks/guide/useGuideKeyboard.ts +++ b/packages/suite/src/hooks/guide/useGuideKeyboard.ts @@ -1,6 +1,7 @@ import { useCallback, useEffect } from 'react'; import { KEYBOARD_CODE } from '@trezor/components'; + import { useGuide } from 'src/hooks/guide'; export const useGuideKeyboard = () => { diff --git a/packages/suite/src/hooks/guide/useGuideLoadArticle.ts b/packages/suite/src/hooks/guide/useGuideLoadArticle.ts index 4583211e45a..29bd237765b 100644 --- a/packages/suite/src/hooks/guide/useGuideLoadArticle.ts +++ b/packages/suite/src/hooks/guide/useGuideLoadArticle.ts @@ -1,5 +1,7 @@ import { useState, useEffect } from 'react'; + import type { GuideNode } from '@suite-common/suite-types'; + import type { Locale } from 'src/config/suite/languages'; export const loadPageMarkdownFile = async (id: string, language = 'en'): Promise => { diff --git a/packages/suite/src/hooks/guide/useGuideSearch.ts b/packages/suite/src/hooks/guide/useGuideSearch.ts index 3e6b7817328..913215ee606 100644 --- a/packages/suite/src/hooks/guide/useGuideSearch.ts +++ b/packages/suite/src/hooks/guide/useGuideSearch.ts @@ -1,5 +1,7 @@ import { useState, useEffect, useMemo } from 'react'; + import { GuideCategory, GuideArticle } from '@suite-common/suite-types'; + import { loadPageMarkdownFile } from 'src/hooks/guide/useGuideLoadArticle'; const SEARCH_DELAY = 300; diff --git a/packages/suite/src/hooks/settings/backends/useBackendReconnection.ts b/packages/suite/src/hooks/settings/backends/useBackendReconnection.ts index f1291c74012..2b42aff8c9b 100644 --- a/packages/suite/src/hooks/settings/backends/useBackendReconnection.ts +++ b/packages/suite/src/hooks/settings/backends/useBackendReconnection.ts @@ -1,9 +1,9 @@ import { useState, useEffect } from 'react'; import { reconnectBlockchainThunk } from '@suite-common/wallet-core'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { useDispatch } from 'src/hooks/suite'; -import { NetworkSymbol } from '@suite-common/wallet-config'; export const useBackendReconnection = ( coin: NetworkSymbol, diff --git a/packages/suite/src/hooks/settings/backends/useBackendsForm.ts b/packages/suite/src/hooks/settings/backends/useBackendsForm.ts index e0bc29befa6..97fee4a3d5d 100644 --- a/packages/suite/src/hooks/settings/backends/useBackendsForm.ts +++ b/packages/suite/src/hooks/settings/backends/useBackendsForm.ts @@ -1,15 +1,16 @@ import { useState } from 'react'; import { useForm } from 'react-hook-form'; -import { analytics, EventType } from '@trezor/suite-analytics'; -import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; +import { analytics, EventType } from '@trezor/suite-analytics'; import { isUrl } from '@trezor/utils'; -import { isOnionUrl } from 'src/utils/suite/tor'; import { blockchainActions } from '@suite-common/wallet-core'; import { isElectrumUrl } from '@suite-common/wallet-utils'; import { NetworkSymbol, BackendType } from '@suite-common/wallet-config'; import { BackendSettings } from '@suite-common/wallet-types'; +import { isOnionUrl } from 'src/utils/suite/tor'; +import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; + export type BackendOption = BackendType | 'default'; type BackendsFormData = { diff --git a/packages/suite/src/hooks/settings/backends/useCustomBackends.ts b/packages/suite/src/hooks/settings/backends/useCustomBackends.ts index 9497f22a23b..ff3a458d3c8 100644 --- a/packages/suite/src/hooks/settings/backends/useCustomBackends.ts +++ b/packages/suite/src/hooks/settings/backends/useCustomBackends.ts @@ -1,6 +1,7 @@ -import { useSelector } from 'src/hooks/suite'; import { getCustomBackends } from '@suite-common/wallet-utils'; +import { useSelector } from 'src/hooks/suite'; + export const useCustomBackends = () => { const blockchains = useSelector(state => state.wallet.blockchain); diff --git a/packages/suite/src/hooks/settings/backends/useDefaultUrls.ts b/packages/suite/src/hooks/settings/backends/useDefaultUrls.ts index fece359e1c3..6d0856c6ab7 100644 --- a/packages/suite/src/hooks/settings/backends/useDefaultUrls.ts +++ b/packages/suite/src/hooks/settings/backends/useDefaultUrls.ts @@ -1,4 +1,5 @@ import { useState, useEffect } from 'react'; + import TrezorConnect, { BlockchainLink } from '@trezor/connect'; import { NetworkSymbol } from '@suite-common/wallet-config'; diff --git a/packages/suite/src/hooks/settings/useNetworkSupport.ts b/packages/suite/src/hooks/settings/useNetworkSupport.ts index 0406aa05140..c5373d6a13e 100644 --- a/packages/suite/src/hooks/settings/useNetworkSupport.ts +++ b/packages/suite/src/hooks/settings/useNetworkSupport.ts @@ -1,8 +1,8 @@ import { Network, getMainnets, getTestnets } from '@suite-common/wallet-config'; import { selectDeviceSupportedNetworks } from '@suite-common/wallet-core'; import { arrayPartition } from '@trezor/utils'; -import { useSelector } from 'src/hooks/suite'; +import { useSelector } from 'src/hooks/suite'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; export const useNetworkSupport = () => { diff --git a/packages/suite/src/hooks/suite/__fixtures__/useFilteredModal.ts b/packages/suite/src/hooks/suite/__fixtures__/useFilteredModal.ts index 5b81f1f6af5..8791c619296 100644 --- a/packages/suite/src/hooks/suite/__fixtures__/useFilteredModal.ts +++ b/packages/suite/src/hooks/suite/__fixtures__/useFilteredModal.ts @@ -1,4 +1,5 @@ import { MODAL } from 'src/actions/suite/constants'; + import { useFilteredModal } from '../useFilteredModal'; export const filters: Parameters[] = [ diff --git a/packages/suite/src/hooks/suite/__tests__/useCountdownTimer.test.tsx b/packages/suite/src/hooks/suite/__tests__/useCountdownTimer.test.tsx index fad4f83cfb8..aaeb4d5910a 100644 --- a/packages/suite/src/hooks/suite/__tests__/useCountdownTimer.test.tsx +++ b/packages/suite/src/hooks/suite/__tests__/useCountdownTimer.test.tsx @@ -1,4 +1,5 @@ import { act, render } from '@testing-library/react'; + import { fixtures } from 'src/hooks/suite/__fixtures__/useCountdownTimer'; import { useCountdownTimer } from 'src/hooks/suite/useCountdownTimer'; diff --git a/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx b/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx index 1c8495927bb..fc29e3d69be 100644 --- a/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx +++ b/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx @@ -1,9 +1,13 @@ import { Provider } from 'react-redux'; -import { configureStore } from 'src/support/tests/configureStore'; + import { render } from '@testing-library/react'; + +import { configureStore } from 'src/support/tests/configureStore'; +import type { State as ModalState } from 'src/reducers/suite/modalReducer'; + import { useFilteredModal } from '../useFilteredModal'; import { filters, fixtures } from '../__fixtures__/useFilteredModal'; -import type { State as ModalState } from 'src/reducers/suite/modalReducer'; + const mockStore = configureStore<{ modal: ModalState }, any>(); diff --git a/packages/suite/src/hooks/suite/__tests__/usePinModal.test.ts b/packages/suite/src/hooks/suite/__tests__/usePinModal.test.ts index 28277c38115..cf8e657c440 100644 --- a/packages/suite/src/hooks/suite/__tests__/usePinModal.test.ts +++ b/packages/suite/src/hooks/suite/__tests__/usePinModal.test.ts @@ -1,4 +1,5 @@ import { ButtonRequest } from '@suite-common/suite-types'; + import { usePinWithoutSelector } from '../usePinModal'; describe('usePinWithoutSelector', () => { diff --git a/packages/suite/src/hooks/suite/useActions.ts b/packages/suite/src/hooks/suite/useActions.ts index 83f37accfd4..ad345304fe2 100644 --- a/packages/suite/src/hooks/suite/useActions.ts +++ b/packages/suite/src/hooks/suite/useActions.ts @@ -1,6 +1,8 @@ import { useMemo, useRef } from 'react'; -import { ActionCreatorsMapObject, bindActionCreators } from 'redux'; import { useDispatch } from 'react-redux'; + +import { ActionCreatorsMapObject, bindActionCreators } from 'redux'; + import type { Action, ThunkAction } from 'src/types/suite'; /** diff --git a/packages/suite/src/hooks/suite/useAnonymityStatus.ts b/packages/suite/src/hooks/suite/useAnonymityStatus.ts index 78db85de42a..f72f92a9ac0 100644 --- a/packages/suite/src/hooks/suite/useAnonymityStatus.ts +++ b/packages/suite/src/hooks/suite/useAnonymityStatus.ts @@ -1,7 +1,8 @@ -import { useSelector } from './useSelector'; import { AnonymityStatus } from 'src/constants/suite/coinjoin'; import { selectCurrentTargetAnonymity } from 'src/reducers/wallet/coinjoinReducer'; +import { useSelector } from './useSelector'; + const getAnonymityStatus = (targetAnonymity: number) => { if (targetAnonymity < AnonymityStatus.Bad) { return AnonymityStatus.Bad; diff --git a/packages/suite/src/hooks/suite/useClearAnchorHighlightOnClick.ts b/packages/suite/src/hooks/suite/useClearAnchorHighlightOnClick.ts index 26272d6148d..be42489a6af 100644 --- a/packages/suite/src/hooks/suite/useClearAnchorHighlightOnClick.ts +++ b/packages/suite/src/hooks/suite/useClearAnchorHighlightOnClick.ts @@ -1,7 +1,9 @@ import { RefObject, useEffect } from 'react'; + +import { onAnchorChange } from 'src/actions/suite/routerActions'; + import { useDispatch } from './useDispatch'; import { useSelector } from './useSelector'; -import { onAnchorChange } from 'src/actions/suite/routerActions'; export const useClearAnchorHighlightOnClick = (elementRef: RefObject) => { const anchor = useSelector(state => state.router.anchor); diff --git a/packages/suite/src/hooks/suite/useCountdownTimer.ts b/packages/suite/src/hooks/suite/useCountdownTimer.ts index 9a992028feb..92791519e5c 100644 --- a/packages/suite/src/hooks/suite/useCountdownTimer.ts +++ b/packages/suite/src/hooks/suite/useCountdownTimer.ts @@ -1,4 +1,5 @@ import { useEffect, useState, useCallback } from 'react'; + import intervalToDuration from 'date-fns/intervalToDuration'; export const useCountdownTimer = (deadline: number) => { diff --git a/packages/suite/src/hooks/suite/useDebugLanguageShortcut.ts b/packages/suite/src/hooks/suite/useDebugLanguageShortcut.ts index ccf7489e691..063a7f602cd 100644 --- a/packages/suite/src/hooks/suite/useDebugLanguageShortcut.ts +++ b/packages/suite/src/hooks/suite/useDebugLanguageShortcut.ts @@ -1,13 +1,15 @@ import { useCallback, useEffect } from 'react'; import { KEYBOARD_CODE } from '@trezor/components'; -import { useSelector } from './useSelector'; -import { useDispatch } from './useDispatch'; + import { setLanguage } from 'src/actions/settings/languageActions'; import LANGUAGES, { Locale } from 'src/config/suite/languages'; import { setAutodetect } from 'src/actions/suite/suiteActions'; import { selectIsDebugModeActive, selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { useDispatch } from './useDispatch'; +import { useSelector } from './useSelector'; + const languages: { value: Locale; label: string }[] = Object.entries(LANGUAGES) .filter(lang => ['official', 'community'].includes(lang[1].type || '')) .map(([value, { name }]) => ({ value: value as Locale, label: name })); diff --git a/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts b/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts index b5ee1a1fb73..b420a9f34c4 100644 --- a/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts +++ b/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts @@ -1,8 +1,11 @@ -import { getTitleForNetwork, getTitleForCoinjoinAccount } from '@suite-common/wallet-utils'; import { useCallback } from 'react'; -import { useTranslation } from './useTranslation'; + +import { getTitleForNetwork, getTitleForCoinjoinAccount } from '@suite-common/wallet-utils'; import { AccountType, NetworkSymbol } from '@suite-common/wallet-config'; +import { useTranslation } from './useTranslation'; + + export interface GetDefaultAccountLabelParams { accountType: AccountType; symbol: NetworkSymbol; diff --git a/packages/suite/src/hooks/suite/useDevice.ts b/packages/suite/src/hooks/suite/useDevice.ts index 13deda0b3b8..aa1587555ed 100644 --- a/packages/suite/src/hooks/suite/useDevice.ts +++ b/packages/suite/src/hooks/suite/useDevice.ts @@ -1,11 +1,11 @@ import { useCallback } from 'react'; import { selectDevice } from '@suite-common/wallet-core'; +import { TrezorDevice } from '@suite-common/suite-types'; import { SUITE } from 'src/actions/suite/constants'; import { useSelector } from './useSelector'; -import { TrezorDevice } from '@suite-common/suite-types'; type Result = { device?: TrezorDevice; diff --git a/packages/suite/src/hooks/suite/useDispatch.ts b/packages/suite/src/hooks/suite/useDispatch.ts index 412ad303306..ec7a510cfae 100644 --- a/packages/suite/src/hooks/suite/useDispatch.ts +++ b/packages/suite/src/hooks/suite/useDispatch.ts @@ -1,5 +1,7 @@ import { useDispatch as useReduxDispatch } from 'react-redux'; + import { ThunkDispatch } from 'redux-thunk'; + import { Action, AppState } from 'src/types/suite'; export const useDispatch: () => ThunkDispatch = useReduxDispatch; diff --git a/packages/suite/src/hooks/suite/useDisplayMode.ts b/packages/suite/src/hooks/suite/useDisplayMode.ts index 52f662c66f5..eb591836333 100644 --- a/packages/suite/src/hooks/suite/useDisplayMode.ts +++ b/packages/suite/src/hooks/suite/useDisplayMode.ts @@ -3,9 +3,10 @@ import { AddressDisplayOptions, StakeType, ReviewOutput } from '@suite-common/wa import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { useSelector } from './useSelector'; import { DisplayMode } from 'src/types/suite'; +import { useSelector } from './useSelector'; + type UseDisplayModeProps = { type: ReviewOutput['type']; ethereumStakeType?: StakeType; diff --git a/packages/suite/src/hooks/suite/useExternalLink.ts b/packages/suite/src/hooks/suite/useExternalLink.ts index 50ac59dd115..e19c8b26912 100644 --- a/packages/suite/src/hooks/suite/useExternalLink.ts +++ b/packages/suite/src/hooks/suite/useExternalLink.ts @@ -1,4 +1,5 @@ import { useMemo } from 'react'; + import { useSelector } from 'src/hooks/suite'; import { getTorUrlIfAvailable } from 'src/utils/suite/tor'; import { selectTorState } from 'src/reducers/suite/suiteReducer'; diff --git a/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts b/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts index 20d2a0feb06..df118815da9 100644 --- a/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts +++ b/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts @@ -1,12 +1,13 @@ -import { useSelector } from 'src/hooks/suite'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { getFiatRateKey, toFiatCurrency } from '@suite-common/wallet-utils'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { selectFiatRatesByFiatRateKey } from '@suite-common/wallet-core'; import { TokenAddress } from '@suite-common/wallet-types'; import { TokenTransfer } from '@trezor/blockchain-link-types'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { useSelector } from 'src/hooks/suite'; + interface CommonOwnProps { amount: string; symbol: NetworkSymbol | TokenTransfer['symbol']; diff --git a/packages/suite/src/hooks/suite/useFormattersConfig.ts b/packages/suite/src/hooks/suite/useFormattersConfig.ts index b1a79606e8a..9ed1a2a81eb 100644 --- a/packages/suite/src/hooks/suite/useFormattersConfig.ts +++ b/packages/suite/src/hooks/suite/useFormattersConfig.ts @@ -1,6 +1,7 @@ +import { FormatterProviderConfig } from '@suite-common/formatters'; + import { useSelector } from 'src/hooks/suite/useSelector'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { FormatterProviderConfig } from '@suite-common/formatters'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; export const useFormattersConfig = (): FormatterProviderConfig => { diff --git a/packages/suite/src/hooks/suite/useMessageSystemStaking.ts b/packages/suite/src/hooks/suite/useMessageSystemStaking.ts index f90da71c216..e7ab840b4e8 100644 --- a/packages/suite/src/hooks/suite/useMessageSystemStaking.ts +++ b/packages/suite/src/hooks/suite/useMessageSystemStaking.ts @@ -3,7 +3,9 @@ import { Feature, selectFeatureMessageContent, } from '@suite-common/message-system'; + import { selectLanguage } from 'src/reducers/suite/suiteReducer'; + import { useSelector } from './useSelector'; export const useMessageSystemStaking = () => { diff --git a/packages/suite/src/hooks/suite/useOnboarding.ts b/packages/suite/src/hooks/suite/useOnboarding.ts index b4b39942d65..ccb699ea8eb 100644 --- a/packages/suite/src/hooks/suite/useOnboarding.ts +++ b/packages/suite/src/hooks/suite/useOnboarding.ts @@ -1,4 +1,5 @@ import { UI } from '@trezor/connect'; + import * as onboardingActions from 'src/actions/onboarding/onboardingActions'; import * as routerActions from 'src/actions/suite/routerActions'; import * as recoveryActions from 'src/actions/recovery/recoveryActions'; diff --git a/packages/suite/src/hooks/suite/useOpenSuiteDesktop.ts b/packages/suite/src/hooks/suite/useOpenSuiteDesktop.ts index e58efe4fa00..8075c23e508 100644 --- a/packages/suite/src/hooks/suite/useOpenSuiteDesktop.ts +++ b/packages/suite/src/hooks/suite/useOpenSuiteDesktop.ts @@ -2,6 +2,7 @@ import TrezorConnect from '@trezor/connect'; import type TrezorConnectWeb from '@trezor/connect-web'; import { useWindowFocus } from '@trezor/react-utils'; import { SUITE_BRIDGE_DEEPLINK, SUITE_URL } from '@trezor/urls'; + import { isWebUsb } from 'src/utils/suite/transport'; import { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/suite/usePasswords.ts b/packages/suite/src/hooks/suite/usePasswords.ts index 2593eaed7f0..ddcd353aa0e 100644 --- a/packages/suite/src/hooks/suite/usePasswords.ts +++ b/packages/suite/src/hooks/suite/usePasswords.ts @@ -5,7 +5,6 @@ import { selectDevice } from '@suite-common/wallet-core'; import { useSelector, useDispatch } from 'src/hooks/suite'; import * as metadataProviderActions from 'src/actions/suite/metadataProviderActions'; import * as metadataPasswordsActions from 'src/actions/suite/metadataPasswordsActions'; - import type { PasswordEntry } from 'src/types/suite/metadata'; import { selectPasswordManagerState, diff --git a/packages/suite/src/hooks/suite/usePinModal.ts b/packages/suite/src/hooks/suite/usePinModal.ts index 6d671de7e56..e7c38dd4faa 100644 --- a/packages/suite/src/hooks/suite/usePinModal.ts +++ b/packages/suite/src/hooks/suite/usePinModal.ts @@ -1,5 +1,6 @@ import { ButtonRequest } from '@suite-common/suite-types'; import { selectDeviceButtonRequests } from '@suite-common/wallet-core'; + import { useSelector } from 'src/hooks/suite'; const NEW_PIN_REQUEST_TYPES = ['PinMatrixRequestType_NewFirst', 'PinMatrixRequestType_NewSecond']; diff --git a/packages/suite/src/hooks/suite/useRediscoveryNeeded.ts b/packages/suite/src/hooks/suite/useRediscoveryNeeded.ts index 9e406fa2535..564b6131f11 100644 --- a/packages/suite/src/hooks/suite/useRediscoveryNeeded.ts +++ b/packages/suite/src/hooks/suite/useRediscoveryNeeded.ts @@ -1,7 +1,9 @@ import { useEffect, useState } from 'react'; -import { useDiscovery, useSelector } from 'src/hooks/suite'; + import { selectDeviceDiscovery } from '@suite-common/wallet-core'; +import { useDiscovery, useSelector } from 'src/hooks/suite'; + export const useRediscoveryNeeded = () => { const [isRediscoveryNeeded, setIsRediscoveryNeeded] = useState(false); diff --git a/packages/suite/src/hooks/suite/useResetScrollOnUrl.ts b/packages/suite/src/hooks/suite/useResetScrollOnUrl.ts index 7b5c3f22395..5de3e74c371 100644 --- a/packages/suite/src/hooks/suite/useResetScrollOnUrl.ts +++ b/packages/suite/src/hooks/suite/useResetScrollOnUrl.ts @@ -1,4 +1,5 @@ import { useLayoutEffect, useRef } from 'react'; + import { useSelector } from './useSelector'; export const useResetScrollOnUrl = () => { diff --git a/packages/suite/src/hooks/suite/useSelector.ts b/packages/suite/src/hooks/suite/useSelector.ts index 892581c7d76..0449578a3d8 100644 --- a/packages/suite/src/hooks/suite/useSelector.ts +++ b/packages/suite/src/hooks/suite/useSelector.ts @@ -1,6 +1,7 @@ -import { AppState } from 'src/types/suite'; import { useSelector as useReduxSelector, shallowEqual, TypedUseSelectorHook } from 'react-redux'; +import { AppState } from 'src/types/suite'; + /** * Properly typed useSelector hook, use this one instead of directly importing it from react-redux. * https://react-redux.js.org/using-react-redux/static-typing#typing-the-useselector-hook diff --git a/packages/suite/src/hooks/suite/useTranslation.ts b/packages/suite/src/hooks/suite/useTranslation.ts index d85183a09d1..9e008ba85e9 100644 --- a/packages/suite/src/hooks/suite/useTranslation.ts +++ b/packages/suite/src/hooks/suite/useTranslation.ts @@ -1,8 +1,10 @@ import { useCallback } from 'react'; import { useIntl } from 'react-intl'; + +import { PrimitiveType } from '@trezor/type-utils'; + import messages from 'src/support/messages'; import { ExtendedMessageDescriptor } from 'src/types/suite'; -import { PrimitiveType } from '@trezor/type-utils'; export type TranslationFunction = ( id: ExtendedMessageDescriptor['id'], diff --git a/packages/suite/src/hooks/wallet/__fixtures__/useSendForm.ts b/packages/suite/src/hooks/wallet/__fixtures__/useSendForm.ts index b9c9098ad84..4004cecde7f 100644 --- a/packages/suite/src/hooks/wallet/__fixtures__/useSendForm.ts +++ b/packages/suite/src/hooks/wallet/__fixtures__/useSendForm.ts @@ -5,6 +5,7 @@ import { DEFAULT_PAYMENT, DEFAULT_VALUES } from '@suite-common/wallet-constants' import { accountsActions, prepareSendFormReducer } from '@suite-common/wallet-core'; import { PROTO } from '@trezor/connect'; import { testMocks } from '@suite-common/test-utils'; + import { extraDependencies } from 'src/support/extraDependencies'; const sendFormReducer = prepareSendFormReducer(extraDependencies); diff --git a/packages/suite/src/hooks/wallet/__tests__/useExcludedUtxos.test.tsx b/packages/suite/src/hooks/wallet/__tests__/useExcludedUtxos.test.tsx index b76ce8efc09..f8d81230ae0 100644 --- a/packages/suite/src/hooks/wallet/__tests__/useExcludedUtxos.test.tsx +++ b/packages/suite/src/hooks/wallet/__tests__/useExcludedUtxos.test.tsx @@ -1,9 +1,12 @@ import { useRef, useState, useEffect } from 'react'; + import { render, screen } from '@testing-library/react'; + import { testMocks } from '@suite-common/test-utils'; -import { useExcludedUtxos } from '../form/useExcludedUtxos'; import * as walletUtils from '@suite-common/wallet-utils'; +import { useExcludedUtxos } from '../form/useExcludedUtxos'; + type Props = Parameters[0]; const ACCOUNT = testMocks.getWalletAccount({ diff --git a/packages/suite/src/hooks/wallet/__tests__/useRbfForm.test.tsx b/packages/suite/src/hooks/wallet/__tests__/useRbfForm.test.tsx index b58804f238f..907d61b7841 100644 --- a/packages/suite/src/hooks/wallet/__tests__/useRbfForm.test.tsx +++ b/packages/suite/src/hooks/wallet/__tests__/useRbfForm.test.tsx @@ -1,7 +1,8 @@ -import TrezorConnect from '@trezor/connect'; import { screen } from '@testing-library/react'; + +import TrezorConnect from '@trezor/connect'; import { configureMockStore, initPreloadedState } from '@suite-common/test-utils'; -import * as fixtures from '../__fixtures__/useRbfForm'; + import { renderWithProviders, waitForLoader, @@ -9,6 +10,8 @@ import { findByTestId, } from 'src/support/tests/hooksHelper'; import { ChangeFee } from 'src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ChangeFee'; + +import * as fixtures from '../__fixtures__/useRbfForm'; import { useRbfContext } from '../useRbfForm'; // do not mock diff --git a/packages/suite/src/hooks/wallet/__tests__/useSendForm.test.tsx b/packages/suite/src/hooks/wallet/__tests__/useSendForm.test.tsx index e01fd2b3b59..c6f4893962f 100644 --- a/packages/suite/src/hooks/wallet/__tests__/useSendForm.test.tsx +++ b/packages/suite/src/hooks/wallet/__tests__/useSendForm.test.tsx @@ -1,8 +1,11 @@ import { useState, useEffect } from 'react'; import { DeepPartial } from 'react-hook-form'; +import { act, waitFor } from '@testing-library/react'; + import { configureMockStore, initPreloadedState, testMocks } from '@suite-common/test-utils'; import { PROTO } from '@trezor/connect'; +import { FormState } from '@suite-common/wallet-types'; import { filterThunkActionTypes } from 'src/support/tests/configureStore'; import { @@ -12,13 +15,11 @@ import { UserAction, actionSequence, } from 'src/support/tests/hooksHelper'; -import { FormState } from '@suite-common/wallet-types'; import SendIndex from 'src/views/wallet/send'; +import { SendContextValues } from 'src/types/wallet/sendForm'; import * as fixtures from '../__fixtures__/useSendForm'; import { useSendFormContext } from '../useSendForm'; -import { act, waitFor } from '@testing-library/react'; -import { SendContextValues } from 'src/types/wallet/sendForm'; const TEST_TIMEOUT = 30000; diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketAccount.ts b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketAccount.ts index 7fdba3344ad..928faa546a4 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketAccount.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketAccount.ts @@ -1,7 +1,9 @@ +import { useState } from 'react'; + import { selectAccounts, selectDevice } from '@suite-common/wallet-core'; import { Account, SelectedAccountLoaded } from '@suite-common/wallet-types'; import { isTestnet } from '@suite-common/wallet-utils'; -import { useState } from 'react'; + import { useSelector } from 'src/hooks/suite'; import { coinmarketGetSortedAccounts, diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketBuildAccountGroups.ts b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketBuildAccountGroups.ts index 7e1712fb12a..3600a712e29 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketBuildAccountGroups.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketBuildAccountGroups.ts @@ -1,5 +1,7 @@ -import { selectAccounts, selectDevice } from '@suite-common/wallet-core'; import { useMemo } from 'react'; + +import { selectAccounts, selectDevice } from '@suite-common/wallet-core'; + import { useDefaultAccountLabel, useSelector } from 'src/hooks/suite'; import { selectAccountLabels } from 'src/reducers/suite/metadataReducer'; import { diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketComposeTransaction.ts b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketComposeTransaction.ts index 5aef7e23772..99f97a2ce9d 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketComposeTransaction.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketComposeTransaction.ts @@ -1,9 +1,11 @@ +import { useEffect, useMemo, useState } from 'react'; +import { UseFormReturn } from 'react-hook-form'; + import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; import { selectAccounts, selectDevice } from '@suite-common/wallet-core'; import { AddressDisplayOptions } from '@suite-common/wallet-types'; import { getFeeLevels } from '@suite-common/wallet-utils'; -import { useEffect, useMemo, useState } from 'react'; -import { UseFormReturn } from 'react-hook-form'; + import { saveComposedTransactionInfo } from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; import { FORM_OUTPUT_ADDRESS, FORM_OUTPUT_AMOUNT } from 'src/constants/wallet/coinmarket/form'; import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketCurrencySwitcher.ts b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketCurrencySwitcher.ts index 81d6784d549..8ac2203b02c 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketCurrencySwitcher.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketCurrencySwitcher.ts @@ -1,8 +1,10 @@ +import { UseFormReturn, useWatch } from 'react-hook-form'; + import { Network } from '@suite-common/wallet-config'; import { Account } from '@suite-common/wallet-types'; import { amountToSmallestUnit, formatAmount } from '@suite-common/wallet-utils'; import { useDidUpdate } from '@trezor/react-utils'; -import { UseFormReturn, useWatch } from 'react-hook-form'; + import { FORM_CRYPTO_INPUT, FORM_FIAT_INPUT, diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketFiatValues.tsx b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketFiatValues.tsx index 65d2cd27ae3..398e57fe724 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketFiatValues.tsx +++ b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketFiatValues.tsx @@ -1,9 +1,12 @@ +import { useCallback, useEffect } from 'react'; + +import { FiatCurrencyCode } from 'invity-api'; + import { networks, NetworkSymbol } from '@suite-common/wallet-config'; import { selectFiatRatesByFiatRateKey, updateFiatRatesThunk } from '@suite-common/wallet-core'; import { FiatRatesResult, Rate, Timestamp, TokenAddress } from '@suite-common/wallet-types'; import { amountToSmallestUnit, getFiatRateKey, toFiatCurrency } from '@suite-common/wallet-utils'; -import { FiatCurrencyCode } from 'invity-api'; -import { useCallback, useEffect } from 'react'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketFormActions.ts b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketFormActions.ts index 331c7d1a8ab..5838ab3271b 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketFormActions.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketFormActions.ts @@ -1,3 +1,9 @@ +import { useCallback, useEffect, useRef, useState } from 'react'; +import { UseFormReturn, useWatch } from 'react-hook-form'; +import { useDebounce } from 'react-use'; + +import { FiatCurrencyCode } from 'invity-api'; + import { isChanged } from '@suite-common/suite-utils'; import { selectAccounts, selectDevice } from '@suite-common/wallet-core'; import { @@ -7,10 +13,7 @@ import { isZero, } from '@suite-common/wallet-utils'; import { BigNumber } from '@trezor/utils'; -import { FiatCurrencyCode } from 'invity-api'; -import { useCallback, useEffect, useRef, useState } from 'react'; -import { UseFormReturn, useWatch } from 'react-hook-form'; -import { useDebounce } from 'react-use'; + import { FORM_CRYPTO_TOKEN, FORM_OUTPUT_ADDRESS, diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketInitializer.ts b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketInitializer.ts index 3f0260ba69e..bd7d86fac3c 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketInitializer.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketInitializer.ts @@ -1,5 +1,7 @@ -import { useTimer } from '@trezor/react-utils'; import { useState } from 'react'; + +import { useTimer } from '@trezor/react-utils'; + import { INVITY_API_RELOAD_QUOTES_AFTER_SECONDS } from 'src/constants/wallet/coinmarket/metadata'; import { useDevice } from 'src/hooks/suite'; import { useServerEnvironment } from 'src/hooks/wallet/coinmarket/useServerEnviroment'; diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketModalCrypto.ts b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketModalCrypto.ts index 96e4c0f7df1..7065f874382 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketModalCrypto.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/common/useCoinmarketModalCrypto.ts @@ -1,5 +1,7 @@ -import { CryptoId } from 'invity-api'; import { useEffect } from 'react'; + +import { CryptoId } from 'invity-api'; + import { SET_MODAL_CRYPTO_CURRENCY } from 'src/actions/wallet/constants/coinmarketCommonConstants'; import { useDispatch } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyForm.tsx b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyForm.tsx index 16f64e66c99..5670533d584 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyForm.tsx +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyForm.tsx @@ -1,9 +1,16 @@ import { useCallback, useState, useEffect, useRef } from 'react'; import { useForm, useWatch } from 'react-hook-form'; + import useDebounce from 'react-use/lib/useDebounce'; import type { BuyTrade, BuyTradeQuoteRequest, CryptoId } from 'invity-api'; + import { isChanged } from '@suite-common/suite-utils'; import { formatAmount } from '@suite-common/wallet-utils'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import { isDesktop } from '@trezor/env-utils'; +import { networks } from '@suite-common/wallet-config'; +import { analytics, EventType } from '@trezor/suite-analytics'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import invityAPI from 'src/services/suite/invityAPI'; import { @@ -29,8 +36,6 @@ import * as coinmarketInfoActions from 'src/actions/wallet/coinmarketInfoActions import * as coinmarketCommonActions from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; import * as coinmarketBuyActions from 'src/actions/wallet/coinmarketBuyActions'; import * as routerActions from 'src/actions/suite/routerActions'; -import { notificationsActions } from '@suite-common/toast-notifications'; -import { isDesktop } from '@trezor/env-utils'; import useCoinmarketPaymentMethod from 'src/hooks/wallet/coinmarket/form/useCoinmarketPaymentMethod'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { useCoinmarketNavigation } from 'src/hooks/wallet/useCoinmarketNavigation'; @@ -44,9 +49,8 @@ import { useCoinmarketLoadData } from 'src/hooks/wallet/coinmarket/useCoinmarket import { useCoinmarketCurrencySwitcher } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketCurrencySwitcher'; import { useCoinmarketModalCrypto } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketModalCrypto'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; -import { networks } from '@suite-common/wallet-config'; -import { analytics, EventType } from '@trezor/suite-analytics'; import { useCoinmarketBuyFormDefaultValues } from 'src/hooks/wallet/coinmarket/form/useCoinmarketBuyFormDefaultValues'; + import { useCoinmarketInitializer } from './common/useCoinmarketInitializer'; export const useCoinmarketBuyForm = ({ diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyFormDefaultValues.tsx b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyFormDefaultValues.tsx index 7fc190bf0d4..c634833da7b 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyFormDefaultValues.tsx +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyFormDefaultValues.tsx @@ -1,5 +1,10 @@ -import { BuyInfo } from 'src/actions/wallet/coinmarketBuyActions'; import { useMemo } from 'react'; + +import { FiatCurrencyCode, CryptoId } from 'invity-api'; + +import { networks } from '@suite-common/wallet-config'; + +import { BuyInfo } from 'src/actions/wallet/coinmarketBuyActions'; import { Account } from 'src/types/wallet'; import { buildFiatOption, getDefaultCountry } from 'src/utils/wallet/coinmarket/coinmarketUtils'; import { CoinmarketBuyFormDefaultValuesProps } from 'src/types/coinmarket/coinmarketForm'; @@ -8,9 +13,8 @@ import { FORM_DEFAULT_FIAT_CURRENCY, FORM_DEFAULT_PAYMENT_METHOD, } from 'src/constants/wallet/coinmarket/form'; -import { FiatCurrencyCode, CryptoId } from 'invity-api'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; -import { networks } from '@suite-common/wallet-config'; + export const useCoinmarketBuyFormDefaultValues = ( accountSymbol: Account['symbol'], diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm.tsx b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm.tsx index dd31f7ad968..be5e6f78624 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm.tsx +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm.tsx @@ -1,4 +1,5 @@ import { createContext, useContext } from 'react'; + import { CoinmarketTradeType } from 'src/types/coinmarket/coinmarket'; import { CoinmarketFormContextValues } from 'src/types/coinmarket/coinmarketForm'; diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeForm.ts b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeForm.ts index e2843cd177e..41202612810 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeForm.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeForm.ts @@ -1,5 +1,6 @@ import { useCallback, useState, useEffect, useRef, useMemo } from 'react'; import { useForm, useWatch } from 'react-hook-form'; + import type { CryptoId, ExchangeTrade, @@ -7,8 +8,14 @@ import type { FiatCurrencyCode, } from 'invity-api'; import useDebounce from 'react-use/lib/useDebounce'; + import { amountToSmallestUnit, formatAmount, toFiatCurrency } from '@suite-common/wallet-utils'; import { isChanged } from '@suite-common/suite-utils'; +import { Account } from '@suite-common/wallet-types'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import { networks } from '@suite-common/wallet-config'; +import { analytics, EventType } from '@trezor/suite-analytics'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import invityAPI from 'src/services/suite/invityAPI'; import { saveQuoteRequest, saveQuotes } from 'src/actions/wallet/coinmarketExchangeActions'; @@ -28,7 +35,6 @@ import { useFormDraft } from 'src/hooks/wallet/useFormDraft'; import { useCoinmarketNavigation } from 'src/hooks/wallet/useCoinmarketNavigation'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { CryptoAmountLimits } from 'src/types/wallet/coinmarketCommonTypes'; -import { Account } from '@suite-common/wallet-types'; import { CoinmarketTradeExchangeType, UseCoinmarketFormProps, @@ -48,18 +54,16 @@ import { import { useCoinmarketExchangeFormDefaultValues } from 'src/hooks/wallet/coinmarket/form/useCoinmarketExchangeFormDefaultValues'; import * as coinmarketExchangeActions from 'src/actions/wallet/coinmarketExchangeActions'; import * as coinmarketCommonActions from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; -import { notificationsActions } from '@suite-common/toast-notifications'; import { useCoinmarketRecomposeAndSign } from 'src/hooks/wallet/useCoinmarketRecomposeAndSign'; import { useCoinmarketLoadData } from 'src/hooks/wallet/coinmarket/useCoinmarketLoadData'; import { useCoinmarketComposeTransaction } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketComposeTransaction'; import { useCoinmarketFormActions } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketFormActions'; import { useCoinmarketCurrencySwitcher } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketCurrencySwitcher'; import { useCoinmarketModalCrypto } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketModalCrypto'; -import { networks } from '@suite-common/wallet-config'; import { useCoinmarketAccount } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketAccount'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; -import { analytics, EventType } from '@trezor/suite-analytics'; import { useCoinmarketFiatValues } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketFiatValues'; + import { useCoinmarketInitializer } from './common/useCoinmarketInitializer'; export const useCoinmarketExchangeForm = ({ diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeFormDefaultValues.ts b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeFormDefaultValues.ts index d576e12513e..9398dcef900 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeFormDefaultValues.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeFormDefaultValues.ts @@ -1,5 +1,8 @@ import { useMemo } from 'react'; + import { DEFAULT_PAYMENT, DEFAULT_VALUES } from '@suite-common/wallet-constants'; +import { FormState, Output } from '@suite-common/wallet-types'; + import { buildFiatOption, cryptoIdToNetworkSymbol, @@ -14,7 +17,6 @@ import { RateType, RateTypeFilter, } from 'src/types/coinmarket/coinmarketForm'; -import { FormState, Output } from '@suite-common/wallet-types'; import { EXCHANGE_COMPARATOR_KYC_FILTER, EXCHANGE_COMPARATOR_KYC_FILTER_ALL, diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeWatchSendApproval.ts b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeWatchSendApproval.ts index 3ba3a4faae6..e10bf181a8d 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeWatchSendApproval.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketExchangeWatchSendApproval.ts @@ -1,6 +1,8 @@ -import { ExchangeTrade } from 'invity-api'; import { useEffect, useState } from 'react'; import { useTimeoutFn, useUnmount } from 'react-use'; + +import { ExchangeTrade } from 'invity-api'; + import { useDispatch } from 'src/hooks/suite'; import invityAPI from 'src/services/suite/invityAPI'; import { CoinmarketTradeExchangeType } from 'src/types/coinmarket/coinmarket'; diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketPaymentMethod.tsx b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketPaymentMethod.tsx index 4c24b871836..a0d68313300 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketPaymentMethod.tsx +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketPaymentMethod.tsx @@ -1,4 +1,5 @@ import { useCallback } from 'react'; + import { useSelector } from 'src/hooks/suite'; import { CoinmarketPaymentMethodListProps, diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellForm.ts b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellForm.ts index ad584514838..f3b11122b4d 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellForm.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellForm.ts @@ -1,9 +1,15 @@ import { useCallback, useState, useEffect, useRef } from 'react'; import { useForm, useWatch } from 'react-hook-form'; + import type { BankAccount, CryptoId, SellFiatTrade, SellFiatTradeQuoteRequest } from 'invity-api'; import useDebounce from 'react-use/lib/useDebounce'; + import { amountToSmallestUnit, formatAmount } from '@suite-common/wallet-utils'; import { isChanged } from '@suite-common/suite-utils'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import { networks } from '@suite-common/wallet-config'; +import { analytics, EventType } from '@trezor/suite-analytics'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import invityAPI from 'src/services/suite/invityAPI'; import { @@ -38,7 +44,6 @@ import { FORM_PAYMENT_METHOD_SELECT, } from 'src/constants/wallet/coinmarket/form'; import { useCoinmarketRecomposeAndSign } from 'src/hooks/wallet/useCoinmarketRecomposeAndSign'; -import { notificationsActions } from '@suite-common/toast-notifications'; import * as coinmarketSellActions from 'src/actions/wallet/coinmarketSellActions'; import * as routerActions from 'src/actions/suite/routerActions'; import * as coinmarketCommonActions from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; @@ -47,10 +52,10 @@ import { useCoinmarketFormActions } from 'src/hooks/wallet/coinmarket/form/commo import { useCoinmarketLoadData } from 'src/hooks/wallet/coinmarket/useCoinmarketLoadData'; import { useCoinmarketComposeTransaction } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketComposeTransaction'; import { useCoinmarketCurrencySwitcher } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketCurrencySwitcher'; -import { networks } from '@suite-common/wallet-config'; import { useCoinmarketAccount } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketAccount'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; -import { analytics, EventType } from '@trezor/suite-analytics'; + + import { useCoinmarketInitializer } from './common/useCoinmarketInitializer'; export const useCoinmarketSellForm = ({ diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellFormDefaultValues.ts b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellFormDefaultValues.ts index 2ef6e5e48b3..afe3543873a 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellFormDefaultValues.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellFormDefaultValues.ts @@ -1,6 +1,9 @@ import { useMemo } from 'react'; -import { SellInfo } from 'src/actions/wallet/coinmarketSellActions'; + import { DEFAULT_PAYMENT, DEFAULT_VALUES } from '@suite-common/wallet-constants'; +import { FormState, Output } from '@suite-common/wallet-types'; + +import { SellInfo } from 'src/actions/wallet/coinmarketSellActions'; import { buildFiatOption, cryptoIdToNetworkSymbol, @@ -9,7 +12,6 @@ import { import { Account } from 'src/types/wallet'; import { CoinmarketPaymentMethodListProps } from 'src/types/coinmarket/coinmarket'; import { CoinmarketSellFormDefaultValuesProps } from 'src/types/coinmarket/coinmarketForm'; -import { FormState, Output } from '@suite-common/wallet-types'; import { FORM_DEFAULT_FIAT_CURRENCY, FORM_DEFAULT_PAYMENT_METHOD, diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketVerifyAccount.tsx b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketVerifyAccount.tsx index 8434cccad71..bfe9724702f 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketVerifyAccount.tsx +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketVerifyAccount.tsx @@ -1,11 +1,15 @@ -import { Network, networksCollection } from '@suite-common/wallet-config'; -import { selectDevice } from '@suite-common/wallet-core'; import { useEffect, useMemo, useState } from 'react'; import { useForm } from 'react-hook-form'; + +import { Network, networksCollection } from '@suite-common/wallet-config'; +import { selectDevice } from '@suite-common/wallet-core'; +import { Account } from '@suite-common/wallet-types'; +import { TrezorDevice } from '@suite-common/suite-types'; +import { filterReceiveAccounts } from '@suite-common/wallet-utils'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; import { openModal } from 'src/actions/suite/modalActions'; -import { Account } from '@suite-common/wallet-types'; import { cryptoIdToNetworkSymbol, getUnusedAddressFromAccount, @@ -21,8 +25,7 @@ import { CoinmarketVerifyFormProps, } from 'src/types/coinmarket/coinmarketVerify'; import { useAccountAddressDictionary } from 'src/hooks/wallet/useAccounts'; -import { TrezorDevice } from '@suite-common/suite-types'; -import { filterReceiveAccounts } from '@suite-common/wallet-utils'; + const getSelectAccountOptions = ( suiteReceiveAccounts: Account[] | undefined, diff --git a/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketDetail.ts b/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketDetail.ts index b33422735a6..4a94878978c 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketDetail.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketDetail.ts @@ -1,5 +1,6 @@ -import { useSelector } from 'src/hooks/suite'; import { createContext, useContext } from 'react'; + +import { useSelector } from 'src/hooks/suite'; import { CoinmarketDetailContextValues, CoinmarketGetDetailDataOutputProps, diff --git a/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketInfo.ts b/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketInfo.ts index b64b44078ca..ba3c5cb92cb 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketInfo.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketInfo.ts @@ -1,8 +1,11 @@ -import { getNetworkByCoingeckoNativeId, networks } from '@suite-common/wallet-config'; -import { CoinInfo, CryptoId } from 'invity-api'; import { useCallback } from 'react'; -import { useSelector } from 'src/hooks/suite/useSelector'; + +import { CoinInfo, CryptoId } from 'invity-api'; + +import { getNetworkByCoingeckoNativeId, networks } from '@suite-common/wallet-config'; import addressValidator from '@trezor/address-validator'; + +import { useSelector } from 'src/hooks/suite/useSelector'; import { CoinmarketCryptoSelectItemProps, CoinmarketCryptoSelectOptionProps, diff --git a/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketLoadData.ts b/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketLoadData.ts index e0b031d75ef..9894e9df2a5 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketLoadData.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketLoadData.ts @@ -1,4 +1,5 @@ import { useEffect } from 'react'; + import { loadInvityData } from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; import { useDispatch } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketWatchTrade.ts b/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketWatchTrade.ts index 7a6c6f0cd1f..0f0b0ace089 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketWatchTrade.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/useCoinmarketWatchTrade.ts @@ -1,11 +1,7 @@ import { useEffect, useState } from 'react'; import { useDispatch } from 'react-redux'; import { useTimeoutFn, useUnmount } from 'react-use'; -import { Trade, TradeType } from 'src/types/wallet/coinmarketCommonTypes'; -import invityAPI from 'src/services/suite/invityAPI'; -import { saveTrade as saveBuyTrade } from 'src/actions/wallet/coinmarketBuyActions'; -import { saveTrade as saveExchangeTrade } from 'src/actions/wallet/coinmarketExchangeActions'; -import { saveTrade as saveSellTrade } from 'src/actions/wallet/coinmarketSellActions'; + import { BuyTradeFinalStatus, ExchangeTradeFinalStatus, @@ -14,6 +10,12 @@ import { WatchExchangeTradeResponse, WatchSellTradeResponse, } from 'invity-api'; + +import { Trade, TradeType } from 'src/types/wallet/coinmarketCommonTypes'; +import invityAPI from 'src/services/suite/invityAPI'; +import { saveTrade as saveBuyTrade } from 'src/actions/wallet/coinmarketBuyActions'; +import { saveTrade as saveExchangeTrade } from 'src/actions/wallet/coinmarketExchangeActions'; +import { saveTrade as saveSellTrade } from 'src/actions/wallet/coinmarketSellActions'; import { CoinmarketTradeStatusType, CoinmarketTradeType, diff --git a/packages/suite/src/hooks/wallet/form/useCoinjoinRegisteredUtxos.ts b/packages/suite/src/hooks/wallet/form/useCoinjoinRegisteredUtxos.ts index 9b6239715ba..b2e2e550bbf 100644 --- a/packages/suite/src/hooks/wallet/form/useCoinjoinRegisteredUtxos.ts +++ b/packages/suite/src/hooks/wallet/form/useCoinjoinRegisteredUtxos.ts @@ -1,4 +1,5 @@ import { useMemo } from 'react'; + import { AccountUtxo } from '@trezor/connect'; import { getUtxoOutpoint } from '@suite-common/wallet-utils'; import { Account } from '@suite-common/wallet-types'; diff --git a/packages/suite/src/hooks/wallet/form/useCoinjoinUnavailableUtxos.ts b/packages/suite/src/hooks/wallet/form/useCoinjoinUnavailableUtxos.ts index 1ca9edc0fff..2277d512d6d 100644 --- a/packages/suite/src/hooks/wallet/form/useCoinjoinUnavailableUtxos.ts +++ b/packages/suite/src/hooks/wallet/form/useCoinjoinUnavailableUtxos.ts @@ -1,9 +1,10 @@ import { useMemo } from 'react'; + import { BigNumber } from '@trezor/utils/src/bigNumber'; import { AccountUtxo } from '@trezor/connect'; - import { getUtxoOutpoint } from '@suite-common/wallet-utils'; import { Account } from '@suite-common/wallet-types'; + import { useSelector, useTranslation } from 'src/hooks/suite'; import { WabiSabiProtocolErrorCode } from 'src/types/wallet/coinjoin'; import { diff --git a/packages/suite/src/hooks/wallet/form/useCompose.ts b/packages/suite/src/hooks/wallet/form/useCompose.ts index c8ee67bbf6b..bd3b4fa89c8 100644 --- a/packages/suite/src/hooks/wallet/form/useCompose.ts +++ b/packages/suite/src/hooks/wallet/form/useCompose.ts @@ -1,11 +1,10 @@ import { useEffect, useRef, useCallback, useState } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; + import { isFulfilled } from '@reduxjs/toolkit'; import { FeeLevel } from '@trezor/connect'; import { useDebounce } from '@trezor/react-utils'; -import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; -import { signAndPushSendFormTransactionThunk } from 'src/actions/wallet/send/sendFormThunks'; import { ComposeActionContext, composeSendFormTransactionFeeLevelsThunk, @@ -19,7 +18,11 @@ import { PrecomposedLevelsCardano, } from '@suite-common/wallet-types'; import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; + +import { signAndPushSendFormTransactionThunk } from 'src/actions/wallet/send/sendFormThunks'; +import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; + import { SendContextValues, UseSendFormState } from '../../../types/wallet/sendForm'; const DEFAULT_FIELD = 'outputs.0.amount'; diff --git a/packages/suite/src/hooks/wallet/form/useFees.ts b/packages/suite/src/hooks/wallet/form/useFees.ts index 6d383b454d2..7d942fcb4eb 100644 --- a/packages/suite/src/hooks/wallet/form/useFees.ts +++ b/packages/suite/src/hooks/wallet/form/useFees.ts @@ -1,14 +1,17 @@ import { useEffect, useRef } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; + import { FeeLevel } from '@trezor/connect'; -import { setLastUsedFeeLevel } from 'src/actions/settings/walletSettingsActions'; -import { useDispatch } from 'src/hooks/suite'; import { FeeInfo, FormState, PrecomposedLevels, PrecomposedLevelsCardano, } from '@suite-common/wallet-types'; + +import { setLastUsedFeeLevel } from 'src/actions/settings/walletSettingsActions'; +import { useDispatch } from 'src/hooks/suite'; + import { SendContextValues } from '../../../types/wallet/sendForm'; interface Props extends UseFormReturn { diff --git a/packages/suite/src/hooks/wallet/form/useStakeCompose.ts b/packages/suite/src/hooks/wallet/form/useStakeCompose.ts index 7c909d5bdfa..2b6469edee8 100644 --- a/packages/suite/src/hooks/wallet/form/useStakeCompose.ts +++ b/packages/suite/src/hooks/wallet/form/useStakeCompose.ts @@ -2,8 +2,6 @@ import { useEffect, useRef, useCallback, useState } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; import { useDebounce } from '@trezor/react-utils'; -import { useDispatch, useTranslation } from 'src/hooks/suite'; -import { composeTransaction } from 'src/actions/wallet/stakeActions'; import { findComposeErrors } from '@suite-common/wallet-utils'; import { StakeFormState, @@ -14,6 +12,9 @@ import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; import { FeeLevel } from '@trezor/connect'; import { ComposeActionContext, StakeContextValues } from '@suite-common/wallet-core'; +import { composeTransaction } from 'src/actions/wallet/stakeActions'; +import { useDispatch, useTranslation } from 'src/hooks/suite'; + const DEFAULT_FIELD = 'outputs.0.amount'; interface Props extends UseFormReturn { diff --git a/packages/suite/src/hooks/wallet/form/useUtxoSelection.ts b/packages/suite/src/hooks/wallet/form/useUtxoSelection.ts index c8e39b62485..acc2940e200 100644 --- a/packages/suite/src/hooks/wallet/form/useUtxoSelection.ts +++ b/packages/suite/src/hooks/wallet/form/useUtxoSelection.ts @@ -4,6 +4,7 @@ import { UseFormReturn } from 'react-hook-form'; import { ExcludedUtxos, FormState } from '@suite-common/wallet-types'; import type { AccountUtxo, PROTO } from '@trezor/connect'; import { getUtxoOutpoint, isSameUtxo } from '@suite-common/wallet-utils'; + import { useCoinjoinRegisteredUtxos } from './useCoinjoinRegisteredUtxos'; import { SendContextValues, diff --git a/packages/suite/src/hooks/wallet/sign-verify/useCopySignedMessage.ts b/packages/suite/src/hooks/wallet/sign-verify/useCopySignedMessage.ts index 5b1c387536d..64b108211cd 100644 --- a/packages/suite/src/hooks/wallet/sign-verify/useCopySignedMessage.ts +++ b/packages/suite/src/hooks/wallet/sign-verify/useCopySignedMessage.ts @@ -1,7 +1,8 @@ import { copyToClipboard } from '@trezor/dom-utils'; -import { useDispatch } from 'src/hooks/suite'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { useDispatch } from 'src/hooks/suite'; + type SignedMessageData = { message?: string; address?: string; diff --git a/packages/suite/src/hooks/wallet/sign-verify/useSignAddressOptions.ts b/packages/suite/src/hooks/wallet/sign-verify/useSignAddressOptions.ts index e5b1d718ee8..b92587485c9 100644 --- a/packages/suite/src/hooks/wallet/sign-verify/useSignAddressOptions.ts +++ b/packages/suite/src/hooks/wallet/sign-verify/useSignAddressOptions.ts @@ -1,4 +1,5 @@ import { useMemo } from 'react'; + import { useTranslation } from 'src/hooks/suite'; import type { Account } from 'src/types/wallet'; import type { ExtendedMessageDescriptor } from 'src/types/suite'; diff --git a/packages/suite/src/hooks/wallet/sign-verify/useSignVerifyForm.ts b/packages/suite/src/hooks/wallet/sign-verify/useSignVerifyForm.ts index e3f9f8f91f5..e2273f8f2db 100644 --- a/packages/suite/src/hooks/wallet/sign-verify/useSignVerifyForm.ts +++ b/packages/suite/src/hooks/wallet/sign-verify/useSignVerifyForm.ts @@ -1,11 +1,13 @@ import { useEffect } from 'react'; import { useForm, useController } from 'react-hook-form'; + +import { yupResolver } from '@hookform/resolvers/yup'; + import { yup } from '@suite-common/validators'; import { isAddressValid } from '@suite-common/wallet-utils'; -import { yupResolver } from '@hookform/resolvers/yup'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import type { Account } from 'src/types/wallet'; -import { NetworkSymbol } from '@suite-common/wallet-config'; export const MAX_LENGTH_MESSAGE = 1024; export const MAX_LENGTH_SIGNATURE = 255; diff --git a/packages/suite/src/hooks/wallet/useBitcoinAmountUnit.ts b/packages/suite/src/hooks/wallet/useBitcoinAmountUnit.ts index edd0cdaaf7b..94d895b54a8 100644 --- a/packages/suite/src/hooks/wallet/useBitcoinAmountUnit.ts +++ b/packages/suite/src/hooks/wallet/useBitcoinAmountUnit.ts @@ -1,10 +1,10 @@ import { PROTO } from '@trezor/connect'; import { selectDeviceUnavailableCapabilities } from '@suite-common/wallet-core'; +import { getNetworkOptional, NetworkSymbol } from '@suite-common/wallet-config'; import { useSelector } from 'src/hooks/suite/useSelector'; import { useActions } from 'src/hooks/suite/useActions'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; -import { getNetworkOptional, NetworkSymbol } from '@suite-common/wallet-config'; export const useBitcoinAmountUnit = (symbol?: NetworkSymbol) => { const bitcoinAmountUnit = useSelector(state => state.wallet.settings.bitcoinAmountUnit); diff --git a/packages/suite/src/hooks/wallet/useClaimEthForm.ts b/packages/suite/src/hooks/wallet/useClaimEthForm.ts index 9b466a513af..646afd34292 100644 --- a/packages/suite/src/hooks/wallet/useClaimEthForm.ts +++ b/packages/suite/src/hooks/wallet/useClaimEthForm.ts @@ -1,21 +1,21 @@ import { createContext, useCallback, useContext, useEffect, useMemo } from 'react'; import { useForm } from 'react-hook-form'; +import { selectNetwork } from '@everstake/wallet-sdk/ethereum'; + import { getFeeLevels } from '@suite-common/wallet-utils'; +import { PrecomposedTransactionFinal } from '@suite-common/wallet-types'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { CRYPTO_INPUT, OUTPUT_AMOUNT, UseStakeFormsProps } from 'src/types/wallet/stakeForms'; - -import { useStakeCompose } from './form/useStakeCompose'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; - import { signTransaction } from 'src/actions/wallet/stakeActions'; -import { PrecomposedTransactionFinal } from '@suite-common/wallet-types'; import { getEthNetworkForWalletSdk, getStakeFormsDefaultValues } from 'src/utils/suite/stake'; -import { selectNetwork } from '@everstake/wallet-sdk/ethereum'; -import { useFees } from './form/useFees'; import { ClaimContextValues, ClaimFormState } from 'src/types/wallet/claimForm'; +import { useFees } from './form/useFees'; +import { useStakeCompose } from './form/useStakeCompose'; + export const ClaimEthFormContext = createContext(null); ClaimEthFormContext.displayName = 'ClaimEthFormContext'; diff --git a/packages/suite/src/hooks/wallet/useCoinmarketNavigation.ts b/packages/suite/src/hooks/wallet/useCoinmarketNavigation.ts index ab0bfe4b2a6..072e0513d9b 100644 --- a/packages/suite/src/hooks/wallet/useCoinmarketNavigation.ts +++ b/packages/suite/src/hooks/wallet/useCoinmarketNavigation.ts @@ -1,4 +1,5 @@ import { useCallback } from 'react'; + import { Account } from 'src/types/wallet'; import { goto } from 'src/actions/suite/routerActions'; import { useDispatch } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/wallet/useCoinmarketRecomposeAndSign.ts b/packages/suite/src/hooks/wallet/useCoinmarketRecomposeAndSign.ts index b09cf9866fd..ba8a834f8be 100644 --- a/packages/suite/src/hooks/wallet/useCoinmarketRecomposeAndSign.ts +++ b/packages/suite/src/hooks/wallet/useCoinmarketRecomposeAndSign.ts @@ -1,6 +1,5 @@ import { useCallback } from 'react'; -import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; -import { signAndPushSendFormTransactionThunk } from 'src/actions/wallet/send/sendFormThunks'; + import { notificationsActions } from '@suite-common/toast-notifications'; import { DEFAULT_VALUES, DEFAULT_PAYMENT } from '@suite-common/wallet-constants'; @@ -10,6 +9,9 @@ import { networks } from '@suite-common/wallet-config'; import type { Account, FormOptions } from '@suite-common/wallet-types'; import { composeSendFormTransactionFeeLevelsThunk } from '@suite-common/wallet-core'; +import { signAndPushSendFormTransactionThunk } from 'src/actions/wallet/send/sendFormThunks'; +import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; + interface CoinmarketRecomposeAndSignProps { account: Account; address: string; diff --git a/packages/suite/src/hooks/wallet/useCoinmarketRedirect.ts b/packages/suite/src/hooks/wallet/useCoinmarketRedirect.ts index 15985d575b4..60457f5276e 100644 --- a/packages/suite/src/hooks/wallet/useCoinmarketRedirect.ts +++ b/packages/suite/src/hooks/wallet/useCoinmarketRedirect.ts @@ -1,11 +1,14 @@ -import { Account } from 'src/types/wallet'; import { BuyTradeQuoteRequest, CryptoId, SellFiatTradeQuoteRequest } from 'invity-api'; + +import { FeeLevel } from '@trezor/connect'; + +import { Account } from 'src/types/wallet'; import { useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; import * as coinmarketBuyActions from 'src/actions/wallet/coinmarketBuyActions'; import * as coinmarketSellActions from 'src/actions/wallet/coinmarketSellActions'; import { saveComposedTransactionInfo } from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; -import { FeeLevel } from '@trezor/connect'; + interface OfferRedirectParams { symbol: Account['symbol']; diff --git a/packages/suite/src/hooks/wallet/useFormDraft.ts b/packages/suite/src/hooks/wallet/useFormDraft.ts index b84c40a6f2d..b6f7da3f385 100644 --- a/packages/suite/src/hooks/wallet/useFormDraft.ts +++ b/packages/suite/src/hooks/wallet/useFormDraft.ts @@ -1,7 +1,8 @@ import { FieldValues } from 'react-hook-form'; -import { useActions } from 'src/hooks/suite'; import { FormDraftKeyPrefix } from '@suite-common/wallet-types'; + +import { useActions } from 'src/hooks/suite'; import * as formDraftActions from 'src/actions/wallet/formDraftActions'; export const useFormDraft = (keyPrefix: FormDraftKeyPrefix) => diff --git a/packages/suite/src/hooks/wallet/useRbfForm.ts b/packages/suite/src/hooks/wallet/useRbfForm.ts index 46adb3e2324..752a827c0aa 100644 --- a/packages/suite/src/hooks/wallet/useRbfForm.ts +++ b/packages/suite/src/hooks/wallet/useRbfForm.ts @@ -1,8 +1,9 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; import { createContext, useContext, useState, useEffect, useMemo } from 'react'; import { useForm } from 'react-hook-form'; + import { fromWei } from 'web3-utils'; -import { useSelector } from 'src/hooks/suite'; + +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { DEFAULT_PAYMENT, DEFAULT_OPRETURN, DEFAULT_VALUES } from '@suite-common/wallet-constants'; import { getFeeLevels } from '@suite-common/wallet-utils'; import { @@ -13,10 +14,13 @@ import { FormState, FeeInfo, } from '@suite-common/wallet-types'; -import { useFees } from './form/useFees'; -import { useCompose } from './form/useCompose'; + +import { useSelector } from 'src/hooks/suite'; import { selectCurrentTargetAnonymity } from 'src/reducers/wallet/coinjoinReducer'; import { useCoinjoinRegisteredUtxos } from 'src/hooks/wallet/form/useCoinjoinRegisteredUtxos'; + +import { useCompose } from './form/useCompose'; +import { useFees } from './form/useFees'; import { useBitcoinAmountUnit } from './useBitcoinAmountUnit'; export type UseRbfProps = { diff --git a/packages/suite/src/hooks/wallet/useSendForm.ts b/packages/suite/src/hooks/wallet/useSendForm.ts index 6d2f69798be..1beb91cf8e1 100644 --- a/packages/suite/src/hooks/wallet/useSendForm.ts +++ b/packages/suite/src/hooks/wallet/useSendForm.ts @@ -1,7 +1,19 @@ import { createContext, useContext, useCallback, useState, useEffect, useRef } from 'react'; import { useForm, useFieldArray } from 'react-hook-form'; -import { useSelector, useDispatch } from 'src/hooks/suite'; + import { useDidUpdate } from '@trezor/react-utils'; +import { FormState } from '@suite-common/wallet-types'; +import { + getFeeLevels, + getDefaultValues, + amountToSmallestUnit, + formatAmount, +} from '@suite-common/wallet-utils'; +import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; +import { selectCurrentFiatRates } from '@suite-common/wallet-core'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; + +import { useSelector, useDispatch } from 'src/hooks/suite'; import { getSendFormDraftThunk, removeSendFormDraftThunk, @@ -15,26 +27,17 @@ import { import { goto } from 'src/actions/suite/routerActions'; import { fillSendForm } from 'src/actions/suite/protocolActions'; import { AppState } from 'src/types/suite'; -import { FormState } from '@suite-common/wallet-types'; -import { - getFeeLevels, - getDefaultValues, - amountToSmallestUnit, - formatAmount, -} from '@suite-common/wallet-utils'; +import { SendContextValues, UseSendFormState } from 'src/types/wallet/sendForm'; + import { useSendFormOutputs } from './useSendFormOutputs'; import { useSendFormFields } from './useSendFormFields'; import { useSendFormCompose } from './useSendFormCompose'; import { useSendFormImport } from './useSendFormImport'; import { useFees } from './form/useFees'; -import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; - import { useBitcoinAmountUnit } from './useBitcoinAmountUnit'; import { useUtxoSelection } from './form/useUtxoSelection'; import { useExcludedUtxos } from './form/useExcludedUtxos'; -import { selectCurrentFiatRates } from '@suite-common/wallet-core'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; -import { SendContextValues, UseSendFormState } from 'src/types/wallet/sendForm'; + export const SendContext = createContext(null); SendContext.displayName = 'SendContext'; diff --git a/packages/suite/src/hooks/wallet/useSendFormCompose.ts b/packages/suite/src/hooks/wallet/useSendFormCompose.ts index 9c644f6b6d6..50aebd96db5 100644 --- a/packages/suite/src/hooks/wallet/useSendFormCompose.ts +++ b/packages/suite/src/hooks/wallet/useSendFormCompose.ts @@ -1,5 +1,8 @@ import { useState, useRef, useEffect, useCallback, Dispatch, SetStateAction } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; +import { useDispatch } from 'react-redux'; + +import { isFulfilled } from '@reduxjs/toolkit'; import { FormState, @@ -14,13 +17,12 @@ import { isChanged } from '@suite-common/suite-utils'; import { findComposeErrors } from '@suite-common/wallet-utils'; import { FeeLevel } from '@trezor/connect'; import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; +import { composeSendFormTransactionFeeLevelsThunk } from '@suite-common/wallet-core'; import { TranslationKey } from 'src/components/suite/Translation'; -import { useDispatch } from 'react-redux'; -import { composeSendFormTransactionFeeLevelsThunk } from '@suite-common/wallet-core'; -import { useTranslation } from '../suite'; import { SendContextValues, UseSendFormState } from 'src/types/wallet/sendForm'; -import { isFulfilled } from '@reduxjs/toolkit'; + +import { useTranslation } from '../suite'; type Props = UseFormReturn & { state: UseSendFormState; diff --git a/packages/suite/src/hooks/wallet/useSendFormFields.ts b/packages/suite/src/hooks/wallet/useSendFormFields.ts index 3e1523f9178..07d033dedf1 100644 --- a/packages/suite/src/hooks/wallet/useSendFormFields.ts +++ b/packages/suite/src/hooks/wallet/useSendFormFields.ts @@ -1,11 +1,14 @@ import { useCallback } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; + import { formatNetworkAmount, getFiatRateKey, toFiatCurrency } from '@suite-common/wallet-utils'; import { FormState, FormOptions, TokenAddress, Rate } from '@suite-common/wallet-types'; -import { useBitcoinAmountUnit } from './useBitcoinAmountUnit'; -import { SendContextValues, UseSendFormState } from 'src/types/wallet/sendForm'; import { FiatCurrencyCode } from '@suite-common/suite-config'; import { selectCurrentFiatRates } from '@suite-common/wallet-core'; + +import { SendContextValues, UseSendFormState } from 'src/types/wallet/sendForm'; + +import { useBitcoinAmountUnit } from './useBitcoinAmountUnit'; import { useSelector } from '../suite'; type Props = UseFormReturn & { diff --git a/packages/suite/src/hooks/wallet/useSendFormImport.ts b/packages/suite/src/hooks/wallet/useSendFormImport.ts index 2a4e07523da..2953a032b9d 100644 --- a/packages/suite/src/hooks/wallet/useSendFormImport.ts +++ b/packages/suite/src/hooks/wallet/useSendFormImport.ts @@ -1,8 +1,5 @@ import { useState, useEffect } from 'react'; -import { importSendFormRequestThunk } from 'src/actions/wallet/send/sendFormThunks'; -import { useDispatch } from 'src/hooks/suite'; -import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { DEFAULT_PAYMENT } from '@suite-common/wallet-constants'; import { FiatCurrencyCode, fiatCurrencies } from '@suite-common/suite-config'; import { @@ -15,6 +12,10 @@ import { import { Output, Timestamp, FiatRatesResult, Rate, FiatRates } from '@suite-common/wallet-types'; import { updateFiatRatesThunk } from '@suite-common/wallet-core'; import { NetworkSymbol } from '@suite-common/wallet-config'; + +import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; +import { useDispatch } from 'src/hooks/suite'; +import { importSendFormRequestThunk } from 'src/actions/wallet/send/sendFormThunks'; import { UseSendFormState } from 'src/types/wallet/sendForm'; type useSendFormImportProps = { diff --git a/packages/suite/src/hooks/wallet/useSendFormOutputs.ts b/packages/suite/src/hooks/wallet/useSendFormOutputs.ts index 9dd712a942a..9225c0762de 100644 --- a/packages/suite/src/hooks/wallet/useSendFormOutputs.ts +++ b/packages/suite/src/hooks/wallet/useSendFormOutputs.ts @@ -1,7 +1,9 @@ import { useCallback, useEffect } from 'react'; import { useFieldArray, UseFormReturn } from 'react-hook-form'; + import { FormState } from '@suite-common/wallet-types'; import { DEFAULT_PAYMENT, DEFAULT_OPRETURN } from '@suite-common/wallet-constants'; + import { SendContextValues, UseSendFormState } from 'src/types/wallet/sendForm'; type Props = UseFormReturn & { diff --git a/packages/suite/src/hooks/wallet/useStakeEthForm.ts b/packages/suite/src/hooks/wallet/useStakeEthForm.ts index 00d6ad328b7..67eeadf6682 100644 --- a/packages/suite/src/hooks/wallet/useStakeEthForm.ts +++ b/packages/suite/src/hooks/wallet/useStakeEthForm.ts @@ -1,9 +1,11 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react'; import { useForm, useWatch } from 'react-hook-form'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; import useDebounce from 'react-use/lib/useDebounce'; +import { fromWei } from 'web3-utils'; +import { selectNetwork } from '@everstake/wallet-sdk/ethereum'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { fromFiatCurrency, getFeeLevels, @@ -11,6 +13,17 @@ import { toFiatCurrency, } from '@suite-common/wallet-utils'; import { isChanged } from '@suite-common/suite-utils'; +import { PrecomposedTransactionFinal, StakeFormState } from '@suite-common/wallet-types'; +import { + AmountLimitsString, + StakeContextValues, + selectFiatRatesByFiatRateKey, +} from '@suite-common/wallet-core'; +import { + MIN_ETH_AMOUNT_FOR_STAKING, + MIN_ETH_BALANCE_FOR_STAKING, + MIN_ETH_FOR_WITHDRAWALS, +} from '@suite-common/wallet-constants'; import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; import { saveComposedTransactionInfo } from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; @@ -20,26 +33,12 @@ import { CRYPTO_INPUT, OUTPUT_AMOUNT, } from 'src/types/wallet/stakeForms'; -import { useFormDraft } from './useFormDraft'; - -import { fromWei } from 'web3-utils'; -import { useStakeCompose } from './form/useStakeCompose'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; - import { signTransaction } from 'src/actions/wallet/stakeActions'; -import { PrecomposedTransactionFinal, StakeFormState } from '@suite-common/wallet-types'; import { getEthNetworkForWalletSdk, getStakeFormsDefaultValues } from 'src/utils/suite/stake'; -import { - AmountLimitsString, - StakeContextValues, - selectFiatRatesByFiatRateKey, -} from '@suite-common/wallet-core'; -import { - MIN_ETH_AMOUNT_FOR_STAKING, - MIN_ETH_BALANCE_FOR_STAKING, - MIN_ETH_FOR_WITHDRAWALS, -} from '@suite-common/wallet-constants'; -import { selectNetwork } from '@everstake/wallet-sdk/ethereum'; + +import { useStakeCompose } from './form/useStakeCompose'; +import { useFormDraft } from './useFormDraft'; import { useFees } from './form/useFees'; export const StakeEthFormContext = createContext(null); diff --git a/packages/suite/src/hooks/wallet/useUnstakeEthForm.ts b/packages/suite/src/hooks/wallet/useUnstakeEthForm.ts index 358daad2945..6f28c52e048 100644 --- a/packages/suite/src/hooks/wallet/useUnstakeEthForm.ts +++ b/packages/suite/src/hooks/wallet/useUnstakeEthForm.ts @@ -1,6 +1,9 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react'; import { useForm, useWatch } from 'react-hook-form'; +import useDebounce from 'react-use/lib/useDebounce'; +import { selectNetwork } from '@everstake/wallet-sdk/ethereum'; + import { fromFiatCurrency, getAccountAutocompoundBalance, @@ -8,6 +11,14 @@ import { getFiatRateKey, toFiatCurrency, } from '@suite-common/wallet-utils'; +import { PrecomposedTransactionFinal } from '@suite-common/wallet-types'; +import { isChanged } from '@suite-common/suite-utils'; +import { + AmountLimitsString, + selectFiatRatesByFiatRateKey, + UnstakeContextValues as UnstakeContextValuesBase, + UnstakeFormState, +} from '@suite-common/wallet-core'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { @@ -16,27 +27,16 @@ import { OUTPUT_AMOUNT, UseStakeFormsProps, } from 'src/types/wallet/stakeForms'; - -import { useStakeCompose } from './form/useStakeCompose'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; - import { signTransaction } from 'src/actions/wallet/stakeActions'; -import { PrecomposedTransactionFinal } from '@suite-common/wallet-types'; import { getEthNetworkForWalletSdk, getStakeFormsDefaultValues, simulateUnstake, } from 'src/utils/suite/stake'; + +import { useStakeCompose } from './form/useStakeCompose'; import { useFormDraft } from './useFormDraft'; -import useDebounce from 'react-use/lib/useDebounce'; -import { isChanged } from '@suite-common/suite-utils'; -import { - AmountLimitsString, - selectFiatRatesByFiatRateKey, - UnstakeContextValues as UnstakeContextValuesBase, - UnstakeFormState, -} from '@suite-common/wallet-core'; -import { selectNetwork } from '@everstake/wallet-sdk/ethereum'; import { useFees } from './form/useFees'; type UnstakeOptions = 'all' | 'rewards' | 'other'; diff --git a/packages/suite/src/middlewares/backup/backupMiddleware.ts b/packages/suite/src/middlewares/backup/backupMiddleware.ts index d74084fb51b..2176d66ce38 100644 --- a/packages/suite/src/middlewares/backup/backupMiddleware.ts +++ b/packages/suite/src/middlewares/backup/backupMiddleware.ts @@ -1,4 +1,5 @@ import { MiddlewareAPI } from 'redux'; + import { SUITE } from 'src/actions/suite/constants'; import * as backupActions from 'src/actions/backup/backupActions'; import { AppState, Action, Dispatch } from 'src/types/suite'; diff --git a/packages/suite/src/middlewares/onboarding/__tests__/onboardingMiddleware.test.ts b/packages/suite/src/middlewares/onboarding/__tests__/onboardingMiddleware.test.ts index 4599ab4e989..1fcb39809e8 100644 --- a/packages/suite/src/middlewares/onboarding/__tests__/onboardingMiddleware.test.ts +++ b/packages/suite/src/middlewares/onboarding/__tests__/onboardingMiddleware.test.ts @@ -1,7 +1,5 @@ import { configureStore } from 'src/support/tests/configureStore'; - import { SUITE } from 'src/actions/suite/constants'; - import routerReducer from 'src/reducers/suite/routerReducer'; import suiteReducer from 'src/reducers/suite/suiteReducer'; import modalReducer from 'src/reducers/suite/modalReducer'; diff --git a/packages/suite/src/middlewares/recovery/recoveryMiddleware.ts b/packages/suite/src/middlewares/recovery/recoveryMiddleware.ts index 6435f23b621..841bee40327 100644 --- a/packages/suite/src/middlewares/recovery/recoveryMiddleware.ts +++ b/packages/suite/src/middlewares/recovery/recoveryMiddleware.ts @@ -7,6 +7,7 @@ import { SUITE } from 'src/actions/suite/constants'; import * as recoveryActions from 'src/actions/recovery/recoveryActions'; import * as onboardingActions from 'src/actions/onboarding/onboardingActions'; import { AppState, Action, Dispatch } from 'src/types/suite'; + import { isRecoveryInProgress } from '../../utils/device/isRecoveryInProgress'; const recovery = diff --git a/packages/suite/src/middlewares/suite/__tests__/protocolMiddleware.test.ts b/packages/suite/src/middlewares/suite/__tests__/protocolMiddleware.test.ts index 19011ec9fe7..281f464d6d1 100644 --- a/packages/suite/src/middlewares/suite/__tests__/protocolMiddleware.test.ts +++ b/packages/suite/src/middlewares/suite/__tests__/protocolMiddleware.test.ts @@ -1,14 +1,15 @@ -import { configureStore } from 'src/support/tests/configureStore'; - -import { PROTOCOL } from 'src/actions/suite/constants'; -import protocolMiddleware from '../protocolMiddleware'; -import protocolReducer from 'src/reducers/suite/protocolReducer'; import { NotificationEntry, notificationsActions, notificationsReducer, } from '@suite-common/toast-notifications'; +import { configureStore } from 'src/support/tests/configureStore'; +import { PROTOCOL } from 'src/actions/suite/constants'; +import protocolReducer from 'src/reducers/suite/protocolReducer'; + +import protocolMiddleware from '../protocolMiddleware'; + const middlewares = [protocolMiddleware]; type ProtocolState = ReturnType; diff --git a/packages/suite/src/middlewares/suite/analyticsMiddleware.ts b/packages/suite/src/middlewares/suite/analyticsMiddleware.ts index bd9f40be4b3..dced6b06ee9 100644 --- a/packages/suite/src/middlewares/suite/analyticsMiddleware.ts +++ b/packages/suite/src/middlewares/suite/analyticsMiddleware.ts @@ -1,6 +1,6 @@ import { MiddlewareAPI } from 'redux'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { getPhysicalDeviceCount } from '@suite-common/suite-utils'; import { discoveryActions, @@ -18,6 +18,7 @@ import { hasBitcoinOnlyFirmware, isDeviceInBootloaderMode, } from '@trezor/device-utils'; +import { Account } from '@suite-common/wallet-types'; import { SUITE, ROUTER } from 'src/actions/suite/constants'; import { COINJOIN } from 'src/actions/wallet/constants'; @@ -32,7 +33,6 @@ import { selectCoinjoinAccountByKey, } from 'src/reducers/wallet/coinjoinReducer'; import { updateLastAnonymityReportTimestamp } from 'src/actions/wallet/coinjoinAccountActions'; -import { Account } from '@suite-common/wallet-types'; /* In analytics middleware we may intercept actions we would like to log. For example: diff --git a/packages/suite/src/middlewares/suite/buttonRequestMiddleware.ts b/packages/suite/src/middlewares/suite/buttonRequestMiddleware.ts index ee151e43107..6af41a6a32a 100644 --- a/packages/suite/src/middlewares/suite/buttonRequestMiddleware.ts +++ b/packages/suite/src/middlewares/suite/buttonRequestMiddleware.ts @@ -2,11 +2,11 @@ import { MiddlewareAPI } from 'redux'; import { selectDevice, deviceActions } from '@suite-common/wallet-core'; import TrezorConnect, { UI } from '@trezor/connect'; +import { checkDeviceAuthenticityThunk } from '@suite-common/device-authenticity'; import { SUITE } from 'src/actions/suite/constants'; import { AppState, Action, Dispatch } from 'src/types/suite'; import { ONBOARDING } from 'src/actions/onboarding/constants'; -import { checkDeviceAuthenticityThunk } from '@suite-common/device-authenticity'; const buttonRequest = (api: MiddlewareAPI) => diff --git a/packages/suite/src/middlewares/suite/logsMiddleware.ts b/packages/suite/src/middlewares/suite/logsMiddleware.ts index 6704b12d392..80db722cae4 100644 --- a/packages/suite/src/middlewares/suite/logsMiddleware.ts +++ b/packages/suite/src/middlewares/suite/logsMiddleware.ts @@ -1,4 +1,5 @@ import { MiddlewareAPI } from 'redux'; + import { authorizeDeviceThunk, deviceActions, discoveryActions } from '@suite-common/wallet-core'; import { addLog } from '@suite-common/logger'; import { TRANSPORT, DEVICE } from '@trezor/connect'; diff --git a/packages/suite/src/middlewares/suite/protocolMiddleware.ts b/packages/suite/src/middlewares/suite/protocolMiddleware.ts index 753c89c27c3..e9818ca2c6c 100644 --- a/packages/suite/src/middlewares/suite/protocolMiddleware.ts +++ b/packages/suite/src/middlewares/suite/protocolMiddleware.ts @@ -1,8 +1,8 @@ import { MiddlewareAPI } from 'redux'; import { notificationsActions, ToastPayload } from '@suite-common/toast-notifications'; -import { PROTOCOL } from 'src/actions/suite/constants'; +import { PROTOCOL } from 'src/actions/suite/constants'; import type { AppState, Action, Dispatch } from 'src/types/suite'; // close custom protocol notification of given type diff --git a/packages/suite/src/middlewares/suite/routerMiddleware.ts b/packages/suite/src/middlewares/suite/routerMiddleware.ts index 05f2940cba2..6e25c1d2bb0 100644 --- a/packages/suite/src/middlewares/suite/routerMiddleware.ts +++ b/packages/suite/src/middlewares/suite/routerMiddleware.ts @@ -1,6 +1,6 @@ import { MiddlewareAPI } from 'redux'; -import { ROUTER } from 'src/actions/suite/constants'; +import { ROUTER } from 'src/actions/suite/constants'; import { AppState, Action, Dispatch } from 'src/types/suite'; const router = (api: MiddlewareAPI) => (next: Dispatch) => (action: Action) => { diff --git a/packages/suite/src/middlewares/suite/toastMiddleware.ts b/packages/suite/src/middlewares/suite/toastMiddleware.ts index cb8515dca5c..a7244623eb1 100644 --- a/packages/suite/src/middlewares/suite/toastMiddleware.ts +++ b/packages/suite/src/middlewares/suite/toastMiddleware.ts @@ -1,7 +1,9 @@ -import { MiddlewareAPI } from 'redux'; import { toast } from 'react-toastify'; +import { MiddlewareAPI } from 'redux'; + import { notificationsActions } from '@suite-common/toast-notifications'; + import { renderToast } from 'src/components/suite'; import { Action, AppState, Dispatch } from 'src/types/suite'; diff --git a/packages/suite/src/middlewares/wallet/__fixtures__/coinjoinMiddleware.ts b/packages/suite/src/middlewares/wallet/__fixtures__/coinjoinMiddleware.ts index 822feaf5dcf..8e6b238a5f0 100644 --- a/packages/suite/src/middlewares/wallet/__fixtures__/coinjoinMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/__fixtures__/coinjoinMiddleware.ts @@ -2,6 +2,7 @@ import { accountsActions } from '@suite-common/wallet-core'; import { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { AnonymitySet } from '@trezor/blockchain-link'; import { DEVICE, StaticSessionId } from '@trezor/connect'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { SuiteState } from 'src/reducers/suite/suiteReducer'; import { ROUTER, SUITE } from 'src/actions/suite/constants'; @@ -9,7 +10,6 @@ import { COINJOIN } from 'src/actions/wallet/constants'; import { CoinjoinState } from 'src/reducers/wallet/coinjoinReducer'; import { CoinjoinAccount, CoinjoinSession } from 'src/types/wallet/coinjoin'; import { Account } from 'src/types/wallet'; -import { NetworkSymbol } from '@suite-common/wallet-config'; import { RouterState } from 'src/reducers/suite/routerReducer'; const DEVICE_A = { diff --git a/packages/suite/src/middlewares/wallet/__fixtures__/walletMiddleware.ts b/packages/suite/src/middlewares/wallet/__fixtures__/walletMiddleware.ts index 45e12e5ad42..da041fd9474 100644 --- a/packages/suite/src/middlewares/wallet/__fixtures__/walletMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/__fixtures__/walletMiddleware.ts @@ -1,14 +1,15 @@ import { PROTO } from '@trezor/connect'; import { Account, FormState as SendFormState, Output } from '@suite-common/wallet-types'; -import { WALLET_SETTINGS } from 'src/actions/settings/constants'; -import { RouterState } from 'src/reducers/suite/routerReducer'; -import { State as SelectedAccountState } from 'src/reducers/wallet/selectedAccountReducer'; import { accountsActions, sendFormActions, convertSendFormDraftsBtcAmountUnitsThunk, } from '@suite-common/wallet-core'; +import { WALLET_SETTINGS } from 'src/actions/settings/constants'; +import { RouterState } from 'src/reducers/suite/routerReducer'; +import { State as SelectedAccountState } from 'src/reducers/wallet/selectedAccountReducer'; + export const blockchainSubscription = [ { description: 'create account, only one subscribed', diff --git a/packages/suite/src/middlewares/wallet/__tests__/coinmarketMiddleware.test.ts b/packages/suite/src/middlewares/wallet/__tests__/coinmarketMiddleware.test.ts index df35fd4b438..e4d82fa9f47 100644 --- a/packages/suite/src/middlewares/wallet/__tests__/coinmarketMiddleware.test.ts +++ b/packages/suite/src/middlewares/wallet/__tests__/coinmarketMiddleware.test.ts @@ -1,5 +1,6 @@ -import { configureStore } from 'src/support/tests/configureStore'; +import { UI } from '@trezor/connect'; +import { configureStore } from 'src/support/tests/configureStore'; import { coinmarketReducer, initialState } from 'src/reducers/wallet/coinmarketReducer'; import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; import { coinmarketMiddleware } from 'src/middlewares/wallet/coinmarketMiddleware'; @@ -11,7 +12,6 @@ import { accounts } from 'src/reducers/wallet/__fixtures__/transactionConstants' import routerReducer, { RouterState } from 'src/reducers/suite/routerReducer'; import modalReducer, { State as ModalState } from 'src/reducers/suite/modalReducer'; import { MODAL, ROUTER } from 'src/actions/suite/constants'; -import { UI } from '@trezor/connect'; jest.mock('src/services/suite/invityAPI'); invityAPI.setInvityServersEnvironment = () => {}; diff --git a/packages/suite/src/middlewares/wallet/coinmarketMiddleware.ts b/packages/suite/src/middlewares/wallet/coinmarketMiddleware.ts index 567b46e65dc..c67b8d13e9b 100644 --- a/packages/suite/src/middlewares/wallet/coinmarketMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/coinmarketMiddleware.ts @@ -1,4 +1,7 @@ import { MiddlewareAPI } from 'redux'; + +import { UI } from '@trezor/connect'; + import { AppState, Action, Dispatch } from 'src/types/suite'; import { COINMARKET_COMMON } from 'src/actions/wallet/constants'; import { INVITY_API_RELOAD_DATA_AFTER_MS } from 'src/constants/wallet/coinmarket/metadata'; @@ -8,7 +11,6 @@ import * as coinmarketInfoAction from 'src/actions/wallet/coinmarketInfoActions' import * as coinmarketBuyActions from 'src/actions/wallet/coinmarketBuyActions'; import * as coinmarketExchangeActions from 'src/actions/wallet/coinmarketExchangeActions'; import * as coinmarketSellActions from 'src/actions/wallet/coinmarketSellActions'; -import { UI } from '@trezor/connect'; import { ROUTER, MODAL } from 'src/actions/suite/constants'; export const coinmarketMiddleware = diff --git a/packages/suite/src/middlewares/wallet/index.ts b/packages/suite/src/middlewares/wallet/index.ts index 3f4c631339f..a15514e9b98 100644 --- a/packages/suite/src/middlewares/wallet/index.ts +++ b/packages/suite/src/middlewares/wallet/index.ts @@ -3,6 +3,9 @@ import { prepareBlockchainMiddleware, prepareStakeMiddleware, } from '@suite-common/wallet-core'; +import { prepareTokenDefinitionsMiddleware } from '@suite-common/token-definitions'; + +import { extraDependencies } from 'src/support/extraDependencies'; import { prepareDiscoveryMiddleware } from './discoveryMiddleware'; import storageMiddleware from './storageMiddleware'; @@ -10,8 +13,6 @@ import walletMiddleware from './walletMiddleware'; import graphMiddleware from './graphMiddleware'; import { coinmarketMiddleware } from './coinmarketMiddleware'; import { coinjoinMiddleware } from './coinjoinMiddleware'; -import { extraDependencies } from 'src/support/extraDependencies'; -import { prepareTokenDefinitionsMiddleware } from '@suite-common/token-definitions'; export default [ prepareBlockchainMiddleware(extraDependencies), diff --git a/packages/suite/src/middlewares/wallet/storageMiddleware.ts b/packages/suite/src/middlewares/wallet/storageMiddleware.ts index 376ee04793c..feeffa9b4d6 100644 --- a/packages/suite/src/middlewares/wallet/storageMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/storageMiddleware.ts @@ -21,6 +21,8 @@ import { isDeviceRemembered } from '@suite-common/suite-utils'; import { messageSystemActions } from '@suite-common/message-system'; import { findAccountDevice } from '@suite-common/wallet-utils'; import { analyticsActions } from '@suite-common/analytics'; +import { tokenDefinitionsActions } from '@suite-common/token-definitions/src/tokenDefinitionsActions'; +import { TokenManagementAction } from '@suite-common/token-definitions'; import { db } from 'src/storage'; import { WALLET_SETTINGS } from 'src/actions/settings/constants'; @@ -33,8 +35,6 @@ import * as metadataActions from 'src/actions/suite/metadataActions'; import { serializeDiscovery } from 'src/utils/suite/storage'; import type { AppState, Action as SuiteAction, Dispatch } from 'src/types/suite'; import type { WalletAction } from 'src/types/wallet'; -import { tokenDefinitionsActions } from '@suite-common/token-definitions/src/tokenDefinitionsActions'; -import { TokenManagementAction } from '@suite-common/token-definitions'; const storageMiddleware = (api: MiddlewareAPI) => { db.onBlocking = () => api.dispatch({ type: STORAGE.ERROR, payload: 'blocking' }); diff --git a/packages/suite/src/reducers/backup/backupReducer.ts b/packages/suite/src/reducers/backup/backupReducer.ts index e10e37f74bc..81df9c9d7ac 100644 --- a/packages/suite/src/reducers/backup/backupReducer.ts +++ b/packages/suite/src/reducers/backup/backupReducer.ts @@ -1,4 +1,5 @@ import produce from 'immer'; + import { BACKUP } from 'src/actions/backup/constants'; import { ConfirmKey, BackupStatus } from 'src/actions/backup/backupActions'; import { Action } from 'src/types/suite'; diff --git a/packages/suite/src/reducers/onboarding/onboardingReducer.ts b/packages/suite/src/reducers/onboarding/onboardingReducer.ts index 09bd6bb83f0..1afdebcbc59 100644 --- a/packages/suite/src/reducers/onboarding/onboardingReducer.ts +++ b/packages/suite/src/reducers/onboarding/onboardingReducer.ts @@ -1,11 +1,11 @@ import produce from 'immer'; + import { DEVICE } from '@trezor/connect'; import { OnboardingAnalytics } from '@trezor/suite-analytics'; import { ONBOARDING } from 'src/actions/onboarding/constants'; import * as STEP from 'src/constants/onboarding/steps'; import { Action, TrezorDevice } from 'src/types/suite'; - import type { AnyStepId, AnyPath } from 'src/types/onboarding'; export interface OnboardingRootState { diff --git a/packages/suite/src/reducers/recovery/recoveryReducer.ts b/packages/suite/src/reducers/recovery/recoveryReducer.ts index 50b0ac17f91..79329b57acd 100644 --- a/packages/suite/src/reducers/recovery/recoveryReducer.ts +++ b/packages/suite/src/reducers/recovery/recoveryReducer.ts @@ -1,4 +1,5 @@ import produce from 'immer'; + import { RECOVERY } from 'src/actions/recovery/constants'; import { Action } from 'src/types/suite'; import { WordCount } from 'src/types/recovery'; diff --git a/packages/suite/src/reducers/store.ts b/packages/suite/src/reducers/store.ts index 414d10a1199..564b801303a 100644 --- a/packages/suite/src/reducers/store.ts +++ b/packages/suite/src/reducers/store.ts @@ -8,6 +8,7 @@ import { prepareFirmwareReducer } from '@suite-common/wallet-core'; import { addLog } from '@suite-common/logger'; import { isCodesignBuild } from '@trezor/env-utils'; import { mergeDeepObject } from '@trezor/utils'; +import { prepareTokenDefinitionsReducer } from '@suite-common/token-definitions'; import suiteMiddlewares from 'src/middlewares/suite'; import walletMiddlewares from 'src/middlewares/wallet'; @@ -27,7 +28,6 @@ import type { PreloadStoreAction } from 'src/support/suite/preloadStore'; import { desktopReducer } from './desktop'; import { extraDependencies } from '../support/extraDependencies'; -import { prepareTokenDefinitionsReducer } from '@suite-common/token-definitions'; const firmwareReducer = prepareFirmwareReducer(extraDependencies); const tokenDefinitionsReducer = prepareTokenDefinitionsReducer(extraDependencies); diff --git a/packages/suite/src/reducers/suite/__tests__/desktopUpdateReducer.test.ts b/packages/suite/src/reducers/suite/__tests__/desktopUpdateReducer.test.ts index 09eb7f4c47a..53c5ab19325 100644 --- a/packages/suite/src/reducers/suite/__tests__/desktopUpdateReducer.test.ts +++ b/packages/suite/src/reducers/suite/__tests__/desktopUpdateReducer.test.ts @@ -1,7 +1,8 @@ -import desktopUpdateReducer, { DesktopUpdateState, UpdateState } from '../desktopUpdateReducer'; import { DESKTOP_UPDATE, SUITE } from 'src/actions/suite/constants'; import type { Action } from 'src/types/suite'; +import desktopUpdateReducer, { DesktopUpdateState, UpdateState } from '../desktopUpdateReducer'; + const createUpdateInfo = (salt: string) => ({ releaseDate: `releaseDate-${salt}`, version: `version-${salt}`, diff --git a/packages/suite/src/reducers/suite/__tests__/modalReducer.test.ts b/packages/suite/src/reducers/suite/__tests__/modalReducer.test.ts index 646bcecebc8..2dddeed9bbd 100644 --- a/packages/suite/src/reducers/suite/__tests__/modalReducer.test.ts +++ b/packages/suite/src/reducers/suite/__tests__/modalReducer.test.ts @@ -1,5 +1,6 @@ -import modalReducer, { State } from '../modalReducer'; import { Action } from 'src/types/suite'; + +import modalReducer, { State } from '../modalReducer'; import fixtures from '../__fixtures__/modalReducer'; describe('modalReducer', () => { diff --git a/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts b/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts index 71a5bf85d17..14b6ba6c29a 100644 --- a/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts +++ b/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts @@ -1,7 +1,8 @@ +import type { Action } from 'src/types/suite'; + import protocolReducer, { State } from '../protocolReducer'; import fixtures from '../__fixtures__/protocolReducer'; -import type { Action } from 'src/types/suite'; describe('Protocol reducer', () => { fixtures.forEach(f => { diff --git a/packages/suite/src/reducers/suite/desktopUpdateReducer.ts b/packages/suite/src/reducers/suite/desktopUpdateReducer.ts index 9e7f63a05e1..ccd6cea4712 100644 --- a/packages/suite/src/reducers/suite/desktopUpdateReducer.ts +++ b/packages/suite/src/reducers/suite/desktopUpdateReducer.ts @@ -1,8 +1,10 @@ import produce from 'immer'; + import { UpdateInfo, UpdateProgress } from '@trezor/suite-desktop-api'; +import { DesktopAppUpdateState as UpdateState } from '@suite-common/suite-constants'; + import { DESKTOP_UPDATE, SUITE } from 'src/actions/suite/constants'; import { Action } from 'src/types/suite'; -import { DesktopAppUpdateState as UpdateState } from '@suite-common/suite-constants'; export { DesktopAppUpdateState as UpdateState } from '@suite-common/suite-constants'; diff --git a/packages/suite/src/reducers/suite/guideReducer.ts b/packages/suite/src/reducers/suite/guideReducer.ts index 73761a602fb..d612d08544b 100644 --- a/packages/suite/src/reducers/suite/guideReducer.ts +++ b/packages/suite/src/reducers/suite/guideReducer.ts @@ -1,9 +1,11 @@ import produce from 'immer'; -import { Action } from 'src/types/suite'; -import { GUIDE } from 'src/actions/suite/constants'; + import type { ActiveView, GuideCategory, GuideNode } from '@suite-common/suite-types'; import * as indexNodeJSON from '@trezor/suite-data/files/guide/index.json'; +import { Action } from 'src/types/suite'; +import { GUIDE } from 'src/actions/suite/constants'; + export interface State { open: boolean; view: ActiveView; diff --git a/packages/suite/src/reducers/suite/metadataReducer.ts b/packages/suite/src/reducers/suite/metadataReducer.ts index 478bc7ead58..14870a0026a 100644 --- a/packages/suite/src/reducers/suite/metadataReducer.ts +++ b/packages/suite/src/reducers/suite/metadataReducer.ts @@ -10,6 +10,8 @@ import { deviceActions, selectDeviceByStaticSessionId, } from '@suite-common/wallet-core'; +import { AccountKey } from '@suite-common/wallet-types'; +import { DeviceState, StaticSessionId } from '@trezor/connect'; import { STORAGE, @@ -31,8 +33,6 @@ import { } from 'src/actions/suite/constants/metadataLabelingConstants'; import { SuiteRootState } from './suiteReducer'; -import { AccountKey } from '@suite-common/wallet-types'; -import { DeviceState, StaticSessionId } from '@trezor/connect'; export const initialState: MetadataState = { // is Suite trying to load metadata (get master key -> sync cloud)? diff --git a/packages/suite/src/reducers/suite/protocolReducer.ts b/packages/suite/src/reducers/suite/protocolReducer.ts index 2b85183463f..820bde59348 100644 --- a/packages/suite/src/reducers/suite/protocolReducer.ts +++ b/packages/suite/src/reducers/suite/protocolReducer.ts @@ -1,7 +1,9 @@ import produce from 'immer'; + +import type { Protocol } from '@suite-common/suite-constants'; + import { PROTOCOL } from 'src/actions/suite/constants'; import type { Action } from 'src/types/suite'; -import type { Protocol } from '@suite-common/suite-constants'; export interface SendFormState { scheme: Protocol; diff --git a/packages/suite/src/reducers/suite/resizeReducer.ts b/packages/suite/src/reducers/suite/resizeReducer.ts index 8c375e563af..2a0e65a189c 100644 --- a/packages/suite/src/reducers/suite/resizeReducer.ts +++ b/packages/suite/src/reducers/suite/resizeReducer.ts @@ -1,7 +1,9 @@ import produce from 'immer'; + import * as variables from '@trezor/components/src/config/variables'; // can't import from index cause it would import all UI components -import { RESIZE } from 'src/actions/suite/constants'; import { getNumberFromPixelString } from '@trezor/utils'; + +import { RESIZE } from 'src/actions/suite/constants'; import { Action } from 'src/types/suite'; const sizes = { diff --git a/packages/suite/src/reducers/suite/suiteReducer.ts b/packages/suite/src/reducers/suite/suiteReducer.ts index 9d0999c3e8c..822bd89b648 100644 --- a/packages/suite/src/reducers/suite/suiteReducer.ts +++ b/packages/suite/src/reducers/suite/suiteReducer.ts @@ -7,6 +7,9 @@ import { discoveryActions, DeviceRootState, selectDevice } from '@suite-common/w import { isArrayMember, versionUtils } from '@trezor/utils'; import { isWeb } from '@trezor/env-utils'; import { TRANSPORT, TransportInfo, ConnectSettings } from '@trezor/connect'; +import { NetworkSymbol } from '@suite-common/wallet-config'; +import { SuiteThemeVariant } from '@trezor/suite-desktop-api'; +import { AddressDisplayOptions, WalletType } from '@suite-common/wallet-types'; import { getIsTorEnabled, getIsTorLoading } from 'src/utils/suite/tor'; import type { OAuthServerEnvironment } from 'src/types/suite/metadata'; @@ -16,13 +19,11 @@ import { SUITE, STORAGE } from 'src/actions/suite/constants'; import { ExperimentalFeature } from 'src/constants/suite/experimental'; import { Action, AppState, Lock, TorBootstrap, TorStatus } from 'src/types/suite'; import { getExcludedPrerequisites, getPrerequisiteName } from 'src/utils/suite/prerequisites'; -import { RouterRootState, selectRouter } from './routerReducer'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import { SuiteThemeVariant } from '@trezor/suite-desktop-api'; -import { AddressDisplayOptions, WalletType } from '@suite-common/wallet-types'; import { SIDEBAR_WIDTH_NUMERIC } from 'src/constants/suite/layout'; import { skippedHashCheckErrors, skippedRevisionCheckErrors } from 'src/constants/suite/firmware'; +import { RouterRootState, selectRouter } from './routerReducer'; + export interface SuiteRootState { suite: SuiteState; } diff --git a/packages/suite/src/reducers/wallet/__fixtures__/coinjoinReducer.ts b/packages/suite/src/reducers/wallet/__fixtures__/coinjoinReducer.ts index c76a82dbe64..6f069b8a59b 100644 --- a/packages/suite/src/reducers/wallet/__fixtures__/coinjoinReducer.ts +++ b/packages/suite/src/reducers/wallet/__fixtures__/coinjoinReducer.ts @@ -1,4 +1,5 @@ import { SessionPhase } from '@trezor/coinjoin'; + import { COINJOIN } from 'src/actions/wallet/constants'; import { initialState } from 'src/reducers/wallet/coinjoinReducer'; diff --git a/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts index eb2923dd4b9..614bac25e52 100644 --- a/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts @@ -1,3 +1,5 @@ +import type { Action } from 'src/types/suite'; + import { coinjoinReducer, CoinjoinState, @@ -6,7 +8,6 @@ import { } from '../coinjoinReducer'; import { actionFixtures, selectorFixtures } from '../__fixtures__/coinjoinReducer'; -import type { Action } from 'src/types/suite'; describe('Coinjoin reducer actions', () => { actionFixtures.forEach(f => { diff --git a/packages/suite/src/reducers/wallet/__tests__/coinmarketReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/coinmarketReducer.test.ts index e57f0606ed9..7327bbe6de8 100644 --- a/packages/suite/src/reducers/wallet/__tests__/coinmarketReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/coinmarketReducer.test.ts @@ -1,3 +1,11 @@ +import { + BuyTradeQuoteRequest, + CryptoId, + ExchangeTradeQuoteRequest, + InfoResponse, + SellFiatTradeQuoteRequest, +} from 'invity-api'; + import { coinmarketReducer, initialState } from 'src/reducers/wallet/coinmarketReducer'; import { TradeBuy, TradeExchange } from 'src/types/wallet/coinmarketCommonTypes'; import { STORAGE } from 'src/actions/suite/constants'; @@ -8,13 +16,6 @@ import { COINMARKET_INFO, COINMARKET_SELL, } from 'src/actions/wallet/constants'; -import { - BuyTradeQuoteRequest, - CryptoId, - ExchangeTradeQuoteRequest, - InfoResponse, - SellFiatTradeQuoteRequest, -} from 'invity-api'; import { BuyInfo } from 'src/actions/wallet/coinmarketBuyActions'; import { ExchangeInfo } from 'src/actions/wallet/coinmarketExchangeActions'; import { diff --git a/packages/suite/src/reducers/wallet/__tests__/sendFormReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/sendFormReducer.test.ts index 627ec65b3f3..9eb2adeac3e 100644 --- a/packages/suite/src/reducers/wallet/__tests__/sendFormReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/sendFormReducer.test.ts @@ -1,5 +1,3 @@ -import { STORAGE } from 'src/actions/suite/constants'; -import { Action } from 'src/types/suite'; import { FormState, PrecomposedTransactionFinal, Account } from '@suite-common/wallet-types'; import { SerializedTx, @@ -9,6 +7,8 @@ import { sendFormActions, } from '@suite-common/wallet-core'; +import { STORAGE } from 'src/actions/suite/constants'; +import { Action } from 'src/types/suite'; import { PreloadStoreAction } from 'src/support/suite/preloadStore'; import { extraDependencies } from 'src/support/extraDependencies'; diff --git a/packages/suite/src/reducers/wallet/__tests__/transactionReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/transactionReducer.test.ts index bc9b4d221a3..bebbba28963 100644 --- a/packages/suite/src/reducers/wallet/__tests__/transactionReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/transactionReducer.test.ts @@ -1,10 +1,12 @@ -import { extraDependencies } from 'src/support/extraDependencies'; import { transactionsInitialState, transactionsActions, prepareTransactionsReducer, fetchTransactionsPageThunk, } from '@suite-common/wallet-core'; + +import { extraDependencies } from 'src/support/extraDependencies'; + import { transactions, accounts } from '../__fixtures__/transactionConstants'; const reducer = prepareTransactionsReducer(extraDependencies); diff --git a/packages/suite/src/reducers/wallet/cardanoStakingReducer.ts b/packages/suite/src/reducers/wallet/cardanoStakingReducer.ts index d3fabca3e08..921aede68e8 100644 --- a/packages/suite/src/reducers/wallet/cardanoStakingReducer.ts +++ b/packages/suite/src/reducers/wallet/cardanoStakingReducer.ts @@ -1,8 +1,10 @@ import produce from 'immer'; + +import { BigNumber } from '@trezor/utils/src/bigNumber'; + import { CARDANO_STAKING } from 'src/actions/wallet/constants'; import { WalletAction } from 'src/types/wallet'; import { CardanoNetwork, PendingStakeTx, PoolsResponse } from 'src/types/wallet/cardanoStaking'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; export interface State { pendingTx: PendingStakeTx[]; diff --git a/packages/suite/src/reducers/wallet/coinjoinReducer.ts b/packages/suite/src/reducers/wallet/coinjoinReducer.ts index f11c3ecb848..619211a0390 100644 --- a/packages/suite/src/reducers/wallet/coinjoinReducer.ts +++ b/packages/suite/src/reducers/wallet/coinjoinReducer.ts @@ -1,7 +1,7 @@ import produce from 'immer'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; import { memoizeWithArgs } from 'proxy-memoize'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { getInputSize, getOutputSize, RoundPhase } from '@trezor/coinjoin'; import { PartialRecord } from '@trezor/type-utils'; import { Account, AccountKey } from '@suite-common/wallet-types'; @@ -58,6 +58,7 @@ import { ZKSNACKS_LEGAL_DOCUMENTS_VERSION, TREZOR_LEGAL_DOCUMENTS_VERSION, } from 'src/services/coinjoin'; + import { SelectedAccountRootState, selectSelectedAccount } from './selectedAccountReducer'; export interface CoinjoinState { diff --git a/packages/suite/src/reducers/wallet/coinmarketReducer.ts b/packages/suite/src/reducers/wallet/coinmarketReducer.ts index 3c96b1fbe0d..8c94f357ace 100644 --- a/packages/suite/src/reducers/wallet/coinmarketReducer.ts +++ b/packages/suite/src/reducers/wallet/coinmarketReducer.ts @@ -1,7 +1,4 @@ import produce from 'immer'; -import type { WalletAction, Account } from 'src/types/wallet'; -import type { PrecomposedTransactionFinal } from '@suite-common/wallet-types'; - import type { BuyTrade, BuyTradeQuoteRequest, @@ -13,6 +10,11 @@ import type { CryptoId, Platforms, } from 'invity-api'; + +import type { PrecomposedTransactionFinal } from '@suite-common/wallet-types'; +import type { FeeLevel } from '@trezor/connect'; + +import type { WalletAction, Account } from 'src/types/wallet'; import type { BuyInfo } from 'src/actions/wallet/coinmarketBuyActions'; import type { ExchangeInfo } from 'src/actions/wallet/coinmarketExchangeActions'; import { @@ -25,7 +27,6 @@ import { import { STORAGE } from 'src/actions/suite/constants'; import type { Action as SuiteAction } from 'src/types/suite'; import type { SellInfo } from 'src/actions/wallet/coinmarketSellActions'; -import type { FeeLevel } from '@trezor/connect'; import type { Trade } from 'src/types/wallet/coinmarketCommonTypes'; import { CoinmarketPaymentMethodListProps, diff --git a/packages/suite/src/reducers/wallet/formDraftReducer.ts b/packages/suite/src/reducers/wallet/formDraftReducer.ts index a83af453edb..51d636405a4 100644 --- a/packages/suite/src/reducers/wallet/formDraftReducer.ts +++ b/packages/suite/src/reducers/wallet/formDraftReducer.ts @@ -1,6 +1,7 @@ -import produce from 'immer'; import { FieldValues } from 'react-hook-form'; +import produce from 'immer'; + import { FORM_DRAFT } from 'src/actions/wallet/constants'; import { Action } from 'src/types/suite'; import { STORAGE } from 'src/actions/suite/constants'; diff --git a/packages/suite/src/reducers/wallet/graphReducer.ts b/packages/suite/src/reducers/wallet/graphReducer.ts index 10a01bd67b8..bdc2a263e1a 100644 --- a/packages/suite/src/reducers/wallet/graphReducer.ts +++ b/packages/suite/src/reducers/wallet/graphReducer.ts @@ -1,11 +1,12 @@ import produce from 'immer'; + +import { accountsActions } from '@suite-common/wallet-core'; + import { GRAPH } from 'src/actions/wallet/constants'; import { STORAGE } from 'src/actions/suite/constants'; import { WalletAction, Account } from 'src/types/wallet'; import { Action as SuiteAction } from 'src/types/suite'; import { SETTINGS } from 'src/config/suite'; - -import { accountsActions } from '@suite-common/wallet-core'; import { GraphData, AccountIdentifier, GraphRange, GraphScale } from 'src/types/wallet/graph'; export interface State { diff --git a/packages/suite/src/reducers/wallet/receiveReducer.ts b/packages/suite/src/reducers/wallet/receiveReducer.ts index 57eefa8a270..aa67a486273 100644 --- a/packages/suite/src/reducers/wallet/receiveReducer.ts +++ b/packages/suite/src/reducers/wallet/receiveReducer.ts @@ -1,8 +1,10 @@ import produce from 'immer'; + +import { ReceiveInfo } from '@suite-common/wallet-types'; + import { RECEIVE } from 'src/actions/wallet/constants'; import { Action as SuiteAction } from 'src/types/suite'; -import { ReceiveInfo } from '@suite-common/wallet-types'; export type State = ReceiveInfo[]; diff --git a/packages/suite/src/reducers/wallet/selectedAccountReducer.ts b/packages/suite/src/reducers/wallet/selectedAccountReducer.ts index 06489822413..dddf53ff897 100644 --- a/packages/suite/src/reducers/wallet/selectedAccountReducer.ts +++ b/packages/suite/src/reducers/wallet/selectedAccountReducer.ts @@ -1,7 +1,8 @@ import { accountsActions } from '@suite-common/wallet-core'; import { MIN_ETH_BALANCE_FOR_STAKING } from '@suite-common/wallet-constants'; -import type { Action } from 'src/types/suite'; import type { SelectedAccountStatus } from '@suite-common/wallet-types'; + +import type { Action } from 'src/types/suite'; import { State as CoinmarketState } from 'src/reducers/wallet/coinmarketReducer'; export type State = SelectedAccountStatus; diff --git a/packages/suite/src/reducers/wallet/settingsReducer.ts b/packages/suite/src/reducers/wallet/settingsReducer.ts index 4f27b62b963..a2a9c57fa80 100644 --- a/packages/suite/src/reducers/wallet/settingsReducer.ts +++ b/packages/suite/src/reducers/wallet/settingsReducer.ts @@ -1,11 +1,13 @@ import produce from 'immer'; + +import { WalletSettings } from '@suite-common/wallet-types'; +import { PROTO } from '@trezor/connect'; + import { STORAGE } from 'src/actions/suite/constants'; import { WALLET_SETTINGS } from 'src/actions/settings/constants'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; import { Action, AppState } from 'src/types/suite'; -import { WalletSettings } from '@suite-common/wallet-types'; -import { PROTO } from '@trezor/connect'; export type State = WalletSettings; diff --git a/packages/suite/src/services/coinjoin/coinjoinService.ts b/packages/suite/src/services/coinjoin/coinjoinService.ts index 734f5a1aaff..3a814bd32f2 100644 --- a/packages/suite/src/services/coinjoin/coinjoinService.ts +++ b/packages/suite/src/services/coinjoin/coinjoinService.ts @@ -3,6 +3,7 @@ import { createIpcProxy } from '@trezor/ipc-proxy'; import { PartialRecord } from '@trezor/type-utils'; import { isDesktop } from '@trezor/env-utils'; import { NetworkSymbol } from '@suite-common/wallet-config'; + import { CoinjoinNetworksConfig, getCoinjoinConfig } from './config'; const loadInstance = (settings: ReturnType) => { diff --git a/packages/suite/src/services/coinjoin/config.ts b/packages/suite/src/services/coinjoin/config.ts index 4a47aba2137..15e2aa7efae 100644 --- a/packages/suite/src/services/coinjoin/config.ts +++ b/packages/suite/src/services/coinjoin/config.ts @@ -6,9 +6,10 @@ import { } from '@trezor/coinjoin/src/constants'; import type { CoinjoinBackendSettings, CoinjoinClientSettings } from '@trezor/coinjoin'; import type { PartialRecord } from '@trezor/type-utils'; -import type { CoinjoinServerEnvironment } from 'src/types/wallet/coinjoin'; import type { NetworkSymbol } from '@suite-common/wallet-config'; +import type { CoinjoinServerEnvironment } from 'src/types/wallet/coinjoin'; + export type CoinjoinNetworksConfig = CoinjoinBackendSettings & CoinjoinClientSettings & { blockbookUrls: string[] }; diff --git a/packages/suite/src/services/github.ts b/packages/suite/src/services/github.ts index 5cee99d8de6..620c7f153f1 100644 --- a/packages/suite/src/services/github.ts +++ b/packages/suite/src/services/github.ts @@ -1,5 +1,4 @@ import { getFirmwareVersion } from '@trezor/device-utils'; - import { getCommitHash, getScreenHeight, @@ -8,10 +7,11 @@ import { getUserAgent, isDesktop, } from '@trezor/env-utils'; -import type { TrezorDevice } from 'src/types/suite'; import type { TransportInfo } from '@trezor/connect'; import { GITHUB_REPO_URL } from '@trezor/urls'; +import type { TrezorDevice } from 'src/types/suite'; + type DebugInfo = { device?: TrezorDevice; transport?: Partial; diff --git a/packages/suite/src/services/google.ts b/packages/suite/src/services/google.ts index 17cd9c1d4e1..c4f25a15c2d 100644 --- a/packages/suite/src/services/google.ts +++ b/packages/suite/src/services/google.ts @@ -6,8 +6,9 @@ * in case our authorization server (which holds a client secret necessary for the authorization code flow) is not available. */ -import { METADATA_PROVIDER } from 'src/actions/suite/constants'; import { isDesktop } from '@trezor/env-utils'; + +import { METADATA_PROVIDER } from 'src/actions/suite/constants'; import { OAuthServerEnvironment, Tokens } from 'src/types/suite/metadata'; import { extractCredentialsFromAuthorizationFlow, diff --git a/packages/suite/src/services/suite/invityAPI.ts b/packages/suite/src/services/suite/invityAPI.ts index 7598a0c1634..806a0f99e25 100644 --- a/packages/suite/src/services/suite/invityAPI.ts +++ b/packages/suite/src/services/suite/invityAPI.ts @@ -23,8 +23,10 @@ import { SellFiatTradeResponse, InfoResponse, } from 'invity-api'; + import { getSuiteVersion, isDesktop } from '@trezor/env-utils'; import type { InvityServerEnvironment, InvityServers } from '@suite-common/invity'; + import { CoinmarketPaymentMethodType, CoinmarketTradeDetailType, diff --git a/packages/suite/src/services/suite/metadata/DropboxProvider.ts b/packages/suite/src/services/suite/metadata/DropboxProvider.ts index f5b65ee92aa..191b969c32b 100644 --- a/packages/suite/src/services/suite/metadata/DropboxProvider.ts +++ b/packages/suite/src/services/suite/metadata/DropboxProvider.ts @@ -1,12 +1,14 @@ import { Dropbox, DropboxAuth } from 'dropbox'; import type { users } from 'dropbox'; + +import { getWeakRandomId } from '@trezor/utils'; + import { AbstractMetadataProvider } from 'src/types/suite/metadata'; import { extractCredentialsFromAuthorizationFlow, getOauthReceiverUrl, } from 'src/utils/suite/oauth'; -import { getWeakRandomId } from '@trezor/utils'; // Dropbox messed up types, that's why @ts-expect-error occurs in this file diff --git a/packages/suite/src/services/suite/metadata/FileSystemProvider.ts b/packages/suite/src/services/suite/metadata/FileSystemProvider.ts index f0bb16cbb71..9943113c7c7 100644 --- a/packages/suite/src/services/suite/metadata/FileSystemProvider.ts +++ b/packages/suite/src/services/suite/metadata/FileSystemProvider.ts @@ -1,4 +1,5 @@ import { desktopApi } from '@trezor/suite-desktop-api'; + import { AbstractMetadataProvider } from 'src/types/suite/metadata'; class FileSystemProvider extends AbstractMetadataProvider { diff --git a/packages/suite/src/storage/definitions.ts b/packages/suite/src/storage/definitions.ts index c483f6a0b19..f4a1c6a63d4 100644 --- a/packages/suite/src/storage/definitions.ts +++ b/packages/suite/src/storage/definitions.ts @@ -1,25 +1,28 @@ -import type { DBSchema } from 'idb'; import { FieldValues } from 'react-hook-form'; -import type { SuiteState } from 'src/reducers/suite/suiteReducer'; +import type { DBSchema } from 'idb'; + import type { FormState, RatesByTimestamps, BackendSettings, WalletSettings, } from '@suite-common/wallet-types'; -import type { MetadataState } from 'src/types/suite/metadata'; -import type { Trade } from 'src/types/wallet/coinmarketCommonTypes'; import type { MessageState } from '@suite-common/message-system'; import type { DeviceWithEmptyPath, MessageSystem } from '@suite-common/suite-types'; -import type { Account, Discovery, WalletAccountTransaction } from 'src/types/wallet'; import { NetworkSymbol } from '@suite-common/wallet-config'; -import type { CoinjoinAccount, CoinjoinDebugSettings } from 'src/types/wallet/coinjoin'; import type { StorageUpdateMessage } from '@trezor/suite-storage'; import { AnalyticsState } from '@suite-common/analytics'; -import { GraphData } from '../types/wallet/graph'; import { SimpleTokenStructure } from '@suite-common/token-definitions'; +import type { CoinjoinAccount, CoinjoinDebugSettings } from 'src/types/wallet/coinjoin'; +import type { Account, Discovery, WalletAccountTransaction } from 'src/types/wallet'; +import type { Trade } from 'src/types/wallet/coinmarketCommonTypes'; +import type { MetadataState } from 'src/types/suite/metadata'; +import type { SuiteState } from 'src/reducers/suite/suiteReducer'; + +import { GraphData } from '../types/wallet/graph'; + export interface DBWalletAccountTransaction { tx: WalletAccountTransaction; order: number; diff --git a/packages/suite/src/storage/index.ts b/packages/suite/src/storage/index.ts index 657547fad2e..43e9c632f45 100644 --- a/packages/suite/src/storage/index.ts +++ b/packages/suite/src/storage/index.ts @@ -1,7 +1,8 @@ import SuiteDB, { OnUpgradeFunc } from '@trezor/suite-storage'; + import { reloadApp } from 'src/utils/suite/reload'; -import { migrate } from './migrations'; +import { migrate } from './migrations'; import type { SuiteDBSchema } from './definitions'; const VERSION = 48; // don't forget to add migration and CHANGELOG when changing versions! diff --git a/packages/suite/src/storage/migrations/index.ts b/packages/suite/src/storage/migrations/index.ts index 1b9ce53d671..3b0691abba8 100644 --- a/packages/suite/src/storage/migrations/index.ts +++ b/packages/suite/src/storage/migrations/index.ts @@ -1,22 +1,24 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; import { toWei } from 'web3-utils'; + +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { isDesktop } from '@trezor/env-utils'; -import type { State } from 'src/reducers/wallet/settingsReducer'; -import type { CustomBackend, BlockbookUrl } from 'src/types/wallet/backend'; import { NetworkSymbol } from '@suite-common/wallet-config'; - import type { BackendSettings } from '@suite-common/wallet-types'; import type { OnUpgradeFunc } from '@trezor/suite-storage'; -import type { DBWalletAccountTransaction, SuiteDBSchema } from '../definitions'; import { formatNetworkAmount, networkAmountToSmallestUnit, amountToSmallestUnit, } from '@suite-common/wallet-utils'; -import { updateAll } from './utils'; import { DeviceModelInternal, FirmwareType } from '@trezor/connect'; import { parseAsset } from '@trezor/blockchain-link-utils/src/blockfrost'; +import type { CustomBackend, BlockbookUrl } from 'src/types/wallet/backend'; +import type { State } from 'src/reducers/wallet/settingsReducer'; + +import { updateAll } from './utils'; +import type { DBWalletAccountTransaction, SuiteDBSchema } from '../definitions'; + type WalletWithBackends = { backends?: Partial<{ [coin in NetworkSymbol]: Omit; diff --git a/packages/suite/src/storage/migrations/utils.ts b/packages/suite/src/storage/migrations/utils.ts index e2d1bbb7eb0..1a9b9805d50 100644 --- a/packages/suite/src/storage/migrations/utils.ts +++ b/packages/suite/src/storage/migrations/utils.ts @@ -1,4 +1,5 @@ import type { StoreNames, StoreValue, IDBPTransaction } from 'idb'; + import type { SuiteDBSchema } from '../definitions'; /** diff --git a/packages/suite/src/support/extraDependencies.ts b/packages/suite/src/support/extraDependencies.ts index bd53f6fc915..b9ad8fb7d65 100644 --- a/packages/suite/src/support/extraDependencies.ts +++ b/packages/suite/src/support/extraDependencies.ts @@ -15,11 +15,17 @@ import { } from '@suite-common/wallet-core'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { ExtraDependencies } from '@suite-common/redux-utils'; +import { PROTO, StaticSessionId } from '@trezor/connect'; +import { + TokenDefinitionsState, + buildTokenDefinitionsFromStorage, +} from '@suite-common/token-definitions'; +import { isDesktop } from '@trezor/env-utils'; + import { findLabelsToBeMovedOrDeleted, moveLabelsForRbfAction, } from 'src/actions/wallet/moveLabelsForRbfActions'; - import { StorageLoadAction } from 'src/actions/suite/storageActions'; import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; import * as metadataActions from 'src/actions/suite/metadataActions'; @@ -27,18 +33,14 @@ import * as cardanoStakingActions from 'src/actions/wallet/cardanoStakingActions import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; import { fixLoadedCoinjoinAccount } from 'src/utils/wallet/coinjoinUtils'; import * as modalActions from 'src/actions/suite/modalActions'; +import { addWalletThunk, openSwitchDeviceDialog } from 'src/actions/wallet/addWalletThunk'; import * as suiteActions from '../actions/suite/suiteActions'; import { AppState, ButtonRequest, TrezorDevice } from '../types/suite'; import { METADATA, STORAGE } from '../actions/suite/constants'; -import { PROTO, StaticSessionId } from '@trezor/connect'; -import { - TokenDefinitionsState, - buildTokenDefinitionsFromStorage, -} from '@suite-common/token-definitions'; import { selectSuiteSettings } from '../reducers/suite/suiteReducer'; -import { addWalletThunk, openSwitchDeviceDialog } from 'src/actions/wallet/addWalletThunk'; -import { isDesktop } from '@trezor/env-utils'; + + const connectSrc = resolveStaticPath('connect/'); // 'https://localhost:8088/'; diff --git a/packages/suite/src/support/suite/Autodetect.tsx b/packages/suite/src/support/suite/Autodetect.tsx index 685975fbe80..f1f2b4c77cc 100644 --- a/packages/suite/src/support/suite/Autodetect.tsx +++ b/packages/suite/src/support/suite/Autodetect.tsx @@ -1,4 +1,5 @@ import { useEffect } from 'react'; + import { getOsTheme, watchOsTheme } from 'src/utils/suite/env'; import { getOsLocale, watchOsLocale } from 'src/utils/suite/l10n'; import { useActions, useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/support/suite/ConnectedIntlProvider.tsx b/packages/suite/src/support/suite/ConnectedIntlProvider.tsx index 64a78adc13f..192d5450c66 100644 --- a/packages/suite/src/support/suite/ConnectedIntlProvider.tsx +++ b/packages/suite/src/support/suite/ConnectedIntlProvider.tsx @@ -1,8 +1,10 @@ import { useState, useEffect, ReactNode } from 'react'; import { IntlProvider } from 'react-intl'; + import enMessages from '@trezor/suite-data/files/translations/en.json'; -import { useSelector } from 'src/hooks/suite/useSelector'; import { isDevEnv } from '@suite-common/suite-utils'; + +import { useSelector } from 'src/hooks/suite/useSelector'; import type { Locale } from 'src/config/suite/languages'; const useFetchMessages = (locale: Locale) => { diff --git a/packages/suite/src/support/suite/ConnectedThemeProvider.tsx b/packages/suite/src/support/suite/ConnectedThemeProvider.tsx index a8ee93434a1..898e7fbf770 100644 --- a/packages/suite/src/support/suite/ConnectedThemeProvider.tsx +++ b/packages/suite/src/support/suite/ConnectedThemeProvider.tsx @@ -1,5 +1,7 @@ import { ReactNode } from 'react'; + import { useSelector } from 'src/hooks/suite'; + import { ThemeProvider } from './ThemeProvider'; interface ConnectedThemeProviderProps { diff --git a/packages/suite/src/support/suite/ErrorBoundary.tsx b/packages/suite/src/support/suite/ErrorBoundary.tsx index d67ba55eab2..64ca69565f3 100644 --- a/packages/suite/src/support/suite/ErrorBoundary.tsx +++ b/packages/suite/src/support/suite/ErrorBoundary.tsx @@ -1,6 +1,8 @@ import { Component, ErrorInfo } from 'react'; import { connect, ConnectedComponent } from 'react-redux'; + import { bindActionCreators, Dispatch } from 'redux'; + import { Error } from 'src/components/suite/Error'; import { reportToSentry } from 'src/utils/suite/sentry'; diff --git a/packages/suite/src/support/suite/OnlineStatus.tsx b/packages/suite/src/support/suite/OnlineStatus.tsx index d436b728860..c45ea7b9efc 100644 --- a/packages/suite/src/support/suite/OnlineStatus.tsx +++ b/packages/suite/src/support/suite/OnlineStatus.tsx @@ -1,4 +1,5 @@ import { useEffect } from 'react'; + import { useDispatch } from 'src/hooks/suite'; import { updateOnlineStatus } from 'src/actions/suite/suiteActions'; diff --git a/packages/suite/src/support/suite/Protocol.tsx b/packages/suite/src/support/suite/Protocol.tsx index c879f910944..7522ac8ef38 100644 --- a/packages/suite/src/support/suite/Protocol.tsx +++ b/packages/suite/src/support/suite/Protocol.tsx @@ -1,8 +1,9 @@ import { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; -import { desktopApi } from '@trezor/suite-desktop-api'; +import { desktopApi } from '@trezor/suite-desktop-api'; import { isWeb, isDesktop } from '@trezor/env-utils'; + import { useActions } from 'src/hooks/suite'; import * as protocolActions from 'src/actions/suite/protocolActions'; diff --git a/packages/suite/src/support/suite/Resize.tsx b/packages/suite/src/support/suite/Resize.tsx index bae17e84ea6..c7ba88ff0e2 100644 --- a/packages/suite/src/support/suite/Resize.tsx +++ b/packages/suite/src/support/suite/Resize.tsx @@ -1,5 +1,7 @@ import { useEffect, useState } from 'react'; + import useDebounce from 'react-use/lib/useDebounce'; + import { useDispatch } from 'src/hooks/suite'; import { updateWindowSize } from 'src/actions/suite/resizeActions'; diff --git a/packages/suite/src/support/suite/Router.tsx b/packages/suite/src/support/suite/Router.tsx index 1ea44aa0fc0..d102ee952d2 100644 --- a/packages/suite/src/support/suite/Router.tsx +++ b/packages/suite/src/support/suite/Router.tsx @@ -2,6 +2,7 @@ import { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; import { useDidUpdate } from '@trezor/react-utils'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { onBeforePopState, onLocationChange } from 'src/actions/suite/routerActions'; import history from 'src/support/history'; diff --git a/packages/suite/src/support/suite/ThemeProvider.tsx b/packages/suite/src/support/suite/ThemeProvider.tsx index 2b423f89697..7d52d1147bd 100644 --- a/packages/suite/src/support/suite/ThemeProvider.tsx +++ b/packages/suite/src/support/suite/ThemeProvider.tsx @@ -1,7 +1,10 @@ import { ReactNode } from 'react'; + import { ThemeProvider as SCThemeProvider } from 'styled-components'; + import { getThemeColors } from 'src/utils/suite/theme'; import { getOsTheme } from 'src/utils/suite/env'; + import GlobalStyle from './styles/GlobalStyle'; type ThemeProviderProps = { diff --git a/packages/suite/src/support/suite/screens/ErrorScreen.tsx b/packages/suite/src/support/suite/screens/ErrorScreen.tsx index 5c3344a0bb1..41c5e1a5da4 100644 --- a/packages/suite/src/support/suite/screens/ErrorScreen.tsx +++ b/packages/suite/src/support/suite/screens/ErrorScreen.tsx @@ -1,4 +1,5 @@ import { Error } from 'src/components/suite/Error'; + import { ThemeProvider } from '../ThemeProvider'; type ErrorScreenProps = { diff --git a/packages/suite/src/support/suite/screens/LoadingScreen.tsx b/packages/suite/src/support/suite/screens/LoadingScreen.tsx index 8a997effc02..59ab1a4cc32 100644 --- a/packages/suite/src/support/suite/screens/LoadingScreen.tsx +++ b/packages/suite/src/support/suite/screens/LoadingScreen.tsx @@ -1,7 +1,9 @@ import styled from 'styled-components'; import { Paragraph } from '@trezor/components'; + import { Loading } from 'src/components/suite'; + import { ThemeProvider } from '../ThemeProvider'; const Wrapper = styled.div` diff --git a/packages/suite/src/support/suite/styles/GlobalStyle.tsx b/packages/suite/src/support/suite/styles/GlobalStyle.tsx index 3d8c9bba5f7..a26242740f6 100644 --- a/packages/suite/src/support/suite/styles/GlobalStyle.tsx +++ b/packages/suite/src/support/suite/styles/GlobalStyle.tsx @@ -1,6 +1,8 @@ +import { createGlobalStyle, DefaultTheme } from 'styled-components'; + import { typography } from '@trezor/theme'; + import animations from './animations'; -import { createGlobalStyle, DefaultTheme } from 'styled-components'; const GlobalStyle = createGlobalStyle<{ theme: DefaultTheme }>` #app { diff --git a/packages/suite/src/support/suite/useTor.tsx b/packages/suite/src/support/suite/useTor.tsx index 2a494106149..371f20ac0e8 100644 --- a/packages/suite/src/support/suite/useTor.tsx +++ b/packages/suite/src/support/suite/useTor.tsx @@ -1,6 +1,9 @@ import { useEffect } from 'react'; import { desktopApi, BootstrapTorEvent, TorStatusEvent } from '@trezor/suite-desktop-api'; +import { isWeb, isDesktop, getLocationHostname } from '@trezor/env-utils'; +import { notificationsActions } from '@suite-common/toast-notifications'; + import { TorStatus } from 'src/types/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { getIsTorDomain } from 'src/utils/suite/tor'; @@ -9,9 +12,8 @@ import { setTorBootstrapSlow, updateTorStatus, } from 'src/actions/suite/suiteActions'; -import { isWeb, isDesktop, getLocationHostname } from '@trezor/env-utils'; import { selectTorState } from 'src/reducers/suite/suiteReducer'; -import { notificationsActions } from '@suite-common/toast-notifications'; + export const useTor = () => { const { torBootstrap, isTorEnabling } = useSelector(selectTorState); diff --git a/packages/suite/src/support/tests/IntlHelper.tsx b/packages/suite/src/support/tests/IntlHelper.tsx index 4007d6ee2c5..c8c63f8cefd 100644 --- a/packages/suite/src/support/tests/IntlHelper.tsx +++ b/packages/suite/src/support/tests/IntlHelper.tsx @@ -2,6 +2,7 @@ import { ReactChild } from 'react'; import renderer from 'react-test-renderer'; import { IntlProvider } from 'react-intl'; import { Provider } from 'react-redux'; + import { configureStore } from 'src/support/tests/configureStore'; interface Props { diff --git a/packages/suite/src/support/tests/hooksHelper.tsx b/packages/suite/src/support/tests/hooksHelper.tsx index f2ac9f9c86a..9653a0df2b5 100644 --- a/packages/suite/src/support/tests/hooksHelper.tsx +++ b/packages/suite/src/support/tests/hooksHelper.tsx @@ -1,11 +1,14 @@ import { ReactNode } from 'react'; import { Provider } from 'react-redux'; import { IntlProvider } from 'react-intl'; + import { act, render, screen, waitForElementToBeRemoved } from '@testing-library/react'; -import { ConnectedThemeProvider } from 'src/support/suite/ConnectedThemeProvider'; import userEvent from '@testing-library/user-event'; + import { MockedFormatterProvider } from '@suite-common/formatters'; +import { ConnectedThemeProvider } from 'src/support/suite/ConnectedThemeProvider'; + // used in hooks tests export const renderWithProviders = (store: any, children: ReactNode) => { const renderMethods = render( diff --git a/packages/suite/src/types/coinmarket/coinmarket.ts b/packages/suite/src/types/coinmarket/coinmarket.ts index 15037a006a7..669f0432c49 100644 --- a/packages/suite/src/types/coinmarket/coinmarket.ts +++ b/packages/suite/src/types/coinmarket/coinmarket.ts @@ -1,14 +1,3 @@ -import type { BuyInfo } from 'src/actions/wallet/coinmarketBuyActions'; -import type { ExchangeInfo } from 'src/actions/wallet/coinmarketExchangeActions'; -import type { SellInfo } from 'src/actions/wallet/coinmarketSellActions'; -import type { - Option, - Trade, - TradeBuy, - TradeExchange, - TradeSell, - TradeType, -} from 'src/types/wallet/coinmarketCommonTypes'; import { BuyCryptoPaymentMethod, BuyProviderInfo, @@ -27,11 +16,10 @@ import { WatchExchangeTradeResponse, WatchSellTradeResponse, } from 'invity-api'; -import { Account, SelectedAccountLoaded } from '@suite-common/wallet-types'; import { AnyAction, Dispatch } from 'redux'; -import { State } from 'src/reducers/wallet/coinmarketReducer'; + +import { Account, SelectedAccountLoaded } from '@suite-common/wallet-types'; import { AccountType } from '@suite-common/wallet-config'; -import { ExtendedMessageDescriptor, TrezorDevice } from 'src/types/suite'; import { Timer } from '@trezor/react-utils'; import { AccountsState } from '@suite-common/wallet-core'; import { TokenDefinitionsState } from '@suite-common/token-definitions'; @@ -41,9 +29,23 @@ import { SelectAssetOptionGroupProps, SelectAssetOptionProps, } from '@trezor/product-components/src/components/SelectAssetModal/SelectAssetModal'; -import { GetDefaultAccountLabelParams } from 'src/hooks/suite/useDefaultAccountLabel'; import { StaticSessionId } from '@trezor/connect'; +import { GetDefaultAccountLabelParams } from 'src/hooks/suite/useDefaultAccountLabel'; +import { State } from 'src/reducers/wallet/coinmarketReducer'; +import { ExtendedMessageDescriptor, TrezorDevice } from 'src/types/suite'; +import type { + Option, + Trade, + TradeBuy, + TradeExchange, + TradeSell, + TradeType, +} from 'src/types/wallet/coinmarketCommonTypes'; +import type { SellInfo } from 'src/actions/wallet/coinmarketSellActions'; +import type { ExchangeInfo } from 'src/actions/wallet/coinmarketExchangeActions'; +import type { BuyInfo } from 'src/actions/wallet/coinmarketBuyActions'; + export type UseCoinmarketProps = { selectedAccount: SelectedAccountLoaded }; export type UseCoinmarketCommonProps = UseCoinmarketProps & { type: CoinmarketTradeType; diff --git a/packages/suite/src/types/coinmarket/coinmarketDetail.ts b/packages/suite/src/types/coinmarket/coinmarketDetail.ts index 5c735399250..99e6c065f8c 100644 --- a/packages/suite/src/types/coinmarket/coinmarketDetail.ts +++ b/packages/suite/src/types/coinmarket/coinmarketDetail.ts @@ -1,7 +1,8 @@ +import type { SelectedAccountLoaded } from '@suite-common/wallet-types'; + import type { CoinmarketTradeCommonProps } from 'src/reducers/wallet/coinmarketReducer'; import type { Account } from 'src/types/wallet'; import type { TradeType } from 'src/types/wallet/coinmarketCommonTypes'; -import type { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { CoinmarketTradeInfoMapProps, CoinmarketTradeMapProps, diff --git a/packages/suite/src/types/coinmarket/coinmarketForm.ts b/packages/suite/src/types/coinmarket/coinmarketForm.ts index 0a04459c8ea..eb7f3f0e367 100644 --- a/packages/suite/src/types/coinmarket/coinmarketForm.ts +++ b/packages/suite/src/types/coinmarket/coinmarketForm.ts @@ -1,3 +1,27 @@ +import type { FieldValues, UseFormReturn, FieldPath } from 'react-hook-form'; +import { PropsWithChildren } from 'react'; + +import type { + BankAccount, + BuyTrade, + CryptoId, + ExchangeTrade, + ExchangeTradeQuoteRequest, + FiatCurrencyCode, + SellFiatTrade, +} from 'invity-api'; + +import { Network } from '@suite-common/wallet-config'; +import { Timer } from '@trezor/react-utils'; +import { + FeeInfo, + FormState, + PrecomposedLevels, + PrecomposedLevelsCardano, +} from '@suite-common/wallet-types'; +import { FeeLevel } from '@trezor/connect'; +import { AccountsState } from '@suite-common/wallet-core'; + import { CoinmarketAccountOptionsGroupOptionProps, CoinmarketCryptoSelectItemProps, @@ -15,39 +39,17 @@ import { CoinmarketTradeType, } from 'src/types/coinmarket/coinmarket'; import type { Account } from 'src/types/wallet'; -import { Network } from '@suite-common/wallet-config'; import type { BuyInfo } from 'src/actions/wallet/coinmarketBuyActions'; -import type { FieldValues, UseFormReturn, FieldPath } from 'react-hook-form'; -import type { - BankAccount, - BuyTrade, - CryptoId, - ExchangeTrade, - ExchangeTradeQuoteRequest, - FiatCurrencyCode, - SellFiatTrade, -} from 'invity-api'; -import { Timer } from '@trezor/react-utils'; import { AppState } from 'src/reducers/store'; import { Dispatch, ExtendedMessageDescriptor, GetState } from 'src/types/suite'; -import { PropsWithChildren } from 'react'; import { AmountLimits, CryptoAmountLimits, Option, TradeSell, } from 'src/types/wallet/coinmarketCommonTypes'; -import { - FeeInfo, - FormState, - PrecomposedLevels, - PrecomposedLevelsCardano, -} from '@suite-common/wallet-types'; -import { FeeLevel } from '@trezor/connect'; import { SendContextValues } from 'src/types/wallet/sendForm'; import { SellInfo } from 'src/actions/wallet/coinmarketSellActions'; - -import { AccountsState } from '@suite-common/wallet-core'; import { ExchangeInfo } from 'src/actions/wallet/coinmarketExchangeActions'; import { EXCHANGE_COMPARATOR_KYC_FILTER, diff --git a/packages/suite/src/types/coinmarket/coinmarketVerify.ts b/packages/suite/src/types/coinmarket/coinmarketVerify.ts index 21ee6d0e1ee..83692ae36b7 100644 --- a/packages/suite/src/types/coinmarket/coinmarketVerify.ts +++ b/packages/suite/src/types/coinmarket/coinmarketVerify.ts @@ -1,8 +1,11 @@ -import type { Account } from 'src/types/wallet'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import { CryptoId } from 'invity-api'; import { UseFormReturn } from 'react-hook-form'; + +import { CryptoId } from 'invity-api'; + +import { NetworkSymbol } from '@suite-common/wallet-config'; import { AccountAddress } from '@trezor/connect'; + +import type { Account } from 'src/types/wallet'; import { ExtendedMessageDescriptor, TrezorDevice } from 'src/types/suite'; export interface CoinmarketVerifyFormProps { diff --git a/packages/suite/src/types/onboarding/index.ts b/packages/suite/src/types/onboarding/index.ts index f3d05e38133..af66cc612c4 100644 --- a/packages/suite/src/types/onboarding/index.ts +++ b/packages/suite/src/types/onboarding/index.ts @@ -1,4 +1,5 @@ import { DeviceModelInternal } from '@trezor/connect'; + import * as STEP from 'src/constants/onboarding/steps'; import { PrerequisiteType } from 'src/utils/suite/prerequisites'; diff --git a/packages/suite/src/types/wallet/coinjoin.ts b/packages/suite/src/types/wallet/coinjoin.ts index eff6e58f9a1..96e8dda7652 100644 --- a/packages/suite/src/types/wallet/coinjoin.ts +++ b/packages/suite/src/types/wallet/coinjoin.ts @@ -15,6 +15,7 @@ import { EndRoundState, WabiSabiProtocolErrorCode, } from '@trezor/coinjoin/src/enums'; + import type { CoinjoinNetworksConfig } from 'src/services/coinjoin'; export { EndRoundState, WabiSabiProtocolErrorCode }; diff --git a/packages/suite/src/types/wallet/coinmarketCommonTypes.ts b/packages/suite/src/types/wallet/coinmarketCommonTypes.ts index f54fe0b9a8d..2d86c94650e 100644 --- a/packages/suite/src/types/wallet/coinmarketCommonTypes.ts +++ b/packages/suite/src/types/wallet/coinmarketCommonTypes.ts @@ -1,7 +1,9 @@ -import type { Account } from 'src/types/wallet'; import type { BuyTrade, SellFiatTrade, ExchangeTrade, FiatCurrencyCode } from 'invity-api'; + import type { FlagProps } from '@trezor/components'; +import type { Account } from 'src/types/wallet'; + type CommonTrade = { date: string; key?: string; diff --git a/packages/suite/src/types/wallet/index.ts b/packages/suite/src/types/wallet/index.ts index c06c1b6a2fa..61b6b6cf0c3 100644 --- a/packages/suite/src/types/wallet/index.ts +++ b/packages/suite/src/types/wallet/index.ts @@ -5,6 +5,8 @@ import { stakeActions, sendFormActions, } from '@suite-common/wallet-core'; +import { tokenDefinitionsActions } from '@suite-common/token-definitions/src/tokenDefinitionsActions'; + import { ReceiveAction } from 'src/actions/wallet/receiveActions'; import { SignVerifyAction } from 'src/actions/wallet/signVerifyActions'; import { CoinmarketBuyAction } from 'src/actions/wallet/coinmarketBuyActions'; @@ -18,7 +20,6 @@ import { CardanoStakingAction } from 'src/actions/wallet/cardanoStakingActions'; import { CoinjoinAccountAction } from 'src/actions/wallet/coinjoinAccountActions'; import { CoinjoinClientAction } from 'src/actions/wallet/coinjoinClientActions'; import { CoinmarketInfoAction } from 'src/actions/wallet/coinmarketInfoActions'; -import { tokenDefinitionsActions } from '@suite-common/token-definitions/src/tokenDefinitionsActions'; // reexport export type { Icon } from './iconTypes'; diff --git a/packages/suite/src/types/wallet/sendForm.ts b/packages/suite/src/types/wallet/sendForm.ts index 20d8e48e526..d4324296b10 100644 --- a/packages/suite/src/types/wallet/sendForm.ts +++ b/packages/suite/src/types/wallet/sendForm.ts @@ -3,7 +3,6 @@ import { FieldPath, UseFormReturn } from 'react-hook-form'; import { Network } from '@suite-common/wallet-config'; import { AccountUtxo, FeeLevel, PROTO } from '@trezor/connect'; - import { Account, AccountKey, diff --git a/packages/suite/src/utils/firmware/__tests__/firmware.test.ts b/packages/suite/src/utils/firmware/__tests__/firmware.test.ts index 9a3ad6f6cef..7c693e0d012 100644 --- a/packages/suite/src/utils/firmware/__tests__/firmware.test.ts +++ b/packages/suite/src/utils/firmware/__tests__/firmware.test.ts @@ -1,6 +1,7 @@ +import { DeviceModelInternal } from '@trezor/connect'; + import { TrezorDevice } from 'src/types/suite'; import { getFormattedFingerprint, validateFirmware } from '../index'; -import { DeviceModelInternal } from '@trezor/connect'; describe('getFormattedFingerprint', () => { it('should return a formatted fingerprint', () => { diff --git a/packages/suite/src/utils/firmware/index.ts b/packages/suite/src/utils/firmware/index.ts index 89b1f70b440..ec425ed1730 100644 --- a/packages/suite/src/utils/firmware/index.ts +++ b/packages/suite/src/utils/firmware/index.ts @@ -1,8 +1,9 @@ import { valid, satisfies } from 'semver'; + import { getFirmwareVersion } from '@trezor/device-utils'; +import { DeviceModelInternal, FirmwareType } from '@trezor/connect'; import { type TrezorDevice, type ExtendedMessageDescriptor } from 'src/types/suite'; -import { DeviceModelInternal, FirmwareType } from '@trezor/connect'; export const getFormattedFingerprint = (fingerprint: string) => [ diff --git a/packages/suite/src/utils/onboarding/__tests__/steps.test.ts b/packages/suite/src/utils/onboarding/__tests__/steps.test.ts index 662765c2699..d4e3151f5c9 100644 --- a/packages/suite/src/utils/onboarding/__tests__/steps.test.ts +++ b/packages/suite/src/utils/onboarding/__tests__/steps.test.ts @@ -2,6 +2,7 @@ import { DeviceModelInternal } from '@trezor/connect'; import * as STEP from 'src/constants/onboarding/steps'; import { Step } from 'src/types/onboarding'; + import { findNextStep, findPrevStep, isStepUsed } from '../steps'; const firmwareStep: Step = { diff --git a/packages/suite/src/utils/suite/__fixtures__/device.ts b/packages/suite/src/utils/suite/__fixtures__/device.ts index f2ddeec22b9..7341600595e 100644 --- a/packages/suite/src/utils/suite/__fixtures__/device.ts +++ b/packages/suite/src/utils/suite/__fixtures__/device.ts @@ -1,8 +1,9 @@ import { testMocks } from '@suite-common/test-utils'; -import type { TrezorDevice } from 'src/types/suite'; import { DeviceModelInternal } from '@trezor/connect'; import * as URLS from '@trezor/urls'; +import type { TrezorDevice } from 'src/types/suite'; + const { getSuiteDevice } = testMocks; const SUITE_DEVICE = getSuiteDevice(); diff --git a/packages/suite/src/utils/suite/__fixtures__/homescreen.ts b/packages/suite/src/utils/suite/__fixtures__/homescreen.ts index 1b64eec500f..00550a613f8 100644 --- a/packages/suite/src/utils/suite/__fixtures__/homescreen.ts +++ b/packages/suite/src/utils/suite/__fixtures__/homescreen.ts @@ -1,6 +1,7 @@ -import { deviceModelInformation } from 'src/utils/suite/homescreen'; import { DeviceModelInternal } from '@trezor/connect'; +import { deviceModelInformation } from 'src/utils/suite/homescreen'; + export const isValidImageFormat = [ { description: 'valid image format for T2T1', diff --git a/packages/suite/src/utils/suite/__tests__/homescreen.test.ts b/packages/suite/src/utils/suite/__tests__/homescreen.test.ts index 47527fb00ce..7c256fe2561 100644 --- a/packages/suite/src/utils/suite/__tests__/homescreen.test.ts +++ b/packages/suite/src/utils/suite/__tests__/homescreen.test.ts @@ -1,3 +1,5 @@ +import { DeviceModelInternal } from '@trezor/connect'; + import { dataUrlToImage, fileToArrayBuffer, @@ -8,8 +10,8 @@ import { isValidImageSize, isValidImageWidth, } from 'src/utils/suite/homescreen'; + import * as fixtures from '../__fixtures__/homescreen'; -import { DeviceModelInternal } from '@trezor/connect'; describe('homescreen', () => { describe('fileToDataUrl', () => { diff --git a/packages/suite/src/utils/suite/__tests__/logsUtils.test.ts b/packages/suite/src/utils/suite/__tests__/logsUtils.test.ts index edb372869e8..c47c5ed650f 100644 --- a/packages/suite/src/utils/suite/__tests__/logsUtils.test.ts +++ b/packages/suite/src/utils/suite/__tests__/logsUtils.test.ts @@ -1,6 +1,7 @@ import { testMocks } from '@suite-common/test-utils'; import { discoveryActions } from '@suite-common/wallet-core'; import { DiscoveryStatus } from '@suite-common/wallet-constants'; +import { StaticSessionId } from '@trezor/connect'; import { redactAccount, @@ -9,7 +10,6 @@ import { redactDiscovery, REDACTED_REPLACEMENT, } from 'src/utils/suite/logsUtils'; -import { StaticSessionId } from '@trezor/connect'; describe('logsUtils', () => { const account = testMocks.getWalletAccount({ diff --git a/packages/suite/src/utils/suite/__tests__/metadata.test.ts b/packages/suite/src/utils/suite/__tests__/metadata.test.ts index 6aee1c61867..50d9d639bab 100644 --- a/packages/suite/src/utils/suite/__tests__/metadata.test.ts +++ b/packages/suite/src/utils/suite/__tests__/metadata.test.ts @@ -1,4 +1,5 @@ import fs from 'fs'; + import { encrypt, decrypt, diff --git a/packages/suite/src/utils/suite/__tests__/parseUri.test.ts b/packages/suite/src/utils/suite/__tests__/parseUri.test.ts index 012c854b602..215dc886b37 100644 --- a/packages/suite/src/utils/suite/__tests__/parseUri.test.ts +++ b/packages/suite/src/utils/suite/__tests__/parseUri.test.ts @@ -1,4 +1,5 @@ import { parseUri, parseQuery } from 'src/utils/suite/parseUri'; + import * as fixtures from '../__fixtures__/parseUri'; describe('parseUri', () => { diff --git a/packages/suite/src/utils/suite/__tests__/protocol.test.ts b/packages/suite/src/utils/suite/__tests__/protocol.test.ts index d468740c766..7b7abe603ce 100644 --- a/packages/suite/src/utils/suite/__tests__/protocol.test.ts +++ b/packages/suite/src/utils/suite/__tests__/protocol.test.ts @@ -1,6 +1,7 @@ import { testMocks } from '@suite-common/test-utils'; import { getProtocolInfo } from 'src/utils/suite/protocol'; + import * as fixtures from '../__fixtures__/protocol'; jest.doMock('@trezor/suite-analytics', () => testMocks.getAnalytics()); diff --git a/packages/suite/src/utils/suite/__tests__/reload.test.ts b/packages/suite/src/utils/suite/__tests__/reload.test.ts index bd79aee15ad..0775536dc99 100644 --- a/packages/suite/src/utils/suite/__tests__/reload.test.ts +++ b/packages/suite/src/utils/suite/__tests__/reload.test.ts @@ -1,4 +1,5 @@ import { desktopApi } from '@trezor/suite-desktop-api'; + import { reloadApp } from '../reload'; describe('reloadApp', () => { diff --git a/packages/suite/src/utils/suite/__tests__/stake.test.ts b/packages/suite/src/utils/suite/__tests__/stake.test.ts index dc60baee034..fae40c39637 100644 --- a/packages/suite/src/utils/suite/__tests__/stake.test.ts +++ b/packages/suite/src/utils/suite/__tests__/stake.test.ts @@ -6,25 +6,13 @@ import TrezorConnect, { Unsuccessful, } from '@trezor/connect'; import { - transformTxFixtures, - stakeFixture, - stakeFailedFixture, - unstakeFixture, - unstakeFailedFixture, - claimFixture, - claimFailedFixture, - getStakeFormsDefaultValuesFixture, - getStakeTxGasLimitFixture, - getUnstakingPeriodInDaysFixture, - getDaysToAddToPoolFixture, - getDaysToUnstakeFixture, - getDaysToAddToPoolInitialFixture, - getAdjustedGasLimitConsumptionFixture, - getEthNetworkForWalletSdkFixture, - getInstantStakeTypeFixture, - getChangedInternalTxFixture, - simulateUnstakeFixture, -} from '../__fixtures__/stake'; + BlockchainEstimatedFee, + BlockchainEstimatedFeeLevel, +} from '@trezor/connect/src/types/api/blockchainEstimateFee'; +import { WalletAccountTransaction } from '@suite-common/wallet-types'; +import { ValidatorsQueue } from '@suite-common/wallet-core'; +import { NetworkSymbol } from '@suite-common/wallet-config'; + import { transformTx, stake, @@ -46,12 +34,25 @@ import { simulateUnstake, } from '../stake'; import { - BlockchainEstimatedFee, - BlockchainEstimatedFeeLevel, -} from '@trezor/connect/src/types/api/blockchainEstimateFee'; -import { WalletAccountTransaction } from '@suite-common/wallet-types'; -import { ValidatorsQueue } from '@suite-common/wallet-core'; -import { NetworkSymbol } from '@suite-common/wallet-config'; + transformTxFixtures, + stakeFixture, + stakeFailedFixture, + unstakeFixture, + unstakeFailedFixture, + claimFixture, + claimFailedFixture, + getStakeFormsDefaultValuesFixture, + getStakeTxGasLimitFixture, + getUnstakingPeriodInDaysFixture, + getDaysToAddToPoolFixture, + getDaysToUnstakeFixture, + getDaysToAddToPoolInitialFixture, + getAdjustedGasLimitConsumptionFixture, + getEthNetworkForWalletSdkFixture, + getInstantStakeTypeFixture, + getChangedInternalTxFixture, + simulateUnstakeFixture, +} from '../__fixtures__/stake'; describe('transformTx', () => { transformTxFixtures.forEach(test => { diff --git a/packages/suite/src/utils/suite/__tests__/theme.test.ts b/packages/suite/src/utils/suite/__tests__/theme.test.ts index 6ed9459a583..f70692f1138 100644 --- a/packages/suite/src/utils/suite/__tests__/theme.test.ts +++ b/packages/suite/src/utils/suite/__tests__/theme.test.ts @@ -1,4 +1,5 @@ import { intermediaryTheme } from '@trezor/components'; + import { getThemeColors } from '../theme'; describe('theme', () => { diff --git a/packages/suite/src/utils/suite/__tests__/tor.test.ts b/packages/suite/src/utils/suite/__tests__/tor.test.ts index f47985658ff..339bb5906a4 100644 --- a/packages/suite/src/utils/suite/__tests__/tor.test.ts +++ b/packages/suite/src/utils/suite/__tests__/tor.test.ts @@ -1,4 +1,5 @@ import { TOR_URLS } from '@trezor/urls'; + import { getTorUrlIfAvailable, getIsTorDomain, isOnionUrl } from 'src/utils/suite/tor'; describe('tor', () => { diff --git a/packages/suite/src/utils/suite/anchor.ts b/packages/suite/src/utils/suite/anchor.ts index 6ee47bd2074..49375b6e286 100644 --- a/packages/suite/src/utils/suite/anchor.ts +++ b/packages/suite/src/utils/suite/anchor.ts @@ -1,9 +1,9 @@ import { css } from 'styled-components'; -import { AccountTransactionBaseAnchor, AnchorType } from 'src/constants/suite/anchors'; +import { borders } from '@trezor/theme'; +import { AccountTransactionBaseAnchor, AnchorType } from 'src/constants/suite/anchors'; import type { WalletAccountTransaction } from 'src/types/wallet'; -import { borders } from '@trezor/theme'; export const getTxIdFromAnchor = (anchor?: string): string => anchor?.split('/').pop() || ''; diff --git a/packages/suite/src/utils/suite/l10n.ts b/packages/suite/src/utils/suite/l10n.ts index 26c027b37d1..ec798cff427 100644 --- a/packages/suite/src/utils/suite/l10n.ts +++ b/packages/suite/src/utils/suite/l10n.ts @@ -1,6 +1,7 @@ -import LANGUAGES, { Locale, TRANSLATION_PSEUDOLANGUAGE } from 'src/config/suite/languages'; import { getPlatformLanguages } from '@trezor/env-utils'; +import LANGUAGES, { Locale, TRANSLATION_PSEUDOLANGUAGE } from 'src/config/suite/languages'; + const TRANSLATION_MODE_FLAG = 'translation_mode'; const DEFAULT_LOCALE = 'en'; diff --git a/packages/suite/src/utils/suite/metadata.ts b/packages/suite/src/utils/suite/metadata.ts index d07d5eac6f3..1b07dde17ea 100644 --- a/packages/suite/src/utils/suite/metadata.ts +++ b/packages/suite/src/utils/suite/metadata.ts @@ -1,9 +1,11 @@ import * as crypto from 'crypto'; import base58check from 'bs58check'; -import { FetchIntervalTrackingId } from 'src/actions/suite/metadataProviderActions'; + import { DataType, MetadataProvider } from '@suite-common/metadata-types'; import { StaticSessionId } from '@trezor/connect'; +import { FetchIntervalTrackingId } from 'src/actions/suite/metadataProviderActions'; + // note we only need base58 conversion fn from base58check, other functions from there might // be supplemented from crypto module diff --git a/packages/suite/src/utils/suite/notification.ts b/packages/suite/src/utils/suite/notification.ts index 03a19d27cee..c80db2caac5 100644 --- a/packages/suite/src/utils/suite/notification.ts +++ b/packages/suite/src/utils/suite/notification.ts @@ -1,7 +1,8 @@ import { NotificationEntry } from '@suite-common/toast-notifications'; +import { intermediaryTheme } from '@trezor/components'; + import { ToastNotificationVariant, AppState } from 'src/types/suite'; import type { NotificationViewProps } from 'src/components/suite'; -import { intermediaryTheme } from '@trezor/components'; export const getNotificationIcon = (variant: ToastNotificationVariant) => { switch (variant) { diff --git a/packages/suite/src/utils/suite/oauth.ts b/packages/suite/src/utils/suite/oauth.ts index 7c98f62f29c..dbe7dbc8a31 100644 --- a/packages/suite/src/utils/suite/oauth.ts +++ b/packages/suite/src/utils/suite/oauth.ts @@ -1,7 +1,8 @@ import { desktopApi } from '@trezor/suite-desktop-api'; +import { Deferred, createDeferred } from '@trezor/utils'; + import { getPrefixedURL } from 'src/utils/suite/router'; import { METADATA_PROVIDER } from 'src/actions/suite/constants'; -import { Deferred, createDeferred } from '@trezor/utils'; import { urlHashParams, urlSearchParams } from 'src/utils/suite/metadata'; /** diff --git a/packages/suite/src/utils/suite/prerequisites.ts b/packages/suite/src/utils/suite/prerequisites.ts index ff5ce7f5559..5c3521dae4a 100644 --- a/packages/suite/src/utils/suite/prerequisites.ts +++ b/packages/suite/src/utils/suite/prerequisites.ts @@ -1,7 +1,9 @@ import type { TransportInfo } from '@trezor/connect'; import { DefinedUnionMember } from '@trezor/type-utils'; + import { RouterState } from 'src/reducers/suite/routerReducer'; import type { TrezorDevice, AppState } from 'src/types/suite'; + import { isAdditionalShamirBackupInProgress, isRecoveryInProgress, diff --git a/packages/suite/src/utils/suite/protocol.ts b/packages/suite/src/utils/suite/protocol.ts index c58918adbb7..9547bbda122 100644 --- a/packages/suite/src/utils/suite/protocol.ts +++ b/packages/suite/src/utils/suite/protocol.ts @@ -1,8 +1,9 @@ import { Protocol } from '@suite-common/suite-constants'; import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; -import { parseQuery, parseUri } from './parseUri'; import { analytics, EventType } from '@trezor/suite-analytics'; +import { parseQuery, parseUri } from './parseUri'; + export type CoinProtocolInfo = { scheme: Protocol; address: string; diff --git a/packages/suite/src/utils/suite/stake.ts b/packages/suite/src/utils/suite/stake.ts index 96d70b7cd50..fcfddfd99f7 100644 --- a/packages/suite/src/utils/suite/stake.ts +++ b/packages/suite/src/utils/suite/stake.ts @@ -1,3 +1,6 @@ +import { selectNetwork } from '@everstake/wallet-sdk/ethereum'; +import { fromWei, numberToHex, toWei } from 'web3-utils'; + import { PrecomposedLevels, StakeFormState, @@ -11,13 +14,12 @@ import { MAX_ETH_AMOUNT_FOR_STAKING, } from '@suite-common/wallet-constants'; import { NetworkSymbol } from '@suite-common/wallet-config'; -import { selectNetwork } from '@everstake/wallet-sdk/ethereum'; -import { fromWei, numberToHex, toWei } from 'web3-utils'; import { getEthereumEstimateFeeParams, isPending, sanitizeHex } from '@suite-common/wallet-utils'; import TrezorConnect, { EthereumTransaction, Success, InternalTransfer } from '@trezor/connect'; import { BigNumber } from '@trezor/utils/src/bigNumber'; import { ValidatorsQueue } from '@suite-common/wallet-core'; import { BlockchainEstimatedFee } from '@trezor/connect/src/types/api/blockchainEstimateFee'; + import { TranslationFunction } from 'src/hooks/suite/useTranslation'; // source is a required parameter for some functions in the Everstake Wallet SDK. diff --git a/packages/suite/src/utils/suite/storage.ts b/packages/suite/src/utils/suite/storage.ts index d1c158a03ed..3b27a8d655f 100644 --- a/packages/suite/src/utils/suite/storage.ts +++ b/packages/suite/src/utils/suite/storage.ts @@ -1,9 +1,9 @@ import { Discovery } from '@suite-common/wallet-types'; import { connectInitThunk } from '@suite-common/connect-init'; +import { DeviceWithEmptyPath } from '@suite-common/suite-types'; import { AcquiredDevice } from 'src/types/suite'; import { CoinjoinAccount } from 'src/types/wallet/coinjoin'; -import { DeviceWithEmptyPath } from '@suite-common/suite-types'; /** * Strip unserializable fields from Discovery (eg. promises) diff --git a/packages/suite/src/utils/suite/theme.ts b/packages/suite/src/utils/suite/theme.ts index 400dbad7e91..677ab210636 100644 --- a/packages/suite/src/utils/suite/theme.ts +++ b/packages/suite/src/utils/suite/theme.ts @@ -1,4 +1,5 @@ import { intermediaryTheme } from '@trezor/components/src/config/colors'; + import type { AppState } from 'src/types/suite'; export const getThemeColors = (theme: AppState['suite']['settings']['theme']) => { diff --git a/packages/suite/src/utils/suite/tor.ts b/packages/suite/src/utils/suite/tor.ts index 2ccb0c2e90b..f5d7f210f55 100644 --- a/packages/suite/src/utils/suite/tor.ts +++ b/packages/suite/src/utils/suite/tor.ts @@ -1,5 +1,6 @@ import { parseHostname, urlToOnion } from '@trezor/utils'; import { TOR_URLS } from '@trezor/urls'; + import { TorStatus } from 'src/types/suite'; /** diff --git a/packages/suite/src/utils/suite/validation.ts b/packages/suite/src/utils/suite/validation.ts index f44859140d1..8701e8a50f7 100644 --- a/packages/suite/src/utils/suite/validation.ts +++ b/packages/suite/src/utils/suite/validation.ts @@ -10,6 +10,7 @@ import { networkAmountToSmallestUnit, } from '@suite-common/wallet-utils'; import { BigNumber } from '@trezor/utils/src/bigNumber'; + import { TranslationFunction } from 'src/hooks/suite/useTranslation'; import { AmountLimits } from 'src/types/wallet/coinmarketCommonTypes'; diff --git a/packages/suite/src/utils/wallet/__fixtures__/coinjoinUtils.ts b/packages/suite/src/utils/wallet/__fixtures__/coinjoinUtils.ts index cf2acb0c5e0..62a0af28506 100644 --- a/packages/suite/src/utils/wallet/__fixtures__/coinjoinUtils.ts +++ b/packages/suite/src/utils/wallet/__fixtures__/coinjoinUtils.ts @@ -1,5 +1,7 @@ import { RoundPhase, SessionPhase } from '@trezor/coinjoin'; + import { ANONYMITY_GAINS_HINDSIGHT_COUNT } from 'src/services/coinjoin'; + import * as coinjoinUtils from '../coinjoinUtils'; const baseUtxo = { diff --git a/packages/suite/src/utils/wallet/accountUtils.ts b/packages/suite/src/utils/wallet/accountUtils.ts index 344f3e18be4..18557c67c5c 100644 --- a/packages/suite/src/utils/wallet/accountUtils.ts +++ b/packages/suite/src/utils/wallet/accountUtils.ts @@ -1,5 +1,6 @@ import { Account } from '@suite-common/wallet-types'; import { StaticSessionId } from '@trezor/connect'; + import { WalletParams } from 'src/types/wallet'; export const getSelectedAccount = ( diff --git a/packages/suite/src/utils/wallet/coinjoinUtils.ts b/packages/suite/src/utils/wallet/coinjoinUtils.ts index 1979e2319f6..5ee6b932844 100644 --- a/packages/suite/src/utils/wallet/coinjoinUtils.ts +++ b/packages/suite/src/utils/wallet/coinjoinUtils.ts @@ -1,21 +1,9 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; import { createHash } from 'crypto'; import hoursToMilliseconds from 'date-fns/hoursToMilliseconds'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { getUtxoOutpoint, getBip43Type } from '@suite-common/wallet-utils'; import { Account, SelectedAccountStatus } from '@suite-common/wallet-types'; -import { - ANONYMITY_GAINS_HINDSIGHT_COUNT, - ANONYMITY_GAINS_HINDSIGHT_DAYS, - MAX_ROUNDS_ALLOWED, - ESTIMATED_MIN_ROUNDS_NEEDED, - SKIP_ROUNDS_VALUE_WHEN_ENABLED, -} from 'src/services/coinjoin/config'; -import { - AnonymityGainPerRound, - CoinjoinAccount, - CoinjoinSessionParameters, -} from 'src/types/wallet/coinjoin'; import { AnonymitySet } from '@trezor/blockchain-link'; import { CoinjoinStatusEvent, @@ -25,6 +13,19 @@ import { RoundPhase, } from '@trezor/coinjoin'; +import { + AnonymityGainPerRound, + CoinjoinAccount, + CoinjoinSessionParameters, +} from 'src/types/wallet/coinjoin'; +import { + ANONYMITY_GAINS_HINDSIGHT_COUNT, + ANONYMITY_GAINS_HINDSIGHT_DAYS, + MAX_ROUNDS_ALLOWED, + ESTIMATED_MIN_ROUNDS_NEEDED, + SKIP_ROUNDS_VALUE_WHEN_ENABLED, +} from 'src/services/coinjoin/config'; + export type CoinjoinBalanceBreakdown = { notAnonymized: string; anonymized: string; diff --git a/packages/suite/src/utils/wallet/coinmarket/__fixtures__/exchangeUtils.ts b/packages/suite/src/utils/wallet/coinmarket/__fixtures__/exchangeUtils.ts index b2aec6c3b5b..22acce6e521 100644 --- a/packages/suite/src/utils/wallet/coinmarket/__fixtures__/exchangeUtils.ts +++ b/packages/suite/src/utils/wallet/coinmarket/__fixtures__/exchangeUtils.ts @@ -1,6 +1,7 @@ -import { ExchangeInfo } from 'src/actions/wallet/coinmarketExchangeActions'; import { CryptoId, ExchangeTrade } from 'invity-api'; +import { ExchangeInfo } from 'src/actions/wallet/coinmarketExchangeActions'; + const litecoin = 'litecoin' as CryptoId; const bitcoin = 'bitcoin' as CryptoId; const ethereum = 'ethereum' as CryptoId; diff --git a/packages/suite/src/utils/wallet/coinmarket/__tests__/coinmarketUtils.test.ts b/packages/suite/src/utils/wallet/coinmarket/__tests__/coinmarketUtils.test.ts index ec8cab06f83..f1903751d76 100644 --- a/packages/suite/src/utils/wallet/coinmarket/__tests__/coinmarketUtils.test.ts +++ b/packages/suite/src/utils/wallet/coinmarket/__tests__/coinmarketUtils.test.ts @@ -1,3 +1,5 @@ +import { CryptoId } from 'invity-api'; + import { Account } from 'src/types/wallet'; import { buildFiatOption, @@ -24,7 +26,6 @@ import { import * as BUY_FIXTURE from 'src/utils/wallet/coinmarket/__fixtures__/buyUtils'; import * as SELL_FIXTURE from 'src/utils/wallet/coinmarket/__fixtures__/sellUtils'; import * as EXCHANGE_FIXTURE from 'src/utils/wallet/coinmarket/__fixtures__/exchangeUtils'; -import { CryptoId } from 'invity-api'; import { useDefaultAccountLabel } from 'src/hooks/suite/useDefaultAccountLabel'; jest.mock('src/hooks/suite/useDefaultAccountLabel', () => ({ diff --git a/packages/suite/src/utils/wallet/coinmarket/__tests__/exchangeUtils.test.ts b/packages/suite/src/utils/wallet/coinmarket/__tests__/exchangeUtils.test.ts index 61a303de716..28cbc86198d 100644 --- a/packages/suite/src/utils/wallet/coinmarket/__tests__/exchangeUtils.test.ts +++ b/packages/suite/src/utils/wallet/coinmarket/__tests__/exchangeUtils.test.ts @@ -1,4 +1,5 @@ import { CryptoId } from 'invity-api'; + import * as fixtures from 'src/utils/wallet/coinmarket/__fixtures__/exchangeUtils'; import { coinmarketGetExchangeReceiveCryptoId, diff --git a/packages/suite/src/utils/wallet/coinmarket/buyUtils.ts b/packages/suite/src/utils/wallet/coinmarket/buyUtils.ts index 081f3ab1a57..e1e1c098931 100644 --- a/packages/suite/src/utils/wallet/coinmarket/buyUtils.ts +++ b/packages/suite/src/utils/wallet/coinmarket/buyUtils.ts @@ -1,8 +1,10 @@ +import { BuyTrade, BuyTradeQuoteRequest, BuyTradeStatus } from 'invity-api'; + import { desktopApi } from '@trezor/suite-desktop-api'; +import { isDesktop, getLocationOrigin } from '@trezor/env-utils'; + import { Account } from 'src/types/wallet'; import { AmountLimits } from 'src/types/wallet/coinmarketCommonTypes'; -import { BuyTrade, BuyTradeQuoteRequest, BuyTradeStatus } from 'invity-api'; -import { isDesktop, getLocationOrigin } from '@trezor/env-utils'; // loop through quotes and if all quotes are either with error below minimum or over maximum, return the limits export function getAmountLimits( diff --git a/packages/suite/src/utils/wallet/coinmarket/coinmarketTypingUtils.ts b/packages/suite/src/utils/wallet/coinmarket/coinmarketTypingUtils.ts index b351264d44e..99748192eae 100644 --- a/packages/suite/src/utils/wallet/coinmarket/coinmarketTypingUtils.ts +++ b/packages/suite/src/utils/wallet/coinmarket/coinmarketTypingUtils.ts @@ -1,5 +1,7 @@ -import { CurrencyOption } from '@suite-common/wallet-types'; import { BuyTrade, ExchangeTrade, SellFiatTrade } from 'invity-api'; + +import { CurrencyOption } from '@suite-common/wallet-types'; + import { FORM_FIAT_CURRENCY_SELECT, FORM_OUTPUT_CURRENCY, diff --git a/packages/suite/src/utils/wallet/coinmarket/coinmarketUtils.ts b/packages/suite/src/utils/wallet/coinmarket/coinmarketUtils.ts index 5866a53618a..61197b7ba10 100644 --- a/packages/suite/src/utils/wallet/coinmarket/coinmarketUtils.ts +++ b/packages/suite/src/utils/wallet/coinmarket/coinmarketUtils.ts @@ -1,4 +1,6 @@ -import { Account } from 'src/types/wallet'; +import { BuyTrade, SellFiatTrade, CryptoId } from 'invity-api'; +import { v4 as uuidv4 } from 'uuid'; + import { Network, NetworkSymbol, @@ -9,15 +11,17 @@ import { networks, } from '@suite-common/wallet-config'; import TrezorConnect from '@trezor/connect'; -import regional from 'src/constants/wallet/coinmarket/regional'; -import { ExtendedMessageDescriptor, TrezorDevice } from 'src/types/suite'; -import { BuyTrade, SellFiatTrade, CryptoId } from 'invity-api'; import { DefinitionType, isTokenDefinitionKnown } from '@suite-common/token-definitions'; import { getContractAddressForNetwork, substituteBip43Path, sortByCoin, } from '@suite-common/wallet-utils'; +import { BigNumber } from '@trezor/utils'; + +import { Account } from 'src/types/wallet'; +import regional from 'src/constants/wallet/coinmarket/regional'; +import { ExtendedMessageDescriptor, TrezorDevice } from 'src/types/suite'; import { CoinmarketAccountOptionsGroupOptionProps, CoinmarketAccountsOptionsGroupProps, @@ -31,8 +35,8 @@ import { CoinmarketTradeDetailType, CoinmarketTradeType, } from 'src/types/coinmarket/coinmarket'; -import { v4 as uuidv4 } from 'uuid'; -import { BigNumber } from '@trezor/utils'; + + export const cryptoPlatformSeparator = '--'; diff --git a/packages/suite/src/utils/wallet/coinmarket/exchangeUtils.ts b/packages/suite/src/utils/wallet/coinmarket/exchangeUtils.ts index 4cadb0b9a37..c2b8f1d4ae3 100644 --- a/packages/suite/src/utils/wallet/coinmarket/exchangeUtils.ts +++ b/packages/suite/src/utils/wallet/coinmarket/exchangeUtils.ts @@ -1,6 +1,7 @@ +import { CryptoId, ExchangeTrade, ExchangeTradeStatus } from 'invity-api'; + import { ExchangeInfo } from 'src/actions/wallet/coinmarketExchangeActions'; import { CryptoAmountLimits } from 'src/types/wallet/coinmarketCommonTypes'; -import { CryptoId, ExchangeTrade, ExchangeTradeStatus } from 'invity-api'; import { RateType } from 'src/types/coinmarket/coinmarketForm'; import { FORM_DEFAULT_CRYPTO_CURRENCY, diff --git a/packages/suite/src/utils/wallet/coinmarket/sellUtils.ts b/packages/suite/src/utils/wallet/coinmarket/sellUtils.ts index a160e5f03a8..82313b0f73f 100644 --- a/packages/suite/src/utils/wallet/coinmarket/sellUtils.ts +++ b/packages/suite/src/utils/wallet/coinmarket/sellUtils.ts @@ -1,8 +1,10 @@ +import { SellFiatTrade, SellFiatTradeQuoteRequest, SellTradeStatus } from 'invity-api'; + import { desktopApi } from '@trezor/suite-desktop-api'; +import { isDesktop, getLocationOrigin } from '@trezor/env-utils'; + import { Account } from 'src/types/wallet'; import { AmountLimits } from 'src/types/wallet/coinmarketCommonTypes'; -import { SellFiatTrade, SellFiatTradeQuoteRequest, SellTradeStatus } from 'invity-api'; -import { isDesktop, getLocationOrigin } from '@trezor/env-utils'; import { ComposedTransactionInfo } from 'src/reducers/wallet/coinmarketReducer'; // loop through quotes and if all quotes are either with error below minimum or over maximum, return the limits diff --git a/packages/suite/src/utils/wallet/exportTransactionsUtils.ts b/packages/suite/src/utils/wallet/exportTransactionsUtils.ts index cfcb4a4e281..8dfb1b731e2 100644 --- a/packages/suite/src/utils/wallet/exportTransactionsUtils.ts +++ b/packages/suite/src/utils/wallet/exportTransactionsUtils.ts @@ -15,7 +15,6 @@ import { } from '@suite-common/wallet-types'; import { TransactionTarget } from '@trezor/connect'; import { BigNumber } from '@trezor/utils/src/bigNumber'; - import { formatAmount, formatNetworkAmount, diff --git a/packages/suite/src/utils/wallet/graph/utils.ts b/packages/suite/src/utils/wallet/graph/utils.ts index 3c937ba3bd7..d0a8971f435 100644 --- a/packages/suite/src/utils/wallet/graph/utils.ts +++ b/packages/suite/src/utils/wallet/graph/utils.ts @@ -1,15 +1,17 @@ +import { differenceInMonths } from 'date-fns'; + import { getFiatRatesForTimestamps } from '@suite-common/fiat-services'; import { resetTime } from '@suite-common/suite-utils'; import { networks, type NetworkSymbol } from '@suite-common/wallet-config'; import { Account } from '@suite-common/wallet-types'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { differenceInMonths } from 'date-fns'; +import type { BlockchainAccountBalanceHistory, StaticSessionId } from '@trezor/connect'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; import { CommonAggregatedHistory, GraphData, GraphRange, GraphScale } from 'src/types/wallet/graph'; -import type { BlockchainAccountBalanceHistory, StaticSessionId } from '@trezor/connect'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; + import { ObjectType, TypeName, sumFiatValueMapInPlace } from './utilsShared'; export const deviceGraphDataFilterFn = (d: GraphData, deviceState: StaticSessionId | undefined) => { diff --git a/packages/suite/src/utils/wallet/graph/utilsShared.ts b/packages/suite/src/utils/wallet/graph/utilsShared.ts index 73b6cbeeea2..cb3391b795f 100644 --- a/packages/suite/src/utils/wallet/graph/utilsShared.ts +++ b/packages/suite/src/utils/wallet/graph/utilsShared.ts @@ -1,4 +1,5 @@ import { BigNumber } from '@trezor/utils/src/bigNumber'; + import { AggregatedAccountHistory, AggregatedDashboardHistory } from 'src/types/wallet/graph'; export type ObjectType = T extends 'account' diff --git a/packages/suite/src/utils/wallet/graph/utilsWorker.ts b/packages/suite/src/utils/wallet/graph/utilsWorker.ts index 09232846a3b..de731ad8238 100644 --- a/packages/suite/src/utils/wallet/graph/utilsWorker.ts +++ b/packages/suite/src/utils/wallet/graph/utilsWorker.ts @@ -1,14 +1,16 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; import { fromUnixTime, getUnixTime, startOfMonth } from 'date-fns'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; +import type { FiatRatesBySymbol } from '@trezor/connect'; +import { toFiatCurrency } from '@suite-common/wallet-utils'; + import { AggregatedAccountHistory, AggregatedDashboardHistory, GraphData, } from 'src/types/wallet/graph'; + import { ObjectType, TypeName, sumFiatValueMapInPlace } from './utilsShared'; -import type { FiatRatesBySymbol } from '@trezor/connect'; -import { toFiatCurrency } from '@suite-common/wallet-utils'; const calcFiatValueMap = ( amount: string, diff --git a/packages/suite/src/utils/wallet/tokenUtils.ts b/packages/suite/src/utils/wallet/tokenUtils.ts index e6d0d304fdf..dd33b401c64 100644 --- a/packages/suite/src/utils/wallet/tokenUtils.ts +++ b/packages/suite/src/utils/wallet/tokenUtils.ts @@ -1,5 +1,4 @@ import { BigNumber } from '@trezor/utils/src/bigNumber'; - import { Account, Rate, TokenAddress, RatesByKey } from '@suite-common/wallet-types'; import { TokenInfo } from '@trezor/connect'; import { getFiatRateKey, isTokenMatchesSearch } from '@suite-common/wallet-utils'; diff --git a/packages/suite/src/views/dashboard/AssetsView/ArrowIcon.tsx b/packages/suite/src/views/dashboard/AssetsView/ArrowIcon.tsx index 41c863276c6..f11ecd7729b 100644 --- a/packages/suite/src/views/dashboard/AssetsView/ArrowIcon.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/ArrowIcon.tsx @@ -1,6 +1,7 @@ +import styled, { css } from 'styled-components'; + import { Icon } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; -import styled, { css } from 'styled-components'; // eslint-disable-next-line local-rules/no-override-ds-component export const ArrowIcon = styled(Icon)` diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx index 477a86e5360..349420228c9 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx @@ -1,16 +1,10 @@ import React from 'react'; +import { useDispatch } from 'react-redux'; + import styled, { useTheme } from 'styled-components'; -import { Network } from '@suite-common/wallet-config'; -import { - AmountUnitSwitchWrapper, - CoinBalance, - PriceTicker, - Translation, - TrendTicker, -} from 'src/components/suite'; +import { Network } from '@suite-common/wallet-config'; import { spacings, spacingsPx, typography } from '@trezor/theme'; - import { Card, Column, @@ -21,22 +15,38 @@ import { variables, Text, } from '@trezor/components'; -import { useDispatch } from 'react-redux'; -import { useAccountSearch, useLoadingSkeleton, useSelector } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { AssetFiatBalance } from '@suite-common/assets'; -import { FiatHeader } from 'src/components/wallet/FiatHeader'; -import { ArrowIcon, styledHoverOnParentOfArrowIcon } from '../ArrowIcon'; -import { CoinmarketBuyButton } from '../CoinmarketBuyButton'; -import { AssetCardInfo, AssetCardInfoSkeleton } from './AssetCardInfo'; -import { useFiatFromCryptoValue } from 'src/hooks/suite/useFiatFromCryptoValue'; import { TokenInfo } from '@trezor/connect'; import { Account, RatesByKey } from '@suite-common/wallet-types'; -import { AssetCardTokensAndStakingInfo } from './AssetCardTokensAndStakingInfo'; import { isTestnet } from '@suite-common/wallet-utils'; import { selectAssetAccountsThatStaked } from '@suite-common/wallet-core'; import { selectCoinDefinitions } from '@suite-common/token-definitions'; + import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { + AmountUnitSwitchWrapper, + CoinBalance, + PriceTicker, + Translation, + TrendTicker, +} from 'src/components/suite'; + + +import { useAccountSearch, useLoadingSkeleton, useSelector } from 'src/hooks/suite'; +import { goto } from 'src/actions/suite/routerActions'; + + +import { FiatHeader } from 'src/components/wallet/FiatHeader'; +import { useFiatFromCryptoValue } from 'src/hooks/suite/useFiatFromCryptoValue'; + +import { ArrowIcon, styledHoverOnParentOfArrowIcon } from '../ArrowIcon'; +import { CoinmarketBuyButton } from '../CoinmarketBuyButton'; +import { AssetCardInfo, AssetCardInfoSkeleton } from './AssetCardInfo'; + + +import { AssetCardTokensAndStakingInfo } from './AssetCardTokensAndStakingInfo'; + + import { handleTokensAndStakingData } from '../assetsViewUtils'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardInfo.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardInfo.tsx index 7256baef3ac..6f1070c936a 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardInfo.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardInfo.tsx @@ -1,11 +1,13 @@ -import { Network } from '@suite-common/wallet-config'; import React from 'react'; + +import { Network } from '@suite-common/wallet-config'; import { AssetFiatBalance } from '@suite-common/assets'; -import { AssetCoinLogo, AssetCoinLogoSkeleton } from '../AssetCoinLogo'; -import { AssetCoinName, AssetCoinNameSkeleton } from '../AssetCoinName'; import { Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { AssetCoinLogo, AssetCoinLogoSkeleton } from '../AssetCoinLogo'; +import { AssetCoinName, AssetCoinNameSkeleton } from '../AssetCoinName'; + type AssetInfoProps = { network: Network; assetsFiatBalances?: AssetFiatBalance[]; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardTokensAndStakingInfo.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardTokensAndStakingInfo.tsx index 96807370029..b6964372a1f 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardTokensAndStakingInfo.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardTokensAndStakingInfo.tsx @@ -1,9 +1,10 @@ import { Row, Column, Icon, Divider, Text } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { spacings } from '@trezor/theme'; +import { Account } from '@suite-common/wallet-types'; + import { CoinBalance, FiatValue, HiddenPlaceholder, Translation } from 'src/components/suite'; import { TokenIconSetWrapper } from 'src/components/wallet/TokenIconSetWrapper'; -import { Account } from '@suite-common/wallet-types'; type AssetCardTokensAndStakingInfoProps = { symbol: NetworkSymbol; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetCoinLogo.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetCoinLogo.tsx index b9bd8a7dd42..855843257e8 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCoinLogo.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCoinLogo.tsx @@ -6,9 +6,10 @@ import { import { Row, SkeletonCircle, Tooltip } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { localizePercentage } from '@suite-common/wallet-utils'; +import { AssetShareIndicator } from '@trezor/product-components'; + import { selectLanguage } from 'src/reducers/suite/suiteReducer'; import { useSelector } from 'src/hooks/suite'; -import { AssetShareIndicator } from '@trezor/product-components'; type AssetCoinLogoProps = { symbol: NetworkSymbol; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetCoinName.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetCoinName.tsx index 6cd6b8e0bb0..dd7df972804 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCoinName.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCoinName.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; + import { Network } from '@suite-common/wallet-config'; import { selectVisibleNonEmptyDeviceAccountsByNetworkSymbol } from '@suite-common/wallet-core'; import { Icon, SkeletonRectangle } from '@trezor/components'; import { spacingsPx, typography } from '@trezor/theme'; + import { useSelector } from 'src/hooks/suite'; const WalletContent = styled.div` diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRow.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRow.tsx index c86299783a2..9d8783ba132 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRow.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRow.tsx @@ -1,7 +1,18 @@ import { memo } from 'react'; + import { useTheme } from 'styled-components'; + import { Network } from '@suite-common/wallet-config'; import { Icon, Table, Row, IconButton, Column, Text } from '@trezor/components'; +import { isTestnet } from '@suite-common/wallet-utils'; +import { spacings } from '@trezor/theme'; +import { TokenInfo } from '@trezor/blockchain-link-types'; +import { selectCoinDefinitions } from '@suite-common/token-definitions'; +import { selectAssetAccountsThatStaked } from '@suite-common/wallet-core'; +import { Account, RatesByKey } from '@suite-common/wallet-types'; +import { AssetFiatBalance } from '@suite-common/assets'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; + import { AmountUnitSwitchWrapper, CoinBalance, @@ -10,23 +21,16 @@ import { Translation, TrendTicker, } from 'src/components/suite'; -import { isTestnet } from '@suite-common/wallet-utils'; import { goto } from 'src/actions/suite/routerActions'; import { useAccountSearch, useDispatch, useSelector } from 'src/hooks/suite'; -import { spacings } from '@trezor/theme'; +import { TokenIconSetWrapper } from 'src/components/wallet/TokenIconSetWrapper'; + import { AssetCoinLogo } from '../AssetCoinLogo'; import { AssetCoinName } from '../AssetCoinName'; import { CoinmarketBuyButton } from '../CoinmarketBuyButton'; -import { TokenInfo } from '@trezor/blockchain-link-types'; import { AssetTokenRow } from './AssetTokenRow'; -import { selectCoinDefinitions } from '@suite-common/token-definitions'; -import { selectAssetAccountsThatStaked } from '@suite-common/wallet-core'; -import { Account, RatesByKey } from '@suite-common/wallet-types'; import { AssetStakingRow } from './AssetStakingRow'; -import { AssetFiatBalance } from '@suite-common/assets'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; import { AssetTableExtraRowsSection as Section } from './AssetTableExtraRowsSection'; -import { TokenIconSetWrapper } from 'src/components/wallet/TokenIconSetWrapper'; import { handleTokensAndStakingData } from '../assetsViewUtils'; export interface AssetTableRowProps { diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRowSkeleton.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRowSkeleton.tsx index 144931ace3d..4dc79e0d93b 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRowSkeleton.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRowSkeleton.tsx @@ -1,7 +1,9 @@ import { Row, Table, SkeletonRectangle } from '@trezor/components'; -import { AssetCoinLogoSkeleton } from '../AssetCoinLogo'; + import { useLoadingSkeleton } from 'src/hooks/suite'; +import { AssetCoinLogoSkeleton } from '../AssetCoinLogo'; + type AssetRowSkeletonProps = { isAnimating?: boolean; }; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetStakingRow.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetStakingRow.tsx index cbb3d5f1148..ef8cfffd3ab 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetStakingRow.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetStakingRow.tsx @@ -1,7 +1,9 @@ import { Column, Icon, Table, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { CoinBalance, HiddenPlaceholder, Translation, FiatValue } from 'src/components/suite'; import { NetworkSymbol } from '@suite-common/wallet-config'; + +import { CoinBalance, HiddenPlaceholder, Translation, FiatValue } from 'src/components/suite'; + import { AssetTableExtraRowsSection as Section } from './AssetTableExtraRowsSection'; interface AssetStakingRowProps { diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTable.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTable.tsx index 773eccec223..59bda778420 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTable.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTable.tsx @@ -1,13 +1,15 @@ -import { AssetRow } from './AssetRow'; -import { AssetRowSkeleton } from './AssetRowSkeleton'; -import { AssetData } from '../AssetsView'; import { Table } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Translation } from 'src/components/suite'; import { AssetFiatBalance } from '@suite-common/assets'; import { RatesByKey } from '@suite-common/wallet-types'; import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { Translation } from 'src/components/suite'; + +import { AssetData } from '../AssetsView'; +import { AssetRowSkeleton } from './AssetRowSkeleton'; +import { AssetRow } from './AssetRow'; + interface AssetTableProps { discoveryInProgress?: boolean; assetsData: AssetData[]; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTableExtraRowsSection.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTableExtraRowsSection.tsx index 2fb4b0f2fb5..a4965756463 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTableExtraRowsSection.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTableExtraRowsSection.tsx @@ -1,4 +1,5 @@ import styled, { css } from 'styled-components'; + import { borders } from '@trezor/theme'; type DashedLinePosition = 'middleToBottom' | 'topToBottom' | 'topToMiddle'; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTokenRow.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTokenRow.tsx index 089c53ec3e1..3b38bd7b533 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTokenRow.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTokenRow.tsx @@ -1,8 +1,10 @@ import { Table } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { Network } from '@suite-common/wallet-config'; + import { FiatValue, Translation } from 'src/components/suite'; + import { AssetTableExtraRowsSection as Section } from './AssetTableExtraRowsSection'; -import { Network } from '@suite-common/wallet-config'; interface AssetTokenProps { tokenIconSetWrapper: React.ReactNode; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx index c7f1ee7a94d..c0babb42700 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx @@ -1,33 +1,35 @@ import styled, { useTheme } from 'styled-components'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Icon, Button, LoadingContent, Card, Row } from '@trezor/components'; import { selectCurrentFiatRates } from '@suite-common/wallet-core'; - -import { DashboardSection } from 'src/components/dashboard'; -import { Account } from 'src/types/wallet'; -import { Translation } from 'src/components/suite'; -import { useDiscovery, useDispatch, useLayoutSize, useSelector } from 'src/hooks/suite'; -import { useAccounts } from 'src/hooks/wallet'; -import { setFlag } from 'src/actions/suite/suiteActions'; -import { goto } from 'src/actions/suite/routerActions'; import { TokenInfo } from '@trezor/blockchain-link-types'; import { AssetFiatBalance } from '@suite-common/assets'; - -import { AssetCard, AssetCardSkeleton } from './AssetCard/AssetCard'; import { spacings, spacingsPx, typography } from '@trezor/theme'; import { getFiatRateKey, toFiatCurrency, isSupportedEthStakingNetworkSymbol, } from '@suite-common/wallet-utils'; -import { selectEnabledNetworks, selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { AssetTable } from './AssetTable/AssetTable'; import { NetworkSymbol, getNetwork, Network } from '@suite-common/wallet-config'; import { RatesByKey } from '@suite-common/wallet-types'; import { FiatCurrencyCode } from '@suite-common/suite-config'; + +import { DashboardSection } from 'src/components/dashboard'; +import { Account } from 'src/types/wallet'; +import { Translation } from 'src/components/suite'; +import { useDiscovery, useDispatch, useLayoutSize, useSelector } from 'src/hooks/suite'; +import { useAccounts } from 'src/hooks/wallet'; +import { setFlag } from 'src/actions/suite/suiteActions'; +import { goto } from 'src/actions/suite/routerActions'; +import { selectEnabledNetworks, selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; +import { AssetCard, AssetCardSkeleton } from './AssetCard/AssetCard'; +import { AssetTable } from './AssetTable/AssetTable'; + + + const InfoMessage = styled.div` padding: ${spacingsPx.md} ${spacingsPx.xl}; display: flex; diff --git a/packages/suite/src/views/dashboard/AssetsView/CoinmarketBuyButton.tsx b/packages/suite/src/views/dashboard/AssetsView/CoinmarketBuyButton.tsx index ac58a433dd6..a0f5c6ac90d 100644 --- a/packages/suite/src/views/dashboard/AssetsView/CoinmarketBuyButton.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/CoinmarketBuyButton.tsx @@ -1,10 +1,14 @@ -import * as routerActions from 'src/actions/suite/routerActions'; +import { MouseEvent } from 'react'; + import { Button } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import { EventType, analytics } from '@trezor/suite-analytics'; + +import * as routerActions from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite'; import { useDispatch, useAccountSearch } from 'src/hooks/suite'; -import { EventType, analytics } from '@trezor/suite-analytics'; -import { MouseEvent } from 'react'; + + type CoinmarketBuyButtonProps = { symbol: NetworkSymbol; diff --git a/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts b/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts index df8c391c29f..7ffc7ebe78e 100644 --- a/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts +++ b/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts @@ -1,8 +1,3 @@ -import { - enhanceTokensWithRates, - getTokens, - sortTokensWithRates, -} from 'src/utils/wallet/tokenUtils'; import { FiatCurrencyCode } from '@suite-common/suite-config'; import { TokenDefinition } from '@suite-common/token-definitions'; @@ -12,6 +7,12 @@ import { TokenInfo } from '@trezor/connect'; import { BigNumber } from '@trezor/utils'; import { getAccountTotalStakingBalance } from '@suite-common/wallet-utils'; +import { + enhanceTokensWithRates, + getTokens, + sortTokensWithRates, +} from 'src/utils/wallet/tokenUtils'; + export const handleTokensAndStakingData = ( assetTokens: TokenInfo[], accountsThatStaked: Account[], diff --git a/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx b/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx index 1502b4597fd..88b3026cc08 100644 --- a/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx +++ b/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx @@ -1,16 +1,21 @@ +import { useState } from 'react'; + +import { AnimatePresence, motion } from 'framer-motion'; +import styled from 'styled-components'; + import { selectDevice } from '@suite-common/wallet-core'; import { Banner, Text, Button, IconButton, Row, Column } from '@trezor/components'; -import { AnimatePresence, motion } from 'framer-motion'; -import { useState } from 'react'; +import { WalletType } from '@suite-common/wallet-types'; + import { goto } from 'src/actions/suite/routerActions'; import { setFlag } from 'src/actions/suite/suiteActions'; import { Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useDiscovery, useDispatch, useSelector } from 'src/hooks/suite'; import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; + import { bannerAnimationConfig } from './banner-animations'; -import { WalletType } from '@suite-common/wallet-types'; -import styled from 'styled-components'; + const Container = styled(motion.div)` width: 100%; diff --git a/packages/suite/src/views/dashboard/PortfolioCard/EmptyWallet.tsx b/packages/suite/src/views/dashboard/PortfolioCard/EmptyWallet.tsx index af64f598e95..335769a1618 100644 --- a/packages/suite/src/views/dashboard/PortfolioCard/EmptyWallet.tsx +++ b/packages/suite/src/views/dashboard/PortfolioCard/EmptyWallet.tsx @@ -1,10 +1,10 @@ import { H3, Row, Paragraph, Button, Column, IconCircle } from '@trezor/components'; import { CoinLogo } from '@trezor/product-components'; import { spacings } from '@trezor/theme'; +import { selectIsDeviceUsingPassphrase } from '@suite-common/wallet-core'; import { Translation } from 'src/components/suite'; import { useSelector, useDispatch } from 'src/hooks/suite'; -import { selectIsDeviceUsingPassphrase } from '@suite-common/wallet-core'; import { goto } from 'src/actions/suite/routerActions'; import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; diff --git a/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCard.tsx b/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCard.tsx index fec3ea85774..9929aca09f5 100644 --- a/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCard.tsx +++ b/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCard.tsx @@ -1,23 +1,25 @@ import { memo, useMemo } from 'react'; + import styled from 'styled-components'; import { Dropdown, Card, Tooltip, Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { getTotalFiatBalance } from '@suite-common/wallet-utils'; +import { selectCurrentFiatRates } from '@suite-common/wallet-core'; +import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; + import { GraphScaleDropdownItem, GraphSkeleton, Translation } from 'src/components/suite'; import { DashboardSection } from 'src/components/dashboard'; import { useDevice, useDiscovery, useDispatch, useSelector } from 'src/hooks/suite'; import { useFastAccounts } from 'src/hooks/wallet'; import { goto } from 'src/actions/suite/routerActions'; import { setFlag } from 'src/actions/suite/suiteActions'; -import { getTotalFiatBalance } from '@suite-common/wallet-utils'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { PortfolioCardHeader } from './PortfolioCardHeader'; import { PortfolioCardException } from './PortfolioCardException'; import { EmptyWallet } from './EmptyWallet'; import { DashboardGraph } from './DashboardGraph'; -import { selectCurrentFiatRates } from '@suite-common/wallet-core'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; // eslint-disable-next-line local-rules/no-override-ds-component const StyledDropdown = styled(Dropdown)` diff --git a/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardHeader.tsx b/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardHeader.tsx index acaab0b77ee..95f5e65da5a 100644 --- a/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardHeader.tsx +++ b/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardHeader.tsx @@ -1,14 +1,15 @@ import { useCallback } from 'react'; + import styled, { css } from 'styled-components'; import { Button, LoadingContent } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; import { GraphRangeSelector, Translation } from 'src/components/suite'; import { updateGraphData } from 'src/actions/wallet/graphActions'; import { useFastAccounts } from 'src/hooks/wallet'; import { GraphRange } from 'src/types/wallet/graph'; import { FiatHeader } from 'src/components/wallet/FiatHeader'; -import { spacingsPx } from '@trezor/theme'; const Wrapper = styled.div<{ $hideBorder: boolean }>` display: flex; diff --git a/packages/suite/src/views/dashboard/PromoBanner.tsx b/packages/suite/src/views/dashboard/PromoBanner.tsx index a0efd35c073..f6f1646cfad 100644 --- a/packages/suite/src/views/dashboard/PromoBanner.tsx +++ b/packages/suite/src/views/dashboard/PromoBanner.tsx @@ -1,14 +1,18 @@ import { useState } from 'react'; + import styled, { css } from 'styled-components'; + import { SUITE_MOBILE_APP_STORE, SUITE_MOBILE_PLAY_STORE, SUITE_URL } from '@trezor/urls'; import { EventType, analytics } from '@trezor/suite-analytics'; import { Button, Icon, Image, Tooltip, variables } from '@trezor/components'; -import { Translation, QrCode, TrezorLink } from 'src/components/suite'; import { isWeb } from '@trezor/env-utils'; +import { spacingsPx } from '@trezor/theme'; + +import { Translation, QrCode, TrezorLink } from 'src/components/suite'; import { useLayoutSize } from 'src/hooks/suite/useLayoutSize'; import { HORIZONTAL_LAYOUT_PADDINGS } from 'src/constants/suite/layout'; import { useSelector } from 'src/hooks/suite'; -import { spacingsPx } from '@trezor/theme'; + const Container = styled.div` position: absolute; diff --git a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCard.tsx b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCard.tsx index 52c9123a1d6..e1be8539240 100644 --- a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCard.tsx +++ b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCard.tsx @@ -1,4 +1,5 @@ import { useEffect, useMemo, useState } from 'react'; + import { variables, Divider, @@ -11,18 +12,20 @@ import { Paragraph, IconName, } from '@trezor/components'; -import { DashboardSection } from 'src/components/dashboard'; -import { Translation, StakingFeature } from 'src/components/suite'; -import { StakeEthCardFooter } from './StakeEthCardFooter/StakeEthCardFooter'; +import { spacings } from '@trezor/theme'; +import { selectPoolStatsApyData } from '@suite-common/wallet-core'; +import { MIN_ETH_BALANCE_FOR_STAKING } from '@suite-common/wallet-constants'; +import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; + import { useDevice, useDiscovery, useDispatch, useSelector } from 'src/hooks/suite'; import { useAccounts } from 'src/hooks/wallet'; -import { spacings } from '@trezor/theme'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; import { setFlag } from 'src/actions/suite/suiteActions'; -import { selectPoolStatsApyData } from '@suite-common/wallet-core'; -import { MIN_ETH_BALANCE_FOR_STAKING } from '@suite-common/wallet-constants'; -import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; +import { Translation, StakingFeature } from 'src/components/suite'; +import { DashboardSection } from 'src/components/dashboard'; + +import { StakeEthCardFooter } from './StakeEthCardFooter/StakeEthCardFooter'; const bannerSymbol = 'eth'; diff --git a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/NetworkBadge.tsx b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/NetworkBadge.tsx index 6d201827c98..c977ac71aa0 100644 --- a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/NetworkBadge.tsx +++ b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/NetworkBadge.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import { Paragraph, Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { CoinLogo } from '@trezor/product-components'; diff --git a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/StakeEthCardFooter.tsx b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/StakeEthCardFooter.tsx index 96d613d31e0..29f0392b4bf 100644 --- a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/StakeEthCardFooter.tsx +++ b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/StakeEthCardFooter.tsx @@ -1,9 +1,11 @@ import { Button, Paragraph, Row } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; -import { NetworkBadge } from './NetworkBadge'; import { useAccountSearch, useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; -import { spacings } from '@trezor/theme'; + +import { NetworkBadge } from './NetworkBadge'; type StakeEthCardFooterProps = { accountIndex: number | undefined; diff --git a/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx b/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx index de72caf64bb..f87648ee53b 100644 --- a/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx +++ b/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx @@ -1,18 +1,22 @@ import React, { useState } from 'react'; + import styled from 'styled-components'; +import { AnimatePresence, motion } from 'framer-motion'; +import { rgba } from 'polished'; import { EventType, analytics } from '@trezor/suite-analytics'; import { TREZOR_SAFE_5_URL } from '@trezor/urls'; +import { Button, IconButton, Image, SVG_IMAGES, SVG_PATH, variables } from '@trezor/components'; +import { resolveStaticPath } from '@suite-common/suite-utils'; +import { colorVariants } from '@trezor/theme'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsDashboardT3T1PromoBannerShown } from 'src/reducers/suite/suiteReducer'; -import { Button, IconButton, Image, SVG_IMAGES, SVG_PATH, variables } from '@trezor/components'; import { setFlag } from 'src/actions/suite/suiteActions'; import { Translation, TrezorLink } from 'src/components/suite'; -import { AnimatePresence, motion } from 'framer-motion'; -import { resolveStaticPath } from '@suite-common/suite-utils'; -import { colorVariants } from '@trezor/theme'; -import { rgba } from 'polished'; + + + import { T3T1PromoLogo } from './T3T1PromoLogo'; import { bannerAnimationConfig } from '../banner-animations'; diff --git a/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoLogo.tsx b/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoLogo.tsx index e975aa43d4e..8a49f49d63a 100644 --- a/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoLogo.tsx +++ b/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoLogo.tsx @@ -1,5 +1,7 @@ import React from 'react'; + import styled from 'styled-components'; + import { borders, colorVariants, typography } from '@trezor/theme'; import { variables } from '@trezor/components'; diff --git a/packages/suite/src/views/dashboard/index.tsx b/packages/suite/src/views/dashboard/index.tsx index 717a9219acd..b92c4cb742c 100644 --- a/packages/suite/src/views/dashboard/index.tsx +++ b/packages/suite/src/views/dashboard/index.tsx @@ -1,14 +1,17 @@ import styled from 'styled-components'; + import { breakpointMediaQueries } from '@trezor/styles'; +import { spacingsPx } from '@trezor/theme'; + import { useLayout } from 'src/hooks/suite'; +import { PageHeader } from 'src/components/suite/layouts/SuiteLayout'; + import { AssetsView } from './AssetsView/AssetsView'; import { PortfolioCard } from './PortfolioCard/PortfolioCard'; import { PromoBanner } from './PromoBanner'; import { T3T1PromoBanner } from './T3T1PromoBanner/T3T1PromoBanner'; -import { PageHeader } from 'src/components/suite/layouts/SuiteLayout'; import { StakeEthCard } from './StakeEthCard/StakeEthCard'; import { DashboardPassphraseBanner } from './DashboardPassphraseBanner'; -import { spacingsPx } from '@trezor/theme'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/firmware/FirmwareCustom.tsx b/packages/suite/src/views/firmware/FirmwareCustom.tsx index 56dfd390193..7eb42c2ebfc 100644 --- a/packages/suite/src/views/firmware/FirmwareCustom.tsx +++ b/packages/suite/src/views/firmware/FirmwareCustom.tsx @@ -2,6 +2,7 @@ import { useState } from 'react'; import { useDevice, useFirmware } from 'src/hooks/suite'; import { SelectCustomFirmware } from 'src/components/firmware'; + import { FirmwareModal } from './FirmwareModal'; export const FirmwareCustom = () => { diff --git a/packages/suite/src/views/firmware/FirmwareModal.tsx b/packages/suite/src/views/firmware/FirmwareModal.tsx index 00ad05b72b8..74414bbb916 100644 --- a/packages/suite/src/views/firmware/FirmwareModal.tsx +++ b/packages/suite/src/views/firmware/FirmwareModal.tsx @@ -1,5 +1,6 @@ import { ReactElement } from 'react'; import { useIntl } from 'react-intl'; + import styled from 'styled-components'; import { TranslationKey } from '@suite-common/intl-types'; diff --git a/packages/suite/src/views/firmware/FirmwareUpdate.tsx b/packages/suite/src/views/firmware/FirmwareUpdate.tsx index 0288443d24c..35032387178 100644 --- a/packages/suite/src/views/firmware/FirmwareUpdate.tsx +++ b/packages/suite/src/views/firmware/FirmwareUpdate.tsx @@ -1,6 +1,7 @@ import { FirmwareInitial } from 'src/components/firmware'; import { closeModalApp } from 'src/actions/suite/routerActions'; import { useDispatch, useFirmware } from 'src/hooks/suite'; + import { FirmwareModal } from './FirmwareModal'; type FirmwareUpdateProps = { diff --git a/packages/suite/src/views/onboarding/UnexpectedState/components/IsSameDevice.tsx b/packages/suite/src/views/onboarding/UnexpectedState/components/IsSameDevice.tsx index dc7183d8b4c..e1a92996c6f 100644 --- a/packages/suite/src/views/onboarding/UnexpectedState/components/IsSameDevice.tsx +++ b/packages/suite/src/views/onboarding/UnexpectedState/components/IsSameDevice.tsx @@ -1,4 +1,5 @@ import { Button } from '@trezor/components'; + import { OnboardingStepBox } from 'src/components/onboarding'; import { Translation } from 'src/components/suite'; import { useOnboarding } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/onboarding/UnexpectedState/index.tsx b/packages/suite/src/views/onboarding/UnexpectedState/index.tsx index 979ac784bcd..a3f07a1f498 100644 --- a/packages/suite/src/views/onboarding/UnexpectedState/index.tsx +++ b/packages/suite/src/views/onboarding/UnexpectedState/index.tsx @@ -1,4 +1,5 @@ import { useMemo } from 'react'; + import styled from 'styled-components'; import { selectDevice } from '@suite-common/wallet-core'; diff --git a/packages/suite/src/views/onboarding/index.tsx b/packages/suite/src/views/onboarding/index.tsx index fdcac1de53c..154218292fc 100644 --- a/packages/suite/src/views/onboarding/index.tsx +++ b/packages/suite/src/views/onboarding/index.tsx @@ -1,9 +1,9 @@ import { useMemo } from 'react'; + import { OnboardingLayout } from 'src/components/onboarding'; import { ReduxModal } from 'src/components/suite/modals/ReduxModal/ReduxModal'; import CreateOrRecover from 'src/views/onboarding/steps/CreateOrRecover'; import { FirmwareStep } from 'src/views/onboarding/steps/FirmwareStep'; -import { DeviceAuthenticity } from './steps/SecurityCheck/DeviceAuthenticity'; import { ResetDeviceStep } from 'src/views/onboarding/steps/ResetDevice'; import { RecoveryStep } from 'src/views/onboarding/steps/Recovery'; import { BackupStep } from 'src/views/onboarding/steps/Backup'; @@ -15,6 +15,8 @@ import UnexpectedState from 'src/views/onboarding/UnexpectedState'; import { useOnboarding, useFilteredModal } from 'src/hooks/suite'; import { MODAL } from 'src/actions/suite/constants'; import * as STEP from 'src/constants/onboarding/steps'; + +import { DeviceAuthenticity } from './steps/SecurityCheck/DeviceAuthenticity'; import { DeviceTutorial } from './steps/DeviceTutorial'; export const Onboarding = () => { diff --git a/packages/suite/src/views/onboarding/steps/BasicSettings/AdvancedSetup.tsx b/packages/suite/src/views/onboarding/steps/BasicSettings/AdvancedSetup.tsx index f9aea899c3d..0bff4856c9a 100644 --- a/packages/suite/src/views/onboarding/steps/BasicSettings/AdvancedSetup.tsx +++ b/packages/suite/src/views/onboarding/steps/BasicSettings/AdvancedSetup.tsx @@ -1,13 +1,17 @@ import { useState, ReactNode } from 'react'; + import styled, { useTheme } from 'styled-components'; -import { Translation } from 'src/components/suite'; + import { Icon } from '@trezor/components'; -import { useSelector } from 'src/hooks/suite'; import { isDesktop, isWeb } from '@trezor/env-utils'; -import { TorSection } from './TorSection'; + +import { useSelector } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; import { getIsTorEnabled } from 'src/utils/suite/tor'; import { CollapsibleOnboardingCard } from 'src/components/onboarding/CollapsibleOnboardingCard'; +import { TorSection } from './TorSection'; + const AdvancedSetupWrapper = styled.div` width: 100%; text-align: center; diff --git a/packages/suite/src/views/onboarding/steps/BasicSettings/BasicSettingsStepBox.tsx b/packages/suite/src/views/onboarding/steps/BasicSettings/BasicSettingsStepBox.tsx index 0476982aecc..86c1345ad56 100644 --- a/packages/suite/src/views/onboarding/steps/BasicSettings/BasicSettingsStepBox.tsx +++ b/packages/suite/src/views/onboarding/steps/BasicSettings/BasicSettingsStepBox.tsx @@ -1,13 +1,16 @@ import { useEffect } from 'react'; + import styled from 'styled-components'; -import { OnboardingStepBox, OnboardingStepBoxProps } from 'src/components/onboarding'; -import { CoinGroup, TooltipSymbol, Translation } from 'src/components/suite'; -import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; + import { CollapsibleBox } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { selectDeviceModel } from '@suite-common/wallet-core'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { DeviceModelInternal } from '@trezor/connect'; + +import { OnboardingStepBox, OnboardingStepBoxProps } from 'src/components/onboarding'; +import { CoinGroup, TooltipSymbol, Translation } from 'src/components/suite'; +import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { changeCoinVisibility } from 'src/actions/settings/walletSettingsActions'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; diff --git a/packages/suite/src/views/onboarding/steps/BasicSettings/TorSection.tsx b/packages/suite/src/views/onboarding/steps/BasicSettings/TorSection.tsx index a326209103f..be5c3f4e5e3 100644 --- a/packages/suite/src/views/onboarding/steps/BasicSettings/TorSection.tsx +++ b/packages/suite/src/views/onboarding/steps/BasicSettings/TorSection.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { variables, Switch } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { toggleTor } from 'src/actions/suite/suiteActions'; diff --git a/packages/suite/src/views/onboarding/steps/DeviceTutorial.tsx b/packages/suite/src/views/onboarding/steps/DeviceTutorial.tsx index 0e8db6ed365..fd58ec0b3d9 100644 --- a/packages/suite/src/views/onboarding/steps/DeviceTutorial.tsx +++ b/packages/suite/src/views/onboarding/steps/DeviceTutorial.tsx @@ -1,10 +1,13 @@ import { useEffect } from 'react'; import { useIntl } from 'react-intl'; + import styled from 'styled-components'; import { selectDevice } from '@suite-common/wallet-core'; import TrezorConnect from '@trezor/connect'; import { Button } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; + import { beginOnboardingTutorial, goToNextStep, @@ -16,7 +19,6 @@ import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; import { selectOnboardingTutorialStatus } from 'src/reducers/onboarding/onboardingReducer'; import messages from 'src/support/messages'; -import { spacingsPx } from '@trezor/theme'; const StyledOnboardingStepBox = styled(OnboardingStepBox)` padding: 40px 20px 0; diff --git a/packages/suite/src/views/onboarding/steps/Final.tsx b/packages/suite/src/views/onboarding/steps/Final.tsx index f3e9aad50c9..d1279b79781 100644 --- a/packages/suite/src/views/onboarding/steps/Final.tsx +++ b/packages/suite/src/views/onboarding/steps/Final.tsx @@ -1,8 +1,9 @@ import { useRef, useState } from 'react'; + import styled, { css } from 'styled-components'; import useMeasure from 'react-use/lib/useMeasure'; -import { analytics, EventType } from '@trezor/suite-analytics'; +import { analytics, EventType } from '@trezor/suite-analytics'; import { Button, variables, @@ -11,13 +12,14 @@ import { Tooltip, DeviceAnimation, } from '@trezor/components'; +import { spacingsPx, typography } from '@trezor/theme'; + import { Translation, HomescreenGallery } from 'src/components/suite'; import { OnboardingStepBox } from 'src/components/onboarding'; import { useDevice, useOnboarding, useSelector } from 'src/hooks/suite'; import { isHomescreenSupportedOnDevice } from 'src/utils/suite/homescreen'; import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; import { ChangeDeviceLabel } from 'src/components/suite/ChangeDeviceLabel'; -import { spacingsPx, typography } from '@trezor/theme'; const Content = styled.div` flex-direction: column; diff --git a/packages/suite/src/views/onboarding/steps/Recovery/RecoveryStepBox.tsx b/packages/suite/src/views/onboarding/steps/Recovery/RecoveryStepBox.tsx index df1898e6226..ff19931af81 100644 --- a/packages/suite/src/views/onboarding/steps/Recovery/RecoveryStepBox.tsx +++ b/packages/suite/src/views/onboarding/steps/Recovery/RecoveryStepBox.tsx @@ -1,4 +1,5 @@ import { DeviceModelInternal } from '@trezor/connect'; + import { OnboardingButtonBack, OnboardingStepBox, diff --git a/packages/suite/src/views/onboarding/steps/ResetDevice.tsx b/packages/suite/src/views/onboarding/steps/ResetDevice.tsx index f8d261d5676..7d4ab01c366 100644 --- a/packages/suite/src/views/onboarding/steps/ResetDevice.tsx +++ b/packages/suite/src/views/onboarding/steps/ResetDevice.tsx @@ -1,19 +1,23 @@ import { useCallback, useEffect, useState } from 'react'; + import styled from 'styled-components'; + import { selectDevice } from '@suite-common/wallet-core'; +import { Button, Divider, Text } from '@trezor/components'; +import { DeviceModelInternal } from '@trezor/connect'; + import * as STEP from 'src/constants/onboarding/steps'; import { OnboardingButtonBack, OptionsWrapper, OnboardingStepBox } from 'src/components/onboarding'; import { Translation } from 'src/components/suite'; import { useDispatch, useSelector, useOnboarding, useDevice } from 'src/hooks/suite'; import { resetDevice } from 'src/actions/settings/deviceSettingsActions'; import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; -import { Button, Divider, Text } from '@trezor/components'; + import { SelectBackupType, getDefaultBackupType, isShamirBackupType, } from './SelectBackupType/SelectBackupType'; -import { DeviceModelInternal } from '@trezor/connect'; import { BackupType } from '../../../reducers/onboarding/onboardingReducer'; const SelectWrapper = styled.div` diff --git a/packages/suite/src/views/onboarding/steps/Security.tsx b/packages/suite/src/views/onboarding/steps/Security.tsx index e7841330bc5..223cafe6b3b 100644 --- a/packages/suite/src/views/onboarding/steps/Security.tsx +++ b/packages/suite/src/views/onboarding/steps/Security.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; + import { Translation } from 'src/components/suite'; import { OnboardingButtonCta, diff --git a/packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx b/packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx index f7421fb7ff0..3290451b959 100644 --- a/packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx +++ b/packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { checkDeviceAuthenticityThunk } from '@suite-common/device-authenticity'; diff --git a/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityCheck.tsx b/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityCheck.tsx index 76b7cca8608..5767f9d2119 100644 --- a/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityCheck.tsx +++ b/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityCheck.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from 'react'; + import styled, { useTheme } from 'styled-components'; import { getConnectedDeviceStatus } from '@suite-common/suite-utils'; @@ -23,6 +24,7 @@ import { SUPPORTS_DEVICE_AUTHENTICITY_CHECK } from 'src/constants/suite/device'; import { SecurityCheckFail } from 'src/components/suite/SecurityCheck/SecurityCheckFail'; import { selectIsOnboardingActive } from 'src/reducers/onboarding/onboardingReducer'; import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; + import { SecurityChecklist } from './SecurityChecklist'; import { DeviceAuthenticity } from './DeviceAuthenticity'; diff --git a/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityChecklist.tsx b/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityChecklist.tsx index 8fab48ec46b..0b4234544b8 100644 --- a/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityChecklist.tsx +++ b/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityChecklist.tsx @@ -2,6 +2,7 @@ import { useTheme } from 'styled-components'; import { Column, Icon, Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; + import { SecurityChecklistItem } from './types'; type SecurityChecklistProps = { diff --git a/packages/suite/src/views/onboarding/steps/SecurityCheck/types.ts b/packages/suite/src/views/onboarding/steps/SecurityCheck/types.ts index f2d2d6ccc16..68cf3a6b660 100644 --- a/packages/suite/src/views/onboarding/steps/SecurityCheck/types.ts +++ b/packages/suite/src/views/onboarding/steps/SecurityCheck/types.ts @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import { IconName } from '@trezor/components'; export type SecurityChecklistItem = { diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/DefaultTag.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/DefaultTag.tsx index 17889c42805..b16979cef1a 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/DefaultTag.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/DefaultTag.tsx @@ -1,5 +1,6 @@ import { Badge, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useLayoutSize } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/FloatingSelections.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/FloatingSelections.tsx index f9eb0d264c5..9faaacea9a9 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/FloatingSelections.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/FloatingSelections.tsx @@ -1,3 +1,7 @@ +import { CSSProperties, forwardRef, useRef } from 'react'; + +import styled from 'styled-components'; + import { useElevation, Divider, @@ -15,13 +19,13 @@ import { spacingsPx, zIndices, } from '@trezor/theme'; -import { CSSProperties, forwardRef, useRef } from 'react'; +import { HELP_CENTER_MULTI_SHARE_BACKUP_URL } from '@trezor/urls'; + import { Translation, TrezorLink } from 'src/components/suite'; + import { LegacyOptions } from './LegacyOptions'; import { isShamirBackupType } from './SelectBackupType'; import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; -import styled from 'styled-components'; -import { HELP_CENTER_MULTI_SHARE_BACKUP_URL } from '@trezor/urls'; import { ShamirOptions } from './ShamirOptions'; const OptionGroupHeading = styled.div` diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/LegacyOptions.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/LegacyOptions.tsx index 936517020a0..3ffb87d40f7 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/LegacyOptions.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/LegacyOptions.tsx @@ -1,6 +1,8 @@ -import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; -import { Translation } from 'src/components/suite'; import { Tooltip } from '@trezor/components'; + +import { Translation } from 'src/components/suite'; + +import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; import { OptionWithContent } from './OptionWithContent'; import { DefaultTag } from './DefaultTag'; diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/OptionWithContent.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/OptionWithContent.tsx index a51c8a40d32..ff3f212e43a 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/OptionWithContent.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/OptionWithContent.tsx @@ -1,9 +1,8 @@ -import { Radio, Row, variables, Text, Icon, useElevation, Tooltip } from '@trezor/components'; -import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; import { ReactNode, forwardRef } from 'react'; -import { Translation } from 'src/components/suite'; -import { useLayoutSize } from 'src/hooks/suite'; + import styled, { css } from 'styled-components'; + +import { Radio, Row, variables, Text, Icon, useElevation, Tooltip } from '@trezor/components'; import { spacingsPx, borders, @@ -11,6 +10,11 @@ import { mapElevationToBackground, mapElevationToBorder, } from '@trezor/theme'; + +import { useLayoutSize } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; + +import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; import { typesToLabelMap } from './typesToLabelMap'; export const OptionText = styled.div` diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx index 5278fa3044e..3338ed99582 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx @@ -1,15 +1,6 @@ -import { ElevationUp, Text, Banner, useElevation } from '@trezor/components'; -import { - Elevation, - borders, - mapElevationToBackground, - mapElevationToBorder, - spacingsPx, -} from '@trezor/theme'; import { useState } from 'react'; + import styled from 'styled-components'; -import { useLayoutSize, useSelector } from '../../../../hooks/suite'; -import { selectDevice } from '@suite-common/wallet-core'; import { FloatingFocusManager, autoUpdate, @@ -22,13 +13,26 @@ import { size, offset, } from '@floating-ui/react'; + +import { ElevationUp, Text, Banner, useElevation } from '@trezor/components'; +import { + Elevation, + borders, + mapElevationToBackground, + mapElevationToBorder, + spacingsPx, +} from '@trezor/theme'; +import { selectDevice } from '@suite-common/wallet-core'; import { TranslationKey } from '@suite-common/intl-types'; +import { DeviceModelInternal } from '@trezor/connect'; + +import { useLayoutSize, useSelector } from '../../../../hooks/suite'; import { Translation } from '../../../../components/suite'; import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; import { OptionText, SelectedOption } from './OptionWithContent'; import { FloatingSelections } from './FloatingSelections'; import { typesToLabelMap } from './typesToLabelMap'; -import { DeviceModelInternal } from '@trezor/connect'; + const SELECT_ELEMENT_HEIGHT = 84; const SELECT_ELEMENT_HEIGHT_MOBILE = 62; diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/ShamirOptions.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/ShamirOptions.tsx index bf69bbd2f03..9d94fdd1576 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/ShamirOptions.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/ShamirOptions.tsx @@ -1,13 +1,15 @@ +import { satisfies } from 'semver'; + import { Badge, Tooltip } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { selectDevice } from '@suite-common/wallet-core'; +import { getFirmwareVersion } from '@trezor/device-utils'; + import { Translation } from '../../../../components/suite'; import { useLayoutSize, useSelector } from '../../../../hooks/suite'; import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; import { DefaultTag } from './DefaultTag'; import { OptionWithContent } from './OptionWithContent'; -import { selectDevice } from '@suite-common/wallet-core'; -import { getFirmwareVersion } from '@trezor/device-utils'; -import { satisfies } from 'semver'; const UpgradableToMultiTag = () => { const { isMobileLayout } = useLayoutSize(); diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/typesToLabelMap.ts b/packages/suite/src/views/onboarding/steps/SelectBackupType/typesToLabelMap.ts index 653860d4878..c8593d7247f 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/typesToLabelMap.ts +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/typesToLabelMap.ts @@ -1,4 +1,5 @@ import { TranslationKey } from '@suite-common/intl-types'; + import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; export const typesToLabelMap: Record = { diff --git a/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx b/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx index 8175ddba046..426d179a391 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx @@ -1,19 +1,20 @@ import React, { useState } from 'react'; + import { randomBytes } from 'crypto'; import styled from 'styled-components'; import TrezorConnect from '@trezor/connect'; - import { Button, Checkbox, Input } from '@trezor/components'; import type { PasswordEntry, PasswordEntryDecoded } from '@suite-common/metadata-types'; +import { selectDevice } from '@suite-common/wallet-core'; +import { isUrl } from '@trezor/utils'; +import { spacingsPx } from '@trezor/theme'; import { usePasswords, useSelector } from 'src/hooks/suite'; -import { selectDevice } from '@suite-common/wallet-core'; import * as metadataUtils from 'src/utils/suite/metadata'; import { PATH } from 'src/actions/suite/constants/metadataPasswordsConstants'; import { getDisplayKey } from 'src/utils/suite/passwords'; -import { isUrl } from '@trezor/utils'; -import { spacingsPx } from '@trezor/theme'; + const FormWrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/password-manager/PasswordManager/PasswordEntry.tsx b/packages/suite/src/views/password-manager/PasswordManager/PasswordEntry.tsx index fb86749e158..692bf051338 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/PasswordEntry.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/PasswordEntry.tsx @@ -1,8 +1,9 @@ import React, { useState } from 'react'; + import styled from 'styled-components'; + import TrezorConnect, { DeviceUniquePath } from '@trezor/connect'; import { Button } from '@trezor/components'; - import { spacingsPx } from '@trezor/theme'; import { DialogModal } from 'src/components/suite/modals/Modal/DialogRenderer'; diff --git a/packages/suite/src/views/password-manager/PasswordManager/PasswordManager.tsx b/packages/suite/src/views/password-manager/PasswordManager/PasswordManager.tsx index 18609626926..8ef40e76102 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/PasswordManager.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/PasswordManager.tsx @@ -1,5 +1,7 @@ import React, { useState } from 'react'; + import styled from 'styled-components'; + import { Button } from '@trezor/components'; import { TextColumn, ActionColumn } from 'src/components/suite'; diff --git a/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx b/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx index a4c61dd0bab..941498a67a3 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx @@ -1,17 +1,20 @@ import styled from 'styled-components'; +import { selectDevice } from '@suite-common/wallet-core'; + +import type { PasswordEntry as PasswordEntryType } from 'src/types/suite/metadata'; +import { useSelector } from 'src/hooks/suite'; +import { TextColumn } from 'src/components/suite'; + import { AddEntryButton } from './AddEntryButton'; import { PasswordEntry as PasswordEntryComponent, PasswordEntryCol, PasswordEntryRow, } from './PasswordEntry'; -import type { PasswordEntry as PasswordEntryType } from 'src/types/suite/metadata'; import { EntryForm } from './EntryForm'; -import { useSelector } from 'src/hooks/suite'; -import { TextColumn } from 'src/components/suite'; -import { selectDevice } from '@suite-common/wallet-core'; + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/password-manager/PasswordManager/TagsList.tsx b/packages/suite/src/views/password-manager/PasswordManager/TagsList.tsx index e1400bcefb3..65f958d57fe 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/TagsList.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/TagsList.tsx @@ -1,9 +1,10 @@ import styled from 'styled-components'; -import { Tag } from './Tag'; import { PasswordTag } from '@suite-common/metadata-types'; import { spacingsPx } from '@trezor/theme'; +import { Tag } from './Tag'; + const TagsListWrapper = styled.div` display: flex; flex-direction: row; diff --git a/packages/suite/src/views/password-manager/index.tsx b/packages/suite/src/views/password-manager/index.tsx index 4651ea58e64..b0b622f27db 100644 --- a/packages/suite/src/views/password-manager/index.tsx +++ b/packages/suite/src/views/password-manager/index.tsx @@ -1,8 +1,9 @@ import { useLayout } from 'src/hooks/suite'; -import { PasswordManager } from './PasswordManager/PasswordManager'; import { PageHeader } from 'src/components/suite/layouts/SuiteLayout'; import { BasicName } from 'src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/BasicName'; +import { PasswordManager } from './PasswordManager/PasswordManager'; + const PasswordManagerView = () => { useLayout('Password manager', () => ( diff --git a/packages/suite/src/views/settings/SettingsCoins/FirmwareTypeSuggestion.tsx b/packages/suite/src/views/settings/SettingsCoins/FirmwareTypeSuggestion.tsx index b00971b1e9d..574850e75ab 100644 --- a/packages/suite/src/views/settings/SettingsCoins/FirmwareTypeSuggestion.tsx +++ b/packages/suite/src/views/settings/SettingsCoins/FirmwareTypeSuggestion.tsx @@ -1,13 +1,14 @@ import styled from 'styled-components'; +import { Button, Banner } from '@trezor/components'; +import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; +import { typography } from '@trezor/theme'; + import { setFlag } from 'src/actions/suite/suiteActions'; import { goto } from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useDevice, useDispatch } from 'src/hooks/suite'; -import { Button, Banner } from '@trezor/components'; -import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; -import { typography } from '@trezor/theme'; const InlineButtonWrapper = styled.div` display: inline-block; diff --git a/packages/suite/src/views/settings/SettingsDebug/InvityApi.tsx b/packages/suite/src/views/settings/SettingsDebug/InvityApi.tsx index 14c8b0c0ec7..40ebca476db 100644 --- a/packages/suite/src/views/settings/SettingsDebug/InvityApi.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/InvityApi.tsx @@ -1,11 +1,12 @@ import styled from 'styled-components'; +import type { InvityServerEnvironment } from '@suite-common/invity'; + import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, ActionSelect, TextColumn } from 'src/components/suite'; import { setDebugMode } from 'src/actions/suite/suiteActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; import invityAPI from 'src/services/suite/invityAPI'; -import type { InvityServerEnvironment } from '@suite-common/invity'; import { SettingsAnchor } from 'src/constants/suite/anchors'; import { reloadApp } from 'src/utils/suite/reload'; diff --git a/packages/suite/src/views/settings/SettingsDebug/SettingsDebug.tsx b/packages/suite/src/views/settings/SettingsDebug/SettingsDebug.tsx index 3bd08871fae..a49284d7641 100644 --- a/packages/suite/src/views/settings/SettingsDebug/SettingsDebug.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/SettingsDebug.tsx @@ -1,6 +1,8 @@ import { isDesktop, isWeb } from '@trezor/env-utils'; import { SettingsSection, SettingsLayout } from 'src/components/settings'; +import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; +import { useSelector } from 'src/hooks/suite'; import { TranslationMode } from './TranslationMode'; import { GithubIssue } from './GithubIssue'; @@ -17,8 +19,6 @@ import { TransportBackends } from './TransportBackends'; import { ViewOnlySettings } from './ViewOnlySettings'; import { TriggerHighlight } from './TriggerHighlight'; import { Backends } from './Backends'; -import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; -import { useSelector } from 'src/hooks/suite'; import { PreField } from './PreField'; import { Tor } from './Tor'; diff --git a/packages/suite/src/views/settings/SettingsDebug/Tor.tsx b/packages/suite/src/views/settings/SettingsDebug/Tor.tsx index 6c2ceeace93..01725610875 100644 --- a/packages/suite/src/views/settings/SettingsDebug/Tor.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/Tor.tsx @@ -1,5 +1,4 @@ import { useDispatch } from 'src/hooks/suite'; - import { ActionColumn, ActionButton, SectionItem, TextColumn } from 'src/components/suite'; import { toggleTor } from 'src/actions/suite/suiteActions'; diff --git a/packages/suite/src/views/settings/SettingsDebug/Transport.tsx b/packages/suite/src/views/settings/SettingsDebug/Transport.tsx index 1cb6b53bcd5..3720ec05465 100644 --- a/packages/suite/src/views/settings/SettingsDebug/Transport.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/Transport.tsx @@ -2,9 +2,9 @@ import { useMemo } from 'react'; import { Checkbox } from '@trezor/components'; import { isDesktop } from '@trezor/env-utils'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { ArrayElement } from '@trezor/type-utils'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { setDebugMode } from 'src/actions/suite/suiteActions'; import { DebugModeOptions } from 'src/reducers/suite/suiteReducer'; import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; diff --git a/packages/suite/src/views/settings/SettingsDebug/TransportBackends.tsx b/packages/suite/src/views/settings/SettingsDebug/TransportBackends.tsx index 0446bdf0d58..cffd204e01d 100644 --- a/packages/suite/src/views/settings/SettingsDebug/TransportBackends.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/TransportBackends.tsx @@ -1,9 +1,10 @@ import { Checkbox } from '@trezor/components'; import { desktopApi } from '@trezor/suite-desktop-api'; +import { isDevEnv } from '@suite-common/suite-utils'; import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; -import { isDevEnv } from '@suite-common/suite-utils'; import { useSelector } from 'src/hooks/suite'; + import { useBridgeDesktopApi } from '../../../hooks/suite/useBridgeDesktopApi'; // note that this variable is duplicated with suite-desktop-core diff --git a/packages/suite/src/views/settings/SettingsDebug/TriggerHighlight.tsx b/packages/suite/src/views/settings/SettingsDebug/TriggerHighlight.tsx index 22155f6aa06..f2428f71ff3 100644 --- a/packages/suite/src/views/settings/SettingsDebug/TriggerHighlight.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/TriggerHighlight.tsx @@ -1,4 +1,5 @@ import { ActionButton, ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; + import { goto } from '../../../actions/suite/routerActions'; import { SettingsAnchor } from '../../../constants/suite/anchors'; import { useDispatch } from '../../../hooks/suite'; diff --git a/packages/suite/src/views/settings/SettingsDebug/ViewOnlySettings.tsx b/packages/suite/src/views/settings/SettingsDebug/ViewOnlySettings.tsx index fab86c2011e..c2ef2153943 100644 --- a/packages/suite/src/views/settings/SettingsDebug/ViewOnlySettings.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/ViewOnlySettings.tsx @@ -1,6 +1,6 @@ import { Checkbox } from '@trezor/components'; -import { useDispatch, useSelector } from 'src/hooks/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { setFlag } from 'src/actions/suite/suiteActions'; import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; diff --git a/packages/suite/src/views/settings/SettingsDebug/WipeData.tsx b/packages/suite/src/views/settings/SettingsDebug/WipeData.tsx index aa004cef809..3e6ad4c0a3f 100644 --- a/packages/suite/src/views/settings/SettingsDebug/WipeData.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/WipeData.tsx @@ -1,10 +1,11 @@ import styled from 'styled-components'; + import { desktopApi } from '@trezor/suite-desktop-api'; +import { notificationsActions } from '@suite-common/toast-notifications'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { notificationsActions } from '@suite-common/toast-notifications'; import { SettingsAnchor } from 'src/constants/suite/anchors'; const UserDataLink = styled.span` diff --git a/packages/suite/src/views/settings/SettingsDevice/AutoLock.tsx b/packages/suite/src/views/settings/SettingsDevice/AutoLock.tsx index 0dfc5611522..7f4267f3e08 100644 --- a/packages/suite/src/views/settings/SettingsDevice/AutoLock.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/AutoLock.tsx @@ -1,10 +1,10 @@ import { analytics, EventType } from '@trezor/suite-analytics'; +import { formatDurationStrict } from '@suite-common/suite-utils'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, ActionSelect, TextColumn, Translation } from 'src/components/suite'; import { useDevice, useDispatch, useLocales } from 'src/hooks/suite'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; -import { formatDurationStrict } from '@suite-common/suite-utils'; import { SettingsAnchor } from 'src/constants/suite/anchors'; // auto lock times in seconds; allowed lock times by device: <1 minute, 6 days> diff --git a/packages/suite/src/views/settings/SettingsDevice/Brightness.tsx b/packages/suite/src/views/settings/SettingsDevice/Brightness.tsx index ee705ae61ff..8753d672576 100644 --- a/packages/suite/src/views/settings/SettingsDevice/Brightness.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/Brightness.tsx @@ -1,5 +1,6 @@ import TrezorConnect from '@trezor/connect'; import { analytics, EventType } from '@trezor/suite-analytics'; + import { SectionItem, ActionButton, @@ -7,6 +8,7 @@ import { TextColumn, Translation, } from 'src/components/suite'; + import { useDevice } from '../../../hooks/suite'; interface DeviceLabelProps { diff --git a/packages/suite/src/views/settings/SettingsDevice/ChangeLanguage.tsx b/packages/suite/src/views/settings/SettingsDevice/ChangeLanguage.tsx index 6267a7c1884..0a5dd471550 100644 --- a/packages/suite/src/views/settings/SettingsDevice/ChangeLanguage.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/ChangeLanguage.tsx @@ -1,5 +1,6 @@ import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, ActionSelect, TextColumn, Translation } from 'src/components/suite'; + import { SettingsAnchor } from '../../../constants/suite/anchors'; import { useDevice, useDispatch } from '../../../hooks/suite'; import { changeLanguage } from '../../../actions/settings/deviceSettingsActions'; diff --git a/packages/suite/src/views/settings/SettingsDevice/DefaultWalletLoading.tsx b/packages/suite/src/views/settings/SettingsDevice/DefaultWalletLoading.tsx index e3bcbb160e6..607b64bf4a4 100644 --- a/packages/suite/src/views/settings/SettingsDevice/DefaultWalletLoading.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/DefaultWalletLoading.tsx @@ -1,6 +1,7 @@ import { WalletType as DefaultWalletLoadingOptions } from '@suite-common/wallet-types'; import { SelectBar } from '@trezor/components'; import { EventType, analytics } from '@trezor/suite-analytics'; +import { deviceActions, selectDevice } from '@suite-common/wallet-core'; import { Translation } from 'src/components/suite/Translation'; import { SettingsAnchor } from 'src/constants/suite/anchors'; @@ -8,7 +9,6 @@ import { useDispatch, useSelector } from 'src/hooks/suite'; import { setDefaultWalletLoading } from 'src/actions/suite/suiteActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn } from 'src/components/suite'; -import { deviceActions, selectDevice } from '@suite-common/wallet-core'; const options = [ { diff --git a/packages/suite/src/views/settings/SettingsDevice/DisplayRotation.tsx b/packages/suite/src/views/settings/SettingsDevice/DisplayRotation.tsx index 6fc556602af..0b4987c749b 100644 --- a/packages/suite/src/views/settings/SettingsDevice/DisplayRotation.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/DisplayRotation.tsx @@ -1,9 +1,9 @@ import { DeviceModelInternal } from '@trezor/connect'; import { analytics, EventType } from '@trezor/suite-analytics'; +import { Icon, SelectBar, Tooltip } from '@trezor/components'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { Icon, SelectBar, Tooltip } from '@trezor/components'; import { useDevice, useDispatch } from 'src/hooks/suite'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; diff --git a/packages/suite/src/views/settings/SettingsDevice/FirmwareRevisionCheck.tsx b/packages/suite/src/views/settings/SettingsDevice/FirmwareRevisionCheck.tsx index f1a702a9f75..162aadc0cbb 100644 --- a/packages/suite/src/views/settings/SettingsDevice/FirmwareRevisionCheck.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/FirmwareRevisionCheck.tsx @@ -1,3 +1,5 @@ +import { HELP_CENTER_FIRMWARE_REVISION_CHECK } from '@trezor/urls'; + import { ActionButton, ActionColumn, @@ -8,7 +10,6 @@ import { import { useDispatch, useSelector } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; import { toggleCheckFirmwareAuthenticity } from 'src/actions/suite/suiteActions'; -import { HELP_CENTER_FIRMWARE_REVISION_CHECK } from '@trezor/urls'; export const FirmwareRevisionCheck = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/views/settings/SettingsDevice/FirmwareTypeChange.tsx b/packages/suite/src/views/settings/SettingsDevice/FirmwareTypeChange.tsx index 62c81afc0a0..ec218a1cc4e 100644 --- a/packages/suite/src/views/settings/SettingsDevice/FirmwareTypeChange.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/FirmwareTypeChange.tsx @@ -1,5 +1,13 @@ import styled from 'styled-components'; +import { Button } from '@trezor/components'; +import { + getFirmwareVersion, + hasBitcoinOnlyFirmware, + isBitcoinOnlyDevice, +} from '@trezor/device-utils'; +import { HELP_FIRMWARE_TYPE } from '@trezor/urls'; + import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, @@ -10,14 +18,7 @@ import { } from 'src/components/suite'; import { useDevice, useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; -import { Button } from '@trezor/components'; import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { - getFirmwareVersion, - hasBitcoinOnlyFirmware, - isBitcoinOnlyDevice, -} from '@trezor/device-utils'; -import { HELP_FIRMWARE_TYPE } from '@trezor/urls'; import { getSuiteFirmwareTypeString } from 'src/utils/firmware'; const Version = styled.div` diff --git a/packages/suite/src/views/settings/SettingsDevice/HapticFeedback.tsx b/packages/suite/src/views/settings/SettingsDevice/HapticFeedback.tsx index fd68f37713d..872d6067ec3 100644 --- a/packages/suite/src/views/settings/SettingsDevice/HapticFeedback.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/HapticFeedback.tsx @@ -1,10 +1,12 @@ import { Switch } from '@trezor/components'; +import { analytics, EventType } from '@trezor/suite-analytics'; + import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { useDevice, useDispatch } from '../../../hooks/suite'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; -import { analytics, EventType } from '@trezor/suite-analytics'; + +import { useDevice, useDispatch } from '../../../hooks/suite'; interface DeviceLabelProps { isDeviceLocked: boolean; diff --git a/packages/suite/src/views/settings/SettingsDevice/Homescreen.tsx b/packages/suite/src/views/settings/SettingsDevice/Homescreen.tsx index f5ea09337fe..7a47dffc86e 100644 --- a/packages/suite/src/views/settings/SettingsDevice/Homescreen.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/Homescreen.tsx @@ -1,8 +1,10 @@ import { useRef, useState } from 'react'; + import styled from 'styled-components'; import { DeviceModelInternal } from '@trezor/connect'; import { HOMESCREEN_EDITOR_URL } from '@trezor/urls'; +import { Button, ButtonGroup, Tooltip, variables } from '@trezor/components'; import { SettingsSectionItem } from 'src/components/settings'; import { @@ -13,7 +15,6 @@ import { Translation, } from 'src/components/suite'; import { HAS_MONOCHROME_SCREEN } from 'src/constants/suite/device'; -import { Button, ButtonGroup, Tooltip, variables } from '@trezor/components'; import { useDevice, useDispatch } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; diff --git a/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx b/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx index 5724cafce8e..cc061355723 100644 --- a/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx @@ -1,4 +1,8 @@ import { HELP_CENTER_MULTI_SHARE_BACKUP_URL } from '@trezor/urls'; +import { selectDevice } from '@suite-common/wallet-core'; +import { TrezorDevice } from '@suite-common/suite-types'; +import { EventType, analytics } from '@trezor/suite-analytics'; + import { ActionButton, ActionColumn, @@ -7,10 +11,9 @@ import { Translation, } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { selectDevice } from '@suite-common/wallet-core'; -import { TrezorDevice } from '@suite-common/suite-types'; + import { goto } from '../../../actions/suite/routerActions'; -import { EventType, analytics } from '@trezor/suite-analytics'; + const doesSupportMultiShare = (device: TrezorDevice | undefined): boolean => { if (device?.features === undefined) { diff --git a/packages/suite/src/views/settings/SettingsDevice/Passphrase.tsx b/packages/suite/src/views/settings/SettingsDevice/Passphrase.tsx index 8762a7b8df5..020d177d28e 100644 --- a/packages/suite/src/views/settings/SettingsDevice/Passphrase.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/Passphrase.tsx @@ -1,9 +1,9 @@ import { HELP_CENTER_PASSPHRASE_URL } from '@trezor/urls'; import { analytics, EventType } from '@trezor/suite-analytics'; +import { Switch } from '@trezor/components'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { Switch } from '@trezor/components'; import { useDevice, useDispatch } from 'src/hooks/suite'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; diff --git a/packages/suite/src/views/settings/SettingsDevice/PinProtection.tsx b/packages/suite/src/views/settings/SettingsDevice/PinProtection.tsx index 028896d05f3..8b2580aa625 100644 --- a/packages/suite/src/views/settings/SettingsDevice/PinProtection.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/PinProtection.tsx @@ -1,7 +1,7 @@ import { analytics, EventType } from '@trezor/suite-analytics'; +import { Switch } from '@trezor/components'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { Switch } from '@trezor/components'; import { useDevice, useDispatch } from 'src/hooks/suite'; import { changePin } from 'src/actions/settings/deviceSettingsActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; diff --git a/packages/suite/src/views/settings/SettingsDevice/WipeCode.tsx b/packages/suite/src/views/settings/SettingsDevice/WipeCode.tsx index a157e0281a7..85d5656773b 100644 --- a/packages/suite/src/views/settings/SettingsDevice/WipeCode.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/WipeCode.tsx @@ -1,13 +1,14 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; import { useSelector } from 'react-redux'; +import { analytics, EventType } from '@trezor/suite-analytics'; import { HELP_CENTER_WIPE_CODE_URL } from '@trezor/urls'; +import { selectIsDeviceProtectedByWipeCode } from '@suite-common/wallet-core'; + import { changeWipeCode } from 'src/actions/settings/deviceSettingsActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useDispatch } from 'src/hooks/suite'; -import { selectIsDeviceProtectedByWipeCode } from '@suite-common/wallet-core'; interface Props { isDeviceLocked: boolean; diff --git a/packages/suite/src/views/settings/SettingsGeneral/Analytics.tsx b/packages/suite/src/views/settings/SettingsGeneral/Analytics.tsx index 3473f093944..66dc68b2c72 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Analytics.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Analytics.tsx @@ -1,4 +1,5 @@ import { useSelector } from 'react-redux'; + import styled from 'styled-components'; import { selectHasUserAllowedTracking } from '@suite-common/analytics'; diff --git a/packages/suite/src/views/settings/SettingsGeneral/AutoStart.tsx b/packages/suite/src/views/settings/SettingsGeneral/AutoStart.tsx index 2c52bbc66d8..08ef3a24a15 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/AutoStart.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/AutoStart.tsx @@ -3,11 +3,11 @@ import { useEffect, useState } from 'react'; import styled from 'styled-components'; import { Switch } from '@trezor/components'; +import { desktopApi } from '@trezor/suite-desktop-api'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { desktopApi } from '@trezor/suite-desktop-api'; const PositionedSwitch = styled.div` align-self: center; diff --git a/packages/suite/src/views/settings/SettingsGeneral/AutomaticUpdate.tsx b/packages/suite/src/views/settings/SettingsGeneral/AutomaticUpdate.tsx index 21d17a880c2..ac5dcb5f676 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/AutomaticUpdate.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/AutomaticUpdate.tsx @@ -1,13 +1,15 @@ import styled from 'styled-components'; import { Switch } from '@trezor/components'; +import { isDesktop } from '@trezor/env-utils'; +import { desktopApi } from '@trezor/suite-desktop-api'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { isDesktop } from '@trezor/env-utils'; + import { useSelector } from '../../../hooks/suite'; -import { desktopApi } from '@trezor/suite-desktop-api'; + const PositionedSwitch = styled.div` align-self: center; diff --git a/packages/suite/src/views/settings/SettingsGeneral/BitcoinAmountUnit.tsx b/packages/suite/src/views/settings/SettingsGeneral/BitcoinAmountUnit.tsx index ddfcd71a274..1425646eb0f 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/BitcoinAmountUnit.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/BitcoinAmountUnit.tsx @@ -1,8 +1,8 @@ import { PROTO } from '@trezor/connect'; +import { UNIT_LABELS, UNIT_OPTIONS } from '@suite-common/suite-constants'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, ActionSelect, TextColumn, Translation } from 'src/components/suite'; -import { UNIT_LABELS, UNIT_OPTIONS } from '@suite-common/suite-constants'; import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; diff --git a/packages/suite/src/views/settings/SettingsGeneral/DesktopSuiteBanner.tsx b/packages/suite/src/views/settings/SettingsGeneral/DesktopSuiteBanner.tsx index f1604c6ce71..6b5e557777d 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/DesktopSuiteBanner.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/DesktopSuiteBanner.tsx @@ -1,14 +1,16 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { AnimatePresence, HTMLMotionProps, motion } from 'framer-motion'; + import { Button, H2, Icon, Image, Paragraph, motionEasing } from '@trezor/components'; import { analytics, EventType } from '@trezor/suite-analytics'; import { SUITE_URL } from '@trezor/urls'; +import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; import { useDispatch } from 'src/hooks/suite/useDispatch'; import { setFlag } from 'src/actions/suite/suiteActions'; import { Translation, TrezorLink } from 'src/components/suite'; -import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; const Container = styled(motion.div)` position: relative; diff --git a/packages/suite/src/views/settings/SettingsGeneral/Experimental.tsx b/packages/suite/src/views/settings/SettingsGeneral/Experimental.tsx index 128330b8bb3..127c9a145d1 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Experimental.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Experimental.tsx @@ -1,5 +1,6 @@ import styled from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; + import { Checkbox, Switch, Banner } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; import { EXPERIMENTAL_FEATURES_KB_URL } from '@trezor/urls'; diff --git a/packages/suite/src/views/settings/SettingsGeneral/Language.tsx b/packages/suite/src/views/settings/SettingsGeneral/Language.tsx index 91ea18fa772..dae86d90c0f 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Language.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Language.tsx @@ -1,5 +1,8 @@ import { useMemo } from 'react'; + import { analytics, EventType } from '@trezor/suite-analytics'; +import { getPlatformLanguages } from '@trezor/env-utils'; +import { CROWDIN_URL } from '@trezor/urls'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, ActionSelect, TextColumn, Translation } from 'src/components/suite'; @@ -9,8 +12,6 @@ import LANGUAGES, { Locale, LocaleInfo } from 'src/config/suite/languages'; import { setAutodetect } from 'src/actions/suite/suiteActions'; import { setLanguage } from 'src/actions/settings/languageActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { getPlatformLanguages } from '@trezor/env-utils'; -import { CROWDIN_URL } from '@trezor/urls'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; const onlyOfficial = (locale: [string, LocaleInfo]): locale is [Locale, LocaleInfo] => diff --git a/packages/suite/src/views/settings/SettingsGeneral/SettingsGeneral.tsx b/packages/suite/src/views/settings/SettingsGeneral/SettingsGeneral.tsx index 48a74edea74..7b78b1573fa 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/SettingsGeneral.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/SettingsGeneral.tsx @@ -1,4 +1,5 @@ import { isDesktop, isWeb } from '@trezor/env-utils'; +import { networks, NetworkFeature } from '@suite-common/wallet-config'; import { SettingsLayout, SettingsSection } from 'src/components/settings'; import { Translation } from 'src/components/suite'; @@ -29,7 +30,6 @@ import { DesktopSuiteBanner } from './DesktopSuiteBanner'; import { AddressDisplay } from './AddressDisplay'; import { EnableViewOnly } from './EnableViewOnly'; import { Experimental } from './Experimental'; -import { networks, NetworkFeature } from '@suite-common/wallet-config'; import { TorSnowflake } from './TorSnowflake'; import { AutomaticUpdate } from './AutomaticUpdate'; import { AutoStart } from './AutoStart'; diff --git a/packages/suite/src/views/settings/SettingsGeneral/ShowApplicationLog.tsx b/packages/suite/src/views/settings/SettingsGeneral/ShowApplicationLog.tsx index a260b0dbe9f..5643d0067ca 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/ShowApplicationLog.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/ShowApplicationLog.tsx @@ -1,6 +1,5 @@ import { openModal } from 'src/actions/suite/modalActions'; import { useDispatch } from 'src/hooks/suite'; - import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; diff --git a/packages/suite/src/views/settings/SettingsGeneral/ShowOnTray.tsx b/packages/suite/src/views/settings/SettingsGeneral/ShowOnTray.tsx index ae259c17fa1..b9162b9f451 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/ShowOnTray.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/ShowOnTray.tsx @@ -3,11 +3,11 @@ import { useEffect, useState } from 'react'; import styled from 'styled-components'; import { Switch } from '@trezor/components'; +import { desktopApi } from '@trezor/suite-desktop-api'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { desktopApi } from '@trezor/suite-desktop-api'; const PositionedSwitch = styled.div` align-self: center; diff --git a/packages/suite/src/views/settings/SettingsGeneral/Theme.tsx b/packages/suite/src/views/settings/SettingsGeneral/Theme.tsx index 2f9d8dc8c4f..3dbf7460619 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Theme.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Theme.tsx @@ -1,13 +1,13 @@ import { analytics, EventType } from '@trezor/suite-analytics'; - import { desktopApi, SuiteThemeVariant } from '@trezor/suite-desktop-api'; +import { ThemeColorVariant } from '@trezor/theme'; + import { setAutodetect, setTheme } from 'src/actions/suite/suiteActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, ActionSelect, TextColumn, Translation } from 'src/components/suite'; import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; import { getOsTheme } from 'src/utils/suite/env'; -import { ThemeColorVariant } from '@trezor/theme'; type ThemeColorVariantWithSystem = ThemeColorVariant | 'system'; type Option = { value: ThemeColorVariantWithSystem; label: string }; diff --git a/packages/suite/src/views/settings/SettingsGeneral/Tor.tsx b/packages/suite/src/views/settings/SettingsGeneral/Tor.tsx index 5da8266ba04..5b49fae855e 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Tor.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Tor.tsx @@ -1,6 +1,8 @@ import { useEffect, useState } from 'react'; + import { LoadingContent, Switch } from '@trezor/components'; import { TOR_PROJECT_URL } from '@trezor/urls'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { toggleTor } from 'src/actions/suite/suiteActions'; import { SettingsSectionItem } from 'src/components/settings'; diff --git a/packages/suite/src/views/settings/SettingsGeneral/TorOnionLinks.tsx b/packages/suite/src/views/settings/SettingsGeneral/TorOnionLinks.tsx index 8264ee62e81..b8540de554b 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/TorOnionLinks.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/TorOnionLinks.tsx @@ -1,8 +1,8 @@ import { analytics, EventType } from '@trezor/suite-analytics'; +import { Switch } from '@trezor/components'; import { setOnionLinks } from 'src/actions/suite/suiteActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { Switch } from '@trezor/components'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; diff --git a/packages/suite/src/views/settings/SettingsGeneral/TorSnowflake.tsx b/packages/suite/src/views/settings/SettingsGeneral/TorSnowflake.tsx index a04aebf1058..6849e111a5e 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/TorSnowflake.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/TorSnowflake.tsx @@ -1,7 +1,7 @@ import { ChangeEventHandler, useEffect, useState } from 'react'; + import styled from 'styled-components'; -import { useSelector, useTranslation } from 'src/hooks/suite'; -import { selectTorState } from 'src/reducers/suite/suiteReducer'; + import { TorSettings } from '@trezor/suite-desktop-api/src/messages'; import { TOR_SNOWFLAKE_KB_URL } from '@trezor/urls'; import { breakpointMediaQueries } from '@trezor/styles'; @@ -10,6 +10,8 @@ import { Button, Input } from '@trezor/components'; import { isFullPath } from '@trezor/utils'; import { spacingsPx } from '@trezor/theme'; +import { selectTorState } from 'src/reducers/suite/suiteReducer'; +import { useSelector, useTranslation } from 'src/hooks/suite'; import { ActionColumn, SectionItem, TextColumn, Translation } from 'src/components/suite'; const Container = styled.div` diff --git a/packages/suite/src/views/settings/SettingsLoader.tsx b/packages/suite/src/views/settings/SettingsLoader.tsx index 56368e85192..22f58e92b42 100644 --- a/packages/suite/src/views/settings/SettingsLoader.tsx +++ b/packages/suite/src/views/settings/SettingsLoader.tsx @@ -1,9 +1,13 @@ import React from 'react'; -import { H3, Spinner, motionEasing } from '@trezor/components'; + import styled from 'styled-components'; +import { motion, AnimatePresence } from 'framer-motion'; + +import { H3, Spinner, motionEasing } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; -import { motion, AnimatePresence } from 'framer-motion'; + const Container = styled(motion.div)` background-color: ${({ theme }) => theme.backgroundTertiaryDefaultOnElevation0}; diff --git a/packages/suite/src/views/start/StartContent.tsx b/packages/suite/src/views/start/StartContent.tsx index 4b9d0af6303..a867f5bfd99 100644 --- a/packages/suite/src/views/start/StartContent.tsx +++ b/packages/suite/src/views/start/StartContent.tsx @@ -1,15 +1,19 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { DataAnalytics } from '@trezor/components'; import { analytics } from '@trezor/suite-analytics'; import { DOCS_ANALYTICS_URL, DATA_TOS_URL } from '@trezor/urls'; import { selectIsAnalyticsConfirmed } from '@suite-common/analytics'; +import { typography } from '@trezor/theme'; + import { rerun } from 'src/actions/recovery/recoveryActions'; import { PrerequisitesGuide, TrezorLink } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectPrerequisite } from 'src/reducers/suite/suiteReducer'; + import { SecurityCheck } from '../onboarding/steps/SecurityCheck/SecurityCheck'; -import { typography } from '@trezor/theme'; const StyledTrezorLink = styled(TrezorLink)` color: ${({ theme }) => theme.legacy.TYPE_LIGHT_GREY}; diff --git a/packages/suite/src/views/start/SuiteStart.tsx b/packages/suite/src/views/start/SuiteStart.tsx index dc465707016..b24022c8cac 100644 --- a/packages/suite/src/views/start/SuiteStart.tsx +++ b/packages/suite/src/views/start/SuiteStart.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { WelcomeLayout } from 'src/components/suite'; + import { StartContent } from './StartContent'; const Content = styled.div` diff --git a/packages/suite/src/views/suite/ErrorPage.tsx b/packages/suite/src/views/suite/ErrorPage.tsx index cff4f6b9009..c8c5e1ad200 100644 --- a/packages/suite/src/views/suite/ErrorPage.tsx +++ b/packages/suite/src/views/suite/ErrorPage.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; -import { Translation } from 'src/components/suite'; import { Paragraph, H2, Button, Link, Image } from '@trezor/components'; +import { Translation } from 'src/components/suite'; + + const Wrapper = styled.div` display: flex; flex: 1; diff --git a/packages/suite/src/views/suite/SwitchDevice/CardWithDevice.tsx b/packages/suite/src/views/suite/SwitchDevice/CardWithDevice.tsx index 54242bf98c1..38b24190313 100644 --- a/packages/suite/src/views/suite/SwitchDevice/CardWithDevice.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/CardWithDevice.tsx @@ -2,11 +2,12 @@ import { ReactNode } from 'react'; import { AnimatePresence, motion } from 'framer-motion'; import styled from 'styled-components'; + import { Card, IconName, motionAnimation, useElevation } from '@trezor/components'; import * as deviceUtils from '@suite-common/suite-utils'; +import { Elevation, mapElevationToBorder, spacingsPx } from '@trezor/theme'; import type { TrezorDevice, ForegroundAppProps } from 'src/types/suite'; -import { Elevation, mapElevationToBorder, spacingsPx } from '@trezor/theme'; import { DeviceHeader } from './DeviceItem/DeviceHeader'; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/AddWalletButton.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/AddWalletButton.tsx index b5715e6a3c6..c23f261f458 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/AddWalletButton.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/AddWalletButton.tsx @@ -1,11 +1,11 @@ import { Button, Column, HotkeyBadge, Row, Tooltip } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { WalletType } from '@suite-common/wallet-types'; import { Translation } from 'src/components/suite'; import { TrezorDevice, AcquiredDevice, ForegroundAppProps } from 'src/types/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { SUITE } from 'src/actions/suite/constants'; -import { spacings } from '@trezor/theme'; -import { WalletType } from '@suite-common/wallet-types'; import { addWalletThunk } from 'src/actions/wallet/addWalletThunk'; interface AddWalletButtonProps { diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceConnectionText.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceConnectionText.tsx index 1d3fc985664..9346fb160e3 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceConnectionText.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceConnectionText.tsx @@ -1,7 +1,9 @@ +import { ReactNode } from 'react'; + +import styled, { css } from 'styled-components'; + import { Icon, IconName, IconVariant, Text } from '@trezor/components'; import { spacingsPx, typography } from '@trezor/theme'; -import styled, { css } from 'styled-components'; -import { ReactNode } from 'react'; const Container = styled.span<{ $isAction?: boolean }>` ${typography.label} diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceDetail.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceDetail.tsx index 070900240e5..2629d22aaf1 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceDetail.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceDetail.tsx @@ -1,6 +1,7 @@ -import { TruncateWithTooltip, Column } from '@trezor/components'; import { ReactNode } from 'react'; +import { TruncateWithTooltip, Column } from '@trezor/components'; + export const DeviceDetail = ({ label, children }: { label: string; children: ReactNode }) => ( {label} diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceHeader.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceHeader.tsx index 52ca0a15cc4..a3499d69d0a 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceHeader.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceHeader.tsx @@ -1,13 +1,15 @@ import styled from 'styled-components'; +import { motion } from 'framer-motion'; + import { IconButton, IconName, Row, TOOLTIP_DELAY_LONG, Tooltip } from '@trezor/components'; +import { spacings, spacingsPx } from '@trezor/theme'; +import { selectDevice } from '@suite-common/wallet-core'; + import { DeviceStatus } from 'src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceStatus'; import { isWebUsb } from 'src/utils/suite/transport'; import { Translation, WebUsbButton } from 'src/components/suite'; -import { spacings, spacingsPx } from '@trezor/theme'; import { useSelector } from 'src/hooks/suite'; -import { motion } from 'framer-motion'; import { ForegroundAppProps, TrezorDevice } from 'src/types/suite'; -import { selectDevice } from '@suite-common/wallet-core'; import { WebUsbIconButton } from 'src/components/suite/WebUsbButton'; const Container = styled.div<{ $isFullHeaderVisible: boolean }>` diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx index 0ce2f655961..3af39084e4a 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx @@ -1,18 +1,19 @@ import styled from 'styled-components'; + import { variables, Column } from '@trezor/components'; import * as deviceUtils from '@suite-common/suite-utils'; - import { selectDevice, selectDeviceThunk, acquireDevice } from '@suite-common/wallet-core'; +import { spacings } from '@trezor/theme'; + import { useDispatch, useSelector } from 'src/hooks/suite'; +import type { TrezorDevice, AcquiredDevice, ForegroundAppProps } from 'src/types/suite'; +import { redirectAfterWalletSelectedThunk } from 'src/actions/wallet/addWalletThunk'; import { WalletInstance } from './WalletInstance'; import { AddWalletButton } from './AddWalletButton'; - -import type { TrezorDevice, AcquiredDevice, ForegroundAppProps } from 'src/types/suite'; -import { spacings } from '@trezor/theme'; import { CardWithDevice } from '../CardWithDevice'; import { DeviceWarning } from './DeviceWarning'; -import { redirectAfterWalletSelectedThunk } from 'src/actions/wallet/addWalletThunk'; + const WalletsWrapper = styled.div<{ $enabled: boolean }>` opacity: ${({ $enabled }) => ($enabled ? 1 : 0.5)}; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx index 9e6b32c15eb..0f5b287ae95 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx @@ -1,12 +1,16 @@ +import React, { MouseEventHandler } from 'react'; + import * as deviceUtils from '@suite-common/suite-utils'; import { TOOLTIP_DELAY_LONG, TruncateWithTooltip } from '@trezor/components'; -import React, { MouseEventHandler } from 'react'; +import { TrezorDevice } from '@suite-common/suite-types'; + import { Translation } from 'src/components/suite'; -import { DeviceConnectionText } from './DeviceConnectionText'; import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer'; import { useSelector } from 'src/hooks/suite'; import { useWalletLabeling } from 'src/components/suite/labeling/WalletLabeling'; -import { TrezorDevice } from '@suite-common/suite-types'; + +import { DeviceConnectionText } from './DeviceConnectionText'; + type DeviceStatusTextProps = { onRefreshClick?: MouseEventHandler; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx index 7555980b0a2..4672dd392f4 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx @@ -1,14 +1,17 @@ import styled from 'styled-components'; import { CollapsibleBox, Text, Row } from '@trezor/components'; -import { Translation } from 'src/components/suite'; -import { ViewOnlyRadios } from './ViewOnlyRadios'; import { spacings, spacingsPx } from '@trezor/theme'; -import { useDispatch } from 'src/hooks/suite'; import { toggleRememberDevice } from '@suite-common/wallet-core'; -import { ContentType } from '../types'; import { AcquiredDevice } from '@suite-common/suite-types'; +import { Translation } from 'src/components/suite'; +import { useDispatch } from 'src/hooks/suite'; + +import { ViewOnlyRadios } from './ViewOnlyRadios'; +import { ContentType } from '../types'; + + type ViewOnlyProps = { setContentType: (contentType: ContentType) => void; instance: AcquiredDevice; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnlyRadios.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnlyRadios.tsx index d688f814f7d..fcc46a09f6e 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnlyRadios.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnlyRadios.tsx @@ -2,9 +2,11 @@ import styled, { useTheme } from 'styled-components'; import { Text, Radio, Icon, useElevation, Row, Column, Paragraph } from '@trezor/components'; import { Elevation, borders, mapElevationToBorder, spacings, spacingsPx } from '@trezor/theme'; +import { AcquiredDevice } from '@suite-common/suite-types'; + import { Translation } from 'src/components/suite'; + import { ContentType } from '../types'; -import { AcquiredDevice } from '@suite-common/suite-types'; type ViewOnlyRadiosProps = { isViewOnlyActive: boolean; diff --git a/packages/suite/src/views/suite/SwitchDevice/SwitchDevice.tsx b/packages/suite/src/views/suite/SwitchDevice/SwitchDevice.tsx index e1f7251682b..ab370ad2b8a 100644 --- a/packages/suite/src/views/suite/SwitchDevice/SwitchDevice.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/SwitchDevice.tsx @@ -1,13 +1,13 @@ import * as deviceUtils from '@suite-common/suite-utils'; import { selectDevice, selectDevices } from '@suite-common/wallet-core'; import { Column } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { ForegroundAppProps } from 'src/types/suite'; import { useSelector } from 'src/hooks/suite'; import { DeviceItem } from './DeviceItem/DeviceItem'; import { SwitchDeviceModal } from './SwitchDeviceModal'; -import { spacings } from '@trezor/theme'; export const SwitchDevice = ({ onCancel }: ForegroundAppProps) => { const selectedDevice = useSelector(selectDevice); diff --git a/packages/suite/src/views/suite/SwitchDevice/SwitchDeviceModal.tsx b/packages/suite/src/views/suite/SwitchDevice/SwitchDeviceModal.tsx index 220ca04df7b..72b8933c1a6 100644 --- a/packages/suite/src/views/suite/SwitchDevice/SwitchDeviceModal.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/SwitchDeviceModal.tsx @@ -1,8 +1,11 @@ import { useEvent } from 'react-use'; + import styled from 'styled-components'; import { motion } from 'framer-motion'; + import { spacings } from '@trezor/theme'; import { NewModal, Column } from '@trezor/components'; + import { TrafficLightOffset } from '../../../components/suite/TrafficLightOffset'; type SwitchDeviceModalProps = { diff --git a/packages/suite/src/views/suite/bridge-requested/index.tsx b/packages/suite/src/views/suite/bridge-requested/index.tsx index 0f2e6514679..49d1f3d0a97 100644 --- a/packages/suite/src/views/suite/bridge-requested/index.tsx +++ b/packages/suite/src/views/suite/bridge-requested/index.tsx @@ -1,14 +1,18 @@ import { useState } from 'react'; + import styled from 'styled-components'; -import { Translation, Modal, Metadata } from 'src/components/suite'; + import { Button, Card, Image, Text } from '@trezor/components'; -import { goto } from 'src/actions/suite/routerActions'; -import { useDispatch, useLayout } from 'src/hooks/suite'; import { desktopApi } from '@trezor/suite-desktop-api'; -import { AutoStart } from 'src/views/settings/SettingsGeneral/AutoStart'; import { isDesktop } from '@trezor/env-utils'; import { spacings } from '@trezor/theme'; +import { Translation, Modal, Metadata } from 'src/components/suite'; +import { goto } from 'src/actions/suite/routerActions'; +import { useDispatch, useLayout } from 'src/hooks/suite'; +import { AutoStart } from 'src/views/settings/SettingsGeneral/AutoStart'; + + const StyledModal = styled(Modal)` ${Modal.BottomBar} { > * { diff --git a/packages/suite/src/views/suite/bridge/index.tsx b/packages/suite/src/views/suite/bridge/index.tsx index 04f3274cb76..46904b8e20e 100644 --- a/packages/suite/src/views/suite/bridge/index.tsx +++ b/packages/suite/src/views/suite/bridge/index.tsx @@ -1,11 +1,14 @@ import styled from 'styled-components'; -import { Translation, Modal, Metadata } from 'src/components/suite'; + import { Button, Link } from '@trezor/components'; +import { DATA_URL } from '@trezor/urls'; + +import { Translation, Modal, Metadata } from 'src/components/suite'; import { goto } from 'src/actions/suite/routerActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { isWebUsb } from 'src/utils/suite/transport'; import { useOpenSuiteDesktop } from 'src/hooks/suite/useOpenSuiteDesktop'; -import { DATA_URL } from '@trezor/urls'; + // eslint-disable-next-line local-rules/no-override-ds-component const StyledButton = styled(Button)` diff --git a/packages/suite/src/views/suite/notifications/index.tsx b/packages/suite/src/views/suite/notifications/index.tsx index efe2deec44a..8dcc03d6eba 100644 --- a/packages/suite/src/views/suite/notifications/index.tsx +++ b/packages/suite/src/views/suite/notifications/index.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { Card } from '@trezor/components'; import { Notifications, Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/suite/version/index.tsx b/packages/suite/src/views/suite/version/index.tsx index 4b69a7c5bb0..59f70ceb3f1 100644 --- a/packages/suite/src/views/suite/version/index.tsx +++ b/packages/suite/src/views/suite/version/index.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; + import { Link, H2, Paragraph } from '@trezor/components'; -import { Modal } from 'src/components/suite'; import { getCommitHash, getSuiteVersion } from '@trezor/env-utils'; +import { Modal } from 'src/components/suite'; + const Wrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/views/view-only/MacWindow.tsx b/packages/suite/src/views/view-only/MacWindow.tsx index d93d3765659..187cb2ddcc5 100644 --- a/packages/suite/src/views/view-only/MacWindow.tsx +++ b/packages/suite/src/views/view-only/MacWindow.tsx @@ -1,3 +1,7 @@ +import { ReactNode } from 'react'; + +import styled from 'styled-components'; + import { ElevationContext, useElevation, variables } from '@trezor/components'; import { Elevation, @@ -6,8 +10,6 @@ import { mapElevationToBorder, spacingsPx, } from '@trezor/theme'; -import { ReactNode } from 'react'; -import styled from 'styled-components'; const MAC_WINDOW_HEIGHT = '184px'; diff --git a/packages/suite/src/views/view-only/ViewOnlyPromo.tsx b/packages/suite/src/views/view-only/ViewOnlyPromo.tsx index 9330fdb9426..ad107e6889f 100644 --- a/packages/suite/src/views/view-only/ViewOnlyPromo.tsx +++ b/packages/suite/src/views/view-only/ViewOnlyPromo.tsx @@ -1,7 +1,9 @@ import styled from 'styled-components'; -import { ViewOnlyPromoContent } from './ViewOnlyPromoContent'; + import { WelcomeLayout } from 'src/components/suite'; +import { ViewOnlyPromoContent } from './ViewOnlyPromoContent'; + const Content = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx b/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx index 3270baf7c8b..95722de74b1 100644 --- a/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx +++ b/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx @@ -1,3 +1,7 @@ +import { ReactNode } from 'react'; + +import styled from 'styled-components'; + import { Button, Card, @@ -9,22 +13,24 @@ import { useElevation, variables, } from '@trezor/components'; -import { FormattedCryptoAmount, Translation } from '../../components/suite'; -import styled from 'styled-components'; import { Elevation, borders, mapElevationToBackground, spacings, spacingsPx } from '@trezor/theme'; +import { selectDevice, toggleRememberDevice } from '@suite-common/wallet-core'; +import { DEFAULT_FLAGSHIP_MODEL } from '@suite-common/suite-constants'; +import { analytics, EventType } from '@trezor/suite-analytics'; + +import { goto } from 'src/actions/suite/routerActions'; + +import { FormattedCryptoAmount, Translation } from '../../components/suite'; import { PriceChartLine } from './images/PriceChartLine'; -import { ReactNode } from 'react'; import { DeviceConnectionText } from '../suite/SwitchDevice/DeviceItem/DeviceConnectionText'; import { DeviceDetail } from '../suite/SwitchDevice/DeviceItem/DeviceDetail'; import { MacWindow } from './MacWindow'; import { useDispatch, useSelector } from '../../hooks/suite'; -import { selectDevice, toggleRememberDevice } from '@suite-common/wallet-core'; import { setFlag } from '../../actions/suite/suiteActions'; import { IllustrativeExample } from './images/IllustrativeExample'; import { IllustrativeExampleArrow } from './images/IllustrativeExampleArrow'; -import { goto } from 'src/actions/suite/routerActions'; -import { DEFAULT_FLAGSHIP_MODEL } from '@suite-common/suite-constants'; -import { analytics, EventType } from '@trezor/suite-analytics'; + + const Callout = styled.div` display: flex; diff --git a/packages/suite/src/views/view-only/ViewOnlyTooltip.tsx b/packages/suite/src/views/view-only/ViewOnlyTooltip.tsx index 9d668c3952c..164ccba25ff 100644 --- a/packages/suite/src/views/view-only/ViewOnlyTooltip.tsx +++ b/packages/suite/src/views/view-only/ViewOnlyTooltip.tsx @@ -1,8 +1,10 @@ +import styled, { useTheme } from 'styled-components'; + import { Button, Icon, Text, Tooltip } from '@trezor/components'; import { borders, palette, spacingsPx, zIndices } from '@trezor/theme'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; -import styled, { useTheme } from 'styled-components'; import { setFlag } from 'src/actions/suite/suiteActions'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/wallet/anonymize/components/CoinjoinConfirmation.tsx b/packages/suite/src/views/wallet/anonymize/components/CoinjoinConfirmation.tsx index cff97fca022..b02c7bf5979 100644 --- a/packages/suite/src/views/wallet/anonymize/components/CoinjoinConfirmation.tsx +++ b/packages/suite/src/views/wallet/anonymize/components/CoinjoinConfirmation.tsx @@ -1,10 +1,8 @@ import { useState } from 'react'; -import { useDispatch, useSelector } from 'src/hooks/suite'; + import styled from 'styled-components'; import { Account } from '@suite-common/wallet-types'; -import { Translation, TrezorLink } from 'src/components/suite'; -import { Error } from 'src/components/suite/Error'; import { Button, Card, @@ -18,12 +16,17 @@ import { } from '@trezor/components'; import { spacingsPx, typography } from '@trezor/theme'; import { DATA_TOS_URL, ZKSNACKS_TERMS_URL } from '@trezor/urls'; + +import { Error } from 'src/components/suite/Error'; +import { Translation, TrezorLink } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { startCoinjoinSession } from 'src/actions/wallet/coinjoinAccountActions'; import { selectCoinjoinClient, selectStartCoinjoinSessionArguments, } from 'src/reducers/wallet/coinjoinReducer'; import { useCoinjoinSessionBlockers } from 'src/hooks/coinjoin/useCoinjoinSessionBlockers'; + import { Tile, TileProps } from './Tile'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/views/wallet/anonymize/components/Tile.tsx b/packages/suite/src/views/wallet/anonymize/components/Tile.tsx index 72fb4e66855..87dc0f196a2 100644 --- a/packages/suite/src/views/wallet/anonymize/components/Tile.tsx +++ b/packages/suite/src/views/wallet/anonymize/components/Tile.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled, { css } from 'styled-components'; import { Card, Image, PngImage, variables } from '@trezor/components'; diff --git a/packages/suite/src/views/wallet/coinmarket/DCA/CoinmarketDCALanding.tsx b/packages/suite/src/views/wallet/coinmarket/DCA/CoinmarketDCALanding.tsx index 34564f3e6bc..11876a3aaf8 100644 --- a/packages/suite/src/views/wallet/coinmarket/DCA/CoinmarketDCALanding.tsx +++ b/packages/suite/src/views/wallet/coinmarket/DCA/CoinmarketDCALanding.tsx @@ -1,4 +1,7 @@ import React from 'react'; + +import styled from 'styled-components'; + import { Card, Column, @@ -11,12 +14,12 @@ import { Row, Text, } from '@trezor/components'; -import styled from 'styled-components'; import { borders, palette, spacings, spacingsPx } from '@trezor/theme'; -import { Translation, TrezorLink } from 'src/components/suite'; import { COINMARKET_DOWNLOAD_INVITY_APP_URL } from '@trezor/urls'; -import { useSelector } from 'src/hooks/suite'; import { variables } from '@trezor/components/src/config'; + +import { Translation, TrezorLink } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; import { CoinmarketLayout } from 'src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayout'; import { CoinmarketContainer } from 'src/views/wallet/coinmarket/common/CoinmarketContainer'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketAddressOptions.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketAddressOptions.tsx index 85031bb0a2e..ba512c857a8 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketAddressOptions.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketAddressOptions.tsx @@ -1,22 +1,24 @@ import { useEffect, ReactElement } from 'react'; import { UseFormReturn, Control, Controller } from 'react-hook-form'; import type { MenuPlacement } from 'react-select'; + import styled from 'styled-components'; +import { CryptoId } from 'invity-api'; import type { AccountAddress } from '@trezor/connect'; -import { Translation } from 'src/components/suite'; import { variables, Select } from '@trezor/components'; +import { spacingsPx, typography } from '@trezor/theme'; +import { formatAmount } from '@suite-common/wallet-utils'; +import { networks } from '@suite-common/wallet-config'; + +import { Translation } from 'src/components/suite'; import type { Account } from 'src/types/wallet'; import { useAccountAddressDictionary } from 'src/hooks/wallet/useAccounts'; import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; import { useSelector } from 'src/hooks/suite'; import { CoinmarketBalance } from 'src/views/wallet/coinmarket/common/CoinmarketBalance'; -import { spacingsPx, typography } from '@trezor/theme'; -import { formatAmount } from '@suite-common/wallet-utils'; import { getCoinmarketNetworkDecimals } from 'src/utils/wallet/coinmarket/coinmarketUtils'; -import { networks } from '@suite-common/wallet-config'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; -import { CryptoId } from 'invity-api'; import { isCoinmarketExchangeContext } from 'src/utils/wallet/coinmarket/coinmarketTypingUtils'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; import { FORM_SEND_CRYPTO_CURRENCY_SELECT } from 'src/constants/wallet/coinmarket/form'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketBalance.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketBalance.tsx index e247d84f298..7d3db331af5 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketBalance.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketBalance.tsx @@ -1,7 +1,10 @@ +import styled from 'styled-components'; + import { networks, NetworkSymbol } from '@suite-common/wallet-config'; import { TokenAddress } from '@suite-common/wallet-types'; import { amountToSmallestUnit } from '@suite-common/wallet-utils'; import { typography } from '@trezor/theme'; + import { FiatValue, HiddenPlaceholder, Translation } from 'src/components/suite'; import { useFiatFromCryptoValue } from 'src/hooks/suite/useFiatFromCryptoValue'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; @@ -10,7 +13,6 @@ import { coinmarketGetAccountLabel, getCoinmarketNetworkDecimals, } from 'src/utils/wallet/coinmarket/coinmarketUtils'; -import styled from 'styled-components'; const CoinmarketBalanceWrapper = styled.div` ${typography.label} diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketCoinLogo.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketCoinLogo.tsx index 4002397acf7..9ea7cc42f52 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketCoinLogo.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketCoinLogo.tsx @@ -1,7 +1,9 @@ +import styled from 'styled-components'; + import { AssetLogo } from '@trezor/components'; + import { CoinmarketCoinLogoProps } from 'src/types/coinmarket/coinmarket'; import { parseCryptoId } from 'src/utils/wallet/coinmarket/coinmarketUtils'; -import styled from 'styled-components'; const Wrapper = styled.div``; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketContainer.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketContainer.tsx index 3d797697938..b0f59dee0f5 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketContainer.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketContainer.tsx @@ -1,4 +1,5 @@ import { ElementType } from 'react'; + import { useSelector } from 'src/hooks/suite'; import { CoinmarketFooter } from 'src/views/wallet/coinmarket/common/CoinmarketFooter/CoinmarketFooter'; import { CoinmarketLayoutHeader } from 'src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutHeader'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketCryptoAmount.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketCryptoAmount.tsx index 886586e93c4..9b202339058 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketCryptoAmount.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketCryptoAmount.tsx @@ -1,10 +1,12 @@ -import { spacings } from '@trezor/theme'; -import { FormattedCryptoAmount } from 'src/components/suite'; import styled from 'styled-components'; +import { CryptoId } from 'invity-api'; + +import { spacings } from '@trezor/theme'; import { Row } from '@trezor/components'; + +import { FormattedCryptoAmount } from 'src/components/suite'; import { CoinmarketCoinLogo } from 'src/views/wallet/coinmarket/common/CoinmarketCoinLogo'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; -import { CryptoId } from 'invity-api'; import { CoinmarketTestWrapper } from 'src/views/wallet/coinmarket'; const LogoWrapper = styled.div` diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuy.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuy.tsx index e40ad32b71e..9c06e5783fe 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuy.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuy.tsx @@ -1,6 +1,7 @@ import styled from 'styled-components'; import { Card } from '@trezor/components'; + import { goto } from 'src/actions/suite/routerActions'; import { useDispatch } from 'src/hooks/suite'; import { useCoinmarketDetailContext } from 'src/hooks/wallet/coinmarket/useCoinmarketDetail'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentFailed.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentFailed.tsx index abee70d39c9..9e63ec728ed 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentFailed.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentFailed.tsx @@ -1,10 +1,12 @@ import styled from 'styled-components'; + import { Button, variables, Link, Image } from '@trezor/components'; +import { spacings, spacingsPx } from '@trezor/theme'; + import { useDispatch } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite/Translation'; import { goto } from 'src/actions/suite/routerActions'; -import { spacings, spacingsPx } from '@trezor/theme'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentProcessing.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentProcessing.tsx index c11cfb7cfbf..c527f3fd763 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentProcessing.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentProcessing.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; + import { variables, Spinner, Button, Link } from '@trezor/components'; -import { Translation } from 'src/components/suite/Translation'; import { spacingsPx } from '@trezor/theme'; +import { Translation } from 'src/components/suite/Translation'; + const Wrapper = styled.div` display: flex; align-items: center; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentSuccessful.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentSuccessful.tsx index ee0fadc0b81..335f3d055c6 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentSuccessful.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentSuccessful.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { Button, variables, Image } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentWaitingForUser.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentWaitingForUser.tsx index c6c03f564bd..7bc0c8eb0f9 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentWaitingForUser.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentWaitingForUser.tsx @@ -1,14 +1,18 @@ import { useState } from 'react'; + import styled from 'styled-components'; +import { BuyTrade, BuyTradeStatus } from 'invity-api'; + import { Button, variables, Image } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite/Translation'; -import { BuyTrade, BuyTradeStatus } from 'invity-api'; import { Account } from 'src/types/wallet'; import invityAPI from 'src/services/suite/invityAPI'; import { createTxLink } from 'src/utils/wallet/coinmarket/buyUtils'; import { submitRequestForm } from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; import { useDispatch } from 'src/hooks/suite'; -import { spacings } from '@trezor/theme'; + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchange.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchange.tsx index a51a5d4967f..9ec50f93de7 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchange.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchange.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { Card } from '@trezor/components'; import { goto } from 'src/actions/suite/routerActions'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentConverting.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentConverting.tsx index 17ccf6f0b9b..2772d25ce63 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentConverting.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentConverting.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; + import { variables, Spinner, Button, Link } from '@trezor/components'; -import { Translation } from 'src/components/suite/Translation'; import { spacingsPx } from '@trezor/theme'; +import { Translation } from 'src/components/suite/Translation'; + const Wrapper = styled.div` display: flex; align-items: center; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentFailed.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentFailed.tsx index 5abde79154d..9e8b6297048 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentFailed.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentFailed.tsx @@ -1,11 +1,12 @@ import styled from 'styled-components'; import { Button, variables, Link, Image } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; + import { useDispatch } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite/Translation'; import { goto } from 'src/actions/suite/routerActions'; -import { spacingsPx } from '@trezor/theme'; import { CoinmarketTransactionId } from 'src/views/wallet/coinmarket/common/CoinmarketTransactionId'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentKYC.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentKYC.tsx index 90086d7fd73..06c4b8f15bd 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentKYC.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentKYC.tsx @@ -1,12 +1,13 @@ import styled from 'styled-components'; +import { ExchangeProviderInfo } from 'invity-api'; import { Button, variables, Link, Image } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; + import { useDispatch } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite/Translation'; -import { ExchangeProviderInfo } from 'invity-api'; import { goto } from 'src/actions/suite/routerActions'; -import { spacingsPx } from '@trezor/theme'; import { CoinmarketTransactionId } from 'src/views/wallet/coinmarket/common/CoinmarketTransactionId'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentSending.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentSending.tsx index 294c0f006fe..44b67313d18 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentSending.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentSending.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; + import { variables, Spinner, Button, Link } from '@trezor/components'; -import { Translation } from 'src/components/suite/Translation'; import { spacingsPx } from '@trezor/theme'; +import { Translation } from 'src/components/suite/Translation'; + const Wrapper = styled.div` display: flex; align-items: center; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentSuccessful.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentSuccessful.tsx index 36863526df5..1556e589b62 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentSuccessful.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailExchange/CoinmarketDetailExchangePaymentSuccessful.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { Button, variables, Image } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSell.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSell.tsx index eb74e7105c6..711ace19bfd 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSell.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSell.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { Card } from '@trezor/components'; import { goto } from 'src/actions/suite/routerActions'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentFailed.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentFailed.tsx index ba45a66e606..81a14c8ff37 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentFailed.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentFailed.tsx @@ -1,11 +1,12 @@ import styled from 'styled-components'; import { Button, variables, Link, Image } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; + import { useDispatch } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite/Translation'; import { goto } from 'src/actions/suite/routerActions'; -import { spacingsPx } from '@trezor/theme'; import { CoinmarketTransactionId } from 'src/views/wallet/coinmarket/common/CoinmarketTransactionId'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentPending.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentPending.tsx index 6871f99af14..f7ea48c2110 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentPending.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentPending.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; + import { variables, Spinner, Button, Link } from '@trezor/components'; -import { Translation } from 'src/components/suite/Translation'; import { spacingsPx } from '@trezor/theme'; +import { Translation } from 'src/components/suite/Translation'; + const Wrapper = styled.div` display: flex; align-items: center; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentSuccessful.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentSuccessful.tsx index b21377ddbb2..74a4a583353 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentSuccessful.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailSell/CoinmarketDetailSellPaymentSuccessful.tsx @@ -1,10 +1,12 @@ import styled from 'styled-components'; + import { Button, variables, Image } from '@trezor/components'; +import { borders } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; import { goto } from 'src/actions/suite/routerActions'; -import { borders } from '@trezor/theme'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersAmounts.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersAmounts.tsx index b92e8a10f39..7aa890d5012 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersAmounts.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersAmounts.tsx @@ -1,5 +1,11 @@ import React from 'react'; + import styled, { useTheme } from 'styled-components'; +import { CryptoId } from 'invity-api'; + +import { spacingsPx } from '@trezor/theme'; +import { Icon } from '@trezor/components'; + import { getCryptoQuoteAmountProps, isCoinmarketBuyContext, @@ -7,10 +13,7 @@ import { } from 'src/utils/wallet/coinmarket/coinmarketTypingUtils'; import { FormattedCryptoAmount } from 'src/components/suite'; import { CoinmarketTradeDetailType } from 'src/types/coinmarket/coinmarket'; -import { spacingsPx } from '@trezor/theme'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; -import { CryptoId } from 'invity-api'; -import { Icon } from '@trezor/components'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; import { CoinmarketFiatAmount } from 'src/views/wallet/coinmarket/common/CoinmarketFiatAmount'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersItem.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersItem.tsx index 73f3180549c..031336b90b2 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersItem.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersItem.tsx @@ -1,8 +1,11 @@ import styled, { useTheme } from 'styled-components'; +import { SellFiatTrade } from 'invity-api'; + import { Badge, Button, Card, Text } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { spacings, spacingsPx } from '@trezor/theme'; import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; + +import { Translation } from 'src/components/suite'; import { getCryptoQuoteAmountProps, getProvidersInfoProps, @@ -12,7 +15,6 @@ import { isCoinmarketSellContext, } from 'src/utils/wallet/coinmarket/coinmarketTypingUtils'; import { getTagAndInfoNote } from 'src/utils/wallet/coinmarket/coinmarketUtils'; -import { SellFiatTrade } from 'invity-api'; import { CoinmarketFormContextValues } from 'src/types/coinmarket/coinmarketForm'; import { CoinmarketTradeDetailBuySellType, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersPaymentInfo.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersPaymentInfo.tsx index 17db763529a..092f19f0999 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersPaymentInfo.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffersPaymentInfo.tsx @@ -1,11 +1,13 @@ +import styled from 'styled-components'; + +import { spacingsPx } from '@trezor/theme'; + import { CoinmarketTradeBuySellType, CoinmarketTradeDetailBuySellType, CoinmarketTradeType, } from 'src/types/coinmarket/coinmarket'; import { Translation } from 'src/components/suite'; -import styled from 'styled-components'; -import { spacingsPx } from '@trezor/theme'; import { CoinmarketPaymentPlainType } from 'src/views/wallet/coinmarket/common/CoinmarketPaymentPlainType'; const PaymentInfoWrapper = styled.div` diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFooter/CoinmarketFooter.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFooter/CoinmarketFooter.tsx index 4ee46c32e32..c892695e69f 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFooter/CoinmarketFooter.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFooter/CoinmarketFooter.tsx @@ -1,10 +1,13 @@ -import { variables, Icon, Link, Image, Row } from '@trezor/components'; import { useState, useRef } from 'react'; + import styled, { css } from 'styled-components'; + +import { variables, Icon, Link, Image, Row } from '@trezor/components'; import { useOnClickOutside } from '@trezor/react-utils'; import { DATA_TOS_INVITY_URL, INVITY_URL } from '@trezor/urls'; -import { Translation } from 'src/components/suite'; import { borders, spacings, spacingsPx, zIndices } from '@trezor/theme'; + +import { Translation } from 'src/components/suite'; import { CoinmarketFooterLogoWrapper } from 'src/views/wallet/coinmarket'; import { CoinmarketProvidedByInvity } from 'src/views/wallet/coinmarket/common/CoinmarketFooter/CoinmarketProvidedByInvity'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFooter/CoinmarketProvidedByInvity.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFooter/CoinmarketProvidedByInvity.tsx index 4f932fca524..e0122de17da 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFooter/CoinmarketProvidedByInvity.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFooter/CoinmarketProvidedByInvity.tsx @@ -1,7 +1,9 @@ import styled from 'styled-components'; -import { Translation } from 'src/components/suite'; + import { INVITY_URL } from '@trezor/urls'; import { variables, Link, Image } from '@trezor/components'; + +import { Translation } from 'src/components/suite'; import { CoinmarketFooterLogoWrapper } from 'src/views/wallet/coinmarket'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputAccount.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputAccount.tsx index c487e11a552..bd3aba50f5e 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputAccount.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputAccount.tsx @@ -1,5 +1,12 @@ import { Controller } from 'react-hook-form'; +import { createFilter } from 'react-select'; + +import styled from 'styled-components'; +import { FiatCurrencyCode } from 'invity-api'; + import { Row, Select } from '@trezor/components'; +import { spacings, spacingsPx } from '@trezor/theme'; + import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; import { CoinmarketAccountOptionsGroupOptionProps, @@ -13,13 +20,9 @@ import { CoinmarketFormInputAccountProps, CoinmarketSellFormProps, } from 'src/types/coinmarket/coinmarketForm'; -import { createFilter } from 'react-select'; import { CoinmarketFormInputAccountOption } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputAccountOption'; import { useCoinmarketFiatValues } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketFiatValues'; import { CoinmarketBalance } from 'src/views/wallet/coinmarket/common/CoinmarketBalance'; -import styled from 'styled-components'; -import { spacings, spacingsPx } from '@trezor/theme'; -import { FiatCurrencyCode } from 'invity-api'; import { AccountTypeBadge } from 'src/components/suite/AccountTypeBadge'; import { useCoinmarketBuildAccountGroups } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketBuildAccountGroups'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputAccountOption.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputAccountOption.tsx index 60a1742ff3d..d2517b24e91 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputAccountOption.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputAccountOption.tsx @@ -1,5 +1,6 @@ import { amountToSmallestUnit } from '@suite-common/wallet-utils'; import { useElevation } from '@trezor/components'; + import { HiddenPlaceholder } from 'src/components/suite'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCountry.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCountry.tsx index bea4f501d31..9d9a3e76e85 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCountry.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCountry.tsx @@ -1,11 +1,14 @@ import { Control, Controller } from 'react-hook-form'; + +import styled from 'styled-components'; + import { Flag, Select } from '@trezor/components'; +import { borders, spacingsPx } from '@trezor/theme'; + import regional from 'src/constants/wallet/coinmarket/regional'; import { CountryOption } from 'src/types/wallet/coinmarketCommonTypes'; import { getCountryLabelParts } from 'src/utils/wallet/coinmarket/coinmarketUtils'; -import styled from 'styled-components'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; -import { borders, spacingsPx } from '@trezor/theme'; import { CoinmarketFormInputLabel } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputLabel'; import { CoinmarketBuySellFormProps, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCryptoSelect.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCryptoSelect.tsx index 0243e00da15..97a5c7e1bf9 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCryptoSelect.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCryptoSelect.tsx @@ -1,11 +1,15 @@ import { Controller } from 'react-hook-form'; +import { useMemo, useState } from 'react'; + import { Select, useElevation } from '@trezor/components'; +import { SelectAssetModal } from '@trezor/product-components'; +import { networks, NetworkSymbol } from '@suite-common/wallet-config'; + import { CoinmarketAccountOptionsGroupOptionProps, CoinmarketCryptoSelectItemProps, CoinmarketTradeBuyExchangeType, } from 'src/types/coinmarket/coinmarket'; -import { useMemo, useState } from 'react'; import { CoinmarketFormOption, CoinmarketFormOptionLabel, @@ -22,8 +26,6 @@ import { import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; import { parseCryptoId } from 'src/utils/wallet/coinmarket/coinmarketUtils'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; -import { SelectAssetModal } from '@trezor/product-components'; -import { networks, NetworkSymbol } from '@suite-common/wallet-config'; import { FORM_CRYPTO_CURRENCY_SELECT, FORM_RECEIVE_CRYPTO_CURRENCY_SELECT, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCurrency.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCurrency.tsx index d38457ca639..7a53621999e 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCurrency.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCurrency.tsx @@ -1,7 +1,9 @@ -import { buildCurrencyOptions } from '@suite-common/wallet-utils'; -import { Select } from '@trezor/components'; import { useMemo } from 'react'; import { Control, Controller } from 'react-hook-form'; + +import { buildCurrencyOptions } from '@suite-common/wallet-utils'; +import { Select } from '@trezor/components'; + import { FORM_FIAT_CURRENCY_SELECT, FORM_FIAT_INPUT, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputFiatCrypto/CoinmarketFormInputCryptoAmount.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputFiatCrypto/CoinmarketFormInputCryptoAmount.tsx index f519c4b90ff..eae06081c4f 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputFiatCrypto/CoinmarketFormInputCryptoAmount.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputFiatCrypto/CoinmarketFormInputCryptoAmount.tsx @@ -1,3 +1,11 @@ +import { FieldErrors } from 'react-hook-form'; + +import { getInputState } from '@suite-common/wallet-utils'; +import { formInputsMaxLength } from '@suite-common/validators'; +import { useFormatters } from '@suite-common/formatters'; +import { useDidUpdate } from '@trezor/react-utils'; +import { FormState } from '@suite-common/wallet-types'; + import { useTranslation } from 'src/hooks/suite'; import { NumberInput } from 'src/components/suite'; import { @@ -7,10 +15,7 @@ import { validateMin, validateReserveOrBalance, } from 'src/utils/suite/validation'; -import { getInputState } from '@suite-common/wallet-utils'; -import { formInputsMaxLength } from '@suite-common/validators'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; -import { useFormatters } from '@suite-common/formatters'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { CoinmarketAllFormProps, @@ -19,18 +24,15 @@ import { CoinmarketSellExchangeFormProps, } from 'src/types/coinmarket/coinmarketForm'; import { CoinmarketFormOptionLabel } from 'src/views/wallet/coinmarket'; -import { FieldErrors } from 'react-hook-form'; import { coinmarketGetAccountLabel, getCoinmarketNetworkDecimals, } from 'src/utils/wallet/coinmarket/coinmarketUtils'; -import { useDidUpdate } from '@trezor/react-utils'; import { FORM_OUTPUT_AMOUNT, FORM_OUTPUT_MAX } from 'src/constants/wallet/coinmarket/form'; import { CoinmarketAccountOptionsGroupOptionProps, CoinmarketCryptoListProps, } from 'src/types/coinmarket/coinmarket'; -import { FormState } from '@suite-common/wallet-types'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; import { isCoinmarketBuyContext, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputFiatCrypto/CoinmarketFormInputFiat.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputFiatCrypto/CoinmarketFormInputFiat.tsx index 2f5431923ba..88db3ac4a69 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputFiatCrypto/CoinmarketFormInputFiat.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputFiatCrypto/CoinmarketFormInputFiat.tsx @@ -1,10 +1,15 @@ +import { FieldErrors, UseControllerProps } from 'react-hook-form'; + +import styled from 'styled-components'; + +import { getInputState } from '@suite-common/wallet-utils'; +import { formInputsMaxLength } from '@suite-common/validators'; +import { useDidUpdate } from '@trezor/react-utils'; + import { useTranslation } from 'src/hooks/suite'; import { NumberInput } from 'src/components/suite'; import { validateDecimals, validateMin } from 'src/utils/suite/validation'; -import { getInputState } from '@suite-common/wallet-utils'; -import { formInputsMaxLength } from '@suite-common/validators'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; -import { useDidUpdate } from '@trezor/react-utils'; import { CoinmarketFormInputCurrency } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCurrency'; import { CoinmarketAllFormProps, @@ -12,8 +17,6 @@ import { CoinmarketFormInputFiatCryptoProps, CoinmarketSellExchangeFormProps, } from 'src/types/coinmarket/coinmarketForm'; -import styled from 'styled-components'; -import { FieldErrors, UseControllerProps } from 'react-hook-form'; import { FORM_OUTPUT_AMOUNT, FORM_OUTPUT_FIAT } from 'src/constants/wallet/coinmarket/form'; import { isCoinmarketExchangeContext } from 'src/utils/wallet/coinmarket/coinmarketTypingUtils'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputLoader.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputLoader.tsx index 3b2ed8d7f98..5f9a353776e 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputLoader.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputLoader.tsx @@ -1,6 +1,7 @@ +import styled from 'styled-components'; + import { Spinner, useElevation } from '@trezor/components'; import { Elevation, borders, mapElevationToBackground, spacingsPx, zIndices } from '@trezor/theme'; -import styled from 'styled-components'; const CoinmarketFormInputLoaderWrapper = styled.div<{ $elevation: Elevation }>` display: flex; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputPaymentMethod.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputPaymentMethod.tsx index c9f7952411f..bd80ea39031 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputPaymentMethod.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputPaymentMethod.tsx @@ -1,5 +1,7 @@ import { Control, Controller } from 'react-hook-form'; + import { Select } from '@trezor/components'; + import { CoinmarketPaymentMethodListProps, CoinmarketTradeBuySellType, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormSwitcherCryptoFiat.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormSwitcherCryptoFiat.tsx index 1c26cddd694..69429d30cb6 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormSwitcherCryptoFiat.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormSwitcherCryptoFiat.tsx @@ -1,4 +1,5 @@ import { TextButton } from '@trezor/components'; + import { Translation } from 'src/components/suite'; interface CoinmarketFormSwitcherCryptoFiatProps { diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormSwitcherExchangeRates.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormSwitcherExchangeRates.tsx index 5f6a28e39e2..ada66db43f1 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormSwitcherExchangeRates.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormSwitcherExchangeRates.tsx @@ -1,11 +1,14 @@ +import { UseFormSetValue } from 'react-hook-form'; + import styled, { css } from 'styled-components'; + import { Radio } from '@trezor/components'; import { variables } from '@trezor/components/src/config'; -import { Translation } from 'src/components/suite'; import { borders, spacingsPx } from '@trezor/theme'; -import { CoinmarketExchangeFormProps, RateType } from 'src/types/coinmarket/coinmarketForm'; -import { UseFormSetValue } from 'react-hook-form'; import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; + +import { Translation } from 'src/components/suite'; +import { CoinmarketExchangeFormProps, RateType } from 'src/types/coinmarket/coinmarketForm'; import { FORM_RATE_FIXED, FORM_RATE_FLOATING, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInputs.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInputs.tsx index 2077e0f472d..7c39f83a356 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInputs.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInputs.tsx @@ -1,4 +1,11 @@ +import styled from 'styled-components'; + import { spacings, spacingsPx } from '@trezor/theme'; +import { Row } from '@trezor/components'; +import { TokenAddress } from '@suite-common/wallet-types'; +import { formatAmount } from '@suite-common/wallet-utils'; +import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; + import { Fees } from 'src/components/wallet/Fees/Fees'; import { FORM_CRYPTO_CURRENCY_SELECT, @@ -20,16 +27,11 @@ import { CoinmarketFormInputCryptoSelect } from 'src/views/wallet/coinmarket/com import { CoinmarketFormInputAccount } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputAccount'; import { CoinmarketFormInputCountry } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCountry'; import { CoinmarketFormInputPaymentMethod } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputPaymentMethod'; -import styled from 'styled-components'; import { CoinmarketFormSwitcherExchangeRates } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormSwitcherExchangeRates'; import { CoinmarketFormInputFiatCrypto } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputFiatCrypto/CoinmarketFormInputFiatCrypto'; import { CoinmarketFractionButtons } from 'src/views/wallet/coinmarket/common/CoinmarketFractionButtons'; -import { Row } from '@trezor/components'; import { CoinmarketBalance } from 'src/views/wallet/coinmarket/common/CoinmarketBalance'; -import { TokenAddress } from '@suite-common/wallet-types'; -import { formatAmount } from '@suite-common/wallet-utils'; import { getCoinmarketNetworkDecimals } from 'src/utils/wallet/coinmarket/coinmarketUtils'; -import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; import { isCoinmarketExchangeContext, isCoinmarketSellContext, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormLayout.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormLayout.tsx index 1fcfa50acb0..095af78f1c3 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormLayout.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormLayout.tsx @@ -1,6 +1,7 @@ import styled from 'styled-components'; import { Card } from '@trezor/components'; + import { CoinmarketFormInputs } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInputs'; import { CoinmarketFormOffer } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffer'; import { CoinmarketFeaturedOffers } from 'src/views/wallet/coinmarket/common/CoinmarketFeaturedOffers/CoinmarketFeaturedOffers'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffer.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffer.tsx index 84b1fc16898..54265fba271 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffer.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffer.tsx @@ -1,6 +1,10 @@ -import { Button, TextButton, Row, Column, Paragraph } from '@trezor/components'; +import { useState } from 'react'; + import { CryptoId, ExchangeTrade } from 'invity-api'; + +import { Button, TextButton, Row, Column, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; + import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; import { getCryptoQuoteAmountProps, @@ -9,7 +13,6 @@ import { getSelectQuoteTyped, isCoinmarketExchangeContext, } from 'src/utils/wallet/coinmarket/coinmarketTypingUtils'; -import { useState } from 'react'; import { Translation } from 'src/components/suite'; import { CoinmarketFormOfferItem } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferItem'; import { CoinmarketFormOfferCryptoAmount } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferCryptoAmount'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferCryptoAmount.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferCryptoAmount.tsx index e70e597f16f..f0ba1e0e17c 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferCryptoAmount.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferCryptoAmount.tsx @@ -1,10 +1,11 @@ +import { CryptoId } from 'invity-api'; + import { Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { FormattedCryptoAmount } from 'src/components/suite'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; import { CoinmarketCoinLogo } from 'src/views/wallet/coinmarket/common/CoinmarketCoinLogo'; -import { CryptoId } from 'invity-api'; interface CoinmarketCryptoAmountProps { amount: string | number; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferFiatAmount.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferFiatAmount.tsx index e0d1032d590..978415e6c97 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferFiatAmount.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferFiatAmount.tsx @@ -1,5 +1,6 @@ import { spacings } from '@trezor/theme'; import { Row, Text } from '@trezor/components'; + import { useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; import { CoinmarketFormInputCurrency } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCurrency'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferItem.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferItem.tsx index d77858781b7..fa605f4c645 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferItem.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOfferItem.tsx @@ -1,5 +1,6 @@ import { Row, Spinner, Card, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { CoinmarketTradeDetailType, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffersSwitcher.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffersSwitcher.tsx index 8466bbc5f80..3149c276a72 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffersSwitcher.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffersSwitcher.tsx @@ -1,7 +1,9 @@ +import { ExchangeTrade } from 'invity-api'; + import { spacings } from '@trezor/theme'; import { Row, Card, Column, Spinner, Paragraph } from '@trezor/components'; + import { Translation } from 'src/components/suite'; -import { ExchangeTrade } from 'invity-api'; import { CoinmarketTradeDetailType, CoinmarketUtilsProvidersProps, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffersSwitcherItem.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffersSwitcherItem.tsx index 49021a81adc..10b907456fe 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffersSwitcherItem.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormOffersSwitcherItem.tsx @@ -1,9 +1,11 @@ import { ExchangeTrade } from 'invity-api'; -import { CoinmarketUtilsProvidersProps } from 'src/types/coinmarket/coinmarket'; -import { Badge, Radio, Tooltip, Row, Text, useElevation } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import styled from 'styled-components'; + +import { Badge, Radio, Tooltip, Row, Text, useElevation } from '@trezor/components'; import { borders, spacings, spacingsPx, mapElevationToBackground, Elevation } from '@trezor/theme'; + +import { CoinmarketUtilsProvidersProps } from 'src/types/coinmarket/coinmarket'; +import { Translation } from 'src/components/suite'; import { ExchangeType } from 'src/types/coinmarket/coinmarketForm'; import { FORM_EXCHANGE_CEX, FORM_EXCHANGE_DEX } from 'src/constants/wallet/coinmarket/form'; import { CoinmarketUtilsProvider } from 'src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsProvider'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFractionButtons.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFractionButtons.tsx index ed8216e5d0c..3b76f793175 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFractionButtons.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketFractionButtons.tsx @@ -1,7 +1,8 @@ import { Button, Row } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { spacings } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; + interface CoinmarketFractionButtonsProps { onFractionClick: (divisor: number) => void; onAllClick: () => void; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketExchangeHeaderSummary.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketExchangeHeaderSummary.tsx index 752fd91f03a..18fcf9abd47 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketExchangeHeaderSummary.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketExchangeHeaderSummary.tsx @@ -1,11 +1,13 @@ import { useTheme } from 'styled-components'; -import { CoinmarketTradeExchangeType } from 'src/types/coinmarket/coinmarket'; -import { useSelector } from 'src/hooks/suite'; -import { H3, Icon, Row, Text } from '@trezor/components'; import { CryptoId } from 'invity-api'; -import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; + +import { H3, Icon, Row, Text } from '@trezor/components'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; import { spacings } from '@trezor/theme'; + +import { CoinmarketTradeExchangeType } from 'src/types/coinmarket/coinmarket'; +import { useSelector } from 'src/hooks/suite'; +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { CoinmarketCryptoAmount } from 'src/views/wallet/coinmarket/common/CoinmarketCryptoAmount'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeader.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeader.tsx index 88990284e49..2a2a51d4baa 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeader.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeader.tsx @@ -1,10 +1,12 @@ +import styled from 'styled-components'; + import { H2 } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; +import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; + import { Translation } from 'src/components/suite'; import { ExtendedMessageDescriptor } from 'src/types/suite'; import { INVITY_API_RELOAD_QUOTES_AFTER_SECONDS } from 'src/constants/wallet/coinmarket/metadata'; -import styled from 'styled-components'; -import { spacingsPx } from '@trezor/theme'; -import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; import { getCryptoQuoteAmountProps, isCoinmarketExchangeContext, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeaderFilter.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeaderFilter.tsx index cd3405654ba..7bf555bb4be 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeaderFilter.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeaderFilter.tsx @@ -1,5 +1,8 @@ import styled from 'styled-components'; + import { spacingsPx } from '@trezor/theme'; +import { Row } from '@trezor/components'; + import { CoinmarketFormInputCountry } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputCountry'; import { CoinmarketBuyFormProps, @@ -14,7 +17,6 @@ import { FORM_SEND_CRYPTO_CURRENCY_SELECT, } from 'src/constants/wallet/coinmarket/form'; import { CoinmarketFormInputFiatCrypto } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputFiatCrypto/CoinmarketFormInputFiatCrypto'; -import { Row } from '@trezor/components'; import { CoinmarketOffersExchangeFiltersPanel } from 'src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketOffersExchangeFiltersPanel'; import { CoinmarketFormInputPaymentMethod } from 'src/views/wallet/coinmarket/common/CoinmarketForm/CoinmarketFormInput/CoinmarketFormInputPaymentMethod'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeaderSummary.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeaderSummary.tsx index 062e6cd74c0..393d0994b0b 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeaderSummary.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketHeaderSummary.tsx @@ -1,7 +1,9 @@ -import { H3, Icon, Row } from '@trezor/components'; import styled from 'styled-components'; + +import { H3, Icon, Row } from '@trezor/components'; import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; import { spacingsPx } from '@trezor/theme'; + import { CoinmarketExchangeHeaderSummary } from 'src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketExchangeHeaderSummary'; import { CoinmarketFiatAmount } from 'src/views/wallet/coinmarket/common/CoinmarketFiatAmount'; import { CoinmarketCryptoAmount } from 'src/views/wallet/coinmarket/common/CoinmarketCryptoAmount'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketOffersExchangeFiltersPanel.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketOffersExchangeFiltersPanel.tsx index 59f5752ed49..3128627708f 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketOffersExchangeFiltersPanel.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketHeader/CoinmarketOffersExchangeFiltersPanel.tsx @@ -1,3 +1,8 @@ +import styled from 'styled-components'; + +import { Row, Select } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { EXCHANGE_COMPARATOR_KYC_FILTER, @@ -10,9 +15,6 @@ import { EXCHANGE_COMPARATOR_RATE_FILTER_FLOATING_CEX, } from 'src/constants/wallet/coinmarket/form'; import { CoinmarketTradeExchangeType } from 'src/types/coinmarket/coinmarket'; -import { Row, Select } from '@trezor/components'; -import styled from 'styled-components'; -import { spacings } from '@trezor/theme'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; const SelectWrapper = styled.div` diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayout.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayout.tsx index e1edfa9da83..6db4321e9f8 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayout.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayout.tsx @@ -2,6 +2,7 @@ import { PropsWithChildren } from 'react'; import { spacings } from '@trezor/theme'; import { Column } from '@trezor/components'; + import { CoinmarketLayoutNavigation } from 'src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutNavigation/CoinmarketLayoutNavigation'; import { useSelector } from 'src/hooks/suite'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutHeader.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutHeader.tsx index 77f86575b1b..437ac0ab4b7 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutHeader.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutHeader.tsx @@ -1,7 +1,9 @@ -import { IconButton, Row } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { PropsWithChildren, useCallback, useMemo } from 'react'; import { useHistory } from 'react-router-dom'; + +import { IconButton, Row } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { PageHeader } from 'src/components/suite/layouts/SuiteLayout'; import { BasicName } from 'src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/BasicName'; import { useLayout, useSelector, useTranslation } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutNavigation/CoinmarketLayoutNavigation.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutNavigation/CoinmarketLayoutNavigation.tsx index 4500cdfa185..19f052f47fd 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutNavigation/CoinmarketLayoutNavigation.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutNavigation/CoinmarketLayoutNavigation.tsx @@ -1,4 +1,5 @@ import { Row } from '@trezor/components'; + import { CoinmarketLayoutNavigationItem } from 'src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutNavigation/CoinmarketLayoutNavigationItem'; export const CoinmarketLayoutNavigation = () => ( diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutNavigation/CoinmarketLayoutNavigationItem.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutNavigation/CoinmarketLayoutNavigationItem.tsx index d0138495dba..ec66d4a21d4 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutNavigation/CoinmarketLayoutNavigationItem.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketLayout/CoinmarketLayoutNavigation/CoinmarketLayoutNavigationItem.tsx @@ -1,13 +1,15 @@ +import styled, { css } from 'styled-components'; + import { TranslationKey } from '@suite-common/intl-types'; import { Route } from '@suite-common/suite-types'; import { Button, IconName } from '@trezor/components'; import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; import { typography, borders, spacingsPx } from '@trezor/theme'; + import { goto } from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite'; import { NavigationItem } from 'src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import styled, { css } from 'styled-components'; const NavListItemWrapper = styled(NavigationItem)` padding: ${spacingsPx.xs} ${spacingsPx.md}; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersEmpty.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersEmpty.tsx index b39052e16b4..76617362068 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersEmpty.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersEmpty.tsx @@ -1,7 +1,8 @@ -import { Translation } from 'src/components/suite'; import { Card, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; + export const CoinmarketOffersEmpty = () => ( diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersExchange.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersExchange.tsx index defebc6f0d7..13442cd7f32 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersExchange.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersExchange.tsx @@ -1,3 +1,7 @@ +import { useMemo } from 'react'; + +import { ExchangeTrade } from 'invity-api'; + import { CoinmarketTradeExchangeType } from 'src/types/coinmarket/coinmarket'; import { EXCHANGE_COMPARATOR_KYC_FILTER, @@ -8,9 +12,7 @@ import { EXCHANGE_COMPARATOR_RATE_FILTER_FIXED_CEX, EXCHANGE_COMPARATOR_RATE_FILTER_FLOATING_CEX, } from 'src/constants/wallet/coinmarket/form'; -import { ExchangeTrade } from 'invity-api'; import { KYC_DEX, KYC_NO_KYC } from 'src/constants/wallet/coinmarket/kyc'; -import { useMemo } from 'react'; import { CoinmarketOffersExchangeQuotesByTypeSection } from 'src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersExchangeQuotesByTypeSection'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersExchangeQuotesByTypeSection.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersExchangeQuotesByTypeSection.tsx index 13a32bf69bc..6471ae9d772 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersExchangeQuotesByTypeSection.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersExchangeQuotesByTypeSection.tsx @@ -1,7 +1,9 @@ import { ExchangeTrade } from 'invity-api'; -import { ExtendedMessageDescriptor, Translation } from 'src/components/suite/Translation'; + import { H3, Icon, Row, Tooltip } from '@trezor/components'; import { spacings } from '@trezor/theme'; + +import { ExtendedMessageDescriptor, Translation } from 'src/components/suite/Translation'; import { CoinmarketOffersItem } from 'src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersItem'; interface CoinmarketOffersExchangeQuotesByTypeSectionProps { diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersItem.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersItem.tsx index bf43bc3b8d6..295fde63177 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersItem.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersItem.tsx @@ -1,8 +1,11 @@ import styled, { useTheme } from 'styled-components'; +import { SellFiatTrade } from 'invity-api'; + import { Badge, Button, Card, Row, Text } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { spacings, spacingsPx } from '@trezor/theme'; import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; + +import { Translation } from 'src/components/suite'; import { CoinmarketTradeDetailMapProps } from 'src/types/coinmarket/coinmarket'; import { getCryptoQuoteAmountProps, @@ -12,7 +15,6 @@ import { isCoinmarketSellContext, } from 'src/utils/wallet/coinmarket/coinmarketTypingUtils'; import { getTagAndInfoNote } from 'src/utils/wallet/coinmarket/coinmarketUtils'; -import { SellFiatTrade } from 'invity-api'; import { CoinmarketUtilsKyc } from 'src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsKyc'; import { CoinmarketTestWrapper } from 'src/views/wallet/coinmarket'; import { CoinmarketUtilsPrice } from 'src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsPrice'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketPaymentPlainType.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketPaymentPlainType.tsx index 83f923c51f7..ca48e5573c2 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketPaymentPlainType.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketPaymentPlainType.tsx @@ -1,8 +1,10 @@ import { ReactNode } from 'react'; + +import { Column, Text } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { FORM_DEFAULT_PAYMENT_METHOD } from 'src/constants/wallet/coinmarket/form'; import { CoinmarketPaymentMethodType } from 'src/types/coinmarket/coinmarket'; -import { Column, Text } from '@trezor/components'; interface CoinmarketPaymentTypeProps { children?: ReactNode; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketPaymentType.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketPaymentType.tsx index 4fc36be5cfc..de7158e0fb3 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketPaymentType.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketPaymentType.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import { Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketProviderInfo.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketProviderInfo.tsx index 26bec749048..c937d0f0392 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketProviderInfo.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketProviderInfo.tsx @@ -1,5 +1,6 @@ import { Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; + import invityAPI from 'src/services/suite/invityAPI'; export interface CoinmarketProviderInfoProps { diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketRefreshTime.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketRefreshTime.tsx index dae66fa6fcc..8ba3df3f2c5 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketRefreshTime.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketRefreshTime.tsx @@ -1,5 +1,7 @@ import { ReactElement } from 'react'; + import styled from 'styled-components'; + import { variables, Spinner, ProgressPie } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoExchangeType.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoExchangeType.tsx index d935004c284..97bcdf970cc 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoExchangeType.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoExchangeType.tsx @@ -1,5 +1,7 @@ -import { Row, Tooltip, Text } from '@trezor/components'; import { ExchangeTrade } from 'invity-api'; + +import { Row, Tooltip, Text } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { CoinmarketExchangeProvidersInfoProps, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoHeader.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoHeader.tsx index 7fff8b9766c..6810934473f 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoHeader.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoHeader.tsx @@ -1,6 +1,8 @@ +import { CryptoId } from 'invity-api'; + import { Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { CryptoId } from 'invity-api'; + import { Translation } from 'src/components/suite'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; import { parseCryptoId } from 'src/utils/wallet/coinmarket/coinmarketUtils'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoItem.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoItem.tsx index e23c6c7b2f4..35fea2c4633 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoItem.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoItem.tsx @@ -1,7 +1,9 @@ +import { CryptoId } from 'invity-api'; + import { Account } from '@suite-common/wallet-types'; import { Column, Row, InfoRow, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { CryptoId } from 'invity-api'; + import { AccountLabeling, Translation } from 'src/components/suite'; import { CoinmarketPayGetLabelType, CoinmarketTradeType } from 'src/types/coinmarket/coinmarket'; import { CoinmarketCoinLogo } from 'src/views/wallet/coinmarket/common/CoinmarketCoinLogo'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoPaymentMethod.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoPaymentMethod.tsx index 720d5d29649..8e02f008489 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoPaymentMethod.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoPaymentMethod.tsx @@ -1,4 +1,5 @@ import { InfoRow } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { CoinmarketPaymentMethodType } from 'src/types/coinmarket/coinmarket'; import { CoinmarketPaymentType } from 'src/views/wallet/coinmarket/common/CoinmarketPaymentType'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoProvider.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoProvider.tsx index 19c2d8ae6c6..09492711456 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoProvider.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketInfo/CoinmarketInfoProvider.tsx @@ -1,4 +1,5 @@ import { InfoRow } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { CoinmarketGetProvidersInfoProps } from 'src/types/coinmarket/coinmarket'; import { CoinmarketProviderInfo } from 'src/views/wallet/coinmarket/common/CoinmarketProviderInfo'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchange.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchange.tsx index 671c5eb5a3a..c79ec7ec1e1 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchange.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchange.tsx @@ -1,3 +1,5 @@ +import { Fragment } from 'react'; + import { Divider, Card } from '@trezor/components'; import { spacings } from '@trezor/theme'; @@ -10,7 +12,6 @@ import { CoinmarketSelectedOfferStepper, CoinmarketSelectedOfferStepperItemProps, } from 'src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOfferStepper'; -import { Fragment } from 'react'; import { CoinmarketTradeExchangeType } from 'src/types/coinmarket/coinmarket'; import { CoinmarketOfferExchangeSend } from 'src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchangeSend'; import { CoinmarketOfferExchangeSendSwap } from 'src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchangeSendSwap'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchangeSendApproval.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchangeSendApproval.tsx index d38c4ca17ec..d78d4038814 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchangeSendApproval.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchangeSendApproval.tsx @@ -1,6 +1,8 @@ import { useState } from 'react'; + import styled from 'styled-components'; -import { Translation, AccountLabeling } from 'src/components/suite'; +import { DexApprovalType } from 'invity-api'; + import { Button, Banner, @@ -14,8 +16,9 @@ import { Card, } from '@trezor/components'; import { spacings } from '@trezor/theme'; + +import { Translation, AccountLabeling } from 'src/components/suite'; import { useCoinmarketNavigation } from 'src/hooks/wallet/useCoinmarketNavigation'; -import { DexApprovalType } from 'invity-api'; import { CoinmarketTradeExchangeType } from 'src/types/coinmarket/coinmarket'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchangeSendSwap.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchangeSendSwap.tsx index a88241ce32b..595bce255f8 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchangeSendSwap.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferExchange/CoinmarketOfferExchangeSendSwap.tsx @@ -1,6 +1,9 @@ import { useState, ChangeEvent } from 'react'; +import { FieldError } from 'react-hook-form'; + +import useDebounce from 'react-use/lib/useDebounce'; import styled, { useTheme } from 'styled-components'; -import { Translation, AccountLabeling, FormattedCryptoAmount } from 'src/components/suite'; + import { Button, Icon, @@ -15,12 +18,12 @@ import { ElevationContext, getInputStateTextColor, } from '@trezor/components'; -import useDebounce from 'react-use/lib/useDebounce'; import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { FieldError } from 'react-hook-form'; import { BottomText } from '@trezor/components/src/components/form/BottomText'; import { TranslationKey } from '@suite-common/intl-types'; import { spacings } from '@trezor/theme'; + +import { Translation, AccountLabeling, FormattedCryptoAmount } from 'src/components/suite'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; import { CoinmarketTradeExchangeType } from 'src/types/coinmarket/coinmarket'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSell.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSell.tsx index 3a95665f0ed..91f96980e97 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSell.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSell.tsx @@ -1,4 +1,5 @@ import { Fragment } from 'react'; + import { Divider, Card } from '@trezor/components'; import { spacings } from '@trezor/theme'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellBankAccount.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellBankAccount.tsx index 2df83d90527..e92f215e455 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellBankAccount.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellBankAccount.tsx @@ -1,12 +1,16 @@ import { useState } from 'react'; + import styled, { useTheme } from 'styled-components'; -import { QuestionTooltip, Translation } from 'src/components/suite'; -import { Button, Select, Icon, Row } from '@trezor/components'; import { BankAccount } from 'invity-api'; + +import { Button, Select, Icon, Row } from '@trezor/components'; +import { fontWeights, spacingsPx, typography } from '@trezor/theme'; + +import { QuestionTooltip, Translation } from 'src/components/suite'; import { formatIban } from 'src/utils/wallet/coinmarket/sellUtils'; import { CoinmarketTradeSellType } from 'src/types/coinmarket/coinmarket'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; -import { fontWeights, spacingsPx, typography } from '@trezor/theme'; + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellTransaction.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellTransaction.tsx index 57b686069ef..4e421cc25d2 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellTransaction.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellTransaction.tsx @@ -1,10 +1,13 @@ import styled from 'styled-components'; -import { Translation, AccountLabeling } from 'src/components/suite'; + import { Button, Spinner } from '@trezor/components'; +import { fontWeights, spacingsPx, typography } from '@trezor/theme'; + +import { Translation, AccountLabeling } from 'src/components/suite'; import { useCoinmarketWatchTrade } from 'src/hooks/wallet/coinmarket/useCoinmarketWatchTrade'; import { CoinmarketTradeSellType } from 'src/types/coinmarket/coinmarket'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; -import { fontWeights, spacingsPx, typography } from '@trezor/theme'; + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOffer.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOffer.tsx index 7060017b1e6..3cbba82b846 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOffer.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOffer.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; import { getCryptoQuoteAmountProps, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOfferInfo.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOfferInfo.tsx index 1ad8f84b3d4..58188288a7f 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOfferInfo.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOfferInfo.tsx @@ -1,4 +1,5 @@ import { CryptoId } from 'invity-api'; + import { Column, Divider } from '@trezor/components'; import { spacings } from '@trezor/theme'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOfferStepper.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOfferStepper.tsx index 064ebb25884..d4095839019 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOfferStepper.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketSelectedOfferStepper.tsx @@ -1,6 +1,8 @@ +import { Fragment } from 'react'; + import { Icon, Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Fragment } from 'react'; + import { Translation } from 'src/components/suite'; import { ExtendedMessageDescriptor } from 'src/types/suite'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerify.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerify.tsx index 50603cd73b7..76f388fde62 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerify.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerify.tsx @@ -1,18 +1,21 @@ +import { useEffect } from 'react'; + +import { CryptoId } from 'invity-api'; + import addressValidator from '@trezor/address-validator'; -import { Translation } from 'src/components/suite'; import { Input, Button, Paragraph, Divider, Column, Tooltip, H4 } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { isHexValid, isInteger } from '@suite-common/wallet-utils'; + +import { Translation } from 'src/components/suite'; import { useTranslation } from 'src/hooks/suite/useTranslation'; import { ConfirmedOnTrezor } from 'src/views/wallet/coinmarket/common/ConfirmedOnTrezor'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; import { CoinmarketTradeBuyExchangeType } from 'src/types/coinmarket/coinmarket'; import { CoinmarketVerifyOptions } from 'src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerifyOptions'; import { CoinmarketVerifyAccountReturnProps } from 'src/types/coinmarket/coinmarketVerify'; -import { CryptoId } from 'invity-api'; -import { isHexValid, isInteger } from '@suite-common/wallet-utils'; import { CoinmarketAddressOptions } from 'src/views/wallet/coinmarket/common/CoinmarketAddressOptions'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; -import { useEffect } from 'react'; import { useDispatch } from 'src/hooks/suite'; import { COINMARKET_BUY } from 'src/actions/wallet/constants'; import * as modalActions from 'src/actions/suite/modalActions'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerifyOptions.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerifyOptions.tsx index d13a22efc05..e44f4125dbd 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerifyOptions.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerifyOptions.tsx @@ -1,4 +1,5 @@ import { Select } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; import { diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerifyOptionsItem.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerifyOptionsItem.tsx index be814714b8b..f8b889282c7 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerifyOptionsItem.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketVerify/CoinmarketVerifyOptionsItem.tsx @@ -1,6 +1,9 @@ +import styled, { useTheme } from 'styled-components'; + import { Column, Icon, Row, variables } from '@trezor/components'; import { CoinLogo } from '@trezor/product-components'; import { spacingsPx } from '@trezor/theme'; + import { AccountLabeling, Translation } from 'src/components/suite'; import { FORM_SEND_CRYPTO_CURRENCY_SELECT } from 'src/constants/wallet/coinmarket/form'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; @@ -9,7 +12,6 @@ import { CoinmarketVerifyOptionsItemProps } from 'src/types/coinmarket/coinmarke import { isCoinmarketExchangeContext } from 'src/utils/wallet/coinmarket/coinmarketTypingUtils'; import { parseCryptoId } from 'src/utils/wallet/coinmarket/coinmarketUtils'; import { CoinmarketBalance } from 'src/views/wallet/coinmarket/common/CoinmarketBalance'; -import styled, { useTheme } from 'styled-components'; const LogoWrapper = styled.div` padding: 0 0 0 ${spacingsPx.xxs}; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTag.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTag.tsx index 7992522d4fa..54e328e5f35 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTag.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTag.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { variables } from '@trezor/components'; import { borders } from '@trezor/theme'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactionId.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactionId.tsx index 9b0cad2df21..694f15a84cf 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactionId.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactionId.tsx @@ -1,11 +1,13 @@ import styled from 'styled-components'; + import { Button, Row } from '@trezor/components'; import { copyToClipboard } from '@trezor/dom-utils'; -import { useDispatch } from 'src/hooks/suite'; -import { Translation } from 'src/components/suite'; import { notificationsActions } from '@suite-common/toast-notifications'; import { spacings, spacingsPx, typography } from '@trezor/theme'; +import { useDispatch } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; + const LabelWrapper = styled.div` width: 100%; flex: auto; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionAmounts.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionAmounts.tsx index 30ceea4c7a2..507b74e3f1e 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionAmounts.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionAmounts.tsx @@ -1,5 +1,6 @@ import { Icon, iconSizes, Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; + import { FormattedCryptoAmount, HiddenPlaceholder } from 'src/components/suite'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; import { Trade } from 'src/types/wallet/coinmarketCommonTypes'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionId.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionId.tsx index d77d1f952c4..7133b0f113a 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionId.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionId.tsx @@ -1,5 +1,6 @@ import { Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; interface CoinmarketTransactionIdProps { diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionInfo.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionInfo.tsx index b19fce0c0e9..82a7c9a5ccf 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionInfo.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionInfo.tsx @@ -1,5 +1,6 @@ import { Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; + import { FormattedDate } from 'src/components/suite'; import { useTranslation } from 'src/hooks/suite'; import { ExtendedMessageDescriptor } from 'src/types/suite'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionProvider.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionProvider.tsx index 0ba4319148b..077b42a8a54 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionProvider.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionProvider.tsx @@ -1,5 +1,6 @@ import { Flex, FlexProps, useMediaQuery, variables } from '@trezor/components'; import { spacings } from '@trezor/theme'; + import { CoinmarketPaymentMethodType } from 'src/types/coinmarket/coinmarket'; import { CoinmarketPaymentType } from 'src/views/wallet/coinmarket/common/CoinmarketPaymentType'; import { diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionStatus.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionStatus.tsx index 9fdb302f47e..381a1cd5ec7 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionStatus.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionStatus.tsx @@ -1,12 +1,16 @@ import { DefaultTheme, useTheme } from 'styled-components'; +import { BuyTradeStatus, ExchangeTradeStatus, SellTradeStatus } from 'invity-api'; + +import { Icon, Row, Text } from '@trezor/components'; +import { spacings } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { getStatusMessage as getBuyStatusMessage } from 'src/utils/wallet/coinmarket/buyUtils'; import { getStatusMessage as getExchangeStatusMessage } from 'src/utils/wallet/coinmarket/exchangeUtils'; import { getStatusMessage as getSellStatusMessage } from 'src/utils/wallet/coinmarket/sellUtils'; -import { Icon, Row, Text } from '@trezor/components'; import { Trade } from 'src/types/wallet/coinmarketCommonTypes'; -import { BuyTradeStatus, ExchangeTradeStatus, SellTradeStatus } from 'invity-api'; -import { spacings } from '@trezor/theme'; + + const getBuyTradeData = (status: BuyTradeStatus, theme: DefaultTheme) => { const message = getBuyStatusMessage(status); diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionExchange.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionExchange.tsx index 83d0f9c46d1..2542d9143b4 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionExchange.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionExchange.tsx @@ -1,6 +1,7 @@ import { ExchangeProviderInfo } from 'invity-api'; import { Button } from '@trezor/components'; + import { TradeExchange } from 'src/types/wallet/coinmarketCommonTypes'; import { goto } from 'src/actions/suite/routerActions'; import { saveTransactionId } from 'src/actions/wallet/coinmarketExchangeActions'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsBuy.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsBuy.tsx index 53d7ee62df7..f1a632b8642 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsBuy.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsBuy.tsx @@ -1,6 +1,8 @@ import { BuyProviderInfo } from 'invity-api'; -import { saveTransactionDetailId } from 'src/actions/wallet/coinmarketBuyActions'; + import { Button } from '@trezor/components'; + +import { saveTransactionDetailId } from 'src/actions/wallet/coinmarketBuyActions'; import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; import { TradeBuy } from 'src/types/wallet/coinmarketCommonTypes'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsList.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsList.tsx index 89130e9bc13..9f3b11275c9 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsList.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsList.tsx @@ -1,9 +1,11 @@ +import styled from 'styled-components'; + +import { H3, Paragraph, variables } from '@trezor/components'; +import { spacingsPx, typography } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; -import { H3, Paragraph, variables } from '@trezor/components'; -import styled from 'styled-components'; import { useCoinmarketLoadData } from 'src/hooks/wallet/coinmarket/useCoinmarketLoadData'; -import { spacingsPx, typography } from '@trezor/theme'; import { CoinmarketTransactionSell } from 'src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsSell'; import { CoinmarketTransactionBuy } from 'src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsBuy'; import { CoinmarketTransactionExchange } from 'src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionExchange'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsSell.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsSell.tsx index 6ca5b4a3120..27d2563f6b9 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsSell.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransactionsSell.tsx @@ -1,4 +1,7 @@ import { SellProviderInfo } from 'invity-api'; + +import { Button } from '@trezor/components'; + import { goto } from 'src/actions/suite/routerActions'; import { saveComposedTransactionInfo } from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; import { @@ -6,7 +9,6 @@ import { saveTransactionId, setIsFromRedirect, } from 'src/actions/wallet/coinmarketSellActions'; -import { Button } from '@trezor/components'; import { CoinmarketTransactionId } from 'src/views/wallet/coinmarket/common'; import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsKyc.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsKyc.tsx index d869051dccb..93b69957e3f 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsKyc.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsKyc.tsx @@ -1,9 +1,11 @@ -import { Banner, Icon, Tooltip } from '@trezor/components'; import { useTheme } from 'styled-components'; +import { ExchangeKYCType } from 'invity-api'; + +import { Banner, Icon, Tooltip } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { TooltipIcon, TooltipText, TooltipWrap } from 'src/views/wallet/coinmarket'; import { CoinmarketExchangeProvidersInfoProps } from 'src/types/coinmarket/coinmarket'; -import { ExchangeKYCType } from 'invity-api'; import { KYC_DEX, KYC_NO_KYC, diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsPrice.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsPrice.tsx index 18a5231ac52..7d4ebb93ab6 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsPrice.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsPrice.tsx @@ -1,7 +1,9 @@ import styled from 'styled-components'; + import { spacingsPx, typography } from '@trezor/theme'; -import { Translation } from 'src/components/suite'; import { FONT_SIZE, SCREEN_QUERY } from '@trezor/components/src/config/variables'; + +import { Translation } from 'src/components/suite'; import { coinmarketGetAmountLabels } from 'src/utils/wallet/coinmarket/coinmarketUtils'; import { CoinmarketFiatAmount } from 'src/views/wallet/coinmarket/common/CoinmarketFiatAmount'; import { CoinmarketCryptoAmount } from 'src/views/wallet/coinmarket/common/CoinmarketCryptoAmount'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsProvider.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsProvider.tsx index 6739ef3df16..2db20cc18e4 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsProvider.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsProvider.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { spacings } from '@trezor/theme'; import { Row } from '@trezor/components'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsTooltip.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsTooltip.tsx index 5fa5af83e45..b83def9002b 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsTooltip.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsTooltip.tsx @@ -1,5 +1,7 @@ -import { Icon, Tooltip } from '@trezor/components'; import { useTheme } from 'styled-components'; + +import { Icon, Tooltip } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useTranslation } from 'src/hooks/suite'; import { TooltipIcon, TooltipText, TooltipWrap } from 'src/views/wallet/coinmarket'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsTooltipFee.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsTooltipFee.tsx index 9b644f7de8c..4a46ee7145a 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsTooltipFee.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketUtils/CoinmarketUtilsTooltipFee.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { typography } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { CoinmarketOffersItemProps } from 'src/views/wallet/coinmarket/common/CoinmarketOffers/CoinmarketOffersItem'; diff --git a/packages/suite/src/views/wallet/coinmarket/common/ConfirmedOnTrezor.tsx b/packages/suite/src/views/wallet/coinmarket/common/ConfirmedOnTrezor.tsx index 775e05005ad..7a930f940b2 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/ConfirmedOnTrezor.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/ConfirmedOnTrezor.tsx @@ -1,10 +1,12 @@ import React from 'react'; +import styled from 'styled-components'; + import { TrezorDevice } from '@suite-common/suite-types'; import { variables } from '@trezor/components'; import { RotateDeviceImage } from '@trezor/product-components'; + import { Translation } from 'src/components/suite'; -import styled from 'styled-components'; const Confirmed = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/coinmarket/index.tsx b/packages/suite/src/views/wallet/coinmarket/index.tsx index 014b83cfd13..323a16d57a9 100644 --- a/packages/suite/src/views/wallet/coinmarket/index.tsx +++ b/packages/suite/src/views/wallet/coinmarket/index.tsx @@ -1,4 +1,6 @@ import styled from 'styled-components'; +import { Margin } from 'recharts/types/util/types'; + import { variables, Spinner } from '@trezor/components'; import { Elevation, @@ -9,7 +11,7 @@ import { spacingsPx, typography, } from '@trezor/theme'; -import { Margin } from 'recharts/types/util/types'; + import { CoinmarketCoinLogo } from 'src/views/wallet/coinmarket/common/CoinmarketCoinLogo'; interface ResponsiveSize { diff --git a/packages/suite/src/views/wallet/coinmarket/redirect/CoinmarketRedirect.tsx b/packages/suite/src/views/wallet/coinmarket/redirect/CoinmarketRedirect.tsx index 5d24eb5bd62..ba9d6f6b6f6 100644 --- a/packages/suite/src/views/wallet/coinmarket/redirect/CoinmarketRedirect.tsx +++ b/packages/suite/src/views/wallet/coinmarket/redirect/CoinmarketRedirect.tsx @@ -1,12 +1,17 @@ import { useEffect } from 'react'; + import styled from 'styled-components'; +import { CryptoId } from 'invity-api'; + +import { variables } from '@trezor/components'; +import { FeeLevel } from '@trezor/connect'; + import { useSelector } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; -import { variables } from '@trezor/components'; import { useCoinmarketRedirect } from 'src/hooks/wallet/useCoinmarketRedirect'; import { Translation } from 'src/components/suite'; -import { FeeLevel } from '@trezor/connect'; -import { CryptoId } from 'invity-api'; + + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/details/CoinjoinLogs.tsx b/packages/suite/src/views/wallet/details/CoinjoinLogs.tsx index fb50521a043..1a325f99f14 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinLogs.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinLogs.tsx @@ -1,7 +1,9 @@ import styled from 'styled-components'; + import { desktopApi } from '@trezor/suite-desktop-api'; -import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { Card } from '@trezor/components'; + +import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; import { useAnchor } from 'src/hooks/suite/useAnchor'; import { CoinjoinLogsAnchor } from 'src/constants/suite/anchors'; diff --git a/packages/suite/src/views/wallet/details/CoinjoinSetup/AnonymityLevelSetup.tsx b/packages/suite/src/views/wallet/details/CoinjoinSetup/AnonymityLevelSetup.tsx index eeb2de9886b..c408200fb70 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/AnonymityLevelSetup.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/AnonymityLevelSetup.tsx @@ -1,12 +1,15 @@ import { useMemo, useState } from 'react'; + import { AnimatePresence, HTMLMotionProps, motion } from 'framer-motion'; import styled, { useTheme } from 'styled-components'; +import { Icon, Banner, motionEasing } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { AnonymityStatus } from 'src/constants/suite/coinjoin'; import { useAnonymityStatus, useDispatch } from 'src/hooks/suite'; -import { Icon, Banner, motionEasing } from '@trezor/components'; import { coinjoinAccountUpdateAnonymity } from 'src/actions/wallet/coinjoinAccountActions'; + import { SetupSlider } from './SetupSlider/SetupSlider'; const Label = styled.span` diff --git a/packages/suite/src/views/wallet/details/CoinjoinSetup/CoinjoinSetup.tsx b/packages/suite/src/views/wallet/details/CoinjoinSetup/CoinjoinSetup.tsx index 6ef24786126..03cb88f1354 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/CoinjoinSetup.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/CoinjoinSetup.tsx @@ -1,15 +1,18 @@ import { useDispatch } from 'react-redux'; + import { AnimatePresence, motion } from 'framer-motion'; import styled from 'styled-components'; +import { Card, Radio, motionAnimation, motionEasing, Banner } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; -import { Card, Radio, motionAnimation, motionEasing, Banner } from '@trezor/components'; import { coinjoinAccountUpdateSetupOption } from 'src/actions/wallet/coinjoinAccountActions'; +import { selectCoinjoinAccountByKey } from 'src/reducers/wallet/coinjoinReducer'; + import { AnonymityLevelSetup } from './AnonymityLevelSetup'; import { MaxMiningFeeSetup } from './MaxMiningFeeSetup'; import { SkipRoundsSetup } from './SkipRoundsSetup'; -import { selectCoinjoinAccountByKey } from 'src/reducers/wallet/coinjoinReducer'; const SetupContainer = styled.div` padding: 18px; diff --git a/packages/suite/src/views/wallet/details/CoinjoinSetup/MaxMiningFeeSetup.tsx b/packages/suite/src/views/wallet/details/CoinjoinSetup/MaxMiningFeeSetup.tsx index e10a507be01..e41931f15c8 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/MaxMiningFeeSetup.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/MaxMiningFeeSetup.tsx @@ -1,13 +1,15 @@ import { useTheme } from 'styled-components'; + import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { coinjoinAccountUpdateMaxMiningFee } from 'src/actions/wallet/coinjoinAccountActions'; -import { SetupSlider } from './SetupSlider/SetupSlider'; import { selectDefaultMaxMiningFeeByAccountKey, selectFeeRateMedianByAccountKey, } from 'src/reducers/wallet/coinjoinReducer'; +import { SetupSlider } from './SetupSlider/SetupSlider'; + const min = 1; const max = 500; const unit = 'sat/vB'; diff --git a/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SetupSlider.tsx b/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SetupSlider.tsx index 75d30da7830..b627b5ab0bd 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SetupSlider.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SetupSlider.tsx @@ -1,9 +1,12 @@ import { useRef, ReactNode, KeyboardEventHandler, ChangeEventHandler } from 'react'; + import styled from 'styled-components'; -import { useSelector } from 'src/hooks/suite/useSelector'; import { Range, RangeProps, variables } from '@trezor/components'; + +import { useSelector } from 'src/hooks/suite/useSelector'; import { selectCurrentCoinjoinSession } from 'src/reducers/wallet/coinjoinReducer'; + import { SliderInput, SliderInputProps } from './SliderInput'; const Row = styled.div` diff --git a/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SliderInput.tsx b/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SliderInput.tsx index 61f2e4bf7b2..61d83f36f80 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SliderInput.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SliderInput.tsx @@ -7,7 +7,9 @@ import { KeyboardEvent, ChangeEvent, } from 'react'; + import styled from 'styled-components'; + import { Input, InputProps, variables } from '@trezor/components'; const LevelContainer = styled.div` diff --git a/packages/suite/src/views/wallet/details/CoinjoinSetup/SkipRoundsSetup.tsx b/packages/suite/src/views/wallet/details/CoinjoinSetup/SkipRoundsSetup.tsx index 7be0f4e889e..2108dd286a3 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/SkipRoundsSetup.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/SkipRoundsSetup.tsx @@ -1,9 +1,11 @@ import { useDispatch } from 'react-redux'; + import styled from 'styled-components'; +import { Switch, variables } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; -import { Switch, variables } from '@trezor/components'; import { coinjoinAccountToggleSkipRounds } from 'src/actions/wallet/coinjoinAccountActions'; import { selectCurrentCoinjoinSession } from 'src/reducers/wallet/coinjoinReducer'; diff --git a/packages/suite/src/views/wallet/details/RescanAccount.tsx b/packages/suite/src/views/wallet/details/RescanAccount.tsx index 1bafb84fe3d..d11e65d8a2e 100644 --- a/packages/suite/src/views/wallet/details/RescanAccount.tsx +++ b/packages/suite/src/views/wallet/details/RescanAccount.tsx @@ -2,6 +2,7 @@ import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/compone import { useDispatch } from 'src/hooks/suite/useDispatch'; import { rescanCoinjoinAccount } from 'src/actions/wallet/coinjoinAccountActions'; import type { Account } from 'src/types/wallet'; + import { Row } from './Row'; type RescanAccountProps = { diff --git a/packages/suite/src/views/wallet/details/Row.tsx b/packages/suite/src/views/wallet/details/Row.tsx index da286d0cda9..ca5dba06d1d 100644 --- a/packages/suite/src/views/wallet/details/Row.tsx +++ b/packages/suite/src/views/wallet/details/Row.tsx @@ -1,5 +1,6 @@ -import { Row as RowComponent } from '@trezor/components'; import { ReactNode } from 'react'; + +import { Row as RowComponent } from '@trezor/components'; import { spacings } from '@trezor/theme'; interface RowProps { diff --git a/packages/suite/src/views/wallet/details/index.tsx b/packages/suite/src/views/wallet/details/index.tsx index 2de0522e95f..8574794e65b 100644 --- a/packages/suite/src/views/wallet/details/index.tsx +++ b/packages/suite/src/views/wallet/details/index.tsx @@ -2,20 +2,21 @@ import styled from 'styled-components'; import { getAccountTypeTech } from '@suite-common/wallet-utils'; import { Paragraph, variables, Card, Column } from '@trezor/components'; +import { HELP_CENTER_BIP32_URL, HELP_CENTER_XPUB_URL } from '@trezor/urls'; +import { spacings } from '@trezor/theme'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; - -import { HELP_CENTER_BIP32_URL, HELP_CENTER_XPUB_URL } from '@trezor/urls'; import { showXpub } from 'src/actions/wallet/publicKeyActions'; import { WalletLayout } from 'src/components/wallet'; import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; +import { AccountTypeDescription } from 'src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription'; +import { AccountTypeBadge } from 'src/components/suite/AccountTypeBadge'; + import { CoinjoinLogs } from './CoinjoinLogs'; import { CoinjoinSetup } from './CoinjoinSetup/CoinjoinSetup'; import { RescanAccount } from './RescanAccount'; -import { spacings } from '@trezor/theme'; import { Row } from './Row'; -import { AccountTypeDescription } from 'src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription'; -import { AccountTypeBadge } from 'src/components/suite/AccountTypeBadge'; + const Heading = styled.h3` color: ${({ theme }) => theme.legacy.TYPE_LIGHT_GREY}; diff --git a/packages/suite/src/views/wallet/receive/Receive.tsx b/packages/suite/src/views/wallet/receive/Receive.tsx index f44c9edf2ef..0ffb0c5a946 100644 --- a/packages/suite/src/views/wallet/receive/Receive.tsx +++ b/packages/suite/src/views/wallet/receive/Receive.tsx @@ -1,15 +1,15 @@ import { selectDevice, selectPendingAccountAddresses } from '@suite-common/wallet-core'; +import { Column } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { WalletLayout, WalletSubpageHeading } from 'src/components/wallet'; import { useDevice, useSelector } from 'src/hooks/suite'; +import { ConfirmEvmExplanationModal } from 'src/components/suite/modals'; import { FreshAddress } from './components/FreshAddress'; import { UsedAddresses } from './components/UsedAddresses'; import { CoinjoinReceiveWarning } from './components/CoinjoinReceiveWarning'; -import { ConfirmEvmExplanationModal } from 'src/components/suite/modals'; import { ConnectDeviceReceivePromo } from './components/ConnectDevicePromo'; -import { Column } from '@trezor/components'; -import { spacings } from '@trezor/theme'; export const Receive = () => { const isCoinjoinReceiveWarningHidden = useSelector( diff --git a/packages/suite/src/views/wallet/receive/components/CoinjoinReceiveWarning.tsx b/packages/suite/src/views/wallet/receive/components/CoinjoinReceiveWarning.tsx index 42364b81571..a515c8a333c 100644 --- a/packages/suite/src/views/wallet/receive/components/CoinjoinReceiveWarning.tsx +++ b/packages/suite/src/views/wallet/receive/components/CoinjoinReceiveWarning.tsx @@ -1,8 +1,10 @@ import styled, { useTheme } from 'styled-components'; import { darken } from 'polished'; + +import { Button, Icon, variables, Banner } from '@trezor/components'; + import { useDispatch, useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; -import { Button, Icon, variables, Banner } from '@trezor/components'; import { hideCoinjoinReceiveWarning } from 'src/actions/suite/suiteActions'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; diff --git a/packages/suite/src/views/wallet/receive/components/ConnectDevicePromo.tsx b/packages/suite/src/views/wallet/receive/components/ConnectDevicePromo.tsx index 038eb17ec38..c24ee6c55c9 100644 --- a/packages/suite/src/views/wallet/receive/components/ConnectDevicePromo.tsx +++ b/packages/suite/src/views/wallet/receive/components/ConnectDevicePromo.tsx @@ -1,9 +1,11 @@ import { Column, Image, Text, Banner } from '@trezor/components'; -import { useSelector } from '../../../../hooks/suite'; import { selectDevice } from '@suite-common/wallet-core'; import { DEFAULT_FLAGSHIP_MODEL } from '@suite-common/suite-constants'; + import { Translation } from 'src/components/suite'; +import { useSelector } from '../../../../hooks/suite'; + type ConnectDevicePromoProps = { title: JSX.Element | string; description: JSX.Element | string; diff --git a/packages/suite/src/views/wallet/receive/components/FreshAddress.tsx b/packages/suite/src/views/wallet/receive/components/FreshAddress.tsx index 110549094a0..4b17ddb9b6f 100644 --- a/packages/suite/src/views/wallet/receive/components/FreshAddress.tsx +++ b/packages/suite/src/views/wallet/receive/components/FreshAddress.tsx @@ -1,16 +1,18 @@ import { useMemo } from 'react'; + import styled from 'styled-components'; -import { Translation, QuestionTooltip, ReadMoreLink } from 'src/components/suite'; -import { AppState } from 'src/types/suite'; -import { showAddress } from 'src/actions/wallet/receiveActions'; -import { useDispatch, useSelector } from 'src/hooks/suite/'; import { Button, Card, variables, H2, Tooltip, GradientOverlay } from '@trezor/components'; import { getFirstFreshAddress } from '@suite-common/wallet-utils'; import { AccountsRootState, selectIsAccountUtxoBased } from '@suite-common/wallet-core'; import { networks } from '@suite-common/wallet-config'; -import { EvmExplanationBox } from 'src/components/wallet/EvmExplanationBox'; import { spacingsPx, typography } from '@trezor/theme'; + +import { Translation, QuestionTooltip, ReadMoreLink } from 'src/components/suite'; +import { AppState } from 'src/types/suite'; +import { showAddress } from 'src/actions/wallet/receiveActions'; +import { useDispatch, useSelector } from 'src/hooks/suite/'; +import { EvmExplanationBox } from 'src/components/wallet/EvmExplanationBox'; import { selectIsFirmwareAuthenticityCheckEnabledAndFailed } from 'src/reducers/suite/suiteReducer'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/views/wallet/receive/components/Header.tsx b/packages/suite/src/views/wallet/receive/components/Header.tsx index 50ac6c8ca8d..4d7073d851d 100644 --- a/packages/suite/src/views/wallet/receive/components/Header.tsx +++ b/packages/suite/src/views/wallet/receive/components/Header.tsx @@ -1,6 +1,8 @@ +import styled from 'styled-components'; + import { H2, Paragraph } from '@trezor/components'; + import { Account } from 'src/types/wallet'; -import styled from 'styled-components'; import { Translation } from 'src/components/suite'; const Content = styled.div` diff --git a/packages/suite/src/views/wallet/receive/components/UsedAddresses.tsx b/packages/suite/src/views/wallet/receive/components/UsedAddresses.tsx index a28769f2642..0e2df8a850c 100644 --- a/packages/suite/src/views/wallet/receive/components/UsedAddresses.tsx +++ b/packages/suite/src/views/wallet/receive/components/UsedAddresses.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { AccountAddress } from '@trezor/connect'; diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/BitcoinOptions.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/BitcoinOptions.tsx index 867189ee37e..451081e2784 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/BitcoinOptions.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/BitcoinOptions.tsx @@ -1,16 +1,19 @@ import { useWatch } from 'react-hook-form'; + import styled from 'styled-components'; import { Button, Tooltip, variables } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; +import { selectNetworkBlockchainInfo } from '@suite-common/wallet-core'; + import { Translation } from 'src/components/suite'; import { useSendFormContext } from 'src/hooks/wallet'; import { OpenGuideFromTooltip } from 'src/components/guide'; +import { useSelector } from 'src/hooks/suite'; + import { Locktime } from './Locktime/Locktime'; import { CoinControl } from './CoinControl/CoinControl'; import { OnOffSwitcher } from '../OnOffSwitcher'; -import { selectNetworkBlockchainInfo } from '@suite-common/wallet-core'; -import { useSelector } from 'src/hooks/suite'; import { canLocktimeTxBeBroadcast } from './Locktime/canLocktimeTxBeBroadcast'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/CoinControl.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/CoinControl.tsx index 315ae0dae42..a7a7d0aadf7 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/CoinControl.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/CoinControl.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from 'react'; + import styled, { useTheme } from 'styled-components'; import { typography } from '@trezor/theme'; @@ -6,17 +7,19 @@ import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; import { fetchAllTransactionsForAccountThunk } from '@suite-common/wallet-core'; import { getTxsPerPage } from '@suite-common/suite-utils'; import { amountToSmallestUnit, formatNetworkAmount } from '@suite-common/wallet-utils'; +import { Card, Checkbox, Icon, Switch, variables } from '@trezor/components'; + import { FormattedCryptoAmount, Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { Pagination } from 'src/components/wallet'; -import { Card, Checkbox, Icon, Switch, variables } from '@trezor/components'; import { useSendFormContext } from 'src/hooks/wallet'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { selectCurrentTargetAnonymity } from 'src/reducers/wallet/coinjoinReducer'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; +import { filterAndCategorizeUtxos } from 'src/utils/wallet/filterAndCategorizeUtxosUtils'; + import { UtxoSelectionList } from './UtxoSelectionList'; import { UtxoSearch } from './UtxoSearch'; -import { filterAndCategorizeUtxos } from 'src/utils/wallet/filterAndCategorizeUtxosUtils'; const Row = styled.div` align-items: center; diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSearch.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSearch.tsx index c46ea9eb21a..4f611a280ed 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSearch.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSearch.tsx @@ -1,6 +1,9 @@ import { useCallback, useRef, Dispatch, SetStateAction, ChangeEvent, KeyboardEvent } from 'react'; + import styled, { useTheme } from 'styled-components'; + import { Input, Icon, KEYBOARD_CODE } from '@trezor/components'; + import { useTranslation } from 'src/hooks/suite/useTranslation'; const Container = styled.div` diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelection.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelection.tsx index 197434bc295..864c7490d6c 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelection.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelection.tsx @@ -1,9 +1,11 @@ import { MouseEventHandler } from 'react'; + import styled, { css, useTheme } from 'styled-components'; import { formatNetworkAmount, isSameUtxo } from '@suite-common/wallet-utils'; import { Checkbox, Spinner, TextButton, Tooltip } from '@trezor/components'; import type { AccountUtxo } from '@trezor/connect'; +import { borders, spacingsPx, typography } from '@trezor/theme'; import { openModal } from 'src/actions/suite/modalActions'; import { @@ -17,12 +19,12 @@ import { TransactionTimestamp, UtxoAnonymity } from 'src/components/wallet'; import { useSendFormContext } from 'src/hooks/wallet'; import { useCoinjoinUnavailableUtxos } from 'src/hooks/wallet/form/useCoinjoinUnavailableUtxos'; import { WalletAccountTransaction } from 'src/types/wallet'; -import { UtxoTag } from './UtxoTag'; import { selectIsLabelingInitPossible, selectLabelingDataForSelectedAccount, } from 'src/reducers/suite/metadataReducer'; -import { borders, spacingsPx, typography } from '@trezor/theme'; + +import { UtxoTag } from './UtxoTag'; const transitionSpeed = '0.16s'; diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList.tsx index 3ea932513c8..f5c483091ec 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList.tsx @@ -1,14 +1,18 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; import { transparentize } from 'polished'; import { selectAccountTransactionsWithNulls } from '@suite-common/wallet-core'; import { Icon, variables, IconName } from '@trezor/components'; -import { useSelector } from 'src/hooks/suite'; import type { AccountUtxo } from '@trezor/connect'; +import { CSSColor } from '@trezor/theme'; + +import { useSelector } from 'src/hooks/suite'; import { useSendFormContext } from 'src/hooks/wallet'; + import { UtxoSelection } from './UtxoSelection'; -import { CSSColor } from '@trezor/theme'; + const Wrapper = styled.section` border-bottom: 1px solid ${({ theme }) => theme.legacy.STROKE_GREY}; diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoTag.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoTag.tsx index 68dadaa72c5..364ba5c30d4 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoTag.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoTag.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import { Icon, Tooltip, IconName } from '@trezor/components'; import { CSSColor } from '@trezor/theme'; diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/Locktime.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/Locktime.tsx index d0384d728d4..90d2cd56f4a 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/Locktime.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/Locktime.tsx @@ -1,13 +1,18 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { useEffect } from 'react'; + import styled from 'styled-components'; -import { NumberInput, Translation } from 'src/components/suite'; -import { useSendFormContext } from 'src/hooks/wallet'; + +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Card, Icon, IconButton } from '@trezor/components'; import { getInputState, isInteger } from '@suite-common/wallet-utils'; -import { useSelector, useTranslation } from 'src/hooks/suite'; import { spacingsPx } from '@trezor/theme'; import { selectNetworkBlockchainInfo } from '@suite-common/wallet-core'; -import { useEffect } from 'react'; + +import { useSelector, useTranslation } from 'src/hooks/suite'; +import { useSendFormContext } from 'src/hooks/wallet'; +import { NumberInput, Translation } from 'src/components/suite'; + + import { canLocktimeTxBeBroadcast } from './canLocktimeTxBeBroadcast'; const Label = styled.div` diff --git a/packages/suite/src/views/wallet/send/Options/CardanoOptions.tsx b/packages/suite/src/views/wallet/send/Options/CardanoOptions.tsx index e007299bc23..0083409a76a 100644 --- a/packages/suite/src/views/wallet/send/Options/CardanoOptions.tsx +++ b/packages/suite/src/views/wallet/send/Options/CardanoOptions.tsx @@ -1,6 +1,8 @@ import styled from 'styled-components'; + import { Button, variables } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; import { useSendFormContext } from 'src/hooks/wallet'; diff --git a/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumData.tsx b/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumData.tsx index 3cc193dd1fc..71ed403018e 100644 --- a/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumData.tsx +++ b/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumData.tsx @@ -1,13 +1,17 @@ import { useEffect } from 'react'; + import styled from 'styled-components'; + import { Textarea, Icon } from '@trezor/components'; -import { Translation } from 'src/components/suite'; -import { useSendFormContext } from 'src/hooks/wallet'; import { getInputState, isHexValid } from '@suite-common/wallet-utils'; import { formInputsMaxLength } from '@suite-common/validators'; -import { useTranslation } from 'src/hooks/suite'; import { spacingsPx } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; +import { useSendFormContext } from 'src/hooks/wallet'; +import { useTranslation } from 'src/hooks/suite'; + + const inputAsciiName = 'ethereumDataAscii'; const inputHexName = 'ethereumDataHex'; const inputAmountName = 'outputs.0.amount'; diff --git a/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumOptions.tsx b/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumOptions.tsx index f076776d653..d8821dff25c 100644 --- a/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumOptions.tsx +++ b/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumOptions.tsx @@ -2,8 +2,10 @@ import styled from 'styled-components'; import { FormOptions } from '@suite-common/wallet-types'; import { Button, Tooltip } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { useSendFormContext } from 'src/hooks/wallet'; + import { EthereumData } from './EthereumData'; import { OnOffSwitcher } from '../OnOffSwitcher'; diff --git a/packages/suite/src/views/wallet/send/Options/OnOffSwitcher.tsx b/packages/suite/src/views/wallet/send/Options/OnOffSwitcher.tsx index c8e66487956..cca77415a69 100644 --- a/packages/suite/src/views/wallet/send/Options/OnOffSwitcher.tsx +++ b/packages/suite/src/views/wallet/send/Options/OnOffSwitcher.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { Translation } from 'src/components/suite'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx b/packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx index 58f28b2089c..43d3977d1a0 100644 --- a/packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx +++ b/packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx @@ -1,12 +1,14 @@ import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Input, Icon } from '@trezor/components'; -import { Translation } from 'src/components/suite'; -import { useSendFormContext } from 'src/hooks/wallet'; import { getInputState, isInteger } from '@suite-common/wallet-utils'; import { U_INT_32 } from '@suite-common/wallet-constants'; -import { useTranslation } from 'src/hooks/suite'; import { formInputsMaxLength } from '@suite-common/validators'; +import { Translation } from 'src/components/suite'; +import { useSendFormContext } from 'src/hooks/wallet'; +import { useTranslation } from 'src/hooks/suite'; + + interface DestinationTagProps { close: () => void; } diff --git a/packages/suite/src/views/wallet/send/Options/RippleOptions/RippleOptions.tsx b/packages/suite/src/views/wallet/send/Options/RippleOptions/RippleOptions.tsx index 8974ce80c08..725f05007cc 100644 --- a/packages/suite/src/views/wallet/send/Options/RippleOptions/RippleOptions.tsx +++ b/packages/suite/src/views/wallet/send/Options/RippleOptions/RippleOptions.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; import { Button, Tooltip } from '@trezor/components'; + import { useSendFormContext } from 'src/hooks/wallet'; import { Translation } from 'src/components/suite'; + import { DestinationTag } from './DestinationTag'; import { OnOffSwitcher } from '../OnOffSwitcher'; diff --git a/packages/suite/src/views/wallet/send/Outputs/Address.tsx b/packages/suite/src/views/wallet/send/Outputs/Address.tsx index 762935f69fe..249e9d2e501 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Address.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Address.tsx @@ -1,4 +1,5 @@ import { useCallback, useState } from 'react'; + import { checkAddressCheckSum, toChecksumAddress } from 'web3-utils'; import styled, { useTheme } from 'styled-components'; @@ -17,7 +18,6 @@ import { notificationsActions } from '@suite-common/toast-notifications'; import { formInputsMaxLength } from '@suite-common/validators'; import type { Output } from '@suite-common/wallet-types'; import TrezorConnect from '@trezor/connect'; -import { useSelector, useDevice, useDispatch, useTranslation } from 'src/hooks/suite'; import { isAddressValid, isAddressDeprecated, @@ -25,23 +25,22 @@ import { isBech32AddressUppercase, getInputState, } from '@suite-common/wallet-utils'; - -import { AddressLabeling, MetadataLabeling } from 'src/components/suite'; -import { Translation } from '../../../../components/suite/Translation'; +import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; +import { HELP_CENTER_EVM_ADDRESS_CHECKSUM } from '@trezor/urls'; +import { spacings } from '@trezor/theme'; +import { CoinLogo } from '@trezor/product-components'; import { scanOrRequestSendFormThunk } from 'src/actions/wallet/send/sendFormThunks'; import { useSendFormContext } from 'src/hooks/wallet'; import { getProtocolInfo } from 'src/utils/suite/protocol'; -import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; - import { InputError } from 'src/components/wallet'; import { InputErrorProps } from 'src/components/wallet/InputError'; - -import { HELP_CENTER_EVM_ADDRESS_CHECKSUM } from '@trezor/urls'; -import { spacings } from '@trezor/theme'; -import { CoinLogo } from '@trezor/product-components'; +import { AddressLabeling, MetadataLabeling } from 'src/components/suite'; +import { useSelector, useDevice, useDispatch, useTranslation } from 'src/hooks/suite'; import { captureSentryMessage } from 'src/utils/suite/sentry'; +import { Translation } from '../../../../components/suite/Translation'; + const Container = styled.div` position: relative; `; diff --git a/packages/suite/src/views/wallet/send/Outputs/Amount/Amount.tsx b/packages/suite/src/views/wallet/send/Outputs/Amount/Amount.tsx index dad5e078732..c81f5801f27 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Amount/Amount.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Amount/Amount.tsx @@ -1,7 +1,8 @@ import { useCallback } from 'react'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; + import styled, { useTheme } from 'styled-components'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Icon, Banner, variables } from '@trezor/components'; import { breakpointMediaQueries } from '@trezor/styles'; import { spacingsPx } from '@trezor/theme'; @@ -30,6 +31,7 @@ import { validateReserveOrBalance, } from 'src/utils/suite/validation'; import { formatTokenSymbol } from 'src/utils/wallet/tokenUtils'; + import { TokenSelect } from './TokenSelect'; import { FiatInput } from './FiatInput'; import { SendMaxSwitch } from './SendMaxSwitch'; diff --git a/packages/suite/src/views/wallet/send/Outputs/Amount/FiatInput.tsx b/packages/suite/src/views/wallet/send/Outputs/Amount/FiatInput.tsx index 2e56e3ac4c3..4f6b1527726 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Amount/FiatInput.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Amount/FiatInput.tsx @@ -1,4 +1,9 @@ import { useCallback } from 'react'; +import { Controller } from 'react-hook-form'; +import { useDispatch } from 'react-redux'; + +import styled from 'styled-components'; + import { Timestamp, TokenAddress, @@ -7,11 +12,7 @@ import { Output, } from '@suite-common/wallet-types'; import { BigNumber } from '@trezor/utils/src/bigNumber'; -import styled from 'styled-components'; -import { Controller } from 'react-hook-form'; - import { Select } from '@trezor/components'; -import { useSendFormContext } from 'src/hooks/wallet'; import { fromFiatCurrency, getInputState, @@ -23,14 +24,17 @@ import { getFiatRateKey, } from '@suite-common/wallet-utils'; import { formInputsMaxLength } from '@suite-common/validators'; +import { NetworkSymbol } from '@suite-common/wallet-config'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { selectFiatRatesByFiatRateKey, updateFiatRatesThunk } from '@suite-common/wallet-core'; + +import { useSendFormContext } from 'src/hooks/wallet'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { NumberInput } from 'src/components/suite'; import { useSelector, useTranslation } from 'src/hooks/suite'; import { validateDecimals } from 'src/utils/suite/validation'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; -import { selectFiatRatesByFiatRateKey, updateFiatRatesThunk } from '@suite-common/wallet-core'; -import { useDispatch } from 'react-redux'; + + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/send/Outputs/Amount/SendMaxSwitch.tsx b/packages/suite/src/views/wallet/send/Outputs/Amount/SendMaxSwitch.tsx index abe8330b502..8689b081384 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Amount/SendMaxSwitch.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Amount/SendMaxSwitch.tsx @@ -1,8 +1,10 @@ +import styled, { css } from 'styled-components'; + import { Switch } from '@trezor/components'; import { breakpointMediaQueries } from '@trezor/styles'; import { spacingsPx } from '@trezor/theme'; + import { Translation } from 'src/components/suite'; -import styled, { css } from 'styled-components'; // eslint-disable-next-line local-rules/no-override-ds-component const StyledSwitch = styled(Switch)<{ diff --git a/packages/suite/src/views/wallet/send/Outputs/Amount/TokenSelect.tsx b/packages/suite/src/views/wallet/send/Outputs/Amount/TokenSelect.tsx index d0e4a480364..44c89194025 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Amount/TokenSelect.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Amount/TokenSelect.tsx @@ -1,14 +1,19 @@ import { useMemo, useEffect } from 'react'; import { Controller } from 'react-hook-form'; -import { Select } from '@trezor/components'; + import styled from 'styled-components'; + +import { Select } from '@trezor/components'; +import { Output, Timestamp, TokenAddress } from '@suite-common/wallet-types'; +import { updateFiatRatesThunk, selectCurrentFiatRates } from '@suite-common/wallet-core'; +import { NetworkSymbol } from '@suite-common/wallet-config'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { TokenDefinitions, selectCoinDefinitions } from '@suite-common/token-definitions'; + import { useSendFormContext } from 'src/hooks/wallet'; import { Account } from 'src/types/wallet'; -import { Output, Timestamp, TokenAddress } from '@suite-common/wallet-types'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { updateFiatRatesThunk, selectCurrentFiatRates } from '@suite-common/wallet-core'; import { TooltipSymbol, Translation } from 'src/components/suite'; -import { NetworkSymbol } from '@suite-common/wallet-config'; import { enhanceTokensWithRates, formatTokenSymbol, @@ -16,8 +21,6 @@ import { sortTokensWithRates, } from 'src/utils/wallet/tokenUtils'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; -import { TokenDefinitions, selectCoinDefinitions } from '@suite-common/token-definitions'; import { SUITE } from 'src/actions/suite/constants'; const UnrecognizedTokensHeading = styled.div` diff --git a/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx b/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx index 25096d39c67..0edaf00967a 100644 --- a/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx @@ -1,13 +1,16 @@ import styled from 'styled-components'; -import { useSendFormContext } from 'src/hooks/wallet'; -import { Translation } from 'src/components/suite'; + import { Textarea, IconButton, Row, Tooltip, variables } from '@trezor/components'; import { getInputState, isHexValid } from '@suite-common/wallet-utils'; -import { OpenGuideFromTooltip } from 'src/components/guide'; import { formInputsMaxLength } from '@suite-common/validators'; -import { useTranslation } from 'src/hooks/suite'; import { spacingsPx } from '@trezor/theme'; +import { useSendFormContext } from 'src/hooks/wallet'; +import { Translation } from 'src/components/suite'; +import { OpenGuideFromTooltip } from 'src/components/guide'; +import { useTranslation } from 'src/hooks/suite'; + + const Inputs = styled.div` display: flex; place-items: center space-between; diff --git a/packages/suite/src/views/wallet/send/Outputs/Outputs.tsx b/packages/suite/src/views/wallet/send/Outputs/Outputs.tsx index efae8549e88..d1a27664ad0 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Outputs.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Outputs.tsx @@ -1,4 +1,5 @@ import { useEffect, useLayoutEffect, useRef, useState } from 'react'; + import styled from 'styled-components'; import { motion } from 'framer-motion'; @@ -6,14 +7,15 @@ import { Card, motionEasing } from '@trezor/components'; import { motionEasingStrings } from '@trezor/components/src/config/motion'; import { spacingsPx } from '@trezor/theme'; import { networks } from '@suite-common/wallet-config'; +import { CoinLogo } from '@trezor/product-components'; import { useSendFormContext } from 'src/hooks/wallet'; import { useLayoutSize } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; + import { Address } from './Address'; import { Amount } from './Amount/Amount'; import { OpReturn } from './OpReturn'; -import { CoinLogo } from '@trezor/product-components'; const Container = styled.div<{ $height: number }>` height: ${({ $height }) => ($height ? `${$height}px` : 'auto')}; diff --git a/packages/suite/src/views/wallet/send/SendHeader.tsx b/packages/suite/src/views/wallet/send/SendHeader.tsx index 2fe84c56815..72a80ebb636 100644 --- a/packages/suite/src/views/wallet/send/SendHeader.tsx +++ b/packages/suite/src/views/wallet/send/SendHeader.tsx @@ -1,11 +1,13 @@ import styled from 'styled-components'; + import { Button, Dropdown, DropdownMenuItemProps } from '@trezor/components'; +import { sendFormActions } from '@suite-common/wallet-core'; +import { FADE_IN } from '@trezor/components/src/config/animations'; + import { Translation } from 'src/components/suite'; import { useDevice, useDispatch } from 'src/hooks/suite'; import { useSendFormContext } from 'src/hooks/wallet'; import { WalletSubpageHeading } from 'src/components/wallet'; -import { sendFormActions } from '@suite-common/wallet-core'; -import { FADE_IN } from '@trezor/components/src/config/animations'; import { ConnectDeviceSendPromo } from 'src/views/wallet/receive/components/ConnectDevicePromo'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/views/wallet/send/SendRaw.tsx b/packages/suite/src/views/wallet/send/SendRaw.tsx index 1dd8c68d0cf..f3e57ed824d 100644 --- a/packages/suite/src/views/wallet/send/SendRaw.tsx +++ b/packages/suite/src/views/wallet/send/SendRaw.tsx @@ -1,14 +1,16 @@ import { useForm } from 'react-hook-form'; + import { analytics, EventType } from '@trezor/suite-analytics'; import { Card, Textarea, Button, Tooltip, H3, IconButton, Row } from '@trezor/components'; import { sendFormActions, pushSendFormRawTransactionThunk } from '@suite-common/wallet-core'; +import { tryGetAccountIdentity, getInputState, isHexValid } from '@suite-common/wallet-utils'; +import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { useDispatch, useTranslation } from 'src/hooks/suite'; -import { tryGetAccountIdentity, getInputState, isHexValid } from '@suite-common/wallet-utils'; import { Account } from 'src/types/wallet'; import { OpenGuideFromTooltip } from 'src/components/guide'; -import { spacings } from '@trezor/theme'; + const INPUT_NAME = 'rawTx'; diff --git a/packages/suite/src/views/wallet/send/TotalSent/ReviewButton.tsx b/packages/suite/src/views/wallet/send/TotalSent/ReviewButton.tsx index 8603b5316f2..fbf60396c6c 100644 --- a/packages/suite/src/views/wallet/send/TotalSent/ReviewButton.tsx +++ b/packages/suite/src/views/wallet/send/TotalSent/ReviewButton.tsx @@ -1,12 +1,15 @@ import { useWatch } from 'react-hook-form'; + import styled from 'styled-components'; import { Checkbox, Button, Banner, variables, Tooltip } from '@trezor/components'; +import { isLowAnonymityWarning } from '@suite-common/wallet-utils'; +import { spacingsPx } from '@trezor/theme'; + import { useDevice } from 'src/hooks/suite'; import { useSendFormContext } from 'src/hooks/wallet'; -import { isLowAnonymityWarning } from '@suite-common/wallet-utils'; import { Translation } from 'src/components/suite/Translation'; -import { spacingsPx } from '@trezor/theme'; + const Container = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx b/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx index ad6b9e7f680..c4a43b28ec0 100644 --- a/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx +++ b/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx @@ -1,10 +1,14 @@ import styled from 'styled-components'; + import { Card, Column, InfoRow, Text } from '@trezor/components'; -import { useSendFormContext } from 'src/hooks/wallet'; import { formatNetworkAmount, formatAmount } from '@suite-common/wallet-utils'; +import { spacings } from '@trezor/theme'; + +import { useSendFormContext } from 'src/hooks/wallet'; import { Translation, FiatValue, FormattedCryptoAmount } from 'src/components/suite'; + import { ReviewButton } from './ReviewButton'; -import { spacings } from '@trezor/theme'; + const Container = styled.div` position: sticky; diff --git a/packages/suite/src/views/wallet/send/index.tsx b/packages/suite/src/views/wallet/send/index.tsx index b7ab07ae63d..59c02ea8be1 100644 --- a/packages/suite/src/views/wallet/send/index.tsx +++ b/packages/suite/src/views/wallet/send/index.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; import { Banner } from '@trezor/components'; @@ -14,6 +15,7 @@ import { } from 'src/reducers/wallet/coinjoinReducer'; import { Translation } from 'src/components/suite'; import { ConfirmEvmExplanationModal } from 'src/components/suite/modals'; + import { SendHeader } from './SendHeader'; import { Outputs } from './Outputs/Outputs'; import { Options } from './Options/Options'; diff --git a/packages/suite/src/views/wallet/sign-verify/components/ButtonRow.tsx b/packages/suite/src/views/wallet/sign-verify/components/ButtonRow.tsx index 819d071158a..680c4c8f1f7 100644 --- a/packages/suite/src/views/wallet/sign-verify/components/ButtonRow.tsx +++ b/packages/suite/src/views/wallet/sign-verify/components/ButtonRow.tsx @@ -1,10 +1,13 @@ -import { Translation } from 'src/components/suite'; - -import { useLayoutSize } from 'src/hooks/suite'; -import { Button, variables } from '@trezor/components'; import { useState } from 'react'; + import styled from 'styled-components'; +import { Button, variables } from '@trezor/components'; + +import { Translation } from 'src/components/suite'; +import { useLayoutSize } from 'src/hooks/suite'; + + export const Row = styled.div` position: relative; display: flex; diff --git a/packages/suite/src/views/wallet/sign-verify/components/HiddenAddressRow.tsx b/packages/suite/src/views/wallet/sign-verify/components/HiddenAddressRow.tsx index ccf6b808ac0..5b8fdf64cbf 100644 --- a/packages/suite/src/views/wallet/sign-verify/components/HiddenAddressRow.tsx +++ b/packages/suite/src/views/wallet/sign-verify/components/HiddenAddressRow.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; + import { GradientOverlay, useElevation } from '@trezor/components'; -import type { AddressItem } from 'src/hooks/wallet/sign-verify/useSignAddressOptions'; import { borders, nextElevation, spacingsPx } from '@trezor/theme'; +import type { AddressItem } from 'src/hooks/wallet/sign-verify/useSignAddressOptions'; + // eslint-disable-next-line local-rules/no-override-ds-component const StyledGradientOverlay = styled(GradientOverlay)` margin: -${spacingsPx.xs}; diff --git a/packages/suite/src/views/wallet/sign-verify/components/Navigation.tsx b/packages/suite/src/views/wallet/sign-verify/components/Navigation.tsx index 24a2dd2c975..99753407b44 100644 --- a/packages/suite/src/views/wallet/sign-verify/components/Navigation.tsx +++ b/packages/suite/src/views/wallet/sign-verify/components/Navigation.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { NavigationTab } from './NavigationTab'; const Container = styled.div` diff --git a/packages/suite/src/views/wallet/sign-verify/components/NavigationTab.tsx b/packages/suite/src/views/wallet/sign-verify/components/NavigationTab.tsx index 8c036168902..695e0397dcb 100644 --- a/packages/suite/src/views/wallet/sign-verify/components/NavigationTab.tsx +++ b/packages/suite/src/views/wallet/sign-verify/components/NavigationTab.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { variables } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { ExtendedMessageDescriptor } from 'src/types/suite'; diff --git a/packages/suite/src/views/wallet/sign-verify/components/SignAddressInput.tsx b/packages/suite/src/views/wallet/sign-verify/components/SignAddressInput.tsx index 626950aa849..82390fbdae1 100644 --- a/packages/suite/src/views/wallet/sign-verify/components/SignAddressInput.tsx +++ b/packages/suite/src/views/wallet/sign-verify/components/SignAddressInput.tsx @@ -1,12 +1,16 @@ import { components } from 'react-select'; + import styled from 'styled-components'; + import { Select, SelectProps } from '@trezor/components'; + import type { Account } from 'src/types/wallet'; import type { State as RevealedAddresses } from 'src/reducers/wallet/receiveReducer'; import { useSignAddressOptions, AddressItem, } from 'src/hooks/wallet/sign-verify/useSignAddressOptions'; + import { HiddenAddressRow } from './HiddenAddressRow'; import { VerifyAddressButton } from './VerifyAddressButton'; diff --git a/packages/suite/src/views/wallet/sign-verify/components/VerifyAddressButton.tsx b/packages/suite/src/views/wallet/sign-verify/components/VerifyAddressButton.tsx index 15c032d6410..eb526581fe8 100644 --- a/packages/suite/src/views/wallet/sign-verify/components/VerifyAddressButton.tsx +++ b/packages/suite/src/views/wallet/sign-verify/components/VerifyAddressButton.tsx @@ -1,10 +1,13 @@ import { MouseEvent } from 'react'; + import styled from 'styled-components'; + import { Icon, variables } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; + import { showAddress } from 'src/actions/wallet/signVerifyActions'; import { useDispatch } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; -import { spacingsPx } from '@trezor/theme'; const RevealText = styled.div` max-width: 0; diff --git a/packages/suite/src/views/wallet/sign-verify/index.tsx b/packages/suite/src/views/wallet/sign-verify/index.tsx index 893c111051b..da6e7507c2b 100644 --- a/packages/suite/src/views/wallet/sign-verify/index.tsx +++ b/packages/suite/src/views/wallet/sign-verify/index.tsx @@ -1,6 +1,8 @@ import { useEffect, useState } from 'react'; import { FieldError } from 'react-hook-form'; + import styled from 'styled-components'; + import { Input, Button, @@ -11,6 +13,8 @@ import { SelectBar, Tooltip, } from '@trezor/components'; +import { getInputState } from '@suite-common/wallet-utils'; +import { spacingsPx } from '@trezor/theme'; import { WalletLayout, WalletSubpageHeading } from 'src/components/wallet'; import { Translation } from 'src/components/suite'; @@ -18,10 +22,6 @@ import { useDevice, useDispatch, useSelector, useTranslation } from 'src/hooks/s import { sign, verify } from 'src/actions/wallet/signVerifyActions'; import { goto } from 'src/actions/suite/routerActions'; import { TranslationKey } from 'src/components/suite/Translation'; - -import { Navigation, NavPages } from './components/Navigation'; -import { SignAddressInput } from './components/SignAddressInput'; -import { ButtonRow, Row } from './components/ButtonRow'; import { useCopySignedMessage } from 'src/hooks/wallet/sign-verify/useCopySignedMessage'; import { useSignVerifyForm, @@ -29,8 +29,10 @@ import { MAX_LENGTH_MESSAGE, MAX_LENGTH_SIGNATURE, } from 'src/hooks/wallet/sign-verify/useSignVerifyForm'; -import { getInputState } from '@suite-common/wallet-utils'; -import { spacingsPx } from '@trezor/theme'; + +import { Navigation, NavPages } from './components/Navigation'; +import { SignAddressInput } from './components/SignAddressInput'; +import { ButtonRow, Row } from './components/ButtonRow'; const SwitchWrapper = styled.label` display: flex; diff --git a/packages/suite/src/views/wallet/staking/WalletStaking.tsx b/packages/suite/src/views/wallet/staking/WalletStaking.tsx index bac1f0c5add..9b9990e25de 100644 --- a/packages/suite/src/views/wallet/staking/WalletStaking.tsx +++ b/packages/suite/src/views/wallet/staking/WalletStaking.tsx @@ -1,8 +1,10 @@ +import { hasNetworkFeatures } from '@suite-common/wallet-utils'; + import { Translation } from 'src/components/suite'; import { AccountExceptionLayout, WalletLayout } from 'src/components/wallet'; import { useSelector } from 'src/hooks/suite'; + import { CardanoStakingDashboard } from './components/CardanoStakingDashboard'; -import { hasNetworkFeatures } from '@suite-common/wallet-utils'; import { EthStakingDashboard } from './components/EthStakingDashboard/EthStakingDashboard'; export const WalletStaking = () => { diff --git a/packages/suite/src/views/wallet/staking/components/CardanoActionPending.tsx b/packages/suite/src/views/wallet/staking/components/CardanoActionPending.tsx index a57b4e34f7b..ea2e101dd2d 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoActionPending.tsx +++ b/packages/suite/src/views/wallet/staking/components/CardanoActionPending.tsx @@ -1,6 +1,7 @@ +import { Banner } from '@trezor/components'; + import { Translation } from 'src/components/suite/Translation'; import { useCardanoStaking } from 'src/hooks/wallet/useCardanoStaking'; -import { Banner } from '@trezor/components'; export const CardanoActionPending = () => { const { pendingStakeTx } = useCardanoStaking(); diff --git a/packages/suite/src/views/wallet/staking/components/CardanoPrimitives.ts b/packages/suite/src/views/wallet/staking/components/CardanoPrimitives.ts index cdaae199f9f..8ff6d1eb544 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoPrimitives.ts +++ b/packages/suite/src/views/wallet/staking/components/CardanoPrimitives.ts @@ -1,6 +1,7 @@ +import styled from 'styled-components'; + import { H2 } from '@trezor/components'; import { borders, typography } from '@trezor/theme'; -import styled from 'styled-components'; export const Heading = styled.div` padding-left: 5px; diff --git a/packages/suite/src/views/wallet/staking/components/CardanoRedelegate.tsx b/packages/suite/src/views/wallet/staking/components/CardanoRedelegate.tsx index 1907c3b997b..dcacbc77287 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoRedelegate.tsx +++ b/packages/suite/src/views/wallet/staking/components/CardanoRedelegate.tsx @@ -1,14 +1,14 @@ import { useEffect } from 'react'; import { Card, Column, Icon } from '@trezor/components'; +import { DeviceModelInternal } from '@trezor/connect'; +import { spacings } from '@trezor/theme'; import { getReasonForDisabledAction, useCardanoStaking } from 'src/hooks/wallet/useCardanoStaking'; import { Translation } from 'src/components/suite/Translation'; -import { Actions, Title, Heading, Text } from './CardanoPrimitives'; +import { Actions, Title, Heading, Text } from './CardanoPrimitives'; import { DeviceButton } from './DeviceButton'; -import { DeviceModelInternal } from '@trezor/connect'; -import { spacings } from '@trezor/theme'; interface CardanoRedelegateProps { deviceModel: DeviceModelInternal; diff --git a/packages/suite/src/views/wallet/staking/components/CardanoRewards.tsx b/packages/suite/src/views/wallet/staking/components/CardanoRewards.tsx index b15ec69cda7..31193518c7d 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoRewards.tsx +++ b/packages/suite/src/views/wallet/staking/components/CardanoRewards.tsx @@ -2,6 +2,8 @@ import { useEffect } from 'react'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; import { Card, Column, Icon } from '@trezor/components'; +import { DeviceModelInternal } from '@trezor/connect'; +import { spacings } from '@trezor/theme'; import { getReasonForDisabledAction, useCardanoStaking } from 'src/hooks/wallet/useCardanoStaking'; import { Translation } from 'src/components/suite/Translation'; @@ -21,8 +23,6 @@ import { Column as CardanoColumn, } from './CardanoPrimitives'; import { CardanoActionPending } from './CardanoActionPending'; -import { DeviceModelInternal } from '@trezor/connect'; -import { spacings } from '@trezor/theme'; interface CardanoRewardsProps { account: Account; diff --git a/packages/suite/src/views/wallet/staking/components/CardanoStake.tsx b/packages/suite/src/views/wallet/staking/components/CardanoStake.tsx index f1d15d7e8cc..8acfac87534 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoStake.tsx +++ b/packages/suite/src/views/wallet/staking/components/CardanoStake.tsx @@ -3,13 +3,14 @@ import { useEffect } from 'react'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; import { Card, Column, Icon, Banner } from '@trezor/components'; import { DeviceModelInternal } from '@trezor/connect'; +import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite/Translation'; import { HiddenPlaceholder } from 'src/components/suite/HiddenPlaceholder'; import { useCardanoStaking, getReasonForDisabledAction } from 'src/hooks/wallet/useCardanoStaking'; -import { CardanoActionPending } from './CardanoActionPending'; import { Account } from 'src/types/wallet'; +import { CardanoActionPending } from './CardanoActionPending'; import { DeviceButton } from './DeviceButton'; import { Title, @@ -22,7 +23,6 @@ import { Content, StyledH2, } from './CardanoPrimitives'; -import { spacings } from '@trezor/theme'; interface CardanoStakeProps { account: Account; diff --git a/packages/suite/src/views/wallet/staking/components/CardanoStakingDashboard.tsx b/packages/suite/src/views/wallet/staking/components/CardanoStakingDashboard.tsx index f39ab0f6427..1d339f53a41 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoStakingDashboard.tsx +++ b/packages/suite/src/views/wallet/staking/components/CardanoStakingDashboard.tsx @@ -1,11 +1,14 @@ +import type { SelectedAccountLoaded } from '@suite-common/wallet-types'; +import { DeviceModelInternal } from '@trezor/connect'; + import { WalletLayout } from 'src/components/wallet'; import { useCardanoStaking } from 'src/hooks/wallet/useCardanoStaking'; +import { useDevice } from 'src/hooks/suite'; + import { CardanoRewards } from './CardanoRewards'; import { CardanoStake } from './CardanoStake'; import { CardanoRedelegate } from './CardanoRedelegate'; -import type { SelectedAccountLoaded } from '@suite-common/wallet-types'; -import { useDevice } from 'src/hooks/suite'; -import { DeviceModelInternal } from '@trezor/connect'; + interface CardanoStakingDashboardProps { selectedAccount: SelectedAccountLoaded; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/EthStakingDashboard.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/EthStakingDashboard.tsx index 75aec7a8472..eadb9c82713 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/EthStakingDashboard.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/EthStakingDashboard.tsx @@ -1,7 +1,9 @@ import { selectAccountHasStaked } from '@suite-common/wallet-core'; import { SelectedAccountLoaded } from '@suite-common/wallet-types'; + import { WalletLayout } from 'src/components/wallet'; import { useSelector } from 'src/hooks/suite'; + import { EmptyStakingCard } from './components/EmptyStakingCard'; import { StakingDashboard } from './components/StakingDashboard'; import { EverstakeFooter } from './components/EverstakeFooter'; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ApproximateInstantEthAmount.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ApproximateInstantEthAmount.tsx index 5f76d3155ad..d84fad9b696 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ApproximateInstantEthAmount.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ApproximateInstantEthAmount.tsx @@ -1,7 +1,8 @@ -import { FormattedCryptoAmount } from 'src/components/suite'; import { Tooltip } from '@trezor/components'; import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { FormattedCryptoAmount } from 'src/components/suite'; + interface ApproximateInstantEthAmountProps { value: string | number; symbol: string; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ApyCard.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ApyCard.tsx index 469d38dd03c..38e3a1534e0 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ApyCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ApyCard.tsx @@ -1,6 +1,9 @@ import { useTheme } from 'styled-components'; + import { Card, Column, Icon } from '@trezor/components'; + import { Translation } from 'src/components/suite'; + import { AccentP, CardBottomContent, GreyP } from './styled'; interface ApyCardProps { diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EmptyStakingCard.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EmptyStakingCard.tsx index c982bf808ef..3dd408a3386 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EmptyStakingCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EmptyStakingCard.tsx @@ -1,4 +1,5 @@ import { useMemo } from 'react'; + import { Button, Card, @@ -13,12 +14,13 @@ import { IconName, } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { selectPoolStatsApyData } from '@suite-common/wallet-core'; + import { Translation, StakingFeature } from 'src/components/suite'; import { openModal } from 'src/actions/suite/modalActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { DashboardSection } from 'src/components/dashboard'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { selectPoolStatsApyData } from '@suite-common/wallet-core'; import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; export const EmptyStakingCard = () => { diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EverstakeFooter.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EverstakeFooter.tsx index fb4ef0d92e2..5b140c3a269 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EverstakeFooter.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EverstakeFooter.tsx @@ -1,10 +1,13 @@ import styled, { useTheme } from 'styled-components'; + import { spacingsPx } from '@trezor/theme'; -import { Translation } from 'src/components/suite'; -import { EverstakeLogo } from './EverstakeLogo'; import { HELP_CENTER_ETH_STAKING } from '@trezor/urls'; + +import { Translation } from 'src/components/suite'; import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; +import { EverstakeLogo } from './EverstakeLogo'; + const Wrapper = styled.div` display: flex; align-items: center; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/InstantStakeBanner.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/InstantStakeBanner.tsx index 608ef67116a..9738cd4e3e0 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/InstantStakeBanner.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/InstantStakeBanner.tsx @@ -1,13 +1,16 @@ -import { Banner, Column, H3, Icon, Paragraph, Row } from '@trezor/components'; -import { Translation } from 'src/components/suite'; +import { useEffect, useRef, useState } from 'react'; + import styled, { useTheme } from 'styled-components'; +import { fromWei } from 'web3-utils'; + +import { Banner, Column, H3, Icon, Paragraph, Row } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; -import { useSelector } from 'src/hooks/suite'; import { StakeType, WalletAccountTransaction } from '@suite-common/wallet-types'; import { InternalTransfer } from '@trezor/connect'; -import { fromWei } from 'web3-utils'; + +import { useSelector } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; import { getChangedInternalTx, getInstantStakeType } from 'src/utils/suite/stake'; -import { useEffect, useRef, useState } from 'react'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; const IconWrapper = styled.div` diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/PayoutCard.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/PayoutCard.tsx index 276a7bfef14..439da9ccfae 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/PayoutCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/PayoutCard.tsx @@ -1,13 +1,17 @@ import { useMemo } from 'react'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; + import { useTheme } from 'styled-components'; + +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Card, Column, Icon } from '@trezor/components'; +import { BACKUP_REWARD_PAYOUT_DAYS } from '@suite-common/wallet-constants'; +import { getAccountAutocompoundBalance } from '@suite-common/wallet-utils'; + import { Translation } from 'src/components/suite'; -import { AccentP, CardBottomContent, GreyP } from './styled'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { useSelector } from 'src/hooks/suite'; -import { BACKUP_REWARD_PAYOUT_DAYS } from '@suite-common/wallet-constants'; -import { getAccountAutocompoundBalance } from '@suite-common/wallet-utils'; + +import { AccentP, CardBottomContent, GreyP } from './styled'; interface PayoutCardProps { nextRewardPayout?: number | null; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ProgressLabels/ProgressLabel.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ProgressLabels/ProgressLabel.tsx index 7f9a8fdcdb5..2d687afd428 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ProgressLabels/ProgressLabel.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ProgressLabels/ProgressLabel.tsx @@ -1,9 +1,12 @@ import { ReactNode, useEffect, useRef, useState } from 'react'; + import styled, { DefaultTheme, useTheme } from 'styled-components'; + import { Icon, variables } from '@trezor/components'; -import { ProgressLabelState } from './types'; import { borders, spacingsPx } from '@trezor/theme'; +import { ProgressLabelState } from './types'; + const DEFAULT_LABEL_HEIGHT = 48; const getProgressStateColor = ({ diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ProgressLabels/ProgressLabels.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ProgressLabels/ProgressLabels.tsx index 0b85edfad2f..0fe2d51d825 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ProgressLabels/ProgressLabels.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/ProgressLabels/ProgressLabels.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { spacingsPx } from '@trezor/theme'; + import { ProgressLabelData } from './types'; import { ProgressLabel } from './ProgressLabel'; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/StakingCard.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/StakingCard.tsx index 7a776c1dcf7..f9d14778222 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/StakingCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/StakingCard.tsx @@ -1,19 +1,22 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; import styled, { useTheme } from 'styled-components'; + +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Badge, Button, Card, Icon, Row, Tooltip, variables } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; import { selectAccountStakeTransactions } from '@suite-common/wallet-core'; import { getAccountEverstakeStakingPool, isPending } from '@suite-common/wallet-utils'; + import { FiatValue, Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; + import { InfoBox, ProgressBar } from './styled'; import { ProgressLabels } from './ProgressLabels/ProgressLabels'; import { useProgressLabelsData } from '../hooks/useProgressLabelsData'; import { useIsTxStatusShown } from '../hooks/useIsTxStatusShown'; import { TrimmedCryptoAmount } from './TrimmedCryptoAmount'; -import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; const AmountsWrapper = styled.div<{ $isStakeOrUnstakePending: boolean }>` display: flex; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/StakingDashboard.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/StakingDashboard.tsx index be2d5921d3f..3be19d3928b 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/StakingDashboard.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/StakingDashboard.tsx @@ -1,15 +1,9 @@ +import { useEffect, useMemo } from 'react'; + import styled from 'styled-components'; + import { variables } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { Divider, Translation } from 'src/components/suite'; -import { DashboardSection } from 'src/components/dashboard'; -import { StakingCard } from './StakingCard'; -import { ApyCard } from './ApyCard'; -import { PayoutCard } from './PayoutCard'; -import { ClaimCard } from './claim/ClaimCard'; -import { Transactions } from './Transactions'; import { fetchAllTransactionsForAccountThunk, selectAccountStakeTransactions, @@ -18,9 +12,19 @@ import { selectPoolStatsNextRewardPayout, selectValidatorsQueue, } from '@suite-common/wallet-core'; + +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { Divider, Translation } from 'src/components/suite'; +import { DashboardSection } from 'src/components/dashboard'; import { getDaysToAddToPool, getDaysToUnstake } from 'src/utils/suite/stake'; + +import { StakingCard } from './StakingCard'; +import { ApyCard } from './ApyCard'; +import { PayoutCard } from './PayoutCard'; +import { ClaimCard } from './claim/ClaimCard'; +import { Transactions } from './Transactions'; import { InstantStakeBanner } from './InstantStakeBanner'; -import { useEffect, useMemo } from 'react'; const FlexCol = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/Transactions.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/Transactions.tsx index c5f4d649e08..3223f454b5c 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/Transactions.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/Transactions.tsx @@ -1,11 +1,12 @@ -import { TransactionList } from 'src/views/wallet/transactions/TransactionList/TransactionList'; -import { useSelector } from 'src/hooks/suite'; import { selectAccountStakeTypeTransactions, selectAreAllTransactionsLoaded, selectIsLoadingAccountTransactions, } from '@suite-common/wallet-core'; +import { TransactionList } from 'src/views/wallet/transactions/TransactionList/TransactionList'; +import { useSelector } from 'src/hooks/suite'; + export const Transactions = () => { const selectedAccount = useSelector(state => state.wallet.selectedAccount); const accountKey = selectedAccount.account?.key ?? ''; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/TrimmedCryptoAmount.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/TrimmedCryptoAmount.tsx index e97efdaed85..6ea5fe53dd7 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/TrimmedCryptoAmount.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/TrimmedCryptoAmount.tsx @@ -1,9 +1,11 @@ -import { FormattedCryptoAmount } from 'src/components/suite'; import styled from 'styled-components'; + import { spacingsPx } from '@trezor/theme'; import { Tooltip, variables } from '@trezor/components'; import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { FormattedCryptoAmount } from 'src/components/suite'; + const StyledFormattedCryptoAmount = styled(FormattedCryptoAmount)<{ $isRewards?: boolean; $isSmall?: boolean; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimCard.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimCard.tsx index a505234c467..6ca42d02b8c 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimCard.tsx @@ -1,9 +1,12 @@ import { useEffect, useMemo, useRef } from 'react'; + import { getAccountEverstakeStakingPool, isPending } from '@suite-common/wallet-utils'; import { selectAccountClaimTransactions } from '@suite-common/wallet-core'; import { notificationsActions } from '@suite-common/toast-notifications'; + import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { useDispatch, useSelector } from 'src/hooks/suite'; + import { ClaimReadyCard } from './ClaimReadyCard'; import { ClaimPendingCard } from './ClaimPendingCard'; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimPendingCard.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimPendingCard.tsx index 3b1c90a0e7a..758f5cddf17 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimPendingCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimPendingCard.tsx @@ -1,11 +1,14 @@ import styled, { useTheme } from 'styled-components'; + import { Icon } from '@trezor/components'; +import { variables } from '@trezor/components/src/config'; +import { borders, spacingsPx } from '@trezor/theme'; + import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; -import { FiatValueWrapper, FormattedCryptoAmountWrapper } from './styled'; import { useSelector } from 'src/hooks/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { variables } from '@trezor/components/src/config'; -import { borders, spacingsPx } from '@trezor/theme'; + +import { FiatValueWrapper, FormattedCryptoAmountWrapper } from './styled'; const StyledCard = styled.div` border-radius: ${borders.radii.md}; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimReadyCard.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimReadyCard.tsx index 3078b751e66..1335c7417bf 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimReadyCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/ClaimReadyCard.tsx @@ -1,13 +1,16 @@ import styled, { useTheme } from 'styled-components'; -import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; + import { Button, Icon, Paragraph, Tooltip, variables } from '@trezor/components'; import { borders, spacingsPx } from '@trezor/theme'; + +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { openModal } from 'src/actions/suite/modalActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { FiatValueWrapper, FormattedCryptoAmountWrapper } from './styled'; import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; +import { FiatValueWrapper, FormattedCryptoAmountWrapper } from './styled'; + const StyledCard = styled.div` border-radius: ${borders.radii.md}; padding: ${spacingsPx.md} ${spacingsPx.xxl} ${spacingsPx.xxl} ${spacingsPx.md}; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/styled.ts b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/styled.ts index a0efb3ede58..ab6da9bae41 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/styled.ts +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/claim/styled.ts @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { variables } from '@trezor/components'; export const FormattedCryptoAmountWrapper = styled.div` diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/styled.ts b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/styled.ts index c889fb96a9f..49d6db87fa5 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/styled.ts +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/styled.ts @@ -1,4 +1,5 @@ import styled from 'styled-components'; + import { Paragraph, variables } from '@trezor/components'; import { borders, spacingsPx } from '@trezor/theme'; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/hooks/useIsTxStatusShown.ts b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/hooks/useIsTxStatusShown.ts index 6f81be789a9..ce077f4ac04 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/hooks/useIsTxStatusShown.ts +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/hooks/useIsTxStatusShown.ts @@ -1,4 +1,5 @@ import { useEffect, useRef, useState } from 'react'; + import { BigNumber } from '@trezor/utils/src/bigNumber'; export const useIsTxStatusShown = (totalPendingStake: BigNumber, accountDescriptor?: string) => { diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/hooks/useProgressLabelsData.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/hooks/useProgressLabelsData.tsx index fdbcbe44e9c..cf9b2038781 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/hooks/useProgressLabelsData.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/hooks/useProgressLabelsData.tsx @@ -1,9 +1,13 @@ import { useMemo } from 'react'; + import styled from 'styled-components'; + import { variables } from '@trezor/components'; -import { ProgressLabelData } from '../components/ProgressLabels/types'; + import { Translation } from 'src/components/suite'; +import { ProgressLabelData } from '../components/ProgressLabels/types'; + const DaysToAddToPool = styled.div` font-size: ${variables.FONT_SIZE.TINY}; color: ${({ theme }) => theme.legacy.TYPE_LIGHT_GREY}; diff --git a/packages/suite/src/views/wallet/tokens/coins/CoinsTable.tsx b/packages/suite/src/views/wallet/tokens/coins/CoinsTable.tsx index 37994d00c4b..225145af6b3 100644 --- a/packages/suite/src/views/wallet/tokens/coins/CoinsTable.tsx +++ b/packages/suite/src/views/wallet/tokens/coins/CoinsTable.tsx @@ -10,9 +10,10 @@ import { sortTokensWithRates, } from 'src/utils/wallet/tokenUtils'; import { useSelector } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; + import { NoTokens } from '../common/NoTokens'; import { TokensTable } from '../common/TokensTable/TokensTable'; -import { Translation } from 'src/components/suite'; interface CoinsTableProps { selectedAccount: SelectedAccountLoaded; diff --git a/packages/suite/src/views/wallet/tokens/common/BlurUrls.tsx b/packages/suite/src/views/wallet/tokens/common/BlurUrls.tsx index da374313063..3b797e7b3d8 100644 --- a/packages/suite/src/views/wallet/tokens/common/BlurUrls.tsx +++ b/packages/suite/src/views/wallet/tokens/common/BlurUrls.tsx @@ -1,9 +1,12 @@ import { Fragment } from 'react'; + import styled from 'styled-components'; + import { Tooltip } from '@trezor/components'; +import { extractUrlsFromText } from '@trezor/utils'; + import { BlurWrapper } from 'src/components/wallet/TransactionItem/TransactionItemBlurWrapper'; import { Translation } from 'src/components/suite'; -import { extractUrlsFromText } from '@trezor/utils'; // eslint-disable-next-line local-rules/no-override-ds-component const StyledTooltip = styled(Tooltip)` diff --git a/packages/suite/src/views/wallet/tokens/common/TokensTable/TokenRow.tsx b/packages/suite/src/views/wallet/tokens/common/TokensTable/TokenRow.tsx index 4301ceb4a9f..8f66fcd8e7d 100644 --- a/packages/suite/src/views/wallet/tokens/common/TokensTable/TokenRow.tsx +++ b/packages/suite/src/views/wallet/tokens/common/TokensTable/TokenRow.tsx @@ -44,7 +44,6 @@ import { useTranslation, } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; -import { BlurUrls } from '../BlurUrls'; import { showAddress } from 'src/actions/wallet/receiveActions'; import { getUnusedAddressFromAccount } from 'src/utils/wallet/coinmarket/coinmarketUtils'; import { openModal } from 'src/actions/suite/modalActions'; @@ -55,6 +54,8 @@ import { } from 'src/reducers/suite/suiteReducer'; import { SUITE } from 'src/actions/suite/constants'; +import { BlurUrls } from '../BlurUrls'; + const ContractAddress = styled.div` display: inline-block; max-width: 200px; diff --git a/packages/suite/src/views/wallet/tokens/common/TokensTable/TokensTable.tsx b/packages/suite/src/views/wallet/tokens/common/TokensTable/TokensTable.tsx index c554b586137..3c2f8eb251c 100644 --- a/packages/suite/src/views/wallet/tokens/common/TokensTable/TokensTable.tsx +++ b/packages/suite/src/views/wallet/tokens/common/TokensTable/TokensTable.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; + import styled from 'styled-components'; import { Account } from '@suite-common/wallet-types'; @@ -8,6 +9,7 @@ import { spacings } from '@trezor/theme'; import { Icon, Table, Paragraph, Card, Row, Text } from '@trezor/components'; import { Translation } from 'src/components/suite'; + import { TokenRow } from './TokenRow'; const IconWrapper = styled.div<{ $isActive: boolean }>` diff --git a/packages/suite/src/views/wallet/tokens/hidden-tokens/HiddenTokensTable.tsx b/packages/suite/src/views/wallet/tokens/hidden-tokens/HiddenTokensTable.tsx index 1aefc43312b..a23265a9784 100644 --- a/packages/suite/src/views/wallet/tokens/hidden-tokens/HiddenTokensTable.tsx +++ b/packages/suite/src/views/wallet/tokens/hidden-tokens/HiddenTokensTable.tsx @@ -1,14 +1,15 @@ import { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { TokenManagementAction, selectCoinDefinitions } from '@suite-common/token-definitions'; +import { spacings } from '@trezor/theme'; +import { Banner, H3, Column } from '@trezor/components'; +import { isTestnet } from '@suite-common/wallet-utils'; import { getTokens } from 'src/utils/wallet/tokenUtils'; import { useSelector } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; + import { NoTokens } from '../common/NoTokens'; import { TokensTable } from '../common/TokensTable/TokensTable'; -import { Translation } from 'src/components/suite'; -import { spacings } from '@trezor/theme'; -import { Banner, H3, Column } from '@trezor/components'; -import { isTestnet } from '@suite-common/wallet-utils'; interface HiddenTokensTableProps { selectedAccount: SelectedAccountLoaded; diff --git a/packages/suite/src/views/wallet/tokens/index.tsx b/packages/suite/src/views/wallet/tokens/index.tsx index 5c5de728add..2c9d3a10013 100644 --- a/packages/suite/src/views/wallet/tokens/index.tsx +++ b/packages/suite/src/views/wallet/tokens/index.tsx @@ -1,12 +1,14 @@ import { useState, useEffect } from 'react'; +import { Route, Switch } from 'react-router-dom'; import { WalletLayout } from 'src/components/wallet'; import { useDispatch, useSelector } from 'src/hooks/suite'; +import { goto } from 'src/actions/suite/routerActions'; + import { CoinsTable } from './coins/CoinsTable'; -import { Route, Switch } from 'react-router-dom'; import { TokensNavigation } from './TokensNavigation'; import { HiddenTokensTable } from './hidden-tokens/HiddenTokensTable'; -import { goto } from 'src/actions/suite/routerActions'; + export const Tokens = () => { const [searchQuery, setSearchQuery] = useState(''); diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinExplanation.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinExplanation.tsx index 6187cffa232..1f52264e455 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinExplanation.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinExplanation.tsx @@ -4,12 +4,13 @@ import { darken } from 'polished'; import { Card, Icon, variables } from '@trezor/components'; import { HELP_CENTER_COINJOIN_URL } from '@trezor/urls'; import { mediaQueries } from '@trezor/styles'; +import { spacings, spacingsPx, typography } from '@trezor/theme'; import { Translation } from 'src/components/suite'; -import { CoinjoinProcessStep, CoinjoinProcessStepProps } from './CoinjoinProcessStep'; -import { spacings, spacingsPx, typography } from '@trezor/theme'; import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; +import { CoinjoinProcessStep, CoinjoinProcessStepProps } from './CoinjoinProcessStep'; + // eslint-disable-next-line local-rules/no-override-ds-component const Container = styled(Card)` background: ${({ theme }) => theme.backgroundTertiaryDefaultOnElevation0}; diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinProcessStep.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinProcessStep.tsx index 6757404661c..37bdbce69f8 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinProcessStep.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinProcessStep.tsx @@ -1,6 +1,9 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { H3, Image, ImageType, Paragraph, variables } from '@trezor/components'; + import { Translation } from 'src/components/suite/Translation'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/BalancePrivacyBreakdown.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/BalancePrivacyBreakdown.tsx index 1b62f6c8d83..267c03b8a5b 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/BalancePrivacyBreakdown.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/BalancePrivacyBreakdown.tsx @@ -2,6 +2,7 @@ import styled, { useTheme } from 'styled-components'; import { Icon } from '@trezor/components'; import { isZero } from '@suite-common/wallet-utils'; + import { Translation } from 'src/components/suite/Translation'; import { useSelector } from 'src/hooks/suite'; import { @@ -9,6 +10,7 @@ import { selectCurrentCoinjoinSession, } from 'src/reducers/wallet/coinjoinReducer'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; + import { CryptoAmountWithHeader } from './CryptoAmountWithHeader'; const BalanceContainer = styled.div` diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/CryptoAmountWithHeader.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/CryptoAmountWithHeader.tsx index a969401e7a1..d39ad6cfaa6 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/CryptoAmountWithHeader.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/CryptoAmountWithHeader.tsx @@ -1,11 +1,14 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { variables } from '@trezor/components'; -import { FiatValue } from 'src/components/suite/FiatValue'; -import { FormattedCryptoAmount } from 'src/components/suite/FormattedCryptoAmount'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; +import { FiatValue } from 'src/components/suite/FiatValue'; +import { FormattedCryptoAmount } from 'src/components/suite/FormattedCryptoAmount'; + const Container = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceError.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceError.tsx index 94fa58d6ca0..54cb5fb4ab6 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceError.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceError.tsx @@ -1,6 +1,8 @@ import styled from 'styled-components'; + import { variables } from '@trezor/components'; import { TranslationKey } from '@suite-common/intl-types'; + import { Translation } from 'src/components/suite/Translation'; const StyledBalanceContainer = styled.div` diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceSection.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceSection.tsx index c60f6f7f938..d208348bb60 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceSection.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceSection.tsx @@ -1,10 +1,13 @@ import { useMemo } from 'react'; + import styled, { useTheme } from 'styled-components'; import { selectHasAccountTransactions } from '@suite-common/wallet-core'; import { Card, Column } from '@trezor/components'; + import { useSelector } from 'src/hooks/suite'; import { selectHasAnonymitySetError } from 'src/reducers/wallet/coinjoinReducer'; + import { BalancePrivacyBreakdown } from './BalancePrivacyBreakdown/BalancePrivacyBreakdown'; import { CoinjoinBalanceError, CoinjoinBalanceErrorProps } from './CoinjoinBalanceError'; import { CoinjoinStatusWheel } from './CoinjoinStatusWheel/CoinjoinStatusWheel'; diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressContent.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressContent.tsx index 73ffe56144b..0a6347a1df9 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressContent.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressContent.tsx @@ -1,5 +1,10 @@ +import { FormattedNumber } from 'react-intl'; + import styled, { useTheme } from 'styled-components'; + import { Spinner, Icon, Tooltip } from '@trezor/components'; +import { spacings, spacingsPx, typography } from '@trezor/theme'; + import { Translation } from 'src/components/suite/Translation'; import { CountdownTimer } from 'src/components/suite/CountdownTimer'; import { useSelector } from 'src/hooks/suite/useSelector'; @@ -9,8 +14,6 @@ import { selectRoundsDurationInHours, } from 'src/reducers/wallet/coinjoinReducer'; import { useCoinjoinSessionBlockers } from 'src/hooks/coinjoin/useCoinjoinSessionBlockers'; -import { FormattedNumber } from 'react-intl'; -import { spacings, spacingsPx, typography } from '@trezor/theme'; export const Container = styled.div<{ $isWide: boolean }>` width: ${({ $isWide }) => `calc(100% - ${$isWide ? 12 : 8}px)`}; diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressWheel.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressWheel.tsx index 5b65cad1a90..84bb151597c 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressWheel.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressWheel.tsx @@ -1,11 +1,10 @@ import { useCallback, useState } from 'react'; + import styled, { css, DefaultTheme, keyframes } from 'styled-components'; -import { Tooltip } from '@trezor/components'; -import { - CoinjoinProgressContent, - Container as ProgressContentContainer, -} from './CoinjoinProgressContent'; import { lighten, rgba } from 'polished'; + +import { Tooltip } from '@trezor/components'; + import { useSelector } from 'src/hooks/suite/useSelector'; import { selectCurrentCoinjoinWheelStates, @@ -23,6 +22,11 @@ import { coinjoinSessionAutostop, } from 'src/actions/wallet/coinjoinAccountActions'; +import { + CoinjoinProgressContent, + Container as ProgressContentContainer, +} from './CoinjoinProgressContent'; + export const DELAYED_SPIN = keyframes` 0% { transform: rotate(0deg); diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusMessage.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusMessage.tsx index 7bf5f33119b..421b279cb8e 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusMessage.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusMessage.tsx @@ -1,4 +1,7 @@ import styled from 'styled-components'; + +import { typography, spacingsPx } from '@trezor/theme'; + import { SESSION_PHASE_MESSAGES } from 'src/constants/suite/coinjoin'; import { Translation } from 'src/components/suite/Translation'; import { CountdownTimer } from 'src/components/suite'; @@ -8,7 +11,6 @@ import { selectCurrentCoinjoinWheelStates, selectCurrentSessionDeadlineInfo, } from 'src/reducers/wallet/coinjoinReducer'; -import { typography, spacingsPx } from '@trezor/theme'; const Cointainer = styled.div` height: 40px; diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusWheel.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusWheel.tsx index 84d563aad7a..802b603a6d9 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusWheel.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusWheel.tsx @@ -1,13 +1,17 @@ import styled from 'styled-components'; + import { Card, Button } from '@trezor/components'; -import { CoinjoinProgressWheel } from './CoinjoinProgressWheel'; -import { CoinjoinStatusMessage } from './CoinjoinStatusMessage'; +import { typography } from '@trezor/theme'; + import { useSelector } from 'src/hooks/suite/useSelector'; import { selectCurrentCoinjoinWheelStates } from 'src/reducers/wallet/coinjoinReducer'; import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { stopCoinjoinSession } from 'src/actions/wallet/coinjoinClientActions'; -import { typography } from '@trezor/theme'; + +import { CoinjoinStatusMessage } from './CoinjoinStatusMessage'; +import { CoinjoinProgressWheel } from './CoinjoinProgressWheel'; + // eslint-disable-next-line local-rules/no-override-ds-component const Container = styled(Card)<{ $isWide?: boolean }>` diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinSummary.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinSummary.tsx index f17581c5eb0..ba8ca086be5 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinSummary.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinSummary.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components'; + import { H3 } from '@trezor/components'; + import { Translation } from 'src/components/suite/Translation'; import { CoinjoinBalanceSection } from './CoinjoinBalanceSection'; diff --git a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx index 5d1b1b7c4fa..8d974e89ffb 100644 --- a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx +++ b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx @@ -1,13 +1,16 @@ import styled from 'styled-components'; import { spacings, spacingsPx, typography } from '@trezor/theme'; +import { Card, Row, variables } from '@trezor/components'; +import { getTitleForNetwork } from '@suite-common/wallet-utils'; +import { CoinLogo } from '@trezor/product-components'; + import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; -import { Card, Row, variables } from '@trezor/components'; + import { TradeBoxMenu } from './TradeBoxMenu'; import { TradeBoxPrices } from './TradeBoxPrices'; -import { getTitleForNetwork } from '@suite-common/wallet-utils'; -import { CoinLogo } from '@trezor/product-components'; + // eslint-disable-next-line local-rules/no-override-ds-component const StyledCard = styled(Card)` diff --git a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxMenu.tsx b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxMenu.tsx index 0ff78b1e4d4..50f27e4caf4 100644 --- a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxMenu.tsx +++ b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxMenu.tsx @@ -1,14 +1,18 @@ +import { ReactNode } from 'react'; + +import styled, { css } from 'styled-components'; + import { Route } from '@suite-common/suite-types'; import { Account } from '@suite-common/wallet-types'; import { Button, variables } from '@trezor/components'; import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; import { EventType, analytics } from '@trezor/suite-analytics'; import { spacingsPx } from '@trezor/theme'; -import { ReactNode } from 'react'; + import { goto } from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite'; import { useDevice, useDispatch } from 'src/hooks/suite'; -import styled, { css } from 'styled-components'; + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxPrices.tsx b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxPrices.tsx index a5161e3b885..7fc28607b5c 100644 --- a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxPrices.tsx +++ b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxPrices.tsx @@ -1,10 +1,14 @@ +import { PropsWithChildren, ReactNode } from 'react'; + import styled from 'styled-components'; + import { variables } from '@trezor/components'; import { spacingsPx, typography } from '@trezor/theme'; -import { PropsWithChildren, ReactNode } from 'react'; +import { networks } from '@suite-common/wallet-config'; + import { PriceTicker, Translation, TrendTicker } from 'src/components/suite'; import { Account } from 'src/types/wallet'; -import { networks } from '@suite-common/wallet-config'; + const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/NoSearchResults.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/NoSearchResults.tsx index a1479ead448..691592e1fd2 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/NoSearchResults.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/NoSearchResults.tsx @@ -1,10 +1,13 @@ import { useState } from 'react'; + import styled from 'styled-components'; + import { Card, Column, variables } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { getWeakRandomNumberInRange } from '@trezor/utils'; import { typography } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; + const NoResults = styled.div` text-align: center; color: ${({ theme }) => theme.legacy.TYPE_DARK_GREY}; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionCandidates.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionCandidates.tsx index dec60139855..b8b5f8a56d0 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionCandidates.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionCandidates.tsx @@ -1,7 +1,9 @@ import styled from 'styled-components'; + import { resolveStaticPath } from '@suite-common/suite-utils'; import { Card, SVG_IMAGES, variables } from '@trezor/components'; import { zIndices } from '@trezor/theme'; + import { useSelector } from 'src/hooks/suite'; import { selectCoinjoinAccountByKey } from 'src/reducers/wallet/coinjoinReducer'; import { TransactionTypeIcon } from 'src/components/wallet/TransactionItem/TransactionTypeIcon'; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionGroupedList.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionGroupedList.tsx index 92add38607c..1a13e31630e 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionGroupedList.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionGroupedList.tsx @@ -4,14 +4,16 @@ import { groupJointTransactions, } from '@suite-common/wallet-utils'; import { getNetwork } from '@suite-common/wallet-config'; + import { CoinjoinBatchItem } from 'src/components/wallet/TransactionItem/CoinjoinBatchItem'; import { useSelector } from 'src/hooks/suite'; import { Account, WalletAccountTransaction } from 'src/types/wallet'; import { TransactionItem } from 'src/components/wallet/TransactionItem/TransactionItem'; -import { TransactionsGroup } from './TransactionsGroup/TransactionsGroup'; import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { TransactionsGroup } from './TransactionsGroup/TransactionsGroup'; + interface TransactionGroupedListProps { transactionGroups: GroupedTransactionsByDate; symbol: WalletAccountTransaction['symbol']; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx index 819602cf989..2727ed99aa2 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx @@ -1,4 +1,5 @@ import { useEffect, useMemo, useRef, useState } from 'react'; + import styled from 'styled-components'; import useDebounce from 'react-use/lib/useDebounce'; @@ -12,19 +13,21 @@ import { groupTransactionsByDate, isPending, } from '@suite-common/wallet-utils'; +import { getTxsPerPage } from '@suite-common/suite-utils'; +import { SkeletonStack } from '@trezor/components'; + import { Translation } from 'src/components/suite'; import { DashboardSection } from 'src/components/dashboard'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { Account, WalletAccountTransaction } from 'src/types/wallet'; -import { TransactionListActions } from './TransactionListActions/TransactionListActions'; import { Pagination } from 'src/components/wallet'; +import { findAnchorTransactionPage } from 'src/utils/suite/anchor'; +import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; + +import { TransactionListActions } from './TransactionListActions/TransactionListActions'; import { SkeletonTransactionItem } from './SkeletonTransactionItem'; import { NoSearchResults } from './NoSearchResults'; -import { findAnchorTransactionPage } from 'src/utils/suite/anchor'; import { TransactionCandidates } from './TransactionCandidates'; -import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; -import { getTxsPerPage } from '@suite-common/suite-utils'; -import { SkeletonStack } from '@trezor/components'; import { PendingGroupHeader } from './TransactionsGroup/PendingGroupHeader'; import { TransactionGroupedList } from './TransactionGroupedList'; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/ExportAction.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/ExportAction.tsx index 26c69cd2c70..922b644bb3a 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/ExportAction.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/ExportAction.tsx @@ -1,18 +1,21 @@ import { useState, useCallback } from 'react'; + import { Spinner, Dropdown } from '@trezor/components'; import { analytics, EventType } from '@trezor/suite-analytics'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import { fetchAllTransactionsForAccountThunk } from '@suite-common/wallet-core'; +import { ExportFileType } from '@suite-common/wallet-types'; +import { getTitleForNetwork, getTitleForCoinjoinAccount } from '@suite-common/wallet-utils'; +import { AccountLabels } from '@suite-common/metadata-types'; + import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { useTranslation } from 'src/hooks/suite/useTranslation'; import { useSelector } from 'src/hooks/suite/useSelector'; -import { notificationsActions } from '@suite-common/toast-notifications'; -import { fetchAllTransactionsForAccountThunk } from '@suite-common/wallet-core'; import { exportTransactionsThunk } from 'src/actions/wallet/exportTransactionsActions'; -import { ExportFileType } from '@suite-common/wallet-types'; import { Account } from 'src/types/wallet'; -import { getTitleForNetwork, getTitleForCoinjoinAccount } from '@suite-common/wallet-utils'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; -import { AccountLabels } from '@suite-common/metadata-types'; + export interface ExportActionProps { account: Account; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/TransactionListActions.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/TransactionListActions.tsx index 083e20cf1f7..ce0dd6285ab 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/TransactionListActions.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/TransactionListActions.tsx @@ -1,15 +1,20 @@ -import styled from 'styled-components'; -import { SearchAction } from 'src/components/wallet/SearchAction'; -import { ExportAction } from './ExportAction'; import { Dispatch, SetStateAction, useCallback, useEffect, useState } from 'react'; -import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; + +import styled from 'styled-components'; + + import { notificationsActions } from '@suite-common/toast-notifications'; import { fetchAllTransactionsForAccountThunk } from '@suite-common/wallet-core'; import { Account } from '@suite-common/wallet-types'; import { AccountLabels } from '@suite-common/metadata-types'; + +import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; +import { SearchAction } from 'src/components/wallet/SearchAction'; import { SUITE } from 'src/actions/suite/constants'; +import { ExportAction } from './ExportAction'; + const Wrapper = styled.div` display: flex; align-items: center; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/CommonComponents.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/CommonComponents.tsx index 83f21c185b1..7cfb5f92d56 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/CommonComponents.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/CommonComponents.tsx @@ -1,6 +1,8 @@ import styled from 'styled-components'; + import { variables } from '@trezor/components'; import { zIndices } from '@trezor/theme'; + import { HiddenPlaceholder } from 'src/components/suite'; import { SUBPAGE_NAV_HEIGHT } from 'src/constants/suite/layout'; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/DayHeader.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/DayHeader.tsx index 7a36a1043fe..4e609ab1af5 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/DayHeader.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/DayHeader.tsx @@ -1,9 +1,12 @@ import { FormattedDate } from 'react-intl'; + import { BigNumber } from '@trezor/utils/src/bigNumber'; import { useFormatters } from '@suite-common/formatters'; import { isTestnet, parseTransactionDateKey } from '@suite-common/wallet-utils'; -import { FormattedCryptoAmount, HiddenPlaceholder } from 'src/components/suite'; import { NetworkSymbol } from '@suite-common/wallet-config'; + +import { FormattedCryptoAmount, HiddenPlaceholder } from 'src/components/suite'; + import { ColAmount, ColDate, ColFiat, HeaderWrapper } from './CommonComponents'; interface DayHeaderProps { diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/PendingGroupHeader.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/PendingGroupHeader.tsx index c7f24b0307e..de7ac8a27bc 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/PendingGroupHeader.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/PendingGroupHeader.tsx @@ -1,4 +1,5 @@ import { Translation } from 'src/components/suite'; + import { ColPending, HeaderWrapper } from './CommonComponents'; type PendingGroupHeaderProps = { txsCount: number }; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/TransactionsGroup.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/TransactionsGroup.tsx index 2f30c072e40..86c999b7e6d 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/TransactionsGroup.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/TransactionsGroup.tsx @@ -1,8 +1,8 @@ import { useState, ReactNode } from 'react'; + import styled from 'styled-components'; -import { WalletAccountTransaction } from 'src/types/wallet'; + import { NetworkSymbol } from '@suite-common/wallet-config'; -import { DayHeader } from './DayHeader'; import { getFiatRateKey, isNftTokenTransfer, @@ -12,10 +12,14 @@ import { } from '@suite-common/wallet-utils'; import { FiatCurrencyCode } from '@suite-common/suite-config'; import { selectHistoricFiatRates } from '@suite-common/wallet-core'; -import { useSelector } from 'src/hooks/suite'; import { Timestamp, TokenAddress } from '@suite-common/wallet-types'; import { isTokenDefinitionKnown, selectCoinDefinitions } from '@suite-common/token-definitions'; +import { useSelector } from 'src/hooks/suite'; +import { WalletAccountTransaction } from 'src/types/wallet'; + +import { DayHeader } from './DayHeader'; + const TransactionsGroupWrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/views/wallet/transactions/Transactions.tsx b/packages/suite/src/views/wallet/transactions/Transactions.tsx index 255b74f0ccd..e3515327efc 100644 --- a/packages/suite/src/views/wallet/transactions/Transactions.tsx +++ b/packages/suite/src/views/wallet/transactions/Transactions.tsx @@ -1,12 +1,17 @@ import { ReactNode } from 'react'; -import { WalletLayout, CoinjoinAccountDiscoveryProgress } from 'src/components/wallet'; -import { useSelector } from 'src/hooks/suite'; -import { AppState } from 'src/types/suite'; +import styled from 'styled-components'; + import { selectAccountTransactions, selectIsLoadingAccountTransactions, } from '@suite-common/wallet-core'; +import { spacingsPx } from '@trezor/theme'; + +import { WalletLayout, CoinjoinAccountDiscoveryProgress } from 'src/components/wallet'; +import { useSelector } from 'src/hooks/suite'; +import { AppState } from 'src/types/suite'; + import { NoTransactions } from './components/NoTransactions'; import { AccountEmpty } from './components/AccountEmpty'; import { TransactionList } from './TransactionList/TransactionList'; @@ -14,8 +19,8 @@ import { TransactionSummary } from './components/TransactionSummary'; import { CoinjoinExplanation } from './CoinjoinExplanation/CoinjoinExplanation'; import { CoinjoinSummary } from './CoinjoinSummary/CoinjoinSummary'; import { TradeBox } from './TradeBox/TradeBox'; -import styled from 'styled-components'; -import { spacingsPx } from '@trezor/theme'; + + const AccountLayout = styled(WalletLayout)` display: flex; diff --git a/packages/suite/src/views/wallet/transactions/components/InfoCard.tsx b/packages/suite/src/views/wallet/transactions/components/InfoCard.tsx index bfac34062e7..5661ef1a9b6 100644 --- a/packages/suite/src/views/wallet/transactions/components/InfoCard.tsx +++ b/packages/suite/src/views/wallet/transactions/components/InfoCard.tsx @@ -1,9 +1,12 @@ import { ReactNode } from 'react'; + import styled from 'styled-components'; + import { variables, Card, SkeletonRectangle } from '@trezor/components'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; + import { HiddenPlaceholder, FormattedCryptoAmount, Sign } from 'src/components/suite'; import { Account } from 'src/types/wallet'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; const InfoCardContent = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/transactions/components/NoTransactions.tsx b/packages/suite/src/views/wallet/transactions/components/NoTransactions.tsx index 0d35318c02c..2bfdadd4f47 100644 --- a/packages/suite/src/views/wallet/transactions/components/NoTransactions.tsx +++ b/packages/suite/src/views/wallet/transactions/components/NoTransactions.tsx @@ -1,7 +1,8 @@ +import { getNetwork } from '@suite-common/wallet-config'; + import { AccountExceptionLayout } from 'src/components/wallet'; import { Translation, TrezorLink } from 'src/components/suite'; import { Account } from 'src/types/wallet'; -import { getNetwork } from '@suite-common/wallet-config'; interface NoTransactionsProps { account: Account; diff --git a/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx b/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx index 742a7a2573d..ac92a211dd8 100644 --- a/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx +++ b/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx @@ -1,15 +1,17 @@ import styled from 'styled-components'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Translation, HiddenPlaceholder, FormattedDate } from 'src/components/suite'; -import { Account } from 'src/types/wallet'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { useFormatters } from '@suite-common/formatters'; import { variables } from '@trezor/components'; +import { DISCREET_PLACEHOLDER, useShouldRedactNumbers } from '@suite-common/wallet-utils'; -import { InfoCard } from './InfoCard'; +import { Translation, HiddenPlaceholder, FormattedDate } from 'src/components/suite'; +import { Account } from 'src/types/wallet'; import { AggregatedAccountHistory, GraphRange } from 'src/types/wallet/graph'; import { sumFiatValueMap } from 'src/utils/wallet/graph'; -import { DISCREET_PLACEHOLDER, useShouldRedactNumbers } from '@suite-common/wallet-utils'; + +import { InfoCard } from './InfoCard'; + const InfoCardsWrapper = styled.div` display: grid; diff --git a/packages/suite/src/views/wallet/transactions/components/TransactionSummary.tsx b/packages/suite/src/views/wallet/transactions/components/TransactionSummary.tsx index ef79942741a..ce7eaf2daef 100644 --- a/packages/suite/src/views/wallet/transactions/components/TransactionSummary.tsx +++ b/packages/suite/src/views/wallet/transactions/components/TransactionSummary.tsx @@ -1,6 +1,9 @@ import styled from 'styled-components'; import { getUnixTime } from 'date-fns'; +import { calcTicks, calcTicksFromData } from '@suite-common/suite-utils'; +import { variables, Button, Card } from '@trezor/components'; + import { Account } from 'src/types/wallet'; import { GraphRangeSelector, @@ -10,14 +13,11 @@ import { } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { getGraphDataForInterval, updateGraphData } from 'src/actions/wallet/graphActions'; - -import { calcTicks, calcTicksFromData } from '@suite-common/suite-utils'; -import { variables, Button, Card } from '@trezor/components'; +import { aggregateBalanceHistory, getMinMaxValueFromData } from 'src/utils/wallet/graph'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { TransactionSummaryDropdown } from './TransactionSummaryDropdown'; import { SummaryCards } from './SummaryCards'; -import { aggregateBalanceHistory, getMinMaxValueFromData } from 'src/utils/wallet/graph'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; const Wrapper = styled.div` display: flex; diff --git a/packages/transport/src/api/abstract.ts b/packages/transport/src/api/abstract.ts index ecab0a4fbfe..1ca42b102ed 100644 --- a/packages/transport/src/api/abstract.ts +++ b/packages/transport/src/api/abstract.ts @@ -1,4 +1,5 @@ import { TypedEmitter, getSynchronize } from '@trezor/utils'; + import type { AnyError, AsyncResultWithTypedError, @@ -8,7 +9,6 @@ import type { PathInternal, } from '../types'; import { success, error, unknownError } from '../utils/result'; - import * as ERRORS from '../errors'; export interface AbstractApiConstructorParams { diff --git a/packages/transport/src/api/udp.ts b/packages/transport/src/api/udp.ts index 9c086b12f1f..62a223a740f 100644 --- a/packages/transport/src/api/udp.ts +++ b/packages/transport/src/api/udp.ts @@ -1,4 +1,5 @@ import UDP from 'dgram'; + import { createTimeoutPromise, isNotUndefined, arrayPartition } from '@trezor/utils'; import { diff --git a/packages/transport/src/api/usb.ts b/packages/transport/src/api/usb.ts index 7c736e9569f..7cd17860a9e 100644 --- a/packages/transport/src/api/usb.ts +++ b/packages/transport/src/api/usb.ts @@ -12,7 +12,6 @@ import { TREZOR_USB_DESCRIPTORS, WEBUSB_BOOTLOADER_PRODUCT, } from '../constants'; - import * as ERRORS from '../errors'; interface ConstructorParams extends AbstractApiConstructorParams { diff --git a/packages/transport/src/sessions/background-browser.ts b/packages/transport/src/sessions/background-browser.ts index 7ef9353a007..a63bf9e79c2 100644 --- a/packages/transport/src/sessions/background-browser.ts +++ b/packages/transport/src/sessions/background-browser.ts @@ -1,6 +1,5 @@ import type { Descriptor } from '../types'; import { SessionsBackground } from './background'; - import { HandleMessageParams, HandleMessageResponse, SessionsBackgroundInterface } from './types'; /** diff --git a/packages/transport/src/transports/abstract.ts b/packages/transport/src/transports/abstract.ts index e9747017518..f8dad7b7784 100644 --- a/packages/transport/src/transports/abstract.ts +++ b/packages/transport/src/transports/abstract.ts @@ -1,4 +1,5 @@ import * as protobuf from 'protobufjs/light'; + import { scheduleAction, ScheduleActionParams, ScheduledAction, TypedEmitter } from '@trezor/utils'; import { PROTOCOL_MALFORMED, TransportProtocol } from '@trezor/protocol'; import { MessageFromTrezor } from '@trezor/protobuf'; @@ -15,7 +16,6 @@ import { PathPublic, } from '../types'; import { success, error, unknownError } from '../utils/result'; - import * as ERRORS from '../errors'; import { ACTION_TIMEOUT, TRANSPORT } from '../constants'; diff --git a/packages/transport/src/transports/abstractApi.ts b/packages/transport/src/transports/abstractApi.ts index 7ebd3afc05e..713f5676e81 100644 --- a/packages/transport/src/transports/abstractApi.ts +++ b/packages/transport/src/transports/abstractApi.ts @@ -1,6 +1,6 @@ -import { SessionsBackground } from '../sessions/background'; import { v1 as v1Protocol } from '@trezor/protocol'; +import { SessionsBackground } from '../sessions/background'; import { AbstractTransport, AbstractTransportParams, diff --git a/packages/transport/src/transports/bridge.ts b/packages/transport/src/transports/bridge.ts index 143cc14feba..b02fe0b9d58 100644 --- a/packages/transport/src/transports/bridge.ts +++ b/packages/transport/src/transports/bridge.ts @@ -5,6 +5,7 @@ import { v1 as protocolV1, TransportProtocol, } from '@trezor/protocol'; + import { bridgeApiCall } from '../utils/bridgeApiCall'; import * as bridgeApiResult from '../utils/bridgeApiResult'; import { createProtocolMessage } from '../utils/bridgeProtocolMessage'; @@ -15,7 +16,6 @@ import { AbstractTransportParams, AbstractTransportMethodParams, } from './abstract'; - import * as ERRORS from '../errors'; import { AnyError, diff --git a/packages/transport/src/transports/nodeusb.browser.ts b/packages/transport/src/transports/nodeusb.browser.ts index 3a4edc92eff..110872765d4 100644 --- a/packages/transport/src/transports/nodeusb.browser.ts +++ b/packages/transport/src/transports/nodeusb.browser.ts @@ -1,5 +1,4 @@ import { AbstractTransport, AbstractTransportParams } from './abstract'; - import { WRONG_ENVIRONMENT } from '../errors'; import { empty, emptySync } from '../utils/resultEmpty'; diff --git a/packages/transport/src/transports/nodeusb.ts b/packages/transport/src/transports/nodeusb.ts index 1ce9ef42e67..78ded1fcf54 100644 --- a/packages/transport/src/transports/nodeusb.ts +++ b/packages/transport/src/transports/nodeusb.ts @@ -1,4 +1,5 @@ import { WebUSB } from 'usb'; + import { AbstractTransportParams } from './abstract'; import { AbstractApiTransport } from './abstractApi'; import { UsbApi } from '../api/usb'; diff --git a/packages/transport/src/transports/udp.browser.ts b/packages/transport/src/transports/udp.browser.ts index c02cf1ce088..7a791d373e0 100644 --- a/packages/transport/src/transports/udp.browser.ts +++ b/packages/transport/src/transports/udp.browser.ts @@ -1,5 +1,4 @@ import { AbstractTransport } from './abstract'; - import { error } from '../utils/result'; import { WRONG_ENVIRONMENT } from '../errors'; diff --git a/packages/transport/src/transports/udp.ts b/packages/transport/src/transports/udp.ts index 56e7430b04b..a9fed5de947 100644 --- a/packages/transport/src/transports/udp.ts +++ b/packages/transport/src/transports/udp.ts @@ -1,5 +1,4 @@ import { AbstractTransportParams } from './abstract'; - import { UdpApi } from '../api/udp'; import { AbstractApiTransport } from './abstractApi'; diff --git a/packages/transport/src/transports/webusb.browser.ts b/packages/transport/src/transports/webusb.browser.ts index 5056d641cd1..b499358b5be 100644 --- a/packages/transport/src/transports/webusb.browser.ts +++ b/packages/transport/src/transports/webusb.browser.ts @@ -1,7 +1,6 @@ import { AbstractTransportMethodParams, AbstractTransportParams } from './abstract'; import { AbstractApiTransport } from './abstractApi'; import { UsbApi } from '../api/usb'; - import { BrowserSessionsBackground } from '../sessions/background-browser'; const defaultSessionsBackgroundUrl = diff --git a/packages/transport/src/transports/webusb.ts b/packages/transport/src/transports/webusb.ts index f3bd27e8350..a862c05e1c4 100644 --- a/packages/transport/src/transports/webusb.ts +++ b/packages/transport/src/transports/webusb.ts @@ -1,5 +1,4 @@ import { AbstractTransport, AbstractTransportParams } from './abstract'; - import { WRONG_ENVIRONMENT } from '../errors'; import { empty, emptySync } from '../utils/resultEmpty'; diff --git a/packages/transport/src/utils/bridgeApiCall.ts b/packages/transport/src/utils/bridgeApiCall.ts index 7d09e46fd3f..274ecbd267d 100644 --- a/packages/transport/src/utils/bridgeApiCall.ts +++ b/packages/transport/src/utils/bridgeApiCall.ts @@ -1,10 +1,9 @@ import fetch from 'cross-fetch'; -import { success, error, unknownError } from './result'; +import { PROTOCOL_MALFORMED } from '@trezor/protocol/src/errors'; +import { success, error, unknownError } from './result'; import * as ERRORS from '../errors'; - -import { PROTOCOL_MALFORMED } from '@trezor/protocol/src/errors'; import { applyBridgeApiCallHeaders } from './applyBridgeApiCallHeaders'; export type HttpRequestOptions = { diff --git a/packages/transport/src/utils/bridgeApiResult.ts b/packages/transport/src/utils/bridgeApiResult.ts index 1d0fd0926ea..2059678eb3d 100644 --- a/packages/transport/src/utils/bridgeApiResult.ts +++ b/packages/transport/src/utils/bridgeApiResult.ts @@ -1,7 +1,6 @@ // input checks for high-level transports import type { Descriptor, Session } from '../types'; - import { success, error } from './result'; import { validateProtocolMessage } from './bridgeProtocolMessage'; import * as ERRORS from '../errors'; diff --git a/packages/transport/src/utils/bridgeProtocolMessage.ts b/packages/transport/src/utils/bridgeProtocolMessage.ts index 6758477978f..903bf585246 100644 --- a/packages/transport/src/utils/bridgeProtocolMessage.ts +++ b/packages/transport/src/utils/bridgeProtocolMessage.ts @@ -1,4 +1,5 @@ import type { TransportProtocol } from '@trezor/protocol'; + import type { BridgeProtocolMessage } from '../types'; // validate expected body: diff --git a/packages/transport/src/utils/send.ts b/packages/transport/src/utils/send.ts index 0eda34f81b5..9983fbdf2f6 100644 --- a/packages/transport/src/utils/send.ts +++ b/packages/transport/src/utils/send.ts @@ -2,6 +2,7 @@ // // Logic of "call" is broken to two parts - sending and receiving import { Root } from 'protobufjs/light'; + import { encode as encodeProtobuf, createMessageFromName } from '@trezor/protobuf'; import { TransportProtocolEncode } from '@trezor/protocol'; diff --git a/packages/transport/tests/abstractUsb.test.ts b/packages/transport/tests/abstractUsb.test.ts index d2eeb6a8336..7e45366f523 100644 --- a/packages/transport/tests/abstractUsb.test.ts +++ b/packages/transport/tests/abstractUsb.test.ts @@ -1,7 +1,8 @@ import { v1 as v1Protocol } from '@trezor/protocol'; +import * as messages from '@trezor/protobuf/messages.json'; + import { AbstractApiTransport } from '../src/transports/abstractApi'; import { UsbApi } from '../src/api/usb'; -import * as messages from '@trezor/protobuf/messages.json'; import { PathPublic, Session } from '../src/types'; // create devices otherwise returned from navigator.usb.getDevices diff --git a/packages/transport/tests/apiUdp.test.ts b/packages/transport/tests/apiUdp.test.ts index a0fd7fda933..0ae1a9f7091 100644 --- a/packages/transport/tests/apiUdp.test.ts +++ b/packages/transport/tests/apiUdp.test.ts @@ -1,4 +1,5 @@ import UDP from 'dgram'; + import { UdpApi } from '../src/api/udp'; // mock dgram api diff --git a/packages/transport/tests/build-receive.test.ts b/packages/transport/tests/build-receive.test.ts index 201cff72df5..6b0f0fa94ab 100644 --- a/packages/transport/tests/build-receive.test.ts +++ b/packages/transport/tests/build-receive.test.ts @@ -1,5 +1,7 @@ import * as protobuf from 'protobufjs/light'; + import { v1 as v1Protocol, bridge as bridgeProtocol } from '@trezor/protocol'; + import { buildMessage, createChunks } from '../src/utils/send'; import { receiveAndParse } from '../src/utils/receive'; diff --git a/packages/utxo-lib/src/address.ts b/packages/utxo-lib/src/address.ts index b55f8fe6e06..b5f75de0537 100644 --- a/packages/utxo-lib/src/address.ts +++ b/packages/utxo-lib/src/address.ts @@ -3,6 +3,7 @@ // - `fromBase58Check` method is using additional "network" param and bs58check.decodeAddress instead of bs58check.decode. checking multibyte version (Zcash and Decred support). import { bech32, bech32m } from 'bech32'; + import * as bs58check from './bs58check'; import * as bscript from './script'; import * as payments from './payments'; diff --git a/packages/utxo-lib/src/bip32.ts b/packages/utxo-lib/src/bip32.ts index ebb65afb129..48e91d62592 100644 --- a/packages/utxo-lib/src/bip32.ts +++ b/packages/utxo-lib/src/bip32.ts @@ -7,6 +7,7 @@ import ecc from 'tiny-secp256k1'; import * as wif from 'wif'; + import { typeforce } from './types/typeforce'; import * as bs58check from './bs58check'; import * as crypto from './crypto'; diff --git a/packages/utxo-lib/src/bs58check.ts b/packages/utxo-lib/src/bs58check.ts index b82009ac561..b551b2d441a 100644 --- a/packages/utxo-lib/src/bs58check.ts +++ b/packages/utxo-lib/src/bs58check.ts @@ -1,7 +1,8 @@ -import { bitcoin as BITCOIN_NETWORK, isNetworkType } from './networks'; import bchaddrjs from 'bchaddrjs'; import bs58 from 'bs58'; import bs58check from 'bs58check'; + +import { bitcoin as BITCOIN_NETWORK, isNetworkType } from './networks'; import { blake256 } from './crypto'; export function decodeBlake(buffer: Buffer) { diff --git a/packages/utxo-lib/src/bufferutils.ts b/packages/utxo-lib/src/bufferutils.ts index 18f2c081da1..4a62fd72dba 100644 --- a/packages/utxo-lib/src/bufferutils.ts +++ b/packages/utxo-lib/src/bufferutils.ts @@ -9,7 +9,9 @@ import BN from 'bn.js'; import pushdata from 'pushdata-bitcoin'; import * as varuint from 'varuint-bitcoin'; import { Int64LE } from 'int64-buffer'; + import { bufferUtils } from '@trezor/utils'; + import * as types from './types'; const OUT_OF_RANGE_ERROR = 'value out of range'; diff --git a/packages/utxo-lib/src/coinselect/coinselectUtils.ts b/packages/utxo-lib/src/coinselect/coinselectUtils.ts index 64feb7e5d62..b9cc459cb5f 100644 --- a/packages/utxo-lib/src/coinselect/coinselectUtils.ts +++ b/packages/utxo-lib/src/coinselect/coinselectUtils.ts @@ -1,4 +1,5 @@ import BN from 'bn.js'; + import { CoinSelectPaymentType, CoinSelectAlgorithm, diff --git a/packages/utxo-lib/src/coinselect/inputs/accumulative.ts b/packages/utxo-lib/src/coinselect/inputs/accumulative.ts index 24d6371baef..feab043e016 100644 --- a/packages/utxo-lib/src/coinselect/inputs/accumulative.ts +++ b/packages/utxo-lib/src/coinselect/inputs/accumulative.ts @@ -1,4 +1,5 @@ import BN from 'bn.js'; + import { bignumberOrNaN, sumOrNaN, diff --git a/packages/utxo-lib/src/coinselect/inputs/branchAndBound.ts b/packages/utxo-lib/src/coinselect/inputs/branchAndBound.ts index 1d13736921d..979f2e87c1a 100644 --- a/packages/utxo-lib/src/coinselect/inputs/branchAndBound.ts +++ b/packages/utxo-lib/src/coinselect/inputs/branchAndBound.ts @@ -1,4 +1,5 @@ import BN from 'bn.js'; + import { bignumberOrNaN, sumOrNaN, diff --git a/packages/utxo-lib/src/coinselect/outputs/split.ts b/packages/utxo-lib/src/coinselect/outputs/split.ts index 5c0000ae851..66bf3ba5fa3 100644 --- a/packages/utxo-lib/src/coinselect/outputs/split.ts +++ b/packages/utxo-lib/src/coinselect/outputs/split.ts @@ -1,4 +1,5 @@ import BN from 'bn.js'; + import { bignumberOrNaN, sumOrNaN, diff --git a/packages/utxo-lib/src/compose/sorting/randomSortingStrategy.ts b/packages/utxo-lib/src/compose/sorting/randomSortingStrategy.ts index 0bffe1c0c74..859142621a3 100644 --- a/packages/utxo-lib/src/compose/sorting/randomSortingStrategy.ts +++ b/packages/utxo-lib/src/compose/sorting/randomSortingStrategy.ts @@ -1,6 +1,7 @@ +import { arrayShuffle, getRandomInt } from '@trezor/utils'; + import { SortingStrategy } from './sortingStrategy'; import { convertOutput } from './convertOutput'; -import { arrayShuffle, getRandomInt } from '@trezor/utils'; export const randomSortingStrategy: SortingStrategy = ({ result, request, convertedInputs }) => { const nonChangeOutputPermutation: number[] = []; diff --git a/packages/utxo-lib/src/derivation.ts b/packages/utxo-lib/src/derivation.ts index f029336879c..51d51e048ce 100644 --- a/packages/utxo-lib/src/derivation.ts +++ b/packages/utxo-lib/src/derivation.ts @@ -1,5 +1,7 @@ import bs58 from 'bs58'; + import { throwError } from '@trezor/utils'; + import { p2pkh, p2sh, p2wpkh, p2tr } from './payments'; import { fromBase58 } from './bip32'; import { bitcoin, Network } from './networks'; diff --git a/packages/utxo-lib/src/payments/p2ms.ts b/packages/utxo-lib/src/payments/p2ms.ts index d68c3f54832..8bc2fe941dd 100644 --- a/packages/utxo-lib/src/payments/p2ms.ts +++ b/packages/utxo-lib/src/payments/p2ms.ts @@ -1,6 +1,7 @@ // upstream: https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/ts_src/payments/p2ms.ts import ecc from 'tiny-secp256k1'; + import { bitcoin as BITCOIN_NETWORK } from '../networks'; import * as bscript from '../script'; import * as lazy from './lazy'; diff --git a/packages/utxo-lib/src/payments/p2pk.ts b/packages/utxo-lib/src/payments/p2pk.ts index 2c649bfcb54..38e5cf4d08f 100644 --- a/packages/utxo-lib/src/payments/p2pk.ts +++ b/packages/utxo-lib/src/payments/p2pk.ts @@ -1,6 +1,7 @@ // https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/ts_src/payments/p2pk.ts import ecc from 'tiny-secp256k1'; + import { bitcoin as BITCOIN_NETWORK } from '../networks'; import * as bscript from '../script'; import * as lazy from './lazy'; diff --git a/packages/utxo-lib/src/payments/p2pkh.ts b/packages/utxo-lib/src/payments/p2pkh.ts index 20a8eaf6da6..f4732eb6788 100644 --- a/packages/utxo-lib/src/payments/p2pkh.ts +++ b/packages/utxo-lib/src/payments/p2pkh.ts @@ -4,6 +4,7 @@ // - using bs58check.encodeAddress instead of bs58check.encode import ecc from 'tiny-secp256k1'; + import * as bs58check from '../bs58check'; import * as bcrypto from '../crypto'; import { bitcoin as BITCOIN_NETWORK } from '../networks'; diff --git a/packages/utxo-lib/src/payments/p2tr.ts b/packages/utxo-lib/src/payments/p2tr.ts index 387d3339374..0c4aaa0b280 100644 --- a/packages/utxo-lib/src/payments/p2tr.ts +++ b/packages/utxo-lib/src/payments/p2tr.ts @@ -3,6 +3,7 @@ import ecc from 'tiny-secp256k1'; import { bech32m } from 'bech32'; + import { bitcoin as BITCOIN_NETWORK } from '../networks'; import * as bcrypto from '../crypto'; import * as bscript from '../script'; diff --git a/packages/utxo-lib/src/payments/p2wpkh.ts b/packages/utxo-lib/src/payments/p2wpkh.ts index 44dba547aef..a49e466256c 100644 --- a/packages/utxo-lib/src/payments/p2wpkh.ts +++ b/packages/utxo-lib/src/payments/p2wpkh.ts @@ -2,6 +2,7 @@ import ecc from 'tiny-secp256k1'; import { bech32 } from 'bech32'; + import * as bcrypto from '../crypto'; import { bitcoin as BITCOIN_NETWORK } from '../networks'; import * as bscript from '../script'; diff --git a/packages/utxo-lib/src/payments/p2wsh.ts b/packages/utxo-lib/src/payments/p2wsh.ts index 83557d1c3bd..70e01089d65 100644 --- a/packages/utxo-lib/src/payments/p2wsh.ts +++ b/packages/utxo-lib/src/payments/p2wsh.ts @@ -2,6 +2,7 @@ import ecc from 'tiny-secp256k1'; import { bech32 } from 'bech32'; + import * as bcrypto from '../crypto'; import { bitcoin as BITCOIN_NETWORK } from '../networks'; import * as bscript from '../script'; diff --git a/packages/utxo-lib/src/script/index.ts b/packages/utxo-lib/src/script/index.ts index 0a188a198d7..1811d04ab17 100644 --- a/packages/utxo-lib/src/script/index.ts +++ b/packages/utxo-lib/src/script/index.ts @@ -5,6 +5,7 @@ import * as bip66 from 'bip66'; import pushdata from 'pushdata-bitcoin'; import ecc from 'tiny-secp256k1'; + import * as scriptNumber from './scriptNumber'; import * as scriptSignature from './scriptSignature'; import { OPS, REVERSE_OPS } from './ops'; diff --git a/packages/utxo-lib/src/script/scriptSignature.ts b/packages/utxo-lib/src/script/scriptSignature.ts index 2d7c0e70093..c2ca64146ee 100644 --- a/packages/utxo-lib/src/script/scriptSignature.ts +++ b/packages/utxo-lib/src/script/scriptSignature.ts @@ -1,6 +1,7 @@ // upstream: https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/ts_src/script_signature.ts import * as bip66 from 'bip66'; + import * as types from '../types'; const ZERO = Buffer.alloc(1, 0); diff --git a/packages/utxo-lib/src/transaction/base.ts b/packages/utxo-lib/src/transaction/base.ts index d869ec9d9ff..cde5812f1bf 100644 --- a/packages/utxo-lib/src/transaction/base.ts +++ b/packages/utxo-lib/src/transaction/base.ts @@ -1,9 +1,9 @@ import * as varuint from 'varuint-bitcoin'; + import { reverseBuffer, getChunkSize } from '../bufferutils'; import * as bcrypto from '../crypto'; import * as types from '../types'; import * as bscript from '../script'; - import { bitcoin as BITCOIN_NETWORK, Network, isNetworkType } from '../networks'; export function varSliceSize(someScript: Buffer) { diff --git a/packages/utxo-lib/src/transaction/dash.ts b/packages/utxo-lib/src/transaction/dash.ts index 5bc6350eb2a..618930b213c 100644 --- a/packages/utxo-lib/src/transaction/dash.ts +++ b/packages/utxo-lib/src/transaction/dash.ts @@ -1,4 +1,5 @@ import * as varuint from 'varuint-bitcoin'; + import { BufferReader, BufferWriter } from '../bufferutils'; import { TransactionBase, TransactionOptions, varSliceSize, vectorSize } from './base'; diff --git a/packages/utxo-lib/src/transaction/decred.ts b/packages/utxo-lib/src/transaction/decred.ts index 10ada38f469..67ec57ed365 100644 --- a/packages/utxo-lib/src/transaction/decred.ts +++ b/packages/utxo-lib/src/transaction/decred.ts @@ -1,6 +1,7 @@ // https://devdocs.decred.org/developer-guides/transactions/transaction-format/ import * as varuint from 'varuint-bitcoin'; + import { BufferReader, BufferWriter } from '../bufferutils'; import * as bcrypto from '../crypto'; import { TransactionBase, TransactionOptions, varSliceSize, EMPTY_SCRIPT } from './base'; diff --git a/packages/utxo-lib/src/transaction/zcash.ts b/packages/utxo-lib/src/transaction/zcash.ts index fc9cd5051f0..dba76653338 100644 --- a/packages/utxo-lib/src/transaction/zcash.ts +++ b/packages/utxo-lib/src/transaction/zcash.ts @@ -3,6 +3,7 @@ import * as varuint from 'varuint-bitcoin'; import { blake2b } from 'blakejs'; + import { BufferReader, BufferWriter, varIntSize } from '../bufferutils'; import { TransactionBase, TransactionOptions, varSliceSize, EMPTY_SCRIPT } from './base'; import { hash256 } from '../crypto'; diff --git a/packages/utxo-lib/src/types/coinselect.ts b/packages/utxo-lib/src/types/coinselect.ts index 14d9b68dde4..bd1e6cddfbd 100644 --- a/packages/utxo-lib/src/types/coinselect.ts +++ b/packages/utxo-lib/src/types/coinselect.ts @@ -1,4 +1,5 @@ import BN from 'bn.js'; + import { TransactionInputOutputSortingStrategy } from './compose'; export type CoinSelectPaymentType = 'p2pkh' | 'p2sh' | 'p2tr' | 'p2wpkh' | 'p2wsh'; diff --git a/packages/utxo-lib/tests/coinselect/coinselectUtils.test.ts b/packages/utxo-lib/tests/coinselect/coinselectUtils.test.ts index 12083a3ed14..a43a1827e35 100644 --- a/packages/utxo-lib/tests/coinselect/coinselectUtils.test.ts +++ b/packages/utxo-lib/tests/coinselect/coinselectUtils.test.ts @@ -1,4 +1,5 @@ import BN from 'bn.js'; + import { bignumberOrNaN, getFee, getDustAmount } from '../../src/coinselect/coinselectUtils'; describe('coinselectUtils', () => { diff --git a/packages/utxo-lib/tests/coinselect/test.utils.ts b/packages/utxo-lib/tests/coinselect/test.utils.ts index 4f692ecbfd1..a6081eedce6 100644 --- a/packages/utxo-lib/tests/coinselect/test.utils.ts +++ b/packages/utxo-lib/tests/coinselect/test.utils.ts @@ -1,4 +1,5 @@ import BN from 'bn.js'; + import { INPUT_SCRIPT_LENGTH, OUTPUT_SCRIPT_LENGTH } from '../../src/coinselect/coinselectUtils'; function addScriptLength(values: any[], scriptLength: number) { diff --git a/packages/utxo-lib/tests/compose.test.ts b/packages/utxo-lib/tests/compose.test.ts index 14037ef9808..74a19c536d6 100644 --- a/packages/utxo-lib/tests/compose.test.ts +++ b/packages/utxo-lib/tests/compose.test.ts @@ -1,11 +1,11 @@ +import { getRandomInt } from '@trezor/utils'; + import { composeTx } from '../src/compose'; import * as NETWORKS from '../src/networks'; - import { verifyTxBytes } from './compose.utils'; import { composeTxFixture } from './__fixtures__/compose'; import { fixturesCrossCheck } from './__fixtures__/compose.crosscheck'; -import { getRandomInt } from '@trezor/utils'; jest.mock('@trezor/utils', () => ({ ...jest.requireActual('@trezor/utils'), diff --git a/packages/utxo-lib/tests/script.test.ts b/packages/utxo-lib/tests/script.test.ts index d7e510f0d97..1b1708dcaa0 100644 --- a/packages/utxo-lib/tests/script.test.ts +++ b/packages/utxo-lib/tests/script.test.ts @@ -1,9 +1,9 @@ -import * as bscript from '../src/script'; +import minimalData from 'minimaldata'; +import * as bscript from '../src/script'; import { fixtures } from './__fixtures__/script'; import { templates } from './__fixtures__/templates'; -import minimalData from 'minimaldata'; describe('script', () => { // TODO From 27982a4643c3c35691c4c606ca1faa12f0a3f0de Mon Sep 17 00:00:00 2001 From: Peter Sanderson Date: Wed, 6 Nov 2024 12:32:11 +0100 Subject: [PATCH 2/4] chore: enable import/order rule for whole codebase - manual fixies --- .../connect/src/types/api/stellarSignTransaction.ts | 1 - packages/suite-build/webpack.config.ts | 1 - packages/suite/src/reducers/store.ts | 1 - packages/suite/src/types/wallet/coinjoin.ts | 3 +-- .../dashboard/AssetsView/AssetCard/AssetCard.tsx | 12 ++---------- 5 files changed, 3 insertions(+), 15 deletions(-) diff --git a/packages/connect/src/types/api/stellarSignTransaction.ts b/packages/connect/src/types/api/stellarSignTransaction.ts index 2771aa9b106..19931f1b77c 100644 --- a/packages/connect/src/types/api/stellarSignTransaction.ts +++ b/packages/connect/src/types/api/stellarSignTransaction.ts @@ -1,5 +1,4 @@ import type { Params, Response } from '../params'; - // todo:maybe we could unify terminology SignTransaction vs SignTx (across all methods) import type { StellarSignTransaction, StellarSignedTx } from './stellar'; diff --git a/packages/suite-build/webpack.config.ts b/packages/suite-build/webpack.config.ts index ce550c90975..78a7e619491 100644 --- a/packages/suite-build/webpack.config.ts +++ b/packages/suite-build/webpack.config.ts @@ -2,7 +2,6 @@ import { merge } from 'webpack-merge'; // Env utils import { project, isDev } from './utils/env'; - // Configs import base from './configs/base.webpack.config'; import dev from './configs/dev.webpack.config'; diff --git a/packages/suite/src/reducers/store.ts b/packages/suite/src/reducers/store.ts index 564b801303a..ab0405fa75c 100644 --- a/packages/suite/src/reducers/store.ts +++ b/packages/suite/src/reducers/store.ts @@ -20,7 +20,6 @@ import walletReducers from 'src/reducers/wallet'; import onboardingReducers from 'src/reducers/onboarding'; import recoveryReducers from 'src/reducers/recovery'; import backupReducers from 'src/reducers/backup'; - // toastMiddleware can be used only in suite-desktop and suite-web // it's not included into `@suite-middlewares` index import toastMiddleware from 'src/middlewares/suite/toastMiddleware'; diff --git a/packages/suite/src/types/wallet/coinjoin.ts b/packages/suite/src/types/wallet/coinjoin.ts index 96e8dda7652..e5e82515c1e 100644 --- a/packages/suite/src/types/wallet/coinjoin.ts +++ b/packages/suite/src/types/wallet/coinjoin.ts @@ -1,6 +1,5 @@ -import { NetworkSymbol } from '@suite-common/wallet-config'; import { PartialRecord } from '@trezor/type-utils'; - +import { NetworkSymbol } from '@suite-common/wallet-config'; // @trezor/coinjoin package is meant to be imported dynamically // importing types is safe, but importing an enum thru index will bundle whole lib import { diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx index 349420228c9..c9bcdeb1da9 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx @@ -21,8 +21,8 @@ import { Account, RatesByKey } from '@suite-common/wallet-types'; import { isTestnet } from '@suite-common/wallet-utils'; import { selectAssetAccountsThatStaked } from '@suite-common/wallet-core'; import { selectCoinDefinitions } from '@suite-common/token-definitions'; - import { FiatCurrencyCode } from '@suite-common/suite-config'; + import { AmountUnitSwitchWrapper, CoinBalance, @@ -30,23 +30,15 @@ import { Translation, TrendTicker, } from 'src/components/suite'; - - import { useAccountSearch, useLoadingSkeleton, useSelector } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; - - import { FiatHeader } from 'src/components/wallet/FiatHeader'; import { useFiatFromCryptoValue } from 'src/hooks/suite/useFiatFromCryptoValue'; import { ArrowIcon, styledHoverOnParentOfArrowIcon } from '../ArrowIcon'; import { CoinmarketBuyButton } from '../CoinmarketBuyButton'; import { AssetCardInfo, AssetCardInfoSkeleton } from './AssetCardInfo'; - - import { AssetCardTokensAndStakingInfo } from './AssetCardTokensAndStakingInfo'; - - import { handleTokensAndStakingData } from '../assetsViewUtils'; // eslint-disable-next-line local-rules/no-override-ds-component @@ -88,8 +80,8 @@ const FailedContainer = styled.div` display: flex; align-items: center; gap: ${spacingsPx.xs}; - ${typography.hint} + ${typography.hint} ${variables.SCREEN_QUERY.MOBILE} { border-bottom: 1px solid ${({ theme }) => theme.borderElevation2}; } From 1cee8ad56a893a226df5ce87bf5a0b9d0c76a32b Mon Sep 17 00:00:00 2001 From: Peter Sanderson Date: Wed, 6 Nov 2024 13:15:42 +0100 Subject: [PATCH 3/4] chore: enable import/order rule for whole codebase - prettier fix --- packages/blockchain-link/src/workers/electrum/devrun.ts | 3 ++- packages/components/src/components/Banner/Banner.tsx | 1 + packages/components/src/components/DataAnalytics.tsx | 1 - .../ElevationContext/ElevationContext.stories.tsx | 1 - packages/components/src/components/Flex/Flex.tsx | 1 - .../components/src/components/HotkeyBadge/HotkeyBadge.tsx | 1 - packages/components/src/components/Markdown/Markdown.tsx | 1 - .../components/src/components/NewModal/NewModalBackdrop.tsx | 1 - packages/components/src/components/Timerange/Timerange.tsx | 1 - .../src/components/buttons/Button/buttons.stories.tsx | 1 - packages/connect-popup/e2e/tests/popup-pages.test.ts | 1 - .../e2e/__fixtures__/cardanoGetAddressDerivations.ts | 1 - packages/connect/e2e/__fixtures__/cardanoSignTransaction.ts | 1 - packages/connect/src/api/bitcoin/refTx.ts | 1 - .../connect/src/api/ethereum/api/ethereumSignTransaction.ts | 1 - packages/connect/src/events/transport.ts | 1 - .../src/components/CoinLogo/coinLogos.stories.tsx | 1 - .../PassphraseTypeCard/PassphraseTypeCardHeading.tsx | 1 - .../src/components/SelectAssetModal/AssetItemNotFound.tsx | 1 - .../src/components/SelectAssetModal/SelectAssetModal.tsx | 1 - packages/suite-web/src/Main.tsx | 2 -- .../actions/onboarding/__tests__/onboardingActions.test.ts | 1 - .../src/actions/suite/__tests__/analyticsActions.test.ts | 1 - .../src/actions/suite/__tests__/protocolActions.test.ts | 1 - packages/suite/src/actions/suite/desktopUpdateActions.ts | 1 - packages/suite/src/actions/suite/metadataActions.ts | 1 - packages/suite/src/actions/suite/protocolActions.ts | 1 - packages/suite/src/actions/wallet/coinjoinClientActions.ts | 1 - packages/suite/src/actions/wallet/formDraftActions.ts | 1 - packages/suite/src/actions/wallet/graphActions.ts | 1 - packages/suite/src/actions/wallet/signVerifyActions.ts | 1 - packages/suite/src/components/guide/Feedback.tsx | 1 - packages/suite/src/components/guide/GuideHeader.tsx | 1 - packages/suite/src/components/guide/GuideSearch.tsx | 1 - packages/suite/src/components/onboarding/Hologram.tsx | 1 - .../suite/src/components/onboarding/OnboardingLayout.tsx | 1 - .../suite/src/components/onboarding/OnboardingStepBox.tsx | 1 - .../suite/src/components/suite/AmountUnitSwitchWrapper.tsx | 1 - packages/suite/src/components/suite/CountdownTimer.tsx | 1 - .../suite/PrerequisitesGuide/PrerequisitesGuide.tsx | 1 - .../suite/src/components/suite/Ticker/NoRatesTooltip.tsx | 1 - packages/suite/src/components/suite/Ticker/PriceTicker.tsx | 1 - .../src/components/suite/banners/MessageSystemBanner.tsx | 1 - .../suite/graph/TransactionsGraph/GraphTooltipAccount.tsx | 1 - .../suite/graph/TransactionsGraph/GraphYAxisTick.tsx | 1 - .../suite/labeling/MetadataLabeling/MetadataLabeling.tsx | 1 - .../suite/src/components/suite/labeling/WalletLabeling.tsx | 1 - .../layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx | 1 - .../layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx | 1 - .../suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx | 1 - .../SuiteLayout/Sidebar/QuickActions/NavBackends.tsx | 1 - .../QuickActions/Update/UpdateStatusActionBarIcon.tsx | 1 - .../suite/layouts/SuiteLayout/useAppShortcuts.tsx | 1 - .../suite/layouts/WelcomeLayout/WelcomeLayout.tsx | 1 - .../components/suite/modals/ConfirmEvmExplanationModal.tsx | 1 - .../suite/modals/ModalSwitcher/ForegroundAppModal.tsx | 1 - .../ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx | 1 - .../TransactionReviewModalContent.tsx | 1 - .../TransactionReviewOutputList/TransactionReviewOutput.tsx | 2 -- .../TransactionReviewModal/TransactionReviewSummary.tsx | 1 - .../AccountTypeSelect/AccountTypeDescription.tsx | 1 - .../AdvancedCoinSettingsModal/AdvancedCoinSettingsModal.tsx | 1 - .../CustomBackends/CustomBackends.tsx | 1 - .../ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx | 1 - .../CriticalCoinjoinPhaseModal/CoinjoinPhaseProgress.tsx | 1 - .../modals/ReduxModal/UserContextModal/DisableTorModal.tsx | 1 - .../MetadataProviderModal/MetadataProviderModal.tsx | 1 - .../MultiShareBackupModal/MultiShareBackupModal.tsx | 1 - .../MultiShareBackupModal/MultiShareBackupStep5Done.tsx | 1 - .../ReduxModal/UserContextModal/SafetyChecksModal.tsx | 1 - .../StakeModal/StakingInfoCards/EstimatedGains.tsx | 1 - .../StakeModal/StakingInfoCards/StakingInfoCards.tsx | 1 - .../TxDetailModal/AdvancedTxDetails/Data.tsx | 1 - .../TxDetailModal/AdvancedTxDetails/IODetails/IODetails.tsx | 1 - .../UserContextModal/TxDetailModal/BasicTxDetails.tsx | 1 - .../UserContextModal/TxDetailModal/ChangeFee/ChangeFee.tsx | 1 - .../TxDetailModal/ChangeFee/DecreasedOutputs.tsx | 1 - .../ReduxModal/UserContextModal/TxDetailModal/IOAddress.tsx | 1 - .../UserContextModal/TxDetailModal/TxDetailModal.tsx | 1 - .../UserContextModal/UnstakeModal/UnstakeEthForm/Inputs.tsx | 1 - .../UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx | 2 -- .../UserContextModal/UnstakeModal/UnstakeModal.tsx | 1 - .../NotificationRenderer/CoinProtocolRenderer.tsx | 1 - .../components/suite/notifications/ToastNotification.tsx | 1 - packages/suite/src/components/wallet/Fees/CustomFee.tsx | 2 -- packages/suite/src/components/wallet/Fees/Fees.tsx | 2 -- .../components/wallet/TransactionItem/InstantStakeBadge.tsx | 2 -- .../components/wallet/TransactionItem/TransactionItem.tsx | 2 -- .../components/wallet/TransactionItem/TransactionRow.tsx | 2 -- .../TransactionTarget/TargetAddressLabel.tsx | 1 - .../TransactionItem/TransactionTarget/TransactionTarget.tsx | 1 - .../wallet/WalletLayout/AccountBanners/AccountBanners.tsx | 3 --- .../wallet/WalletLayout/AccountBanners/ContextMessage.tsx | 1 - .../wallet/WalletLayout/AccountBanners/XRPReserve.tsx | 1 - .../wallet/WalletLayout/AccountsMenu/AccountGroup.tsx | 1 - .../wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx | 1 - .../wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx | 1 - .../wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx | 1 - .../src/hooks/suite/__tests__/useFilteredModal.test.tsx | 1 - packages/suite/src/hooks/suite/useDefaultAccountLabel.ts | 1 - packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts | 1 - .../coinmarket/form/useCoinmarketBuyFormDefaultValues.tsx | 1 - .../hooks/wallet/coinmarket/form/useCoinmarketSellForm.ts | 1 - .../wallet/coinmarket/form/useCoinmarketVerifyAccount.tsx | 1 - .../suite/src/hooks/wallet/useCoinmarketRecomposeAndSign.ts | 1 - packages/suite/src/hooks/wallet/useCoinmarketRedirect.ts | 1 - packages/suite/src/hooks/wallet/useSendForm.ts | 1 - .../src/reducers/desktop/__tests__/desktopReducer.test.ts | 6 ++++-- .../src/reducers/suite/__tests__/protocolReducer.test.ts | 1 - .../src/reducers/wallet/__tests__/coinjoinReducer.test.ts | 1 - packages/suite/src/reducers/wallet/receiveReducer.ts | 1 - packages/suite/src/reducers/wallet/settingsReducer.ts | 1 - .../suite/src/services/suite/metadata/DropboxProvider.ts | 1 - packages/suite/src/support/extraDependencies.ts | 2 -- packages/suite/src/support/suite/useTor.tsx | 1 - .../suite/src/utils/firmware/__tests__/firmware.test.ts | 1 + .../suite/src/utils/wallet/coinmarket/coinmarketUtils.ts | 2 -- packages/suite/src/utils/wallet/graph/utils.ts | 1 - .../suite/src/views/dashboard/AssetsView/AssetsView.tsx | 2 -- .../src/views/dashboard/AssetsView/CoinmarketBuyButton.tsx | 2 -- .../suite/src/views/dashboard/AssetsView/assetsViewUtils.ts | 1 - .../suite/src/views/dashboard/DashboardPassphraseBanner.tsx | 1 - packages/suite/src/views/dashboard/PromoBanner.tsx | 1 - .../src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx | 2 -- .../onboarding/steps/SelectBackupType/SelectBackupType.tsx | 1 - .../views/password-manager/PasswordManager/EntryForm.tsx | 1 - .../password-manager/PasswordManager/PasswordsList.tsx | 2 -- .../src/views/settings/SettingsDevice/MultiShareBackup.tsx | 1 - .../src/views/settings/SettingsGeneral/AutomaticUpdate.tsx | 1 - packages/suite/src/views/settings/SettingsLoader.tsx | 1 - packages/suite/src/views/suite/ErrorPage.tsx | 1 - .../src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx | 1 - .../suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx | 1 - .../src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx | 1 - packages/suite/src/views/suite/bridge-requested/index.tsx | 1 - packages/suite/src/views/suite/bridge/index.tsx | 1 - packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx | 2 -- .../CoinmarketDetailBuyPaymentWaitingForUser.tsx | 1 - .../CoinmarketOfferSell/CoinmarketOfferSellBankAccount.tsx | 1 - .../CoinmarketOfferSell/CoinmarketOfferSellTransaction.tsx | 1 - .../CoinmarketTransaction/CoinmarketTransactionStatus.tsx | 2 -- .../views/wallet/coinmarket/redirect/CoinmarketRedirect.tsx | 2 -- packages/suite/src/views/wallet/details/index.tsx | 1 - .../BitcoinOptions/CoinControl/UtxoSelectionList.tsx | 1 - .../send/Options/BitcoinOptions/Locktime/Locktime.tsx | 1 - .../wallet/send/Options/EthereumOptions/EthereumData.tsx | 1 - .../wallet/send/Options/RippleOptions/DestinationTag.tsx | 1 - .../src/views/wallet/send/Outputs/Amount/FiatInput.tsx | 2 -- packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx | 1 - packages/suite/src/views/wallet/send/SendRaw.tsx | 1 - .../suite/src/views/wallet/send/TotalSent/ReviewButton.tsx | 1 - .../suite/src/views/wallet/send/TotalSent/TotalSent.tsx | 1 - .../src/views/wallet/sign-verify/components/ButtonRow.tsx | 1 - .../wallet/staking/components/CardanoStakingDashboard.tsx | 1 - packages/suite/src/views/wallet/tokens/index.tsx | 1 - .../CoinjoinStatusWheel/CoinjoinStatusWheel.tsx | 1 - .../src/views/wallet/transactions/TradeBox/TradeBox.tsx | 1 - .../src/views/wallet/transactions/TradeBox/TradeBoxMenu.tsx | 1 - .../views/wallet/transactions/TradeBox/TradeBoxPrices.tsx | 1 - .../TransactionList/TransactionListActions/ExportAction.tsx | 1 - .../TransactionListActions/TransactionListActions.tsx | 2 -- .../suite/src/views/wallet/transactions/Transactions.tsx | 2 -- .../views/wallet/transactions/components/SummaryCards.tsx | 1 - packages/utxo-lib/tests/compose.test.ts | 1 - packages/utxo-lib/tests/script.test.ts | 1 - 165 files changed, 8 insertions(+), 186 deletions(-) diff --git a/packages/blockchain-link/src/workers/electrum/devrun.ts b/packages/blockchain-link/src/workers/electrum/devrun.ts index ea387e3cd71..3c28cbb3119 100644 --- a/packages/blockchain-link/src/workers/electrum/devrun.ts +++ b/packages/blockchain-link/src/workers/electrum/devrun.ts @@ -1,10 +1,11 @@ // @ts-nocheck /// -import ElectrumWorker from './index'; import { createSocket } from './sockets'; import type { Message, Response } from '../../types'; +import ElectrumWorker from './index'; + const TOR_ADDRESS = '127.0.0.1:9050'; const LOCALHOST_CONFIG = 'localhost:50001:t'; diff --git a/packages/components/src/components/Banner/Banner.tsx b/packages/components/src/components/Banner/Banner.tsx index 721bbec2fe1..eaf9845c12a 100755 --- a/packages/components/src/components/Banner/Banner.tsx +++ b/packages/components/src/components/Banner/Banner.tsx @@ -3,6 +3,7 @@ import { ReactNode } from 'react'; import styled, { css, DefaultTheme, useTheme } from 'styled-components'; import { Elevation, borders, spacingsPx, typography, spacings } from '@trezor/theme'; + import { FrameProps, FramePropsKeys, diff --git a/packages/components/src/components/DataAnalytics.tsx b/packages/components/src/components/DataAnalytics.tsx index ba6afe52835..c880922a8b9 100644 --- a/packages/components/src/components/DataAnalytics.tsx +++ b/packages/components/src/components/DataAnalytics.tsx @@ -11,7 +11,6 @@ import { CollapsibleBox } from './CollapsibleBox/CollapsibleBox'; import { Card } from './Card/Card'; import { Switch } from './form/Switch/Switch'; - const Wrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/components/src/components/ElevationContext/ElevationContext.stories.tsx b/packages/components/src/components/ElevationContext/ElevationContext.stories.tsx index 129ace1de78..123248eacb1 100644 --- a/packages/components/src/components/ElevationContext/ElevationContext.stories.tsx +++ b/packages/components/src/components/ElevationContext/ElevationContext.stories.tsx @@ -21,7 +21,6 @@ import { ElevationUp, } from './ElevationContext'; - const UiBox = styled.div<{ $elevation: Elevation }>` background-color: ${mapElevationToBackground}; border: 1px solid ${mapElevationToBorder}; diff --git a/packages/components/src/components/Flex/Flex.tsx b/packages/components/src/components/Flex/Flex.tsx index 4634fe219cc..4bac71a0615 100644 --- a/packages/components/src/components/Flex/Flex.tsx +++ b/packages/components/src/components/Flex/Flex.tsx @@ -13,7 +13,6 @@ import { import { makePropsTransient, TransientProps } from '../../utils/transientProps'; import { useElevation } from '../ElevationContext/ElevationContext'; - export const allowedFlexFrameProps = [ 'margin', 'width', diff --git a/packages/components/src/components/HotkeyBadge/HotkeyBadge.tsx b/packages/components/src/components/HotkeyBadge/HotkeyBadge.tsx index c1b6322dd05..cc8553f28a6 100644 --- a/packages/components/src/components/HotkeyBadge/HotkeyBadge.tsx +++ b/packages/components/src/components/HotkeyBadge/HotkeyBadge.tsx @@ -13,7 +13,6 @@ import { import { ElevationDown, useElevation } from '../ElevationContext/ElevationContext'; import { Keys, keyboardKeys } from './keyboardKeys'; - export const Container = styled.div<{ $elevation: Elevation; $isActive: boolean }>` display: flex; gap: ${spacingsPx.xxs}; diff --git a/packages/components/src/components/Markdown/Markdown.tsx b/packages/components/src/components/Markdown/Markdown.tsx index c898c62756c..3ad56b5f766 100644 --- a/packages/components/src/components/Markdown/Markdown.tsx +++ b/packages/components/src/components/Markdown/Markdown.tsx @@ -6,7 +6,6 @@ import { typography } from '@trezor/theme'; import { variables } from '../../config'; - const StyledMarkdown = styled.div` ${typography.hint} diff --git a/packages/components/src/components/NewModal/NewModalBackdrop.tsx b/packages/components/src/components/NewModal/NewModalBackdrop.tsx index 56089d43d6d..4d42fa6bdd3 100644 --- a/packages/components/src/components/NewModal/NewModalBackdrop.tsx +++ b/packages/components/src/components/NewModal/NewModalBackdrop.tsx @@ -6,7 +6,6 @@ import styled from 'styled-components'; import { zIndices, spacings } from '@trezor/theme'; - import { NewModalAlignment } from './types'; import { mapAlignmentToAlignItems, mapAlignmentToJustifyContent } from './utils'; import { useModalTarget } from './NewModalProvider'; diff --git a/packages/components/src/components/Timerange/Timerange.tsx b/packages/components/src/components/Timerange/Timerange.tsx index 35204258a1d..ad39c88e705 100644 --- a/packages/components/src/components/Timerange/Timerange.tsx +++ b/packages/components/src/components/Timerange/Timerange.tsx @@ -7,7 +7,6 @@ import type { Locale } from 'date-fns'; import { mediaQueries } from '@trezor/styles'; import { borders, spacingsPx, zIndices } from '@trezor/theme'; - import { Button } from '../buttons/Button/Button'; type Selection = { diff --git a/packages/components/src/components/buttons/Button/buttons.stories.tsx b/packages/components/src/components/buttons/Button/buttons.stories.tsx index 4dac9402fe9..e120c3a9599 100644 --- a/packages/components/src/components/buttons/Button/buttons.stories.tsx +++ b/packages/components/src/components/buttons/Button/buttons.stories.tsx @@ -7,7 +7,6 @@ import { Button } from '../../../index'; import { StoryColumn } from '../../../support/Story'; import { ButtonVariant } from '../buttonStyleUtils'; - const variants: Array = ['primary', 'tertiary', 'info', 'warning', 'destructive']; const meta: Meta = { diff --git a/packages/connect-popup/e2e/tests/popup-pages.test.ts b/packages/connect-popup/e2e/tests/popup-pages.test.ts index fcae9e676f3..2501726d290 100644 --- a/packages/connect-popup/e2e/tests/popup-pages.test.ts +++ b/packages/connect-popup/e2e/tests/popup-pages.test.ts @@ -12,7 +12,6 @@ import { waitAndClick, } from '../support/helpers'; - const url = process.env.URL || 'http://localhost:8088/'; const bridgeVersion = '2.0.33'; diff --git a/packages/connect/e2e/__fixtures__/cardanoGetAddressDerivations.ts b/packages/connect/e2e/__fixtures__/cardanoGetAddressDerivations.ts index e8669f19e36..8ec92e17bc1 100644 --- a/packages/connect/e2e/__fixtures__/cardanoGetAddressDerivations.ts +++ b/packages/connect/e2e/__fixtures__/cardanoGetAddressDerivations.ts @@ -4,7 +4,6 @@ import { MessagesSchema } from '@trezor/protobuf'; import commonFixtures from '../../../../submodules/trezor-common/tests/fixtures/cardano/get_base_address.derivations.json'; - const { CardanoAddressType, CardanoDerivationType } = MessagesSchema; const legacyResults = { diff --git a/packages/connect/e2e/__fixtures__/cardanoSignTransaction.ts b/packages/connect/e2e/__fixtures__/cardanoSignTransaction.ts index 8c580fa03e4..59f5937e3c2 100644 --- a/packages/connect/e2e/__fixtures__/cardanoSignTransaction.ts +++ b/packages/connect/e2e/__fixtures__/cardanoSignTransaction.ts @@ -2,7 +2,6 @@ import { MessagesSchema } from '@trezor/protobuf'; import { NETWORK_IDS, PROTOCOL_MAGICS } from '../../src/constants/cardano'; - const { CardanoAddressType, CardanoCVoteRegistrationFormat, diff --git a/packages/connect/src/api/bitcoin/refTx.ts b/packages/connect/src/api/bitcoin/refTx.ts index 778663b7efc..a2aeca99414 100644 --- a/packages/connect/src/api/bitcoin/refTx.ts +++ b/packages/connect/src/api/bitcoin/refTx.ts @@ -24,7 +24,6 @@ import type { import type { RefTransaction, TransactionOptions } from '../../types/api/bitcoin'; import { PROTO } from '../../constants'; - // Referenced transactions are not required if: // - all internal inputs script_type === SPENDTAPROOT // - zcash tx version is NU5 (or greater) diff --git a/packages/connect/src/api/ethereum/api/ethereumSignTransaction.ts b/packages/connect/src/api/ethereum/api/ethereumSignTransaction.ts index 0a40ebf6e4b..cf1c4e8943f 100644 --- a/packages/connect/src/api/ethereum/api/ethereumSignTransaction.ts +++ b/packages/connect/src/api/ethereum/api/ethereumSignTransaction.ts @@ -23,7 +23,6 @@ import { EthereumSignTransaction as EthereumSignTransactionSchema, } from '../../../types'; - type Params = { path: number[]; network?: EthereumNetworkInfo; diff --git a/packages/connect/src/events/transport.ts b/packages/connect/src/events/transport.ts index b1157bbbbce..f0d83f8442f 100644 --- a/packages/connect/src/events/transport.ts +++ b/packages/connect/src/events/transport.ts @@ -4,7 +4,6 @@ import { TRANSPORT } from '@trezor/transport/src/constants'; import { serializeError } from '../constants/errors'; import type { MessageFactoryFn } from '../types/utils'; - export { TRANSPORT } from '@trezor/transport/src/constants'; export const TRANSPORT_EVENT = 'TRANSPORT_EVENT'; diff --git a/packages/product-components/src/components/CoinLogo/coinLogos.stories.tsx b/packages/product-components/src/components/CoinLogo/coinLogos.stories.tsx index 04218cb39d2..03056d600af 100644 --- a/packages/product-components/src/components/CoinLogo/coinLogos.stories.tsx +++ b/packages/product-components/src/components/CoinLogo/coinLogos.stories.tsx @@ -7,7 +7,6 @@ import { NetworkSymbol } from '@suite-common/wallet-config'; import { CoinLogo } from '../../index'; import { COINS } from './coins'; - const CoinName = styled.div` margin-bottom: 0.5rem; color: ${({ theme }) => theme.legacy.TYPE_LIGHT_GREY}; diff --git a/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardHeading.tsx b/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardHeading.tsx index f3e2f3131a2..4b7607f5313 100644 --- a/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardHeading.tsx +++ b/packages/product-components/src/components/PassphraseTypeCard/PassphraseTypeCardHeading.tsx @@ -8,7 +8,6 @@ import { Tooltip, TooltipProps, Column, Row, Icon } from '@trezor/components'; import { WalletType } from './types'; - const IconWrapper = styled.div<{ $type: WalletType }>` width: 38px; height: 38px; diff --git a/packages/product-components/src/components/SelectAssetModal/AssetItemNotFound.tsx b/packages/product-components/src/components/SelectAssetModal/AssetItemNotFound.tsx index dc74a0bbc0a..243cd7df5b3 100644 --- a/packages/product-components/src/components/SelectAssetModal/AssetItemNotFound.tsx +++ b/packages/product-components/src/components/SelectAssetModal/AssetItemNotFound.tsx @@ -5,7 +5,6 @@ import { spacings } from '@trezor/theme'; import { SelectAssetNetworkProps, SelectAssetSearchCategoryType } from './SelectAssetModal'; - interface AssetItemNotFoundProps { searchCategory: SelectAssetSearchCategoryType; networkCategories: SelectAssetNetworkProps[]; diff --git a/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.tsx b/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.tsx index d169d6b5b0d..50721401ff8 100644 --- a/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.tsx +++ b/packages/product-components/src/components/SelectAssetModal/SelectAssetModal.tsx @@ -17,7 +17,6 @@ import { AssetItem } from './AssetItem'; import { NetworkTabs } from './NetworkTabs'; import { AssetItemNotFound } from './AssetItemNotFound'; - export interface SelectAssetOptionCurrencyProps { type: 'currency'; value: string; // CryptoId (networkId + contractAddress) diff --git a/packages/suite-web/src/Main.tsx b/packages/suite-web/src/Main.tsx index 9b13e15d91e..0d32c8955dd 100644 --- a/packages/suite-web/src/Main.tsx +++ b/packages/suite-web/src/Main.tsx @@ -28,8 +28,6 @@ import { ModalContextProvider } from 'src/support/suite/ModalContext'; import AppRouter from './support/Router'; import { useCypress } from './support/useCypress'; - - const Main = () => { useCypress(); useTor(); diff --git a/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts b/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts index 900caae8c0b..8db3ce3e8e3 100644 --- a/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts +++ b/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts @@ -6,7 +6,6 @@ import { Action } from 'src/types/suite'; import fixtures from '../__fixtures__/onboardingActions'; - // todo fighting with typescript here. How to keep string literal being exported from fixtures and not converted // to string? if exported as const, it makes all properties readonly and thus not assignable to reducer which // expects mutable properties; diff --git a/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts b/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts index 6b61098f2f9..50ebd37c650 100644 --- a/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts @@ -4,7 +4,6 @@ import { extraDependencies } from 'src/support/extraDependencies'; import { configureStore } from 'src/support/tests/configureStore'; import { init } from 'src/actions/suite/analyticsActions'; - const analyticsReducer = prepareAnalyticsReducer(extraDependencies); type AnalyticsState = ReturnType; diff --git a/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts b/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts index ff920c45a52..48673ffac5a 100644 --- a/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts @@ -4,7 +4,6 @@ import { NETWORK_TO_PROTOCOLS } from '@suite-common/suite-constants'; import { configureStore } from 'src/support/tests/configureStore'; import protocolReducer, { State as ProtocolState } from 'src/reducers/suite/protocolReducer'; - import * as protocolActions from '../protocolActions'; import * as protocolConstants from '../constants/protocolConstants'; diff --git a/packages/suite/src/actions/suite/desktopUpdateActions.ts b/packages/suite/src/actions/suite/desktopUpdateActions.ts index a57299f39ad..3db2bbfeb93 100644 --- a/packages/suite/src/actions/suite/desktopUpdateActions.ts +++ b/packages/suite/src/actions/suite/desktopUpdateActions.ts @@ -7,7 +7,6 @@ import { Dispatch, GetState } from 'src/types/suite'; import { UpdateState, UpdateModalVisibility } from 'src/reducers/suite/desktopUpdateReducer'; import { getAppUpdatePayload } from 'src/utils/suite/analytics'; - export type DesktopUpdateAction = | { type: typeof DESKTOP_UPDATE.CHECKING } | { type: typeof DESKTOP_UPDATE.AVAILABLE; payload: UpdateInfo } diff --git a/packages/suite/src/actions/suite/metadataActions.ts b/packages/suite/src/actions/suite/metadataActions.ts index d38735df649..453df45bedc 100644 --- a/packages/suite/src/actions/suite/metadataActions.ts +++ b/packages/suite/src/actions/suite/metadataActions.ts @@ -18,7 +18,6 @@ import * as metadataUtils from 'src/utils/suite/metadata'; import { selectSelectedProviderForLabels } from 'src/reducers/suite/metadataReducer'; import type { AbstractMetadataProvider, PasswordManagerState } from 'src/types/suite/metadata'; - export type MetadataAction = | { type: typeof METADATA.ENABLE } | { type: typeof METADATA.DISABLE } diff --git a/packages/suite/src/actions/suite/protocolActions.ts b/packages/suite/src/actions/suite/protocolActions.ts index 66104dda02d..9d1dc3c6421 100644 --- a/packages/suite/src/actions/suite/protocolActions.ts +++ b/packages/suite/src/actions/suite/protocolActions.ts @@ -8,7 +8,6 @@ import type { Dispatch } from 'src/types/suite'; import type { SendFormState } from 'src/reducers/suite/protocolReducer'; import * as routerActions from 'src/actions/suite/routerActions'; - import { PROTOCOL } from './constants'; export type ProtocolAction = diff --git a/packages/suite/src/actions/wallet/coinjoinClientActions.ts b/packages/suite/src/actions/wallet/coinjoinClientActions.ts index 003420d86f0..3351518c686 100644 --- a/packages/suite/src/actions/wallet/coinjoinClientActions.ts +++ b/packages/suite/src/actions/wallet/coinjoinClientActions.ts @@ -38,7 +38,6 @@ import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; import * as COINJOIN from './constants/coinjoinConstants'; - const clientEnable = (symbol: Account['symbol']) => ({ type: COINJOIN.CLIENT_ENABLE, diff --git a/packages/suite/src/actions/wallet/formDraftActions.ts b/packages/suite/src/actions/wallet/formDraftActions.ts index 9ade4f324ec..3d22da1e63e 100644 --- a/packages/suite/src/actions/wallet/formDraftActions.ts +++ b/packages/suite/src/actions/wallet/formDraftActions.ts @@ -7,7 +7,6 @@ import { Dispatch, GetState } from 'src/types/suite'; import { FORM_DRAFT } from './constants'; - export type FormDraftAction = | { type: typeof FORM_DRAFT.STORE_DRAFT; diff --git a/packages/suite/src/actions/wallet/graphActions.ts b/packages/suite/src/actions/wallet/graphActions.ts index 2486b9d52cf..a58052b6088 100644 --- a/packages/suite/src/actions/wallet/graphActions.ts +++ b/packages/suite/src/actions/wallet/graphActions.ts @@ -25,7 +25,6 @@ import { SET_SELECTED_VIEW, } from './constants/graphConstants'; - export type GraphAction = | { type: typeof ACCOUNT_GRAPH_SUCCESS; diff --git a/packages/suite/src/actions/wallet/signVerifyActions.ts b/packages/suite/src/actions/wallet/signVerifyActions.ts index 8e17b2937c3..2eac4dd33ae 100644 --- a/packages/suite/src/actions/wallet/signVerifyActions.ts +++ b/packages/suite/src/actions/wallet/signVerifyActions.ts @@ -9,7 +9,6 @@ import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; import { SIGN_VERIFY } from './constants'; - export type SignVerifyAction = | { type: typeof SIGN_VERIFY.SIGN_SUCCESS; signSignature: string } | { type: typeof SIGN_VERIFY.VERIFY_SUCCESS }; diff --git a/packages/suite/src/components/guide/Feedback.tsx b/packages/suite/src/components/guide/Feedback.tsx index e308e35fc03..01bb8166c6f 100644 --- a/packages/suite/src/components/guide/Feedback.tsx +++ b/packages/suite/src/components/guide/Feedback.tsx @@ -22,7 +22,6 @@ import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; import { sendFeedback, setView } from 'src/actions/suite/guideActions'; import { GuideViewWrapper, GuideHeader, GuideContent } from 'src/components/guide'; - const Headline = styled.div` font-size: ${variables.FONT_SIZE.TINY}; font-weight: ${variables.FONT_WEIGHT.DEMI_BOLD}; diff --git a/packages/suite/src/components/guide/GuideHeader.tsx b/packages/suite/src/components/guide/GuideHeader.tsx index e42b70364b2..79ea11ffac4 100644 --- a/packages/suite/src/components/guide/GuideHeader.tsx +++ b/packages/suite/src/components/guide/GuideHeader.tsx @@ -11,7 +11,6 @@ import { close } from 'src/actions/suite/guideActions'; import { useDispatch } from 'src/hooks/suite'; import { HeaderBreadcrumb, ContentScrolledContext } from 'src/components/guide'; - const HeaderWrapper = styled.div<{ $noLabel?: boolean; $isScrolled: boolean }>` display: flex; align-items: center; diff --git a/packages/suite/src/components/guide/GuideSearch.tsx b/packages/suite/src/components/guide/GuideSearch.tsx index c8f3e22d535..cde56565947 100644 --- a/packages/suite/src/components/guide/GuideSearch.tsx +++ b/packages/suite/src/components/guide/GuideSearch.tsx @@ -11,7 +11,6 @@ import { useTranslation } from 'src/hooks/suite'; import { GuideNode } from 'src/components/guide'; import { useGuideSearch } from 'src/hooks/guide'; - const Wrapper = styled.div` margin-bottom: ${spacingsPx.xs}; `; diff --git a/packages/suite/src/components/onboarding/Hologram.tsx b/packages/suite/src/components/onboarding/Hologram.tsx index e8e54cb6048..1ef72695976 100644 --- a/packages/suite/src/components/onboarding/Hologram.tsx +++ b/packages/suite/src/components/onboarding/Hologram.tsx @@ -12,7 +12,6 @@ import { DeviceModelInternal } from '@trezor/connect'; import { Translation, TrezorLink } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; - const HologramSubHeading = styled.span` font-size: ${variables.FONT_SIZE.SMALL}; font-weight: ${variables.FONT_WEIGHT.MEDIUM}; diff --git a/packages/suite/src/components/onboarding/OnboardingLayout.tsx b/packages/suite/src/components/onboarding/OnboardingLayout.tsx index 8e778461530..aa50c4f8f0b 100644 --- a/packages/suite/src/components/onboarding/OnboardingLayout.tsx +++ b/packages/suite/src/components/onboarding/OnboardingLayout.tsx @@ -17,7 +17,6 @@ import { GuideButton, GuideRouter } from 'src/components/guide'; import { MessageSystemBanner } from 'src/components/suite/banners'; import { ModalContextProvider } from 'src/support/suite/ModalContext'; - import { TrafficLightOffset } from '../suite/TrafficLightOffset'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/onboarding/OnboardingStepBox.tsx b/packages/suite/src/components/onboarding/OnboardingStepBox.tsx index 43530aa48ba..5bd74ba2668 100644 --- a/packages/suite/src/components/onboarding/OnboardingStepBox.tsx +++ b/packages/suite/src/components/onboarding/OnboardingStepBox.tsx @@ -17,7 +17,6 @@ import { CollapsibleOnboardingCardProps, } from './CollapsibleOnboardingCard'; - const WrapperWrapper = styled.div` z-index: ${zIndices.onboardingForeground}; `; diff --git a/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx b/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx index 5ab3bf08591..69581e68bb9 100644 --- a/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx +++ b/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx @@ -10,7 +10,6 @@ import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { Translation } from './Translation'; - const Container = styled.div` position: relative; display: flex; diff --git a/packages/suite/src/components/suite/CountdownTimer.tsx b/packages/suite/src/components/suite/CountdownTimer.tsx index c97a42485be..1967741247d 100644 --- a/packages/suite/src/components/suite/CountdownTimer.tsx +++ b/packages/suite/src/components/suite/CountdownTimer.tsx @@ -2,7 +2,6 @@ import { FormattedNumber } from 'react-intl'; import styled from 'styled-components'; - import { TranslationKey } from '@suite-common/intl-types'; import { useCountdownTimer } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx index 3a9a7c6ddc2..93e33acedf2 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx @@ -27,7 +27,6 @@ import { DeviceUpdateRequired } from './DeviceUpdateRequired'; import { DeviceDisconnectRequired } from './DeviceDisconnectRequired'; import { MultiShareBackupInProgress } from './MultiShareBackupInProgress'; - const Wrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx b/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx index 5040c22aa47..1b443f035b3 100644 --- a/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx +++ b/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx @@ -6,7 +6,6 @@ import { Translation, TooltipSymbol } from 'src/components/suite'; import { TranslationKey } from '../Translation'; - const NoRatesMessage = styled.div` ${typography.label}; display: flex; diff --git a/packages/suite/src/components/suite/Ticker/PriceTicker.tsx b/packages/suite/src/components/suite/Ticker/PriceTicker.tsx index f53c9047d26..ea244a8cf22 100644 --- a/packages/suite/src/components/suite/Ticker/PriceTicker.tsx +++ b/packages/suite/src/components/suite/Ticker/PriceTicker.tsx @@ -8,7 +8,6 @@ import { FiatValue } from 'src/components/suite'; import { NoRatesTooltip } from './NoRatesTooltip'; import { LastUpdateTooltip } from './LastUpdateTooltip'; - const FiatRateWrapper = styled.span` ${typography.callout} display: flex; diff --git a/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx b/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx index cc5243143a8..5658d4e39cc 100644 --- a/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx +++ b/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx @@ -9,7 +9,6 @@ import { useDispatch, useSelector } from 'src/hooks/suite'; import { getTorUrlIfAvailable } from 'src/utils/suite/tor'; import { selectLanguage, selectTorState } from 'src/reducers/suite/suiteReducer'; - type MessageSystemBannerProps = { message: Message; }; diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx index bf97271f1ff..f44b18ac21a 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx @@ -11,7 +11,6 @@ import { CommonAggregatedHistory, GraphRange } from 'src/types/wallet/graph'; import type { CryptoGraphProps } from './TransactionsGraph'; import { GraphTooltipBase } from './GraphTooltipBase'; - const StyledCryptoAmount = styled(FormattedCryptoAmount)` margin-right: 2px; `; diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx index 2279b12993c..d2288abde5b 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx @@ -2,7 +2,6 @@ import { useRef, useLayoutEffect } from 'react'; import { useTheme } from 'styled-components'; - import { useFormatters } from '@suite-common/formatters'; import { NetworkSymbol } from '@suite-common/wallet-config'; diff --git a/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx b/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx index 65e2a6f8561..543e0986e37 100644 --- a/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx +++ b/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx @@ -20,7 +20,6 @@ import { withEditable } from './withEditable'; import { withDropdown } from './withDropdown'; import { AccountTypeBadge } from '../../AccountTypeBadge'; - const LabelValue = styled.div` overflow: hidden; text-overflow: ellipsis; diff --git a/packages/suite/src/components/suite/labeling/WalletLabeling.tsx b/packages/suite/src/components/suite/labeling/WalletLabeling.tsx index f0a34b5dd60..b25cc817790 100644 --- a/packages/suite/src/components/suite/labeling/WalletLabeling.tsx +++ b/packages/suite/src/components/suite/labeling/WalletLabeling.tsx @@ -9,7 +9,6 @@ import { useTranslation } from 'src/hooks/suite/useTranslation'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer'; - interface WalletLabellingProps { device: TrezorDevice; shouldUseDeviceLabel?: boolean; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx index fe9a5518180..998a9f1bdea 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx @@ -15,7 +15,6 @@ import { ViewOnlyTooltip } from 'src/views/view-only/ViewOnlyTooltip'; import { SidebarDeviceStatus } from './SidebarDeviceStatus'; - const CaretContainer = styled.div` background: transparent; padding: 10px; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx index 0cab65a72a5..2d9cb0aebbf 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx @@ -10,7 +10,6 @@ import { MAIN_MENU_ITEMS } from 'src/constants/suite/menu'; import { useAccountSearch, useSelector, useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; - interface ComponentProps { isActive: boolean; isDisabled?: boolean; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx index 39c0302b74b..194f3487e16 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx @@ -19,7 +19,6 @@ import { useDispatch, useSelector } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; - export const NavigationItemBase = styled.div.attrs(() => ({ tabIndex: 0, }))` diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/NavBackends.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/NavBackends.tsx index 1233bb57198..dc40b0feaea 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/NavBackends.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/NavBackends.tsx @@ -13,7 +13,6 @@ import { goto } from 'src/actions/suite/routerActions'; import type { CustomBackend } from 'src/types/wallet'; import { openModal } from 'src/actions/suite/modalActions'; - // eslint-disable-next-line local-rules/no-override-ds-component const StyledDropdown = styled(Dropdown)` display: block; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateStatusActionBarIcon.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateStatusActionBarIcon.tsx index b4889bfa6ca..5b4d4a63d13 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateStatusActionBarIcon.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/UpdateStatusActionBarIcon.tsx @@ -21,7 +21,6 @@ import { UpdateVariant, } from './updateQuickActionTypes'; - type MapArgs = { $variant: UpdateVariant; theme: DefaultTheme; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/useAppShortcuts.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/useAppShortcuts.tsx index 7f058414dc9..1395f04012e 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/useAppShortcuts.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/useAppShortcuts.tsx @@ -7,7 +7,6 @@ import { closeModalApp, goto } from 'src/actions/suite/routerActions'; import { addWalletThunk } from 'src/actions/wallet/addWalletThunk'; import { useDispatch, useSelector } from 'src/hooks/suite'; - export const useAppShortcuts = () => { const selectedDevice = useSelector(selectDevice); const dispatch = useDispatch(); diff --git a/packages/suite/src/components/suite/layouts/WelcomeLayout/WelcomeLayout.tsx b/packages/suite/src/components/suite/layouts/WelcomeLayout/WelcomeLayout.tsx index f707f5f5d15..eda98dc40db 100644 --- a/packages/suite/src/components/suite/layouts/WelcomeLayout/WelcomeLayout.tsx +++ b/packages/suite/src/components/suite/layouts/WelcomeLayout/WelcomeLayout.tsx @@ -33,7 +33,6 @@ import { MAX_ONBOARDING_WIDTH } from 'src/constants/suite/layout'; import { NavSettings } from './NavSettings'; import { TrafficLightOffset } from '../../TrafficLightOffset'; - const MessageContainer = styled.div` margin: ${spacingsPx.xxs} ${spacingsPx.xs} ${spacingsPx.xs}; `; diff --git a/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx b/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx index 8c5b3361ecb..b95487436bb 100644 --- a/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx +++ b/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx @@ -12,7 +12,6 @@ import { onCancel } from 'src/actions/suite/modalActions'; import { TranslationKey } from 'src/components/suite/Translation'; import { SUITE } from 'src/actions/suite/constants'; - const ImageWrapper = styled.div` position: relative; width: 97.5%; diff --git a/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx b/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx index 632aa6ed3f4..a1410e0dcb3 100644 --- a/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx +++ b/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx @@ -15,7 +15,6 @@ import { BridgeRequested } from 'src/views/suite/bridge-requested'; import { MultiShareBackupModal } from '../ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal'; - // would not work if defined directly in the switch const FirmwareType = () => ; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx index 1d3304920fe..dcb4989647e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx @@ -7,7 +7,6 @@ import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite/useDispatch'; import { SettingsAnchor } from 'src/constants/suite/anchors'; - export const NoBackupModal = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx index e6552baa8f2..48a20baf901 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx @@ -32,7 +32,6 @@ import { TransactionReviewSummary } from './TransactionReviewSummary'; import { TransactionReviewOutputList } from './TransactionReviewOutputList/TransactionReviewOutputList'; import { TransactionReviewEvmExplanation } from './TransactionReviewEvmExplanation'; - const StyledModal = styled(Modal)` ${Modal.Body} { padding: 10px; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutput.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutput.tsx index 95eab9ff959..505776af8be 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutput.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutput.tsx @@ -20,8 +20,6 @@ import { OutputElementLine, } from './TransactionReviewOutputElement'; - - const getFeeLabel = (networkType: Account['networkType']) => { switch (networkType) { case 'ethereum': diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx index 2320a7fa48b..097f68341af 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx @@ -15,7 +15,6 @@ import { Account } from 'src/types/wallet'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; - const Wrapper = styled.div` padding: 20px 15px 12px; display: flex; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription.tsx index 2438a02266f..632fe960428 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription.tsx @@ -12,7 +12,6 @@ import { Translation } from 'src/components/suite'; import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; import { useTranslation } from 'src/hooks/suite'; - interface AccountTypeDescriptionProps { bip43Path: Bip43PathTemplate; accountType?: AccountType; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/AdvancedCoinSettingsModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/AdvancedCoinSettingsModal.tsx index 970be85f2e7..e6d481a44b8 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/AdvancedCoinSettingsModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/AdvancedCoinSettingsModal.tsx @@ -10,7 +10,6 @@ import { useSelector } from 'src/hooks/suite'; import { CustomBackends } from './CustomBackends/CustomBackends'; - const Section = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/CustomBackends.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/CustomBackends.tsx index 7f4905d801e..192fb4be57d 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/CustomBackends.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AdvancedCoinSettingsModal/CustomBackends/CustomBackends.tsx @@ -17,7 +17,6 @@ import { BackendInput } from './BackendInput'; import { BackendTypeSelect } from './BackendTypeSelect'; import { TorModal, TorResult } from './TorModal'; - const Wrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx index 2a31ddb16d6..d0cda63bad4 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx @@ -10,7 +10,6 @@ import { Dispatch, GetState } from 'src/types/suite'; import { onCancel } from 'src/actions/suite/modalActions'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; - interface ConfirmUnverifiedModalProps { action: { event: () => (dispatch: Dispatch) => void; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CoinjoinPhaseProgress.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CoinjoinPhaseProgress.tsx index 0429e72ee79..4ff1b5509d1 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CoinjoinPhaseProgress.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CriticalCoinjoinPhaseModal/CoinjoinPhaseProgress.tsx @@ -9,7 +9,6 @@ import { SESSION_PHASE_MESSAGES } from 'src/constants/suite/coinjoin'; import { Translation } from 'src/components/suite/Translation'; import { CountdownTimer } from 'src/components/suite/CountdownTimer'; - const Container = styled.div` padding: ${spacingsPx.xxl} ${spacingsPx.xxxl} 0; `; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorModal.tsx index 65e745c1d3f..86e5ac1a37b 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorModal.tsx @@ -15,7 +15,6 @@ import { isOnionUrl } from 'src/utils/suite/tor'; import { useCustomBackends } from 'src/hooks/settings/backends'; import { AdvancedCoinSettingsModal } from 'src/components/suite/modals'; - const BackendRowWrapper = styled.div` display: flex; width: 100%; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MetadataProviderModal/MetadataProviderModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MetadataProviderModal/MetadataProviderModal.tsx index f529a9d0182..08d9a4a18ba 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MetadataProviderModal/MetadataProviderModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MetadataProviderModal/MetadataProviderModal.tsx @@ -10,7 +10,6 @@ import { useDispatch } from 'src/hooks/suite'; import { connectProvider } from 'src/actions/suite/metadataProviderActions'; import { MetadataProviderType } from 'src/types/suite/metadata'; - import { DropboxLogo } from './DropboxLogo'; import { GoogleDriveLogo } from './GoogleDriveLogo'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal.tsx index 6766cfc9946..d912143274f 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal.tsx @@ -21,7 +21,6 @@ import { isAdditionalShamirBackupInProgress } from '../../../../../../utils/devi import { MultiShareBackupStep3VerifyOwnership } from './MultiShareBackupStep3VerifyOwnership'; import { MultiShareBackupStep4BackupSeed } from './MultiShareBackupStep4BackupSeed'; - type Steps = 'first-info' | 'second-info' | 'verify-ownership' | 'backup-seed' | 'done'; type MultiShareBackupModalProps = { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5Done.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5Done.tsx index 741cf8d7199..a4da4c17bec 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5Done.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5Done.tsx @@ -10,7 +10,6 @@ import { Translation } from 'src/components/suite'; import { Body, Section } from './multiShareModalLayout'; - const GradientCallout = styled.div` background-image: linear-gradient( to right, diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/SafetyChecksModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/SafetyChecksModal.tsx index b76230c324a..dc5ca558ab6 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/SafetyChecksModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/SafetyChecksModal.tsx @@ -16,7 +16,6 @@ import { useDevice, useDispatch } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; - /** * A Modal that allows user to set the `safety_checks` feature of connected Trezor. * Only supports setting it to `Strict` or `PromptTemporarily`. diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/EstimatedGains.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/EstimatedGains.tsx index 51cd482af25..98efe4ca743 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/EstimatedGains.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/EstimatedGains.tsx @@ -14,7 +14,6 @@ import { CRYPTO_INPUT } from 'src/types/wallet/stakeForms'; import { FiatValue, FormattedCryptoAmount, TrezorLink } from 'src/components/suite'; import { calculateGains } from 'src/utils/suite/stake'; - const Heading = styled.div` margin-bottom: ${spacingsPx.xl}; `; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/StakingInfoCards.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/StakingInfoCards.tsx index 8c4e81ff297..9f6f3bcbbed 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/StakingInfoCards.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/StakingInfoCards.tsx @@ -6,7 +6,6 @@ import { StakingInfo } from 'src/components/suite/StakingProcess/StakingInfo'; import { EstimatedGains } from './EstimatedGains'; - export const StakingInfoCards = () => { const cards = [ { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/Data.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/Data.tsx index a99c63970f5..e5e4c8fa0fa 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/Data.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/Data.tsx @@ -7,7 +7,6 @@ import { TranslationKey } from '@suite-common/intl-types'; import { Translation } from 'src/components/suite'; - const Container = styled.div` display: grid; grid-template-columns: 130px 3fr; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/IODetails.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/IODetails.tsx index 8415fb0b7a5..749ff18c6ee 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/IODetails.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/IODetails.tsx @@ -17,7 +17,6 @@ import { FormattedNftAmount } from 'src/components/suite/FormattedNftAmount'; import { AnalyzeInExplorerBanner } from './AnalyzeInExplorerBanner'; import { IOAddress } from '../../IOAddress'; - export const blurFix = css` margin-left: -10px; margin-right: -10px; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/BasicTxDetails.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/BasicTxDetails.tsx index 44d1055be0f..d228dab9c46 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/BasicTxDetails.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/BasicTxDetails.tsx @@ -21,7 +21,6 @@ import { TransactionHeader } from 'src/components/wallet/TransactionItem/Transac import { IOAddress } from './IOAddress'; - const Wrapper = styled.div<{ $elevation: Elevation }>` background: ${mapElevationToBackground}; padding: ${spacingsPx.lg}; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ChangeFee.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ChangeFee.tsx index b0a4a5d6bf7..b8ee5a4144f 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ChangeFee.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ChangeFee.tsx @@ -16,7 +16,6 @@ import { AffectedTransactions } from './AffectedTransactions'; import { DecreasedOutputs } from './DecreasedOutputs'; import { ReplaceTxButton } from './ReplaceTxButton'; - const Wrapper = styled.div` margin: 12px 0; `; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/DecreasedOutputs.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/DecreasedOutputs.tsx index fed8d17ec93..f67534611ac 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/DecreasedOutputs.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/DecreasedOutputs.tsx @@ -14,7 +14,6 @@ import { useRbfContext } from 'src/hooks/wallet/useRbfForm'; import { GreyCard } from './GreyCard'; import { WarnHeader } from './WarnHeader'; - const OutputsWrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/IOAddress.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/IOAddress.tsx index 1e03a6430b4..8e6d225e76c 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/IOAddress.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/IOAddress.tsx @@ -5,7 +5,6 @@ import styled, { css, useTheme } from 'styled-components'; import { Icon, Link, Paragraph } from '@trezor/components'; import { copyToClipboard } from '@trezor/dom-utils'; - import { HiddenPlaceholder } from 'src/components/suite/HiddenPlaceholder'; const IconWrapper = styled.div` diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModal.tsx index 101ba9628d0..97b3b123c28 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModal.tsx @@ -22,7 +22,6 @@ import { BasicTxDetails } from './BasicTxDetails'; import { AdvancedTxDetails, TabID } from './AdvancedTxDetails/AdvancedTxDetails'; import { ChangeFee } from './ChangeFee/ChangeFee'; - const PhishingBanner = styled.div` margin-bottom: ${spacingsPx.xs}; padding: ${spacingsPx.xs} ${spacingsPx.sm}; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Inputs.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Inputs.tsx index 65be5014a50..063ac30ab82 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Inputs.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/Inputs.tsx @@ -13,7 +13,6 @@ import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReduce import { validateDecimals, validateLimitsBigNum, validateMin } from 'src/utils/suite/validation'; import { useUnstakeEthFormContext } from 'src/hooks/wallet/useUnstakeEthForm'; - const HStack = styled.div` display: flex; gap: 14px; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx index 0bce3a08a91..ce65ff37568 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeEthForm/UnstakeEthForm.tsx @@ -17,8 +17,6 @@ import { ApproximateInstantEthAmount } from 'src/views/wallet/staking/components import { Options } from './Options'; import UnstakeFees from './Fees'; - - const DividerWrapper = styled.div` & > div { background: ${({ theme }) => theme.borderElevation2}; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeModal.tsx index 43cd16618b3..9040cb8704f 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnstakeModal/UnstakeModal.tsx @@ -20,7 +20,6 @@ import { UnstakeEthFormContext, useUnstakeEthForm } from 'src/hooks/wallet/useUn import { UnstakeButton } from './UnstakeEthForm/UnstakeButton'; import { UnstakeEthForm } from './UnstakeEthForm/UnstakeEthForm'; - interface UnstakeModalModalProps { onCancel?: () => void; } diff --git a/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx b/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx index 2576197f7c9..4c224974b92 100644 --- a/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx +++ b/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx @@ -12,7 +12,6 @@ import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import type { NotificationRendererProps } from 'src/components/suite'; - import { ConditionalActionRenderer } from './ConditionalActionRenderer'; const Row = styled.span` diff --git a/packages/suite/src/components/suite/notifications/ToastNotification.tsx b/packages/suite/src/components/suite/notifications/ToastNotification.tsx index e4384a154c9..eb948b0c211 100644 --- a/packages/suite/src/components/suite/notifications/ToastNotification.tsx +++ b/packages/suite/src/components/suite/notifications/ToastNotification.tsx @@ -12,7 +12,6 @@ import { getNotificationIcon, getVariantColor } from 'src/utils/suite/notificati import { ToastNotificationVariant } from '../../../types/suite'; - const Wrapper = styled.div<{ $variant: ToastNotificationVariant; $isTall: boolean }>` display: flex; align-items: ${({ $isTall }) => ($isTall ? 'start' : 'center')}; diff --git a/packages/suite/src/components/wallet/Fees/CustomFee.tsx b/packages/suite/src/components/wallet/Fees/CustomFee.tsx index da145124a18..fd47b570f45 100644 --- a/packages/suite/src/components/wallet/Fees/CustomFee.tsx +++ b/packages/suite/src/components/wallet/Fees/CustomFee.tsx @@ -35,8 +35,6 @@ import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; import { InputError } from '../InputError'; - - const Wrapper = styled.div` display: flex; width: 100%; diff --git a/packages/suite/src/components/wallet/Fees/Fees.tsx b/packages/suite/src/components/wallet/Fees/Fees.tsx index 2a470c32233..3e346f781f6 100644 --- a/packages/suite/src/components/wallet/Fees/Fees.tsx +++ b/packages/suite/src/components/wallet/Fees/Fees.tsx @@ -30,8 +30,6 @@ import { ExtendedMessageDescriptor } from 'src/types/suite'; import { CustomFee } from './CustomFee'; import { FeeDetails } from './FeeDetails'; - - const Container = styled.div` overflow: hidden; /* prevent scrollbar when custom fee is opened */ width: 100%; diff --git a/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx b/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx index 9a2bcc34dd4..3095b3e9249 100644 --- a/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx @@ -14,8 +14,6 @@ import { WalletAccountTransaction } from 'src/types/wallet'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { getInstantStakeType } from 'src/utils/suite/stake'; - - const Wrapper = styled.div` display: flex; gap: ${spacingsPx.xxs}; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx index 67c6c84d30f..4f1fd64a176 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx @@ -45,8 +45,6 @@ import { } from './CommonComponents'; import { BlurWrapper } from './TransactionItemBlurWrapper'; - - // eslint-disable-next-line local-rules/no-override-ds-component const Wrapper = styled(Card)<{ $isPending: boolean; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx index d6471e53243..2cc8e4df9b7 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx @@ -18,8 +18,6 @@ import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { TransactionTargetLayout } from './TransactionTargetLayout'; import { StyledFormattedCryptoAmount } from './CommonComponents'; - - export const CustomRow = ({ transaction, title, diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx index 2173e134ec9..018af01b24d 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx @@ -7,7 +7,6 @@ import { WalletAccountTransaction } from 'src/types/wallet'; import { Translation, AddressLabeling } from 'src/components/suite'; import { AccountLabels } from 'src/types/suite/metadata'; - const TruncatedSpan = styled.span<{ $isBlurred?: boolean }>` overflow: hidden; text-overflow: ellipsis; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx index 0840e5172d1..9d5e79e7256 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx @@ -24,7 +24,6 @@ import { TargetAddressLabel } from './TargetAddressLabel'; import { TransactionTargetLayout } from '../TransactionTargetLayout'; import { StyledFormattedCryptoAmount, StyledFormattedNftAmount } from '../CommonComponents'; - interface BaseTransfer { singleRowLayout?: boolean; useAnimation?: boolean; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx index 872250203dc..32faa5babea 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx @@ -19,9 +19,6 @@ import { StakeEthBanner } from './StakeEthBanner'; import { EvmExplanationBanner } from './EvmExplanationBanner'; import { TaprootBanner } from './TaprootBanner'; - - - const BannersWrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx index 79d0f251eed..d8f439eed47 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx @@ -7,7 +7,6 @@ import { NotificationCard } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; - type ContextMessageProps = { context: (typeof Context)[keyof typeof Context]; }; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx index d47a8e996d3..be8c888fee6 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx @@ -5,7 +5,6 @@ import { HELP_CENTER_XRP_URL } from '@trezor/urls'; import { NotificationCard, Translation } from 'src/components/suite'; import type { Account } from 'src/types/wallet/index'; - interface XRPReserveProps { account: Account | undefined; } diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountGroup.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountGroup.tsx index ede3185a339..4aa1242f81b 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountGroup.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountGroup.tsx @@ -10,7 +10,6 @@ import { Account } from 'src/types/wallet'; import { AnimationWrapper } from '../../AnimationWrapper'; - const ICON_SIZE = 18; const IconWrapper = styled.div<{ $isActive: boolean }>` diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx index a47fb9028bf..a6a2d65e5d1 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx @@ -13,7 +13,6 @@ import { useSelector } from 'src/hooks/suite'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; - import { AccountItem } from './AccountItem'; const Section = styled.div<{ $selected?: boolean }>` diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx index 3923e2705d3..45495cf51cd 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx @@ -17,7 +17,6 @@ import { AccountsList } from './AccountsList'; import { AccountsMenuNotice } from './AccountsMenuNotice'; import { RefreshAfterDiscoveryNeeded } from './RefreshAfterDiscoveryNeeded'; - const Wrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx index b33cf7488b9..a94e437244f 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx @@ -6,7 +6,6 @@ import { TrezorDevice } from 'src/types/suite'; import { useDiscovery, useDispatch } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; - const getExplanationMessage = (device: TrezorDevice | undefined, discoveryIsRunning: boolean) => { let message; if (device && !device.connected) { diff --git a/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx b/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx index fc29e3d69be..1c47a0454dc 100644 --- a/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx +++ b/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx @@ -8,7 +8,6 @@ import type { State as ModalState } from 'src/reducers/suite/modalReducer'; import { useFilteredModal } from '../useFilteredModal'; import { filters, fixtures } from '../__fixtures__/useFilteredModal'; - const mockStore = configureStore<{ modal: ModalState }, any>(); type Result = ModalState | null; diff --git a/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts b/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts index b420a9f34c4..dc7f7a4bf6d 100644 --- a/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts +++ b/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts @@ -5,7 +5,6 @@ import { AccountType, NetworkSymbol } from '@suite-common/wallet-config'; import { useTranslation } from './useTranslation'; - export interface GetDefaultAccountLabelParams { accountType: AccountType; symbol: NetworkSymbol; diff --git a/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts b/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts index df118815da9..5cc6d29d321 100644 --- a/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts +++ b/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts @@ -1,4 +1,3 @@ - import { NetworkSymbol } from '@suite-common/wallet-config'; import { getFiatRateKey, toFiatCurrency } from '@suite-common/wallet-utils'; import { selectFiatRatesByFiatRateKey } from '@suite-common/wallet-core'; diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyFormDefaultValues.tsx b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyFormDefaultValues.tsx index c634833da7b..e4cd467e4f2 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyFormDefaultValues.tsx +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketBuyFormDefaultValues.tsx @@ -15,7 +15,6 @@ import { } from 'src/constants/wallet/coinmarket/form'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; - export const useCoinmarketBuyFormDefaultValues = ( accountSymbol: Account['symbol'], buyInfo: BuyInfo | undefined, diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellForm.ts b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellForm.ts index f3b11122b4d..46d329ade91 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellForm.ts +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketSellForm.ts @@ -55,7 +55,6 @@ import { useCoinmarketCurrencySwitcher } from 'src/hooks/wallet/coinmarket/form/ import { useCoinmarketAccount } from 'src/hooks/wallet/coinmarket/form/common/useCoinmarketAccount'; import { useCoinmarketInfo } from 'src/hooks/wallet/coinmarket/useCoinmarketInfo'; - import { useCoinmarketInitializer } from './common/useCoinmarketInitializer'; export const useCoinmarketSellForm = ({ diff --git a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketVerifyAccount.tsx b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketVerifyAccount.tsx index bfe9724702f..d5ddf2cfd37 100644 --- a/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketVerifyAccount.tsx +++ b/packages/suite/src/hooks/wallet/coinmarket/form/useCoinmarketVerifyAccount.tsx @@ -26,7 +26,6 @@ import { } from 'src/types/coinmarket/coinmarketVerify'; import { useAccountAddressDictionary } from 'src/hooks/wallet/useAccounts'; - const getSelectAccountOptions = ( suiteReceiveAccounts: Account[] | undefined, device: TrezorDevice | undefined, diff --git a/packages/suite/src/hooks/wallet/useCoinmarketRecomposeAndSign.ts b/packages/suite/src/hooks/wallet/useCoinmarketRecomposeAndSign.ts index ba8a834f8be..b18174da3b5 100644 --- a/packages/suite/src/hooks/wallet/useCoinmarketRecomposeAndSign.ts +++ b/packages/suite/src/hooks/wallet/useCoinmarketRecomposeAndSign.ts @@ -1,6 +1,5 @@ import { useCallback } from 'react'; - import { notificationsActions } from '@suite-common/toast-notifications'; import { DEFAULT_VALUES, DEFAULT_PAYMENT } from '@suite-common/wallet-constants'; import { FormState } from '@suite-common/wallet-types'; diff --git a/packages/suite/src/hooks/wallet/useCoinmarketRedirect.ts b/packages/suite/src/hooks/wallet/useCoinmarketRedirect.ts index 60457f5276e..5cecfd9e454 100644 --- a/packages/suite/src/hooks/wallet/useCoinmarketRedirect.ts +++ b/packages/suite/src/hooks/wallet/useCoinmarketRedirect.ts @@ -9,7 +9,6 @@ import * as coinmarketBuyActions from 'src/actions/wallet/coinmarketBuyActions'; import * as coinmarketSellActions from 'src/actions/wallet/coinmarketSellActions'; import { saveComposedTransactionInfo } from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; - interface OfferRedirectParams { symbol: Account['symbol']; index: Account['index']; diff --git a/packages/suite/src/hooks/wallet/useSendForm.ts b/packages/suite/src/hooks/wallet/useSendForm.ts index 1beb91cf8e1..4e87f43c383 100644 --- a/packages/suite/src/hooks/wallet/useSendForm.ts +++ b/packages/suite/src/hooks/wallet/useSendForm.ts @@ -38,7 +38,6 @@ import { useBitcoinAmountUnit } from './useBitcoinAmountUnit'; import { useUtxoSelection } from './form/useUtxoSelection'; import { useExcludedUtxos } from './form/useExcludedUtxos'; - export const SendContext = createContext(null); SendContext.displayName = 'SendContext'; diff --git a/packages/suite/src/reducers/desktop/__tests__/desktopReducer.test.ts b/packages/suite/src/reducers/desktop/__tests__/desktopReducer.test.ts index 009949f7bc3..c01cf5fd10c 100644 --- a/packages/suite/src/reducers/desktop/__tests__/desktopReducer.test.ts +++ b/packages/suite/src/reducers/desktop/__tests__/desktopReducer.test.ts @@ -1,7 +1,9 @@ -import { desktopReducer } from '../index'; -import * as SUITE from 'src/actions/suite/constants/suiteConstants'; import type { HandshakeElectron } from '@trezor/suite-desktop-api'; +import * as SUITE from 'src/actions/suite/constants/suiteConstants'; + +import { desktopReducer } from '../index'; + const handshakePayload: HandshakeElectron = { paths: { binDir: 'a', diff --git a/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts b/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts index 14b6ba6c29a..eee215605db 100644 --- a/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts +++ b/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts @@ -3,7 +3,6 @@ import type { Action } from 'src/types/suite'; import protocolReducer, { State } from '../protocolReducer'; import fixtures from '../__fixtures__/protocolReducer'; - describe('Protocol reducer', () => { fixtures.forEach(f => { it(f.description, () => { diff --git a/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts index 614bac25e52..65db9af53f3 100644 --- a/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts @@ -8,7 +8,6 @@ import { } from '../coinjoinReducer'; import { actionFixtures, selectorFixtures } from '../__fixtures__/coinjoinReducer'; - describe('Coinjoin reducer actions', () => { actionFixtures.forEach(f => { it(f.description, () => { diff --git a/packages/suite/src/reducers/wallet/receiveReducer.ts b/packages/suite/src/reducers/wallet/receiveReducer.ts index aa67a486273..9545214bdec 100644 --- a/packages/suite/src/reducers/wallet/receiveReducer.ts +++ b/packages/suite/src/reducers/wallet/receiveReducer.ts @@ -5,7 +5,6 @@ import { ReceiveInfo } from '@suite-common/wallet-types'; import { RECEIVE } from 'src/actions/wallet/constants'; import { Action as SuiteAction } from 'src/types/suite'; - export type State = ReceiveInfo[]; const showAddress = (draft: State, path: string, address: string) => { diff --git a/packages/suite/src/reducers/wallet/settingsReducer.ts b/packages/suite/src/reducers/wallet/settingsReducer.ts index a2a9c57fa80..f099d7feb9e 100644 --- a/packages/suite/src/reducers/wallet/settingsReducer.ts +++ b/packages/suite/src/reducers/wallet/settingsReducer.ts @@ -8,7 +8,6 @@ import { WALLET_SETTINGS } from 'src/actions/settings/constants'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; import { Action, AppState } from 'src/types/suite'; - export type State = WalletSettings; export const initialState: State = { diff --git a/packages/suite/src/services/suite/metadata/DropboxProvider.ts b/packages/suite/src/services/suite/metadata/DropboxProvider.ts index 191b969c32b..27b00b52aa3 100644 --- a/packages/suite/src/services/suite/metadata/DropboxProvider.ts +++ b/packages/suite/src/services/suite/metadata/DropboxProvider.ts @@ -9,7 +9,6 @@ import { getOauthReceiverUrl, } from 'src/utils/suite/oauth'; - // Dropbox messed up types, that's why @ts-expect-error occurs in this file class DropboxProvider extends AbstractMetadataProvider { diff --git a/packages/suite/src/support/extraDependencies.ts b/packages/suite/src/support/extraDependencies.ts index b9ad8fb7d65..2c5127b54ce 100644 --- a/packages/suite/src/support/extraDependencies.ts +++ b/packages/suite/src/support/extraDependencies.ts @@ -40,8 +40,6 @@ import { AppState, ButtonRequest, TrezorDevice } from '../types/suite'; import { METADATA, STORAGE } from '../actions/suite/constants'; import { selectSuiteSettings } from '../reducers/suite/suiteReducer'; - - const connectSrc = resolveStaticPath('connect/'); // 'https://localhost:8088/'; // 'https://connect.corp.sldev.cz/develop/'; diff --git a/packages/suite/src/support/suite/useTor.tsx b/packages/suite/src/support/suite/useTor.tsx index 371f20ac0e8..3e92b348cc0 100644 --- a/packages/suite/src/support/suite/useTor.tsx +++ b/packages/suite/src/support/suite/useTor.tsx @@ -14,7 +14,6 @@ import { } from 'src/actions/suite/suiteActions'; import { selectTorState } from 'src/reducers/suite/suiteReducer'; - export const useTor = () => { const { torBootstrap, isTorEnabling } = useSelector(selectTorState); const dispatch = useDispatch(); diff --git a/packages/suite/src/utils/firmware/__tests__/firmware.test.ts b/packages/suite/src/utils/firmware/__tests__/firmware.test.ts index 7c693e0d012..a08c75339b3 100644 --- a/packages/suite/src/utils/firmware/__tests__/firmware.test.ts +++ b/packages/suite/src/utils/firmware/__tests__/firmware.test.ts @@ -1,6 +1,7 @@ import { DeviceModelInternal } from '@trezor/connect'; import { TrezorDevice } from 'src/types/suite'; + import { getFormattedFingerprint, validateFirmware } from '../index'; describe('getFormattedFingerprint', () => { diff --git a/packages/suite/src/utils/wallet/coinmarket/coinmarketUtils.ts b/packages/suite/src/utils/wallet/coinmarket/coinmarketUtils.ts index 61197b7ba10..2b43ea07adc 100644 --- a/packages/suite/src/utils/wallet/coinmarket/coinmarketUtils.ts +++ b/packages/suite/src/utils/wallet/coinmarket/coinmarketUtils.ts @@ -36,8 +36,6 @@ import { CoinmarketTradeType, } from 'src/types/coinmarket/coinmarket'; - - export const cryptoPlatformSeparator = '--'; interface ParsedCryptoId { diff --git a/packages/suite/src/utils/wallet/graph/utils.ts b/packages/suite/src/utils/wallet/graph/utils.ts index d0a8971f435..a09b770cd6b 100644 --- a/packages/suite/src/utils/wallet/graph/utils.ts +++ b/packages/suite/src/utils/wallet/graph/utils.ts @@ -11,7 +11,6 @@ import { FiatCurrencyCode } from '@suite-common/suite-config'; import { CommonAggregatedHistory, GraphData, GraphRange, GraphScale } from 'src/types/wallet/graph'; - import { ObjectType, TypeName, sumFiatValueMapInPlace } from './utilsShared'; export const deviceGraphDataFilterFn = (d: GraphData, deviceState: StaticSessionId | undefined) => { diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx index c0babb42700..8146112d549 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx @@ -28,8 +28,6 @@ import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; import { AssetCard, AssetCardSkeleton } from './AssetCard/AssetCard'; import { AssetTable } from './AssetTable/AssetTable'; - - const InfoMessage = styled.div` padding: ${spacingsPx.md} ${spacingsPx.xl}; display: flex; diff --git a/packages/suite/src/views/dashboard/AssetsView/CoinmarketBuyButton.tsx b/packages/suite/src/views/dashboard/AssetsView/CoinmarketBuyButton.tsx index a0f5c6ac90d..acc280f026c 100644 --- a/packages/suite/src/views/dashboard/AssetsView/CoinmarketBuyButton.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/CoinmarketBuyButton.tsx @@ -8,8 +8,6 @@ import * as routerActions from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite'; import { useDispatch, useAccountSearch } from 'src/hooks/suite'; - - type CoinmarketBuyButtonProps = { symbol: NetworkSymbol; 'data-testid'?: string; diff --git a/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts b/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts index 7ffc7ebe78e..3dae8884a23 100644 --- a/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts +++ b/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts @@ -1,4 +1,3 @@ - import { FiatCurrencyCode } from '@suite-common/suite-config'; import { TokenDefinition } from '@suite-common/token-definitions'; import { NetworkSymbol } from '@suite-common/wallet-config'; diff --git a/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx b/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx index 88b3026cc08..a5cffcd0b02 100644 --- a/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx +++ b/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx @@ -16,7 +16,6 @@ import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; import { bannerAnimationConfig } from './banner-animations'; - const Container = styled(motion.div)` width: 100%; `; diff --git a/packages/suite/src/views/dashboard/PromoBanner.tsx b/packages/suite/src/views/dashboard/PromoBanner.tsx index f6f1646cfad..10eda006707 100644 --- a/packages/suite/src/views/dashboard/PromoBanner.tsx +++ b/packages/suite/src/views/dashboard/PromoBanner.tsx @@ -13,7 +13,6 @@ import { useLayoutSize } from 'src/hooks/suite/useLayoutSize'; import { HORIZONTAL_LAYOUT_PADDINGS } from 'src/constants/suite/layout'; import { useSelector } from 'src/hooks/suite'; - const Container = styled.div` position: absolute; bottom: 0; diff --git a/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx b/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx index f87648ee53b..2bbdc9bdc1d 100644 --- a/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx +++ b/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx @@ -15,8 +15,6 @@ import { selectIsDashboardT3T1PromoBannerShown } from 'src/reducers/suite/suiteR import { setFlag } from 'src/actions/suite/suiteActions'; import { Translation, TrezorLink } from 'src/components/suite'; - - import { T3T1PromoLogo } from './T3T1PromoLogo'; import { bannerAnimationConfig } from '../banner-animations'; diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx index 3338ed99582..a189606b5ac 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx @@ -33,7 +33,6 @@ import { OptionText, SelectedOption } from './OptionWithContent'; import { FloatingSelections } from './FloatingSelections'; import { typesToLabelMap } from './typesToLabelMap'; - const SELECT_ELEMENT_HEIGHT = 84; const SELECT_ELEMENT_HEIGHT_MOBILE = 62; diff --git a/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx b/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx index 426d179a391..c3f19155daf 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx @@ -15,7 +15,6 @@ import * as metadataUtils from 'src/utils/suite/metadata'; import { PATH } from 'src/actions/suite/constants/metadataPasswordsConstants'; import { getDisplayKey } from 'src/utils/suite/passwords'; - const FormWrapper = styled.div` display: flex; flex: 1; diff --git a/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx b/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx index 941498a67a3..4d308b976a3 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx @@ -14,8 +14,6 @@ import { } from './PasswordEntry'; import { EntryForm } from './EntryForm'; - - const Wrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx b/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx index cc061355723..d0a77ea84da 100644 --- a/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx @@ -14,7 +14,6 @@ import { useDispatch, useSelector } from 'src/hooks/suite'; import { goto } from '../../../actions/suite/routerActions'; - const doesSupportMultiShare = (device: TrezorDevice | undefined): boolean => { if (device?.features === undefined) { return false; diff --git a/packages/suite/src/views/settings/SettingsGeneral/AutomaticUpdate.tsx b/packages/suite/src/views/settings/SettingsGeneral/AutomaticUpdate.tsx index ac5dcb5f676..2d63168d5df 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/AutomaticUpdate.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/AutomaticUpdate.tsx @@ -10,7 +10,6 @@ import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useSelector } from '../../../hooks/suite'; - const PositionedSwitch = styled.div` align-self: center; `; diff --git a/packages/suite/src/views/settings/SettingsLoader.tsx b/packages/suite/src/views/settings/SettingsLoader.tsx index 22f58e92b42..d1fbf0226bc 100644 --- a/packages/suite/src/views/settings/SettingsLoader.tsx +++ b/packages/suite/src/views/settings/SettingsLoader.tsx @@ -8,7 +8,6 @@ import { spacings, spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; - const Container = styled(motion.div)` background-color: ${({ theme }) => theme.backgroundTertiaryDefaultOnElevation0}; border-radius: 48px; diff --git a/packages/suite/src/views/suite/ErrorPage.tsx b/packages/suite/src/views/suite/ErrorPage.tsx index c8c5e1ad200..e9148ed4f01 100644 --- a/packages/suite/src/views/suite/ErrorPage.tsx +++ b/packages/suite/src/views/suite/ErrorPage.tsx @@ -4,7 +4,6 @@ import { Paragraph, H2, Button, Link, Image } from '@trezor/components'; import { Translation } from 'src/components/suite'; - const Wrapper = styled.div` display: flex; flex: 1; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx index 3af39084e4a..724fbbf37a5 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx @@ -14,7 +14,6 @@ import { AddWalletButton } from './AddWalletButton'; import { CardWithDevice } from '../CardWithDevice'; import { DeviceWarning } from './DeviceWarning'; - const WalletsWrapper = styled.div<{ $enabled: boolean }>` opacity: ${({ $enabled }) => ($enabled ? 1 : 0.5)}; pointer-events: ${({ $enabled }) => ($enabled ? 'unset' : 'none')}; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx index 0f5b287ae95..7f1b2e8a6b9 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx @@ -11,7 +11,6 @@ import { useWalletLabeling } from 'src/components/suite/labeling/WalletLabeling' import { DeviceConnectionText } from './DeviceConnectionText'; - type DeviceStatusTextProps = { onRefreshClick?: MouseEventHandler; device: TrezorDevice; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx index 4672dd392f4..6a6bdd581ea 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx @@ -11,7 +11,6 @@ import { useDispatch } from 'src/hooks/suite'; import { ViewOnlyRadios } from './ViewOnlyRadios'; import { ContentType } from '../types'; - type ViewOnlyProps = { setContentType: (contentType: ContentType) => void; instance: AcquiredDevice; diff --git a/packages/suite/src/views/suite/bridge-requested/index.tsx b/packages/suite/src/views/suite/bridge-requested/index.tsx index 49d1f3d0a97..d9497a2f5aa 100644 --- a/packages/suite/src/views/suite/bridge-requested/index.tsx +++ b/packages/suite/src/views/suite/bridge-requested/index.tsx @@ -12,7 +12,6 @@ import { goto } from 'src/actions/suite/routerActions'; import { useDispatch, useLayout } from 'src/hooks/suite'; import { AutoStart } from 'src/views/settings/SettingsGeneral/AutoStart'; - const StyledModal = styled(Modal)` ${Modal.BottomBar} { > * { diff --git a/packages/suite/src/views/suite/bridge/index.tsx b/packages/suite/src/views/suite/bridge/index.tsx index 46904b8e20e..eea739753a7 100644 --- a/packages/suite/src/views/suite/bridge/index.tsx +++ b/packages/suite/src/views/suite/bridge/index.tsx @@ -9,7 +9,6 @@ import { useDispatch, useSelector } from 'src/hooks/suite'; import { isWebUsb } from 'src/utils/suite/transport'; import { useOpenSuiteDesktop } from 'src/hooks/suite/useOpenSuiteDesktop'; - // eslint-disable-next-line local-rules/no-override-ds-component const StyledButton = styled(Button)` path { diff --git a/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx b/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx index 95722de74b1..35af050d14e 100644 --- a/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx +++ b/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx @@ -30,8 +30,6 @@ import { setFlag } from '../../actions/suite/suiteActions'; import { IllustrativeExample } from './images/IllustrativeExample'; import { IllustrativeExampleArrow } from './images/IllustrativeExampleArrow'; - - const Callout = styled.div` display: flex; flex-direction: row; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentWaitingForUser.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentWaitingForUser.tsx index 7bc0c8eb0f9..8f09bf2997c 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentWaitingForUser.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketDetail/CoinmarketDetailBuy/CoinmarketDetailBuyPaymentWaitingForUser.tsx @@ -13,7 +13,6 @@ import { createTxLink } from 'src/utils/wallet/coinmarket/buyUtils'; import { submitRequestForm } from 'src/actions/wallet/coinmarket/coinmarketCommonActions'; import { useDispatch } from 'src/hooks/suite'; - const Wrapper = styled.div` display: flex; align-items: center; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellBankAccount.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellBankAccount.tsx index e92f215e455..be9a3146da0 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellBankAccount.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellBankAccount.tsx @@ -11,7 +11,6 @@ import { formatIban } from 'src/utils/wallet/coinmarket/sellUtils'; import { CoinmarketTradeSellType } from 'src/types/coinmarket/coinmarket'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; - const Wrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellTransaction.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellTransaction.tsx index 4e421cc25d2..7084e187702 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellTransaction.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketSelectedOffer/CoinmarketOfferSell/CoinmarketOfferSellTransaction.tsx @@ -8,7 +8,6 @@ import { useCoinmarketWatchTrade } from 'src/hooks/wallet/coinmarket/useCoinmark import { CoinmarketTradeSellType } from 'src/types/coinmarket/coinmarket'; import { useCoinmarketFormContext } from 'src/hooks/wallet/coinmarket/form/useCoinmarketCommonForm'; - const Wrapper = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionStatus.tsx b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionStatus.tsx index 381a1cd5ec7..da29aff29e9 100644 --- a/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionStatus.tsx +++ b/packages/suite/src/views/wallet/coinmarket/common/CoinmarketTransactions/CoinmarketTransaction/CoinmarketTransactionStatus.tsx @@ -10,8 +10,6 @@ import { getStatusMessage as getExchangeStatusMessage } from 'src/utils/wallet/c import { getStatusMessage as getSellStatusMessage } from 'src/utils/wallet/coinmarket/sellUtils'; import { Trade } from 'src/types/wallet/coinmarketCommonTypes'; - - const getBuyTradeData = (status: BuyTradeStatus, theme: DefaultTheme) => { const message = getBuyStatusMessage(status); diff --git a/packages/suite/src/views/wallet/coinmarket/redirect/CoinmarketRedirect.tsx b/packages/suite/src/views/wallet/coinmarket/redirect/CoinmarketRedirect.tsx index ba9d6f6b6f6..ff0cc01cbdb 100644 --- a/packages/suite/src/views/wallet/coinmarket/redirect/CoinmarketRedirect.tsx +++ b/packages/suite/src/views/wallet/coinmarket/redirect/CoinmarketRedirect.tsx @@ -11,8 +11,6 @@ import { Account } from 'src/types/wallet'; import { useCoinmarketRedirect } from 'src/hooks/wallet/useCoinmarketRedirect'; import { Translation } from 'src/components/suite'; - - const Wrapper = styled.div` display: flex; justify-content: center; diff --git a/packages/suite/src/views/wallet/details/index.tsx b/packages/suite/src/views/wallet/details/index.tsx index 8574794e65b..1c85062612e 100644 --- a/packages/suite/src/views/wallet/details/index.tsx +++ b/packages/suite/src/views/wallet/details/index.tsx @@ -17,7 +17,6 @@ import { CoinjoinSetup } from './CoinjoinSetup/CoinjoinSetup'; import { RescanAccount } from './RescanAccount'; import { Row } from './Row'; - const Heading = styled.h3` color: ${({ theme }) => theme.legacy.TYPE_LIGHT_GREY}; font-size: ${variables.FONT_SIZE.SMALL}; diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList.tsx index f5c483091ec..e4850aa1b82 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList.tsx @@ -13,7 +13,6 @@ import { useSendFormContext } from 'src/hooks/wallet'; import { UtxoSelection } from './UtxoSelection'; - const Wrapper = styled.section` border-bottom: 1px solid ${({ theme }) => theme.legacy.STROKE_GREY}; margin: 12px 0 16px; diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/Locktime.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/Locktime.tsx index 90d2cd56f4a..3ee2b8112a3 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/Locktime.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/Locktime.tsx @@ -12,7 +12,6 @@ import { useSelector, useTranslation } from 'src/hooks/suite'; import { useSendFormContext } from 'src/hooks/wallet'; import { NumberInput, Translation } from 'src/components/suite'; - import { canLocktimeTxBeBroadcast } from './canLocktimeTxBeBroadcast'; const Label = styled.div` diff --git a/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumData.tsx b/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumData.tsx index 71ed403018e..4f04e402479 100644 --- a/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumData.tsx +++ b/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumData.tsx @@ -11,7 +11,6 @@ import { Translation } from 'src/components/suite'; import { useSendFormContext } from 'src/hooks/wallet'; import { useTranslation } from 'src/hooks/suite'; - const inputAsciiName = 'ethereumDataAscii'; const inputHexName = 'ethereumDataHex'; const inputAmountName = 'outputs.0.amount'; diff --git a/packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx b/packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx index 43d3977d1a0..5a7a3f79b0e 100644 --- a/packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx +++ b/packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx @@ -8,7 +8,6 @@ import { Translation } from 'src/components/suite'; import { useSendFormContext } from 'src/hooks/wallet'; import { useTranslation } from 'src/hooks/suite'; - interface DestinationTagProps { close: () => void; } diff --git a/packages/suite/src/views/wallet/send/Outputs/Amount/FiatInput.tsx b/packages/suite/src/views/wallet/send/Outputs/Amount/FiatInput.tsx index 4f6b1527726..75807a937cb 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Amount/FiatInput.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Amount/FiatInput.tsx @@ -34,8 +34,6 @@ import { NumberInput } from 'src/components/suite'; import { useSelector, useTranslation } from 'src/hooks/suite'; import { validateDecimals } from 'src/utils/suite/validation'; - - const Wrapper = styled.div` display: flex; width: 100%; diff --git a/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx b/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx index 0edaf00967a..2f2b3a98b57 100644 --- a/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx @@ -10,7 +10,6 @@ import { Translation } from 'src/components/suite'; import { OpenGuideFromTooltip } from 'src/components/guide'; import { useTranslation } from 'src/hooks/suite'; - const Inputs = styled.div` display: flex; place-items: center space-between; diff --git a/packages/suite/src/views/wallet/send/SendRaw.tsx b/packages/suite/src/views/wallet/send/SendRaw.tsx index f3e57ed824d..dc2a9f34270 100644 --- a/packages/suite/src/views/wallet/send/SendRaw.tsx +++ b/packages/suite/src/views/wallet/send/SendRaw.tsx @@ -11,7 +11,6 @@ import { useDispatch, useTranslation } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; import { OpenGuideFromTooltip } from 'src/components/guide'; - const INPUT_NAME = 'rawTx'; type SendRawProps = { diff --git a/packages/suite/src/views/wallet/send/TotalSent/ReviewButton.tsx b/packages/suite/src/views/wallet/send/TotalSent/ReviewButton.tsx index fbf60396c6c..7abc4e30b69 100644 --- a/packages/suite/src/views/wallet/send/TotalSent/ReviewButton.tsx +++ b/packages/suite/src/views/wallet/send/TotalSent/ReviewButton.tsx @@ -10,7 +10,6 @@ import { useDevice } from 'src/hooks/suite'; import { useSendFormContext } from 'src/hooks/wallet'; import { Translation } from 'src/components/suite/Translation'; - const Container = styled.div` display: flex; flex-direction: column; diff --git a/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx b/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx index c4a43b28ec0..ba440d591ba 100644 --- a/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx +++ b/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx @@ -9,7 +9,6 @@ import { Translation, FiatValue, FormattedCryptoAmount } from 'src/components/su import { ReviewButton } from './ReviewButton'; - const Container = styled.div` position: sticky; top: 80px; diff --git a/packages/suite/src/views/wallet/sign-verify/components/ButtonRow.tsx b/packages/suite/src/views/wallet/sign-verify/components/ButtonRow.tsx index 680c4c8f1f7..6543e897667 100644 --- a/packages/suite/src/views/wallet/sign-verify/components/ButtonRow.tsx +++ b/packages/suite/src/views/wallet/sign-verify/components/ButtonRow.tsx @@ -7,7 +7,6 @@ import { Button, variables } from '@trezor/components'; import { Translation } from 'src/components/suite'; import { useLayoutSize } from 'src/hooks/suite'; - export const Row = styled.div` position: relative; display: flex; diff --git a/packages/suite/src/views/wallet/staking/components/CardanoStakingDashboard.tsx b/packages/suite/src/views/wallet/staking/components/CardanoStakingDashboard.tsx index 1d339f53a41..c9d74c11798 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoStakingDashboard.tsx +++ b/packages/suite/src/views/wallet/staking/components/CardanoStakingDashboard.tsx @@ -9,7 +9,6 @@ import { CardanoRewards } from './CardanoRewards'; import { CardanoStake } from './CardanoStake'; import { CardanoRedelegate } from './CardanoRedelegate'; - interface CardanoStakingDashboardProps { selectedAccount: SelectedAccountLoaded; } diff --git a/packages/suite/src/views/wallet/tokens/index.tsx b/packages/suite/src/views/wallet/tokens/index.tsx index 2c9d3a10013..fc4d79af225 100644 --- a/packages/suite/src/views/wallet/tokens/index.tsx +++ b/packages/suite/src/views/wallet/tokens/index.tsx @@ -9,7 +9,6 @@ import { CoinsTable } from './coins/CoinsTable'; import { TokensNavigation } from './TokensNavigation'; import { HiddenTokensTable } from './hidden-tokens/HiddenTokensTable'; - export const Tokens = () => { const [searchQuery, setSearchQuery] = useState(''); diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusWheel.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusWheel.tsx index 802b603a6d9..3ecec8c1361 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusWheel.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusWheel.tsx @@ -12,7 +12,6 @@ import { stopCoinjoinSession } from 'src/actions/wallet/coinjoinClientActions'; import { CoinjoinStatusMessage } from './CoinjoinStatusMessage'; import { CoinjoinProgressWheel } from './CoinjoinProgressWheel'; - // eslint-disable-next-line local-rules/no-override-ds-component const Container = styled(Card)<{ $isWide?: boolean }>` position: relative; diff --git a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx index 8d974e89ffb..b8c1c36fb82 100644 --- a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx +++ b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx @@ -11,7 +11,6 @@ import { Translation } from 'src/components/suite'; import { TradeBoxMenu } from './TradeBoxMenu'; import { TradeBoxPrices } from './TradeBoxPrices'; - // eslint-disable-next-line local-rules/no-override-ds-component const StyledCard = styled(Card)` flex-flow: row wrap; diff --git a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxMenu.tsx b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxMenu.tsx index 50f27e4caf4..38108bb8109 100644 --- a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxMenu.tsx +++ b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxMenu.tsx @@ -13,7 +13,6 @@ import { goto } from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite'; import { useDevice, useDispatch } from 'src/hooks/suite'; - const Wrapper = styled.div` display: flex; gap: ${spacingsPx.sm}; diff --git a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxPrices.tsx b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxPrices.tsx index 7fc28607b5c..5e1f2ca69a5 100644 --- a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxPrices.tsx +++ b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBoxPrices.tsx @@ -9,7 +9,6 @@ import { networks } from '@suite-common/wallet-config'; import { PriceTicker, Translation, TrendTicker } from 'src/components/suite'; import { Account } from 'src/types/wallet'; - const Wrapper = styled.div` display: flex; gap: 42px; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/ExportAction.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/ExportAction.tsx index 922b644bb3a..4e20e3716cf 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/ExportAction.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/ExportAction.tsx @@ -16,7 +16,6 @@ import { exportTransactionsThunk } from 'src/actions/wallet/exportTransactionsAc import { Account } from 'src/types/wallet'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; - export interface ExportActionProps { account: Account; searchQuery: string; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/TransactionListActions.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/TransactionListActions.tsx index ce0dd6285ab..edd9a1fd7b6 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/TransactionListActions.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/TransactionListActions.tsx @@ -1,9 +1,7 @@ - import { Dispatch, SetStateAction, useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; - import { notificationsActions } from '@suite-common/toast-notifications'; import { fetchAllTransactionsForAccountThunk } from '@suite-common/wallet-core'; import { Account } from '@suite-common/wallet-types'; diff --git a/packages/suite/src/views/wallet/transactions/Transactions.tsx b/packages/suite/src/views/wallet/transactions/Transactions.tsx index e3515327efc..19923855b51 100644 --- a/packages/suite/src/views/wallet/transactions/Transactions.tsx +++ b/packages/suite/src/views/wallet/transactions/Transactions.tsx @@ -20,8 +20,6 @@ import { CoinjoinExplanation } from './CoinjoinExplanation/CoinjoinExplanation'; import { CoinjoinSummary } from './CoinjoinSummary/CoinjoinSummary'; import { TradeBox } from './TradeBox/TradeBox'; - - const AccountLayout = styled(WalletLayout)` display: flex; flex-direction: column; diff --git a/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx b/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx index ac92a211dd8..3dd1c08da42 100644 --- a/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx +++ b/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx @@ -12,7 +12,6 @@ import { sumFiatValueMap } from 'src/utils/wallet/graph'; import { InfoCard } from './InfoCard'; - const InfoCardsWrapper = styled.div` display: grid; margin-top: 20px; diff --git a/packages/utxo-lib/tests/compose.test.ts b/packages/utxo-lib/tests/compose.test.ts index 74a19c536d6..e89209b5431 100644 --- a/packages/utxo-lib/tests/compose.test.ts +++ b/packages/utxo-lib/tests/compose.test.ts @@ -6,7 +6,6 @@ import { verifyTxBytes } from './compose.utils'; import { composeTxFixture } from './__fixtures__/compose'; import { fixturesCrossCheck } from './__fixtures__/compose.crosscheck'; - jest.mock('@trezor/utils', () => ({ ...jest.requireActual('@trezor/utils'), getRandomInt: jest.fn(), diff --git a/packages/utxo-lib/tests/script.test.ts b/packages/utxo-lib/tests/script.test.ts index 1b1708dcaa0..e264d7a0855 100644 --- a/packages/utxo-lib/tests/script.test.ts +++ b/packages/utxo-lib/tests/script.test.ts @@ -4,7 +4,6 @@ import * as bscript from '../src/script'; import { fixtures } from './__fixtures__/script'; import { templates } from './__fixtures__/templates'; - describe('script', () => { // TODO describe('isCanonicalPubKey', () => { From 3b943988042159d8622cf164565472faee815538 Mon Sep 17 00:00:00 2001 From: Peter Sanderson Date: Wed, 6 Nov 2024 17:45:05 +0100 Subject: [PATCH 4/4] chore: fix import/order ESlint after rebase --- packages/components/src/components/Card/Card.tsx | 3 +++ packages/components/src/components/Divider/Divider.tsx | 2 ++ .../suite/SwitchDevice/DeviceItem/EjectButton.tsx | 2 ++ .../SwitchDevice/DeviceItem/EjectConfirmation.tsx | 10 +++++++--- .../suite/SwitchDevice/DeviceItem/WalletInstance.tsx | 8 +++++--- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/components/src/components/Card/Card.tsx b/packages/components/src/components/Card/Card.tsx index 59f8aa061af..aa25ce8c267 100644 --- a/packages/components/src/components/Card/Card.tsx +++ b/packages/components/src/components/Card/Card.tsx @@ -1,6 +1,9 @@ import { forwardRef, HTMLAttributes, ReactNode } from 'react'; + import styled, { css } from 'styled-components'; + import { borders, Elevation, spacingsPx } from '@trezor/theme'; + import { ElevationUp, useElevation } from '../ElevationContext/ElevationContext'; import { FrameProps, diff --git a/packages/components/src/components/Divider/Divider.tsx b/packages/components/src/components/Divider/Divider.tsx index 0defb36457f..04b78ec99f3 100644 --- a/packages/components/src/components/Divider/Divider.tsx +++ b/packages/components/src/components/Divider/Divider.tsx @@ -1,5 +1,7 @@ import styled, { css } from 'styled-components'; + import { Color, Elevation, mapElevationToBorder, spacings } from '@trezor/theme'; + import { useElevation } from '../ElevationContext/ElevationContext'; import { FrameProps, diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectButton.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectButton.tsx index 49dba19be77..78dd7d0d3b4 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectButton.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectButton.tsx @@ -1,7 +1,9 @@ import { useTheme } from 'styled-components'; import { Tooltip, Icon } from '@trezor/components'; + import { Translation } from 'src/components/suite'; + import { ContentType } from '../types'; interface EjectButtonProps { diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectConfirmation.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectConfirmation.tsx index 944a8321122..649033bd492 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectConfirmation.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectConfirmation.tsx @@ -1,12 +1,16 @@ +import { MouseEventHandler, ReactNode } from 'react'; + import styled from 'styled-components'; -import { useDispatch, useSelector } from 'src/hooks/suite'; + import { H4, Button, Paragraph, Row } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { deviceActions } from '@suite-common/wallet-core'; import { analytics, EventType } from '@trezor/suite-analytics'; import { AcquiredDevice } from '@suite-common/suite-types'; -import { MouseEventHandler, ReactNode } from 'react'; import { spacings } from '@trezor/theme'; + +import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; + import { selectSuiteSettings } from '../../../../reducers/suite/suiteReducer'; const Container = styled.div` diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx index d829e050194..771d8ea89d1 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx @@ -1,3 +1,5 @@ +import { useState } from 'react'; + import { selectDiscoveryByDeviceState, selectCurrentFiatRates, @@ -18,16 +20,16 @@ import { import { useDispatch, useSelector } from 'src/hooks/suite'; import { AcquiredDevice, ForegroundAppProps } from 'src/types/suite'; import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer'; -import { useWalletLabeling } from '../../../../components/suite/labeling/WalletLabeling'; import { METADATA_LABELING } from 'src/actions/suite/constants'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { FiatHeader } from 'src/components/wallet/FiatHeader'; -import { useState } from 'react'; +import { redirectAfterWalletSelectedThunk } from 'src/actions/wallet/addWalletThunk'; + +import { useWalletLabeling } from '../../../../components/suite/labeling/WalletLabeling'; import { EjectConfirmation, EjectConfirmationDisableViewOnly } from './EjectConfirmation'; import { ContentType } from '../types'; import { ViewOnly } from './ViewOnly'; import { EjectButton } from './EjectButton'; -import { redirectAfterWalletSelectedThunk } from 'src/actions/wallet/addWalletThunk'; interface WalletInstanceProps { instance: AcquiredDevice;