diff --git a/packages/suite/src/actions/backup/__tests__/backupActions.test.ts b/packages/suite/src/actions/backup/__tests__/backupActions.test.ts index 1b7ded4a7c1..f5bfeb7b7ed 100644 --- a/packages/suite/src/actions/backup/__tests__/backupActions.test.ts +++ b/packages/suite/src/actions/backup/__tests__/backupActions.test.ts @@ -1,13 +1,13 @@ -import { mergeDeepObject } from '@trezor/utils'; import { connectInitThunk } from '@suite-common/connect-init'; import { testMocks } from '@suite-common/test-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; import { CommonParams, DeviceModelInternal } from '@trezor/connect'; +import { mergeDeepObject } from '@trezor/utils'; -import { configureStore } from 'src/support/tests/configureStore'; -import { SUITE } from 'src/actions/suite/constants'; -import { BACKUP } from 'src/actions/backup/constants'; import * as backupActions from 'src/actions/backup/backupActions'; +import { BACKUP } from 'src/actions/backup/constants'; +import { SUITE } from 'src/actions/suite/constants'; +import { configureStore } from 'src/support/tests/configureStore'; const getInitialState = (override: any) => { const defaults = { diff --git a/packages/suite/src/actions/backup/backupActions.ts b/packages/suite/src/actions/backup/backupActions.ts index e5a17e039fb..9e1f3c7495a 100644 --- a/packages/suite/src/actions/backup/backupActions.ts +++ b/packages/suite/src/actions/backup/backupActions.ts @@ -1,7 +1,7 @@ -import TrezorConnect from '@trezor/connect'; -import { analytics, EventType } from '@trezor/suite-analytics'; import { notificationsActions } from '@suite-common/toast-notifications'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import TrezorConnect from '@trezor/connect'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { BACKUP } from 'src/actions/backup/constants'; import type { Dispatch, GetState } from 'src/types/suite'; diff --git a/packages/suite/src/actions/firmware/__fixtures__/firmwareActions.ts b/packages/suite/src/actions/firmware/__fixtures__/firmwareActions.ts index fb738f59d49..1990804dd2e 100644 --- a/packages/suite/src/actions/firmware/__fixtures__/firmwareActions.ts +++ b/packages/suite/src/actions/firmware/__fixtures__/firmwareActions.ts @@ -1,6 +1,6 @@ +import { firmwareActions, firmwareUpdate } from '@suite-common/firmware'; import { testMocks } from '@suite-common/test-utils'; -import { firmwareUpdate, firmwareActions } from '@suite-common/firmware'; -import { UI, DeviceModelInternal, FirmwareType } from '@trezor/connect'; +import { DeviceModelInternal, FirmwareType, UI } from '@trezor/connect'; const { getSuiteDevice, getFirmwareRelease } = testMocks; diff --git a/packages/suite/src/actions/firmware/__tests__/firmwareActions.test.ts b/packages/suite/src/actions/firmware/__tests__/firmwareActions.test.ts index f1054433cac..4723e6c28f7 100644 --- a/packages/suite/src/actions/firmware/__tests__/firmwareActions.test.ts +++ b/packages/suite/src/actions/firmware/__tests__/firmwareActions.test.ts @@ -1,11 +1,11 @@ +import { prepareFirmwareReducer } from '@suite-common/firmware'; import { testMocks } from '@suite-common/test-utils'; import { State as DeviceState } from '@suite-common/wallet-core'; import { DeviceModelInternal } from '@trezor/connect'; -import { prepareFirmwareReducer } from '@suite-common/firmware'; -import { configureStore, filterThunkActionTypes } from 'src/support/tests/configureStore'; import suiteReducer from 'src/reducers/suite/suiteReducer'; import { extraDependencies } from 'src/support/extraDependencies'; +import { configureStore, filterThunkActionTypes } from 'src/support/tests/configureStore'; import { actions, reducerActions } from '../__fixtures__/firmwareActions'; diff --git a/packages/suite/src/actions/onboarding/__fixtures__/onboardingActions.ts b/packages/suite/src/actions/onboarding/__fixtures__/onboardingActions.ts index fe757b43d71..90eb4a17278 100644 --- a/packages/suite/src/actions/onboarding/__fixtures__/onboardingActions.ts +++ b/packages/suite/src/actions/onboarding/__fixtures__/onboardingActions.ts @@ -1,8 +1,8 @@ import { testMocks } from '@suite-common/test-utils'; import * as onboardingActions from 'src/actions/onboarding/onboardingActions'; -import onboardingReducer from 'src/reducers/onboarding/onboardingReducer'; import * as STEP from 'src/constants/onboarding/steps'; +import onboardingReducer from 'src/reducers/onboarding/onboardingReducer'; const { getSuiteDevice } = testMocks; diff --git a/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts b/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts index 8db3ce3e8e3..222c12b3bf9 100644 --- a/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts +++ b/packages/suite/src/actions/onboarding/__tests__/onboardingActions.test.ts @@ -1,7 +1,7 @@ -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 suiteReducer from 'src/reducers/suite/suiteReducer'; +import { configureStore } from 'src/support/tests/configureStore'; import { Action } from 'src/types/suite'; import fixtures from '../__fixtures__/onboardingActions'; diff --git a/packages/suite/src/actions/onboarding/onboardingActions.ts b/packages/suite/src/actions/onboarding/onboardingActions.ts index c88f26120d3..f41c8d75c4b 100644 --- a/packages/suite/src/actions/onboarding/onboardingActions.ts +++ b/packages/suite/src/actions/onboarding/onboardingActions.ts @@ -1,14 +1,14 @@ -import { OnboardingAnalytics } from '@trezor/suite-analytics'; -import TrezorConnect from '@trezor/connect'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import TrezorConnect 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 { AnyStepId, AnyPath } from 'src/types/onboarding'; import steps from 'src/config/onboarding/steps'; -import { findNextStep, findPrevStep, isStepUsed } from 'src/utils/onboarding/steps'; -import { GetState, Dispatch } from 'src/types/suite'; +import * as STEP from 'src/constants/onboarding/steps'; import { BackupType, DeviceTutorialStatus } from 'src/reducers/onboarding/onboardingReducer'; +import { AnyPath, AnyStepId } from 'src/types/onboarding'; +import { Dispatch, GetState } from 'src/types/suite'; +import { findNextStep, findPrevStep, isStepUsed } from 'src/utils/onboarding/steps'; export type OnboardingAction = | { diff --git a/packages/suite/src/actions/recovery/__tests__/recoveryActions.test.ts b/packages/suite/src/actions/recovery/__tests__/recoveryActions.test.ts index 73835958164..ee638e5a1e4 100644 --- a/packages/suite/src/actions/recovery/__tests__/recoveryActions.test.ts +++ b/packages/suite/src/actions/recovery/__tests__/recoveryActions.test.ts @@ -1,9 +1,9 @@ import { DeviceModelInternal } from '@trezor/connect'; -import { configureStore } from 'src/support/tests/configureStore'; +import * as recoveryActions from 'src/actions/recovery/recoveryActions'; import recoveryReducer from 'src/reducers/recovery/recoveryReducer'; +import { configureStore } from 'src/support/tests/configureStore'; import { Action } from 'src/types/suite'; -import * as recoveryActions from 'src/actions/recovery/recoveryActions'; const getInitialState = (custom?: any): any => ({ suite: { diff --git a/packages/suite/src/actions/recovery/recoveryActions.ts b/packages/suite/src/actions/recovery/recoveryActions.ts index bce420c884f..51632ee4b02 100644 --- a/packages/suite/src/actions/recovery/recoveryActions.ts +++ b/packages/suite/src/actions/recovery/recoveryActions.ts @@ -1,13 +1,13 @@ import { selectSelectedDevice } from '@suite-common/wallet-core'; -import TrezorConnect, { UI, RecoveryDevice, DeviceModelInternal, PROTO } from '@trezor/connect'; -import { analytics, EventType } from '@trezor/suite-analytics'; +import TrezorConnect, { DeviceModelInternal, PROTO, RecoveryDevice, UI } from '@trezor/connect'; +import { EventType, analytics } from '@trezor/suite-analytics'; -import { RECOVERY } from 'src/actions/recovery/constants'; import * as onboardingActions from 'src/actions/onboarding/onboardingActions'; +import { RECOVERY } from 'src/actions/recovery/constants'; 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 { WordCount } from 'src/types/recovery'; +import { Dispatch, GetState } from 'src/types/suite'; import { isRecoveryInProgress } from '../../utils/device/isRecoveryInProgress'; diff --git a/packages/suite/src/actions/settings/__fixtures__/deviceSettings.ts b/packages/suite/src/actions/settings/__fixtures__/deviceSettings.ts index 159b6ce2095..e57485c4e71 100644 --- a/packages/suite/src/actions/settings/__fixtures__/deviceSettings.ts +++ b/packages/suite/src/actions/settings/__fixtures__/deviceSettings.ts @@ -1,5 +1,6 @@ import assert from 'assert'; +import { TrezorDevice } from '@suite-common/suite-types'; import { testMocks } from '@suite-common/test-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; import { @@ -7,7 +8,6 @@ import { deviceActions, prepareDeviceReducer, } from '@suite-common/wallet-core'; -import { TrezorDevice } from '@suite-common/suite-types'; import { Response } from '@trezor/connect'; import suiteReducer from 'src/reducers/suite/suiteReducer'; diff --git a/packages/suite/src/actions/settings/__tests__/deviceSettingsActions.test.ts b/packages/suite/src/actions/settings/__tests__/deviceSettingsActions.test.ts index c899af8e2f3..5b4ed7030b2 100644 --- a/packages/suite/src/actions/settings/__tests__/deviceSettingsActions.test.ts +++ b/packages/suite/src/actions/settings/__tests__/deviceSettingsActions.test.ts @@ -2,8 +2,8 @@ import { testMocks } from '@suite-common/test-utils'; import { deviceActions } from '@suite-common/wallet-core'; import TrezorConnect from '@trezor/connect'; -import { configureStore } from 'src/support/tests/configureStore'; import suiteReducer from 'src/reducers/suite/suiteReducer'; +import { configureStore } from 'src/support/tests/configureStore'; import fixtures, { DeviceSettingsFixtureState, diff --git a/packages/suite/src/actions/settings/__tests__/walletSettingsActions.test.ts b/packages/suite/src/actions/settings/__tests__/walletSettingsActions.test.ts index 54c672f6644..d31265362bb 100644 --- a/packages/suite/src/actions/settings/__tests__/walletSettingsActions.test.ts +++ b/packages/suite/src/actions/settings/__tests__/walletSettingsActions.test.ts @@ -1,8 +1,8 @@ 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 settingsReducer from 'src/reducers/wallet/settingsReducer'; +import { configureStore } from 'src/support/tests/configureStore'; import fixtures from '../__fixtures__/walletSettings'; diff --git a/packages/suite/src/actions/settings/constants/index.ts b/packages/suite/src/actions/settings/constants/index.ts index ec702152b3f..d26ea28269e 100644 --- a/packages/suite/src/actions/settings/constants/index.ts +++ b/packages/suite/src/actions/settings/constants/index.ts @@ -1,4 +1,4 @@ -import * as WALLET_SETTINGS from './walletSettings'; import * as DEVICE_SETTINGS from './deviceSettings'; +import * as WALLET_SETTINGS from './walletSettings'; export { WALLET_SETTINGS, DEVICE_SETTINGS }; diff --git a/packages/suite/src/actions/settings/deviceSettingsActions.ts b/packages/suite/src/actions/settings/deviceSettingsActions.ts index 3efd7caf632..d0d961f3bde 100644 --- a/packages/suite/src/actions/settings/deviceSettingsActions.ts +++ b/packages/suite/src/actions/settings/deviceSettingsActions.ts @@ -1,17 +1,17 @@ -import { selectDevices, selectSelectedDevice, deviceActions } from '@suite-common/wallet-core'; import { FIRMWARE_MODULE_PREFIX } from '@suite-common/firmware'; +import { createThunk } from '@suite-common/redux-utils'; 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 { deviceActions, selectDevices, selectSelectedDevice } from '@suite-common/wallet-core'; +import TrezorConnect, { ERRORS } from '@trezor/connect'; import { getFirmwareVersion } from '@trezor/device-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; 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 { reportCheckFail } from 'src/components/suite/SecurityCheck/useReportDeviceCompromised'; +import * as DEVICE from 'src/constants/suite/device'; +import { Dispatch, GetState } from 'src/types/suite'; import { selectSuiteSettings } from '../../reducers/suite/suiteReducer'; diff --git a/packages/suite/src/actions/settings/languageActions.ts b/packages/suite/src/actions/settings/languageActions.ts index 400fbf81b5d..4b1702855c0 100644 --- a/packages/suite/src/actions/settings/languageActions.ts +++ b/packages/suite/src/actions/settings/languageActions.ts @@ -1,7 +1,7 @@ import { SUITE } from 'src/actions/suite/constants'; -import { ensureLocale } from 'src/utils/suite/l10n'; -import type { Locale } from 'src/config/suite/languages'; import type { SuiteAction } from 'src/actions/suite/suiteActions'; +import type { Locale } from 'src/config/suite/languages'; +import { ensureLocale } from 'src/utils/suite/l10n'; export const setLanguage = (locale: Locale): SuiteAction => ({ type: SUITE.SET_LANGUAGE, diff --git a/packages/suite/src/actions/settings/walletSettingsActions.ts b/packages/suite/src/actions/settings/walletSettingsActions.ts index 927e7fe2294..b36266dc56b 100644 --- a/packages/suite/src/actions/settings/walletSettingsActions.ts +++ b/packages/suite/src/actions/settings/walletSettingsActions.ts @@ -1,13 +1,13 @@ import { createAction } from '@reduxjs/toolkit'; -import { NetworkSymbol } from '@suite-common/wallet-config'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; import { UNIT_ABBREVIATIONS } from '@suite-common/suite-constants'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { FeeLevel, PROTO } from '@trezor/connect'; -import { analytics, EventType } from '@trezor/suite-analytics'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { EventType, analytics } from '@trezor/suite-analytics'; -import { Dispatch, GetState } from 'src/types/suite'; import * as suiteActions from 'src/actions/suite/suiteActions'; +import { Dispatch, GetState } from 'src/types/suite'; import { WALLET_SETTINGS } from './constants'; diff --git a/packages/suite/src/actions/suite/__fixtures__/metadataActions.ts b/packages/suite/src/actions/suite/__fixtures__/metadataActions.ts index f913b01116e..029e0643900 100644 --- a/packages/suite/src/actions/suite/__fixtures__/metadataActions.ts +++ b/packages/suite/src/actions/suite/__fixtures__/metadataActions.ts @@ -3,9 +3,9 @@ import { deviceActions } from '@suite-common/wallet-core'; import { METADATA, METADATA_LABELING } from 'src/actions/suite/constants/'; +import * as metadataActions from '../metadataActions'; import * as metadataLabelingActions from '../metadataLabelingActions'; import * as metadataProviderActions from '../metadataProviderActions'; -import * as metadataActions from '../metadataActions'; const { getSuiteDevice, getWalletAccount } = testMocks; diff --git a/packages/suite/src/actions/suite/__fixtures__/suiteActions.ts b/packages/suite/src/actions/suite/__fixtures__/suiteActions.ts index eeba4d9d890..f4aca13a7b3 100644 --- a/packages/suite/src/actions/suite/__fixtures__/suiteActions.ts +++ b/packages/suite/src/actions/suite/__fixtures__/suiteActions.ts @@ -1,12 +1,12 @@ import { testMocks } from '@suite-common/test-utils'; +import { notificationsActions } from '@suite-common/toast-notifications'; import { - discoveryActions, - deviceActions, authorizeDeviceThunk, createDeviceInstanceThunk, + deviceActions, + discoveryActions, } from '@suite-common/wallet-core'; import { DEVICE, TRANSPORT } from '@trezor/connect'; -import { notificationsActions } from '@suite-common/toast-notifications'; import { SUITE } from 'src/actions/suite/constants'; import { TorStatus } from 'src/types/suite'; diff --git a/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts b/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts index 50ebd37c650..fb552843a2b 100644 --- a/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/analyticsActions.test.ts @@ -1,8 +1,8 @@ -import { prepareAnalyticsReducer, analyticsActions } from '@suite-common/analytics'; +import { analyticsActions, prepareAnalyticsReducer } from '@suite-common/analytics'; +import { init } from 'src/actions/suite/analyticsActions'; import { extraDependencies } from 'src/support/extraDependencies'; import { configureStore } from 'src/support/tests/configureStore'; -import { init } from 'src/actions/suite/analyticsActions'; const analyticsReducer = prepareAnalyticsReducer(extraDependencies); diff --git a/packages/suite/src/actions/suite/__tests__/initAction.test.ts b/packages/suite/src/actions/suite/__tests__/initAction.test.ts index f17265543d8..eaeea3a1a20 100644 --- a/packages/suite/src/actions/suite/__tests__/initAction.test.ts +++ b/packages/suite/src/actions/suite/__tests__/initAction.test.ts @@ -1,41 +1,41 @@ +import { analyticsActions, prepareAnalyticsReducer } from '@suite-common/analytics'; +import { connectInitThunk } from '@suite-common/connect-init'; import { - prepareMessageSystemReducer, - messageSystemActions, - initMessageSystemThunk, fetchConfigThunk, + initMessageSystemThunk, + messageSystemActions, + prepareMessageSystemReducer, } from '@suite-common/message-system'; import { validJws } from '@suite-common/message-system/src/__fixtures__/messageSystemActions'; -import { connectInitThunk } from '@suite-common/connect-init'; import { - prepareDeviceReducer, - initDevices, + initTokenDefinitionsThunk, + periodicCheckTokenDefinitionsThunk, +} from '@suite-common/token-definitions'; +import { blockchainActions, fetchFiatRatesThunk, initBlockchainThunk, - periodicFetchFiatRatesThunk, - preloadFeeInfoThunk, + initDevices, initStakeDataThunk, periodicCheckStakeDataThunk, + periodicFetchFiatRatesThunk, + preloadFeeInfoThunk, + prepareDeviceReducer, updateMissingTxFiatRatesThunk, } from '@suite-common/wallet-core'; -import { - initTokenDefinitionsThunk, - periodicCheckTokenDefinitionsThunk, -} from '@suite-common/token-definitions'; -import { analyticsActions, prepareAnalyticsReducer } from '@suite-common/analytics'; import TrezorConnect from '@trezor/connect'; -import { configureStore } from 'src/support/tests/configureStore'; -import { SUITE, ROUTER } from 'src/actions/suite/constants'; -import suiteReducer from 'src/reducers/suite/suiteReducer'; +import { ROUTER, SUITE } from 'src/actions/suite/constants'; +import { init } from 'src/actions/suite/initAction'; +import suiteMiddleware from 'src/middlewares/suite/suiteMiddleware'; +import metadataReducer from 'src/reducers/suite/metadataReducer'; import modalReducer from 'src/reducers/suite/modalReducer'; import routerReducer from 'src/reducers/suite/routerReducer'; -import metadataReducer from 'src/reducers/suite/metadataReducer'; +import suiteReducer from 'src/reducers/suite/suiteReducer'; import walletReducers from 'src/reducers/wallet'; -import { init } from 'src/actions/suite/initAction'; -import suiteMiddleware from 'src/middlewares/suite/suiteMiddleware'; -import type { AppState } from 'src/types/suite'; import { extraDependencies } from 'src/support/extraDependencies'; +import { configureStore } from 'src/support/tests/configureStore'; +import type { AppState } from 'src/types/suite'; import { appChanged } from '../suiteActions'; diff --git a/packages/suite/src/actions/suite/__tests__/metadataActions.test.ts b/packages/suite/src/actions/suite/__tests__/metadataActions.test.ts index 9f9f6fe3f79..e3a255f3a70 100644 --- a/packages/suite/src/actions/suite/__tests__/metadataActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/metadataActions.test.ts @@ -1,22 +1,22 @@ import fs from 'fs'; import path from 'path'; -import { prepareDeviceReducer } from '@suite-common/wallet-core'; import { testMocks } from '@suite-common/test-utils'; +import { prepareDeviceReducer } from '@suite-common/wallet-core'; -import { configureStore } from 'src/support/tests/configureStore'; +import suiteMiddleware from 'src/middlewares/suite/suiteMiddleware'; import metadataReducer from 'src/reducers/suite/metadataReducer'; import { SuiteState } from 'src/reducers/suite/suiteReducer'; -import DropboxProvider from 'src/services/suite/metadata/DropboxProvider'; -import suiteMiddleware from 'src/middlewares/suite/suiteMiddleware'; import { accountsReducer } from 'src/reducers/wallet'; +import DropboxProvider from 'src/services/suite/metadata/DropboxProvider'; import { extraDependencies } from 'src/support/extraDependencies'; +import { configureStore } from 'src/support/tests/configureStore'; -import { STORAGE, MODAL } from '../constants'; +import * as fixtures from '../__fixtures__/metadataActions'; +import { MODAL, STORAGE } from '../constants'; import * as metadataActions from '../metadataActions'; -import * as metadataProviderActions from '../metadataProviderActions'; import * as metadataLabelingActions from '../metadataLabelingActions'; -import * as fixtures from '../__fixtures__/metadataActions'; +import * as metadataProviderActions from '../metadataProviderActions'; const deviceReducer = prepareDeviceReducer(extraDependencies); diff --git a/packages/suite/src/actions/suite/__tests__/modalActions.test.ts b/packages/suite/src/actions/suite/__tests__/modalActions.test.ts index 910d036be18..d9729228124 100644 --- a/packages/suite/src/actions/suite/__tests__/modalActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/modalActions.test.ts @@ -1,5 +1,5 @@ -import * as modalActions from '../modalActions'; import { MODAL } from '../constants'; +import * as modalActions from '../modalActions'; describe('Modal Actions', () => { it('cancel actions', () => { diff --git a/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts b/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts index 48673ffac5a..46de165c1e8 100644 --- a/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/protocolActions.test.ts @@ -1,11 +1,11 @@ -import { testMocks } from '@suite-common/test-utils'; import { NETWORK_TO_PROTOCOLS } from '@suite-common/suite-constants'; +import { testMocks } from '@suite-common/test-utils'; -import { configureStore } from 'src/support/tests/configureStore'; import protocolReducer, { State as ProtocolState } from 'src/reducers/suite/protocolReducer'; +import { configureStore } from 'src/support/tests/configureStore'; -import * as protocolActions from '../protocolActions'; import * as protocolConstants from '../constants/protocolConstants'; +import * as protocolActions from '../protocolActions'; jest.doMock('@trezor/suite-analytics', () => testMocks.getAnalytics()); diff --git a/packages/suite/src/actions/suite/__tests__/routerActions.test.ts b/packages/suite/src/actions/suite/__tests__/routerActions.test.ts index 2e9212ba304..dffb0f48ba6 100644 --- a/packages/suite/src/actions/suite/__tests__/routerActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/routerActions.test.ts @@ -1,8 +1,8 @@ -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 modalReducer from 'src/reducers/suite/modalReducer'; +import routerReducer from 'src/reducers/suite/routerReducer'; +import suiteReducer from 'src/reducers/suite/suiteReducer'; +import { configureStore } from 'src/support/tests/configureStore'; import * as fixtures from '../__fixtures__/routerActions'; import * as routerActions from '../routerActions'; diff --git a/packages/suite/src/actions/suite/__tests__/storageActions.test.ts b/packages/suite/src/actions/suite/__tests__/storageActions.test.ts index 8046962dcb1..20687a6eef3 100644 --- a/packages/suite/src/actions/suite/__tests__/storageActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/storageActions.test.ts @@ -2,34 +2,34 @@ import { Middleware } from 'redux'; import { testMocks } from '@suite-common/test-utils'; import { + createDiscoveryThunk, + deviceActions, + disableAccountsThunk, prepareDeviceReducer, + prepareDiscoveryReducer, + prepareSendFormReducer, selectDevices, selectDevicesCount, - prepareDiscoveryReducer, - disableAccountsThunk, transactionsActions, - createDiscoveryThunk, - deviceActions, - prepareSendFormReducer, } from '@suite-common/wallet-core'; import * as discoveryActions from '@suite-common/wallet-core'; -import { getAccountTransactions, getAccountIdentifier } from '@suite-common/wallet-utils'; +import { getAccountIdentifier, getAccountTransactions } from '@suite-common/wallet-utils'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; -import { accountsReducer, fiatRatesReducer, transactionsReducer } from 'src/reducers/wallet'; -import walletSettingsReducer from 'src/reducers/wallet/settingsReducer'; -import suiteReducer from 'src/reducers/suite/suiteReducer'; -import graphReducer from 'src/reducers/wallet/graphReducer'; +import { SETTINGS } from 'src/config/suite'; import storageMiddleware from 'src/middlewares/wallet/storageMiddleware'; +import suiteReducer from 'src/reducers/suite/suiteReducer'; +import { accountsReducer, fiatRatesReducer, transactionsReducer } from 'src/reducers/wallet'; import { coinjoinReducer } from 'src/reducers/wallet/coinjoinReducer'; +import graphReducer from 'src/reducers/wallet/graphReducer'; +import walletSettingsReducer from 'src/reducers/wallet/settingsReducer'; +import { extraDependencies } from 'src/support/extraDependencies'; +import { preloadStore } from 'src/support/suite/preloadStore'; import { configureStore } from 'src/support/tests/configureStore'; import { AcquiredDevice, AppState } from 'src/types/suite'; -import { SETTINGS } from 'src/config/suite'; -import { preloadStore } from 'src/support/suite/preloadStore'; -import { extraDependencies } from 'src/support/extraDependencies'; -import * as suiteActions from '../suiteActions'; import * as storageActions from '../storageActions'; +import * as suiteActions from '../suiteActions'; const { getSuiteDevice, getWalletAccount, getWalletTransaction } = testMocks; diff --git a/packages/suite/src/actions/suite/__tests__/suiteActions.test.ts b/packages/suite/src/actions/suite/__tests__/suiteActions.test.ts index 277a8c9b169..07366b784c7 100644 --- a/packages/suite/src/actions/suite/__tests__/suiteActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/suiteActions.test.ts @@ -1,38 +1,38 @@ // unit test for suite actions // data provided by TrezorConnect are mocked +import { connectInitThunk } from '@suite-common/connect-init'; +import { prepareFirmwareReducer } from '@suite-common/firmware'; import { testMocks } from '@suite-common/test-utils'; import { - prepareDeviceReducer, - selectSelectedDevice, - selectDevices, - selectDevicesCount, - deviceActions, + ConnectDeviceSettings, acquireDevice, authConfirm, authorizeDeviceThunk, + createDeviceInstanceThunk, + deviceActions, forgetDisconnectedDevices, handleDeviceConnect, + handleDeviceDisconnect, observeSelectedDevice, - switchDuplicatedDevice, + prepareDeviceReducer, selectDeviceThunk, - handleDeviceDisconnect, - createDeviceInstanceThunk, - ConnectDeviceSettings, + selectDevices, + selectDevicesCount, + selectSelectedDevice, + switchDuplicatedDevice, } from '@suite-common/wallet-core'; -import { prepareFirmwareReducer } from '@suite-common/firmware'; -import { connectInitThunk } from '@suite-common/connect-init'; import { DEVICE } from '@trezor/connect'; -import { configureStore, filterThunkActionTypes } 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 { discardMockedConnectInitActions } from 'src/utils/suite/storage'; +import routerReducer from 'src/reducers/suite/routerReducer'; +import suiteReducer from 'src/reducers/suite/suiteReducer'; import { extraDependencies } from 'src/support/extraDependencies'; +import { configureStore, filterThunkActionTypes } from 'src/support/tests/configureStore'; +import { discardMockedConnectInitActions } from 'src/utils/suite/storage'; +import fixtures from '../__fixtures__/suiteActions'; import { SUITE } from '../constants'; import * as suiteActions from '../suiteActions'; -import fixtures from '../__fixtures__/suiteActions'; const { getSuiteDevice } = testMocks; diff --git a/packages/suite/src/actions/suite/__tests__/trezorConnectActions.test.ts b/packages/suite/src/actions/suite/__tests__/trezorConnectActions.test.ts index 6a050a461ac..859e694926a 100644 --- a/packages/suite/src/actions/suite/__tests__/trezorConnectActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/trezorConnectActions.test.ts @@ -1,12 +1,12 @@ -import { DEVICE_EVENT, UI_EVENT, TRANSPORT_EVENT, BLOCKCHAIN_EVENT } from '@trezor/connect'; import { connectInitThunk } from '@suite-common/connect-init'; import { testMocks } from '@suite-common/test-utils'; import { prepareDeviceReducer } from '@suite-common/wallet-core'; +import { BLOCKCHAIN_EVENT, DEVICE_EVENT, TRANSPORT_EVENT, UI_EVENT } from '@trezor/connect'; -import { configureStore } from 'src/support/tests/configureStore'; -import suiteReducer from 'src/reducers/suite/suiteReducer'; import { SUITE } from 'src/actions/suite/constants'; +import suiteReducer from 'src/reducers/suite/suiteReducer'; import { extraDependencies } from 'src/support/extraDependencies'; +import { configureStore } from 'src/support/tests/configureStore'; const deviceReducer = prepareDeviceReducer(extraDependencies); diff --git a/packages/suite/src/actions/suite/__tests__/windowActions.test.ts b/packages/suite/src/actions/suite/__tests__/windowActions.test.ts index d73fa5570b0..beff46d5506 100644 --- a/packages/suite/src/actions/suite/__tests__/windowActions.test.ts +++ b/packages/suite/src/actions/suite/__tests__/windowActions.test.ts @@ -1,6 +1,6 @@ -import { configureStore } from 'src/support/tests/configureStore'; -import windowReducer, { State as WindowState } from 'src/reducers/suite/windowReducer'; import * as windowActions from 'src/actions/suite/windowActions'; +import windowReducer, { State as WindowState } from 'src/reducers/suite/windowReducer'; +import { configureStore } from 'src/support/tests/configureStore'; const getInitialState = (state?: WindowState) => ({ window: { diff --git a/packages/suite/src/actions/suite/analyticsActions.ts b/packages/suite/src/actions/suite/analyticsActions.ts index 066fd4ad3b7..d82dbcde5ee 100644 --- a/packages/suite/src/actions/suite/analyticsActions.ts +++ b/packages/suite/src/actions/suite/analyticsActions.ts @@ -3,16 +3,16 @@ * @docs docs/misc/analytics.md */ -import { getEnvironment, getCommitHash, isCodesignBuild } from '@trezor/env-utils'; import { analyticsActions, - selectHasUserAllowedTracking, selectAnalyticsInstanceId, - selectIsAnalyticsEnabled, + selectHasUserAllowedTracking, selectIsAnalyticsConfirmed, + selectIsAnalyticsEnabled, } from '@suite-common/analytics'; import { getTrackingRandomId } from '@trezor/analytics'; -import { analytics, EventType } from '@trezor/suite-analytics'; +import { getCommitHash, getEnvironment, isCodesignBuild } from '@trezor/env-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; import type { Dispatch, GetState } from 'src/types/suite'; import { allowSentryReport, setSentryUser } from 'src/utils/suite/sentry'; diff --git a/packages/suite/src/actions/suite/constants/index.ts b/packages/suite/src/actions/suite/constants/index.ts index f4c3de04671..8167b237054 100644 --- a/packages/suite/src/actions/suite/constants/index.ts +++ b/packages/suite/src/actions/suite/constants/index.ts @@ -1,15 +1,15 @@ -import * as STORAGE from './storageConstants'; -import * as SUITE from './suiteConstants'; -import * as MODAL from './modalConstants'; -import * as ROUTER from './routerConstants'; -import * as WINDOW from './windowConstants'; +import * as DESKTOP_UPDATE from './desktopUpdateConstants'; +import * as GUIDE from './guideConstants'; import * as METADATA from './metadataConstants'; import * as METADATA_LABELING from './metadataLabelingConstants'; -import * as METADATA_PROVIDER from './metadataProviderConstants'; import * as METADATA_PASSWORDS from './metadataPasswordsConstants'; -import * as DESKTOP_UPDATE from './desktopUpdateConstants'; -import * as GUIDE from './guideConstants'; +import * as METADATA_PROVIDER from './metadataProviderConstants'; +import * as MODAL from './modalConstants'; import * as PROTOCOL from './protocolConstants'; +import * as ROUTER from './routerConstants'; +import * as STORAGE from './storageConstants'; +import * as SUITE from './suiteConstants'; +import * as WINDOW from './windowConstants'; export { STORAGE, diff --git a/packages/suite/src/actions/suite/constants/metadataLabelingConstants.ts b/packages/suite/src/actions/suite/constants/metadataLabelingConstants.ts index 326e085bc07..d7a6ce1f8a7 100644 --- a/packages/suite/src/actions/suite/constants/metadataLabelingConstants.ts +++ b/packages/suite/src/actions/suite/constants/metadataLabelingConstants.ts @@ -1,6 +1,6 @@ import { - MetadataEncryptionVersion, AccountLabels, + MetadataEncryptionVersion, WalletLabels, } from '@suite-common/metadata-types'; import { TrezorConnect } from '@trezor/connect'; diff --git a/packages/suite/src/actions/suite/copyAddressActions.ts b/packages/suite/src/actions/suite/copyAddressActions.ts index c35a2dcb68d..7b5d49ca346 100644 --- a/packages/suite/src/actions/suite/copyAddressActions.ts +++ b/packages/suite/src/actions/suite/copyAddressActions.ts @@ -1,8 +1,8 @@ import { Dispatch } from 'redux'; +import { notificationsActions } from '@suite-common/toast-notifications'; import { AddressType } from '@suite-common/wallet-types'; import { copyToClipboard } from '@trezor/dom-utils'; -import { notificationsActions } from '@suite-common/toast-notifications'; import { openModal } from 'src/actions/suite/modalActions'; diff --git a/packages/suite/src/actions/suite/desktopUpdateActions.ts b/packages/suite/src/actions/suite/desktopUpdateActions.ts index eb1e0706fea..6ac704a63cd 100644 --- a/packages/suite/src/actions/suite/desktopUpdateActions.ts +++ b/packages/suite/src/actions/suite/desktopUpdateActions.ts @@ -1,10 +1,10 @@ -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 { AppUpdateEventStatus, EventType, analytics } from '@trezor/suite-analytics'; +import { UpdateInfo, UpdateProgress, desktopApi } from '@trezor/suite-desktop-api'; import { DESKTOP_UPDATE } from 'src/actions/suite/constants'; +import { UpdateModalVisibility, UpdateState } from 'src/reducers/suite/desktopUpdateReducer'; 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 = diff --git a/packages/suite/src/actions/suite/guideActions.ts b/packages/suite/src/actions/suite/guideActions.ts index 86730ea9534..72dc73e9c18 100644 --- a/packages/suite/src/actions/suite/guideActions.ts +++ b/packages/suite/src/actions/suite/guideActions.ts @@ -1,4 +1,3 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; import type { ActiveView, Feedback, @@ -8,6 +7,7 @@ import type { } from '@suite-common/suite-types'; import { notificationsActions } from '@suite-common/toast-notifications'; import { isCodesignBuild } from '@trezor/env-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { Dispatch } from 'src/types/suite'; diff --git a/packages/suite/src/actions/suite/initAction.ts b/packages/suite/src/actions/suite/initAction.ts index bf8bf0a9b91..7b301afe682 100644 --- a/packages/suite/src/actions/suite/initAction.ts +++ b/packages/suite/src/actions/suite/initAction.ts @@ -1,21 +1,21 @@ -import { initMessageSystemThunk } from '@suite-common/message-system'; import * as trezorConnectActions from '@suite-common/connect-init'; +import { initMessageSystemThunk } from '@suite-common/message-system'; +import { periodicCheckTokenDefinitionsThunk } from '@suite-common/token-definitions'; import { initBlockchainThunk, initDevices, - periodicFetchFiatRatesThunk, periodicCheckStakeDataThunk, + periodicFetchFiatRatesThunk, updateMissingTxFiatRatesThunk, } from '@suite-common/wallet-core'; -import { periodicCheckTokenDefinitionsThunk } from '@suite-common/token-definitions'; +import { isDesktop } from '@trezor/env-utils'; import { desktopApi } from '@trezor/suite-desktop-api'; import * as trezorConnectPopupActions from '@trezor/suite-desktop-connect-popup'; -import { isDesktop } from '@trezor/env-utils'; -import * as routerActions from 'src/actions/suite/routerActions'; +import * as languageActions from 'src/actions/settings/languageActions'; import * as analyticsActions from 'src/actions/suite/analyticsActions'; import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; -import * as languageActions from 'src/actions/settings/languageActions'; +import * as routerActions from 'src/actions/suite/routerActions'; import type { Dispatch, GetState } from 'src/types/suite'; import { SUITE } from './constants'; diff --git a/packages/suite/src/actions/suite/metadataActions.ts b/packages/suite/src/actions/suite/metadataActions.ts index 5442603ddfe..694d5328fda 100644 --- a/packages/suite/src/actions/suite/metadataActions.ts +++ b/packages/suite/src/actions/suite/metadataActions.ts @@ -1,24 +1,24 @@ import { createAction } from '@reduxjs/toolkit'; +import { notificationsActions } from '@suite-common/toast-notifications'; import { selectDevices } from '@suite-common/wallet-core'; import { Account } from '@suite-common/wallet-types'; import { StaticSessionId } from '@trezor/connect'; import { createZip } from '@trezor/utils'; -import { notificationsActions } from '@suite-common/toast-notifications'; import { METADATA, METADATA_LABELING } from 'src/actions/suite/constants'; +import { selectSelectedProviderForLabels } from 'src/reducers/suite/metadataReducer'; import { Dispatch, GetState } from 'src/types/suite'; import { - MetadataProvider, + AccountLabels, + DataType, DeviceMetadata, Labels, - DataType, + MetadataProvider, WalletLabels, - AccountLabels, } from 'src/types/suite/metadata'; -import * as metadataUtils from 'src/utils/suite/metadata'; -import { selectSelectedProviderForLabels } from 'src/reducers/suite/metadataReducer'; import type { AbstractMetadataProvider, PasswordManagerState } from 'src/types/suite/metadata'; +import * as metadataUtils from 'src/utils/suite/metadata'; import { getProviderInstance } from './metadataProviderActions'; diff --git a/packages/suite/src/actions/suite/metadataLabelingActions.ts b/packages/suite/src/actions/suite/metadataLabelingActions.ts index e65d8d0061a..4f4f2deff92 100644 --- a/packages/suite/src/actions/suite/metadataLabelingActions.ts +++ b/packages/suite/src/actions/suite/metadataLabelingActions.ts @@ -1,28 +1,28 @@ -import TrezorConnect, { StaticSessionId } from '@trezor/connect'; -import { cloneObject } from '@trezor/utils'; import { + selectDeviceByStaticSessionId, selectDevices, selectSelectedDevice, - selectDeviceByStaticSessionId, } from '@suite-common/wallet-core'; +import TrezorConnect, { StaticSessionId } from '@trezor/connect'; +import { cloneObject } from '@trezor/utils'; import { METADATA, METADATA_LABELING } from 'src/actions/suite/constants'; +import { + selectLabelableEntities, + selectMetadata, + selectSelectedProviderForLabels, +} from 'src/reducers/suite/metadataReducer'; import { Dispatch, GetState, TrezorDevice } from 'src/types/suite'; import { - MetadataProvider, + AccountLabels, MetadataAddPayload, - ProviderErrorAction, MetadataEncryptionVersion, + MetadataProvider, + ProviderErrorAction, WalletLabels, - AccountLabels, } from 'src/types/suite/metadata'; import { Account } from 'src/types/wallet'; import * as metadataUtils from 'src/utils/suite/metadata'; -import { - selectLabelableEntities, - selectMetadata, - selectSelectedProviderForLabels, -} from 'src/reducers/suite/metadataReducer'; import type { MetadataAction } from './metadataActions'; import * as metadataActions from './metadataActions'; diff --git a/packages/suite/src/actions/suite/metadataPasswordsActions.ts b/packages/suite/src/actions/suite/metadataPasswordsActions.ts index 34430b25390..c2dc9984475 100644 --- a/packages/suite/src/actions/suite/metadataPasswordsActions.ts +++ b/packages/suite/src/actions/suite/metadataPasswordsActions.ts @@ -1,14 +1,14 @@ import crypto from 'crypto'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; import TrezorConnect from '@trezor/connect'; import { cloneObject } from '@trezor/utils'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; -import { METADATA, METADATA_PROVIDER, METADATA_PASSWORDS } from 'src/actions/suite/constants'; +import { METADATA, METADATA_PASSWORDS, METADATA_PROVIDER } from 'src/actions/suite/constants'; +import { selectSelectedProviderForPasswords } from 'src/reducers/suite/metadataReducer'; import { Dispatch, GetState } from 'src/types/suite'; -import { ProviderErrorAction, PasswordEntry, LabelableEntityKeys } from 'src/types/suite/metadata'; +import { LabelableEntityKeys, PasswordEntry, ProviderErrorAction } from 'src/types/suite/metadata'; import * as metadataUtils from 'src/utils/suite/metadata'; -import { selectSelectedProviderForPasswords } from 'src/reducers/suite/metadataReducer'; import * as metadataActions from './metadataActions'; import * as metadataProviderActions from './metadataProviderActions'; diff --git a/packages/suite/src/actions/suite/metadataProviderActions.ts b/packages/suite/src/actions/suite/metadataProviderActions.ts index 1dac615e0d2..3d4fc832703 100644 --- a/packages/suite/src/actions/suite/metadataProviderActions.ts +++ b/packages/suite/src/actions/suite/metadataProviderActions.ts @@ -1,26 +1,26 @@ -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 { EventType, analytics } from '@trezor/suite-analytics'; +import { createDeferred } from '@trezor/utils'; import { METADATA, METADATA_PROVIDER } from 'src/actions/suite/constants'; +import * as modalActions from 'src/actions/suite/modalActions'; +import DropboxProvider from 'src/services/suite/metadata/DropboxProvider'; +import FileSystemProvider from 'src/services/suite/metadata/FileSystemProvider'; +import GoogleProvider from 'src/services/suite/metadata/GoogleProvider'; import { Dispatch, GetState } from 'src/types/suite'; import { - MetadataProviderType, + DataType, MetadataProvider, - Tokens, Error as MetadataProviderError, + MetadataProviderType, OAuthServerEnvironment, ProviderErrorAction, - DataType, + Tokens, } from 'src/types/suite/metadata'; -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 * as metadataActions from './metadataActions'; +import { InMemoryTestProvider } from '../../services/suite/metadata/InMemoryTestProvider'; export type MetadataAction = { type: typeof METADATA.SET_SELECTED_PROVIDER; diff --git a/packages/suite/src/actions/suite/modalActions.ts b/packages/suite/src/actions/suite/modalActions.ts index d165986782c..45eb849944a 100644 --- a/packages/suite/src/actions/suite/modalActions.ts +++ b/packages/suite/src/actions/suite/modalActions.ts @@ -1,8 +1,8 @@ import { createAction } from '@reduxjs/toolkit'; -import TrezorConnect, { UI } from '@trezor/connect'; -import { createDeferred, DeferredResponse } from '@trezor/utils'; import { UserContextPayload } from '@suite-common/suite-types'; +import TrezorConnect, { UI } from '@trezor/connect'; +import { DeferredResponse, createDeferred } from '@trezor/utils'; import { MODAL } from 'src/actions/suite/constants'; import { Dispatch } from 'src/types/suite'; diff --git a/packages/suite/src/actions/suite/protocolActions.ts b/packages/suite/src/actions/suite/protocolActions.ts index 9d1dc3c6421..84e378d7e09 100644 --- a/packages/suite/src/actions/suite/protocolActions.ts +++ b/packages/suite/src/actions/suite/protocolActions.ts @@ -3,10 +3,10 @@ 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 * as routerActions from 'src/actions/suite/routerActions'; +import type { SendFormState } from 'src/reducers/suite/protocolReducer'; +import type { Dispatch } from 'src/types/suite'; +import { CoinProtocolInfo, getProtocolInfo } from 'src/utils/suite/protocol'; import { PROTOCOL } from './constants'; diff --git a/packages/suite/src/actions/suite/routerActions.ts b/packages/suite/src/actions/suite/routerActions.ts index 75f06533dd3..7539c56081b 100644 --- a/packages/suite/src/actions/suite/routerActions.ts +++ b/packages/suite/src/actions/suite/routerActions.ts @@ -3,22 +3,22 @@ */ import { Route } from '@suite-common/suite-types'; -import * as suiteActions from 'src/actions/suite/suiteActions'; import { ROUTER } from 'src/actions/suite/constants'; +import * as suiteActions from 'src/actions/suite/suiteActions'; +import type { AnchorType } from 'src/constants/suite/anchors'; import { RouterAppWithParams, SettingsBackRoute } from 'src/constants/suite/routes'; +import { selectIsRouterLocked, selectIsRouterOrUiLocked } from 'src/reducers/suite/suiteReducer'; +import history from 'src/support/history'; +import { Dispatch, GetState } from 'src/types/suite'; import { + RouteParams, + findRoute, + findRouteByName, getAppWithParams, + getBackgroundRoute, getPrefixedURL, getRoute, - getBackgroundRoute, - findRoute, - findRouteByName, - RouteParams, } from 'src/utils/suite/router'; -import { Dispatch, GetState } from 'src/types/suite'; -import history from 'src/support/history'; -import type { AnchorType } from 'src/constants/suite/anchors'; -import { selectIsRouterLocked, selectIsRouterOrUiLocked } from 'src/reducers/suite/suiteReducer'; export type RouterAction = | { diff --git a/packages/suite/src/actions/suite/storageActions.ts b/packages/suite/src/actions/suite/storageActions.ts index 99aa97d2bc5..84e6b2f0f7f 100644 --- a/packages/suite/src/actions/suite/storageActions.ts +++ b/packages/suite/src/actions/suite/storageActions.ts @@ -1,30 +1,30 @@ 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 { MetadataState } from '@suite-common/metadata-types'; import { isDeviceAcquired } from '@suite-common/suite-utils'; -import { selectDevices, deviceActions } from '@suite-common/wallet-core'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import { DefinitionType, TokenManagementAction } from '@suite-common/token-definitions'; import type { NetworkSymbol } from '@suite-common/wallet-config'; +import { FormDraftPrefixKeyValues } from '@suite-common/wallet-constants'; +import { deviceActions, selectDevices } from '@suite-common/wallet-core'; 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 { Discovery, FormDraftKeyPrefix } from '@suite-common/wallet-types'; +import { getFormDraftKey, selectHistoricRatesByTransactions } from '@suite-common/wallet-utils'; +import { cloneObject } from '@trezor/utils'; +import { selectCoinjoinAccountByKey } from 'src/reducers/wallet/coinjoinReducer'; import { db } from 'src/storage'; -import { - serializeDiscovery, - serializeDevice, - serializeCoinjoinAccount, -} from 'src/utils/suite/storage'; +import type { PreloadStoreAction } from 'src/support/suite/preloadStore'; import type { AppState, Dispatch, GetState, TrezorDevice } from 'src/types/suite'; import type { Account } from 'src/types/wallet'; -import type { Trade } from 'src/types/wallet/tradingCommonTypes'; -import type { PreloadStoreAction } from 'src/support/suite/preloadStore'; import { GraphData } from 'src/types/wallet/graph'; +import type { Trade } from 'src/types/wallet/tradingCommonTypes'; +import { + serializeCoinjoinAccount, + serializeDevice, + serializeDiscovery, +} from 'src/utils/suite/storage'; import { deviceGraphDataFilterFn } from 'src/utils/wallet/graph'; -import { selectCoinjoinAccountByKey } from 'src/reducers/wallet/coinjoinReducer'; import { STORAGE } from './constants'; import { selectSuiteSettings } from '../../reducers/suite/suiteReducer'; diff --git a/packages/suite/src/actions/suite/suiteActions.ts b/packages/suite/src/actions/suite/suiteActions.ts index 787efda20b7..976b883ce4b 100644 --- a/packages/suite/src/actions/suite/suiteActions.ts +++ b/packages/suite/src/actions/suite/suiteActions.ts @@ -1,24 +1,24 @@ import { createAction } from '@reduxjs/toolkit'; import { notificationsActions } from '@suite-common/toast-notifications'; -import { getCustomBackends } from '@suite-common/wallet-utils'; -import { desktopApi, HandshakeElectron } from '@trezor/suite-desktop-api'; -import { analytics, EventType } from '@trezor/suite-analytics'; import { deviceActions } from '@suite-common/wallet-core'; +import { getCustomBackends } from '@suite-common/wallet-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { HandshakeElectron, desktopApi } from '@trezor/suite-desktop-api'; -import { TorStatus } from 'src/types/suite'; -import { isOnionUrl } from 'src/utils/suite/tor'; import * as modalActions from 'src/actions/suite/modalActions'; -import { ExperimentalFeature } from 'src/constants/suite/experimental'; +import type { TranslationKey } from 'src/components/suite/Translation'; import type { Locale } from 'src/config/suite/languages'; -import type { Dispatch, GetState, AppState, TorBootstrap } from 'src/types/suite'; +import { ExperimentalFeature } from 'src/constants/suite/experimental'; import { - DebugModeOptions, AutodetectSettings, - selectTorState, + DebugModeOptions, EvmSettings, + selectTorState, } from 'src/reducers/suite/suiteReducer'; -import type { TranslationKey } from 'src/components/suite/Translation'; +import { TorStatus } from 'src/types/suite'; +import type { AppState, Dispatch, GetState, TorBootstrap } from 'src/types/suite'; +import { isOnionUrl } from 'src/utils/suite/tor'; import { SUITE } from './constants'; diff --git a/packages/suite/src/actions/wallet/__fixtures__/blockchainActions.ts b/packages/suite/src/actions/wallet/__fixtures__/blockchainActions.ts index e544600da36..ab7eb325615 100644 --- a/packages/suite/src/actions/wallet/__fixtures__/blockchainActions.ts +++ b/packages/suite/src/actions/wallet/__fixtures__/blockchainActions.ts @@ -1,6 +1,6 @@ -import { analyzeTransactions } from '@suite-common/wallet-utils/src/__fixtures__/transactionUtils'; -import { blockchainActions, transactionsActions, accountsActions } from '@suite-common/wallet-core'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { accountsActions, blockchainActions, transactionsActions } from '@suite-common/wallet-core'; +import { analyzeTransactions } from '@suite-common/wallet-utils/src/__fixtures__/transactionUtils'; const DEFAULT_ACCOUNT = { deviceState: '1stTestnetAddress@device_id:0', diff --git a/packages/suite/src/actions/wallet/__fixtures__/coinjoinAccountActions.ts b/packages/suite/src/actions/wallet/__fixtures__/coinjoinAccountActions.ts index d34beb96f92..3187405fa93 100644 --- a/packages/suite/src/actions/wallet/__fixtures__/coinjoinAccountActions.ts +++ b/packages/suite/src/actions/wallet/__fixtures__/coinjoinAccountActions.ts @@ -1,8 +1,8 @@ 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'; +import { Account } from 'src/types/wallet'; const ACCOUNT: Partial = { accountType: 'coinjoin', 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 de9bead12bd..354ad48e158 100644 --- a/packages/suite/src/actions/wallet/__fixtures__/moveLabelsForRbf/moveLabelsForRbfMetadataState.fixture.ts +++ b/packages/suite/src/actions/wallet/__fixtures__/moveLabelsForRbf/moveLabelsForRbfMetadataState.fixture.ts @@ -1,8 +1,8 @@ import { MetadataState } from '@suite-common/metadata-types'; import { - originalTransactionSpendAccount, chainSpendingReceivedCoins, + originalTransactionSpendAccount, } from './moveLabelsForRbfTransactions.fixture'; export const moveLabelsForRbfMetadataStateFixture: MetadataState = { diff --git a/packages/suite/src/actions/wallet/__fixtures__/publicKeyActions.ts b/packages/suite/src/actions/wallet/__fixtures__/publicKeyActions.ts index 8226a4f2d05..20cd128d890 100644 --- a/packages/suite/src/actions/wallet/__fixtures__/publicKeyActions.ts +++ b/packages/suite/src/actions/wallet/__fixtures__/publicKeyActions.ts @@ -2,8 +2,8 @@ import { connectInitThunk } from '@suite-common/connect-init'; import { testMocks } from '@suite-common/test-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; -import * as publicKeyActions from 'src/actions/wallet/publicKeyActions'; import { MODAL } from 'src/actions/suite/constants'; +import * as publicKeyActions from 'src/actions/wallet/publicKeyActions'; const { getSuiteDevice } = testMocks; diff --git a/packages/suite/src/actions/wallet/__fixtures__/receiveActions.ts b/packages/suite/src/actions/wallet/__fixtures__/receiveActions.ts index 66f74976dbb..bf86466aea2 100644 --- a/packages/suite/src/actions/wallet/__fixtures__/receiveActions.ts +++ b/packages/suite/src/actions/wallet/__fixtures__/receiveActions.ts @@ -3,8 +3,8 @@ 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 * as receiveActions from 'src/actions/wallet/receiveActions'; import { RECEIVE } from '../constants'; diff --git a/packages/suite/src/actions/wallet/__tests__/blockchainActions.test.ts b/packages/suite/src/actions/wallet/__tests__/blockchainActions.test.ts index 7e728eca520..116b6a41cbc 100644 --- a/packages/suite/src/actions/wallet/__tests__/blockchainActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/blockchainActions.test.ts @@ -1,20 +1,20 @@ -import { PROTO } from '@trezor/connect'; import { testMocks } from '@suite-common/test-utils'; import { notificationsActions, notificationsReducer } from '@suite-common/toast-notifications'; import { + feesReducer, initBlockchainThunk, + onBlockMinedThunk, onBlockchainConnectThunk, onBlockchainDisconnectThunk, - onBlockMinedThunk, onBlockchainNotificationThunk, preloadFeeInfoThunk, setCustomBackendThunk, updateFeeInfoThunk, - feesReducer, } from '@suite-common/wallet-core'; +import { PROTO } from '@trezor/connect'; +import { accountsReducer, blockchainReducer, transactionsReducer } from 'src/reducers/wallet'; import { configureStore, filterThunkActionTypes } from 'src/support/tests/configureStore'; -import { accountsReducer, transactionsReducer, blockchainReducer } from 'src/reducers/wallet'; import * as fixtures from '../__fixtures__/blockchainActions'; diff --git a/packages/suite/src/actions/wallet/__tests__/cardanoStakingActions.test.ts b/packages/suite/src/actions/wallet/__tests__/cardanoStakingActions.test.ts index faea584433b..0c300d4cc1c 100644 --- a/packages/suite/src/actions/wallet/__tests__/cardanoStakingActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/cardanoStakingActions.test.ts @@ -3,11 +3,11 @@ import { getUnixTime } from 'date-fns'; import { testMocks } from '@suite-common/test-utils'; 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 { WalletAccountTransaction } from 'src/types/wallet'; import { transactionsReducer } from 'src/reducers/wallet'; +import cardanoStakingReducer from 'src/reducers/wallet/cardanoStakingReducer'; +import { configureStore } from 'src/support/tests/configureStore'; +import { WalletAccountTransaction } from 'src/types/wallet'; import { CARDANO_STAKING } from '../constants'; diff --git a/packages/suite/src/actions/wallet/__tests__/coinjoinAccountActions.test.ts b/packages/suite/src/actions/wallet/__tests__/coinjoinAccountActions.test.ts index a31e4c9018b..ed8a081996e 100644 --- a/packages/suite/src/actions/wallet/__tests__/coinjoinAccountActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/coinjoinAccountActions.test.ts @@ -1,17 +1,17 @@ import { combineReducers, createReducer } from '@reduxjs/toolkit'; -import { configureMockStore, initPreloadedState, testMocks } from '@suite-common/test-utils'; import { prepareMessageSystemReducer } from '@suite-common/message-system'; +import { configureMockStore, initPreloadedState, testMocks } from '@suite-common/test-utils'; -import { extraDependencies } from 'src/support/extraDependencies'; import { accountsReducer } from 'src/reducers/wallet'; import { coinjoinReducer } from 'src/reducers/wallet/coinjoinReducer'; import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; import { CoinjoinService } from 'src/services/coinjoin/coinjoinService'; +import { extraDependencies } from 'src/support/extraDependencies'; +import * as fixtures from '../__fixtures__/coinjoinAccountActions'; import * as coinjoinAccountActions from '../coinjoinAccountActions'; import * as coinjoinClientActions from '../coinjoinClientActions'; -import * as fixtures from '../__fixtures__/coinjoinAccountActions'; jest.mock('src/services/coinjoin/coinjoinService', () => { const mock = jest.requireActual('../__fixtures__/mockCoinjoinService'); diff --git a/packages/suite/src/actions/wallet/__tests__/coinjoinClientActions.test.ts b/packages/suite/src/actions/wallet/__tests__/coinjoinClientActions.test.ts index f7615e5a05c..6ea101888ee 100644 --- a/packages/suite/src/actions/wallet/__tests__/coinjoinClientActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/coinjoinClientActions.test.ts @@ -1,28 +1,28 @@ import { combineReducers, createReducer } from '@reduxjs/toolkit'; +import { prepareMessageSystemReducer } from '@suite-common/message-system'; import { configureMockStore, initPreloadedState, testMocks } from '@suite-common/test-utils'; import { promiseAllSequence } from '@trezor/utils'; -import { prepareMessageSystemReducer } from '@suite-common/message-system'; -import { db } from 'src/storage'; +import { coinjoinMiddleware } from 'src/middlewares/wallet/coinjoinMiddleware'; +import modalReducer from 'src/reducers/suite/modalReducer'; import { accountsReducer } from 'src/reducers/wallet'; import { coinjoinReducer } from 'src/reducers/wallet/coinjoinReducer'; import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; -import { extraDependencies } from 'src/support/extraDependencies'; -import modalReducer from 'src/reducers/suite/modalReducer'; -import { coinjoinMiddleware } from 'src/middlewares/wallet/coinjoinMiddleware'; import { CoinjoinService } from 'src/services/coinjoin/coinjoinService'; +import { db } from 'src/storage'; +import { extraDependencies } from 'src/support/extraDependencies'; +import * as fixtures from '../__fixtures__/coinjoinClientActions'; import { + clientEmitException, initCoinjoinService, - onCoinjoinRoundChanged, onCoinjoinClientRequest, - setDebugSettings, - clientEmitException, + onCoinjoinRoundChanged, pauseCoinjoinSession, + setDebugSettings, stopCoinjoinSession, } from '../coinjoinClientActions'; -import * as fixtures from '../__fixtures__/coinjoinClientActions'; const TrezorConnect = testMocks.getTrezorConnectMock(); jest.mock('src/services/coinjoin/coinjoinService', () => { diff --git a/packages/suite/src/actions/wallet/__tests__/discoveryActions.test.ts b/packages/suite/src/actions/wallet/__tests__/discoveryActions.test.ts index d5777e219c4..429460244db 100644 --- a/packages/suite/src/actions/wallet/__tests__/discoveryActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/discoveryActions.test.ts @@ -1,35 +1,35 @@ // unit test for discovery actions // data provided by TrezorConnect are mocked +import { BITCOIN_ONLY_SYMBOLS } from '@suite-common/suite-constants'; +import { testMocks } from '@suite-common/test-utils'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import { DiscoveryStatus } from '@suite-common/wallet-constants'; import { - prepareDiscoveryReducer, accountsActions, createDiscoveryThunk, + prepareDiscoveryReducer, restartDiscoveryThunk, + selectIsDiscoveryAuthConfirmationRequired, startDiscoveryThunk, stopDiscoveryThunk, updateNetworkSettingsThunk, - selectIsDiscoveryAuthConfirmationRequired, } from '@suite-common/wallet-core'; -import { ArrayElement } from '@trezor/type-utils'; -import { testMocks } from '@suite-common/test-utils'; -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_SYMBOLS } from '@suite-common/suite-constants'; +import { ArrayElement } from '@trezor/type-utils'; -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 { accountsReducer } from 'src/reducers/wallet'; +import walletSettingsReducer from 'src/reducers/wallet/settingsReducer'; import { extraDependencies } from 'src/support/extraDependencies'; +import { configureStore, filterThunkActionTypes } from 'src/support/tests/configureStore'; import { - paramsError, + changeNetworksFixtures, fixtures, interruptionFixtures, - changeNetworksFixtures, + paramsError, unavailableCapabilities, } from '../__fixtures__/discoveryActions'; diff --git a/packages/suite/src/actions/wallet/__tests__/formDraftActions.test.ts b/packages/suite/src/actions/wallet/__tests__/formDraftActions.test.ts index bb85f078e6b..675cef1fc82 100644 --- a/packages/suite/src/actions/wallet/__tests__/formDraftActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/formDraftActions.test.ts @@ -1,5 +1,5 @@ -import { configureStore } from 'src/support/tests/configureStore'; import formDraftReducer, { FormDraftState } from 'src/reducers/wallet/formDraftReducer'; +import { configureStore } from 'src/support/tests/configureStore'; import * as formDraftActions from '../formDraftActions'; diff --git a/packages/suite/src/actions/wallet/__tests__/moveLabelsForRbfActions.test.ts b/packages/suite/src/actions/wallet/__tests__/moveLabelsForRbfActions.test.ts index 6ac89d536f4..bcd5c1b777f 100644 --- a/packages/suite/src/actions/wallet/__tests__/moveLabelsForRbfActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/moveLabelsForRbfActions.test.ts @@ -2,23 +2,23 @@ import { combineReducers } from '@reduxjs/toolkit'; import { configureMockStore, initPreloadedState } from '@suite-common/test-utils'; +import metadataReducer, { + selectLabelingDataForAccount, +} from '../../../reducers/suite/metadataReducer'; +import suiteReducer from '../../../reducers/suite/suiteReducer'; import { accountsReducer, transactionsReducer } from '../../../reducers/wallet'; -import { findLabelsToBeMovedOrDeleted, moveLabelsForRbfAction } from '../moveLabelsForRbfActions'; import { accountReceivingCoins, accountSpendingCoins, moveLabelsForRbfAccountsFixture, } from '../__fixtures__/moveLabelsForRbf/moveLabelsForRbfAccounts.fixture'; +import { moveLabelsForRbfMetadataStateFixture } from '../__fixtures__/moveLabelsForRbf/moveLabelsForRbfMetadataState.fixture'; import { moveLabelsForRbfTransactionsFixture, originalTransactionSpendAccount, transactionSendingCoinsReplacement, } from '../__fixtures__/moveLabelsForRbf/moveLabelsForRbfTransactions.fixture'; -import metadataReducer, { - selectLabelingDataForAccount, -} from '../../../reducers/suite/metadataReducer'; -import { moveLabelsForRbfMetadataStateFixture } from '../__fixtures__/moveLabelsForRbf/moveLabelsForRbfMetadataState.fixture'; -import suiteReducer from '../../../reducers/suite/suiteReducer'; +import { findLabelsToBeMovedOrDeleted, moveLabelsForRbfAction } from '../moveLabelsForRbfActions'; const rootReducer = combineReducers({ wallet: combineReducers({ diff --git a/packages/suite/src/actions/wallet/__tests__/publicKeyActions.test.ts b/packages/suite/src/actions/wallet/__tests__/publicKeyActions.test.ts index b1f5f2dcee5..9c9e0bb4c85 100644 --- a/packages/suite/src/actions/wallet/__tests__/publicKeyActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/publicKeyActions.test.ts @@ -1,7 +1,7 @@ import { combineReducers, createReducer } from '@reduxjs/toolkit'; -import { configureMockStore, testMocks } from '@suite-common/test-utils'; import { connectInitThunk } from '@suite-common/connect-init'; +import { configureMockStore, testMocks } from '@suite-common/test-utils'; import { State as DeviceState } from '@suite-common/wallet-core'; import fixtures from '../__fixtures__/publicKeyActions'; diff --git a/packages/suite/src/actions/wallet/__tests__/receiveActions.test.ts b/packages/suite/src/actions/wallet/__tests__/receiveActions.test.ts index da0419e0d9d..abb05d96988 100644 --- a/packages/suite/src/actions/wallet/__tests__/receiveActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/receiveActions.test.ts @@ -1,15 +1,15 @@ import { connectInitThunk } from '@suite-common/connect-init'; import { testMocks } from '@suite-common/test-utils'; +import type { NetworkSymbol, NetworkType } from '@suite-common/wallet-config'; import { prepareDeviceReducer } from '@suite-common/wallet-core'; import { AccountKey } from '@suite-common/wallet-types'; -import type { NetworkSymbol, NetworkType } from '@suite-common/wallet-config'; -import { configureStore } from 'src/support/tests/configureStore'; -import receiveReducer from 'src/reducers/wallet/receiveReducer'; -import suiteReducer from 'src/reducers/suite/suiteReducer'; -import modalReducer from 'src/reducers/suite/modalReducer'; import * as receiveActions from 'src/actions/wallet/receiveActions'; +import modalReducer from 'src/reducers/suite/modalReducer'; +import suiteReducer from 'src/reducers/suite/suiteReducer'; +import receiveReducer from 'src/reducers/wallet/receiveReducer'; import { extraDependencies } from 'src/support/extraDependencies'; +import { configureStore } from 'src/support/tests/configureStore'; import fixtures from '../__fixtures__/receiveActions'; diff --git a/packages/suite/src/actions/wallet/__tests__/selectedAccountActions.test.ts b/packages/suite/src/actions/wallet/__tests__/selectedAccountActions.test.ts index 8d647a2a4ba..8af3f46aa31 100644 --- a/packages/suite/src/actions/wallet/__tests__/selectedAccountActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/selectedAccountActions.test.ts @@ -1,8 +1,8 @@ -import { configureStore } from 'src/support/tests/configureStore'; import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; +import { configureStore } from 'src/support/tests/configureStore'; -import { syncSelectedAccount } from '../selectedAccountActions'; import fixtures from '../__fixtures__/selectedAccountActions'; +import { syncSelectedAccount } from '../selectedAccountActions'; const getInitialState = (_settings?: any) => ({ wallet: { diff --git a/packages/suite/src/actions/wallet/__tests__/tradingBuyActions.test.ts b/packages/suite/src/actions/wallet/__tests__/tradingBuyActions.test.ts index 17ae42ec153..7e3f15fa7d9 100644 --- a/packages/suite/src/actions/wallet/__tests__/tradingBuyActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/tradingBuyActions.test.ts @@ -2,8 +2,8 @@ import { BuyTrade, BuyTradeQuoteRequest, CryptoId } from 'invity-api'; import { invityAPI } from '@suite-common/invity'; -import { configureStore } from 'src/support/tests/configureStore'; import { tradingReducer } from 'src/reducers/wallet/tradingReducer'; +import { configureStore } from 'src/support/tests/configureStore'; import * as tradingBuyActions from '../tradingBuyActions'; diff --git a/packages/suite/src/actions/wallet/__tests__/tradingExchangeActions.test.ts b/packages/suite/src/actions/wallet/__tests__/tradingExchangeActions.test.ts index def79e824ad..fcd0c0b2884 100644 --- a/packages/suite/src/actions/wallet/__tests__/tradingExchangeActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/tradingExchangeActions.test.ts @@ -2,8 +2,8 @@ import { CryptoId, ExchangeTrade, ExchangeTradeQuoteRequest } from 'invity-api'; import { invityAPI } from '@suite-common/invity'; -import { configureStore } from 'src/support/tests/configureStore'; import { tradingReducer } from 'src/reducers/wallet/tradingReducer'; +import { configureStore } from 'src/support/tests/configureStore'; import * as tradingExchangeActions from '../tradingExchangeActions'; diff --git a/packages/suite/src/actions/wallet/__tests__/transactionActions.test.ts b/packages/suite/src/actions/wallet/__tests__/transactionActions.test.ts index df765092bbd..bc7a8a2c2c2 100644 --- a/packages/suite/src/actions/wallet/__tests__/transactionActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/transactionActions.test.ts @@ -1,13 +1,13 @@ import { configureStore } from '@reduxjs/toolkit'; -import { getAccountTransactions } from '@suite-common/wallet-utils'; +import { getTxsPerPage } from '@suite-common/suite-utils'; +import { testMocks } from '@suite-common/test-utils'; import { + TransactionsState, transactionsActions, transactionsInitialState, - TransactionsState, } from '@suite-common/wallet-core'; -import { getTxsPerPage } from '@suite-common/suite-utils'; -import { testMocks } from '@suite-common/test-utils'; +import { getAccountTransactions } from '@suite-common/wallet-utils'; import { transactionsReducer } from 'src/reducers/wallet'; diff --git a/packages/suite/src/actions/wallet/cardanoStakingActions.ts b/packages/suite/src/actions/wallet/cardanoStakingActions.ts index 6c66d8888eb..fc9a1d5389a 100644 --- a/packages/suite/src/actions/wallet/cardanoStakingActions.ts +++ b/packages/suite/src/actions/wallet/cardanoStakingActions.ts @@ -1,26 +1,26 @@ import { getUnixTime } from 'date-fns'; +import { getNetworkOptional } from '@suite-common/wallet-config'; +import { CARDANO_DEFAULT_TTL_OFFSET } from '@suite-common/wallet-constants'; +import { transactionsActions } from '@suite-common/wallet-core'; +import { getAccountTransactions, getNetworkName, isPending } from '@suite-common/wallet-utils'; import { BlockchainBlock } from '@trezor/connect'; import { - CARDANO_STAKE_POOL_PREVIEW_URL, - CARDANO_STAKE_POOL_MAINNET_URL, CARDANO_MAINNET_DREP, CARDANO_PREVIEW_DREP, + CARDANO_STAKE_POOL_MAINNET_URL, + CARDANO_STAKE_POOL_PREVIEW_URL, } from '@trezor/urls'; -import { isPending, getAccountTransactions, getNetworkName } 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 { Dispatch, GetState } from 'src/types/suite'; +import { Account, WalletAccountTransaction } from 'src/types/wallet'; import { - PendingStakeTx, - PoolsResponse, CardanoNetwork, DRepResponse, + PendingStakeTx, + PoolsResponse, } 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 } diff --git a/packages/suite/src/actions/wallet/coinjoinAccountActions.ts b/packages/suite/src/actions/wallet/coinjoinAccountActions.ts index 935e7e6bbb5..e39737a1aba 100644 --- a/packages/suite/src/actions/wallet/coinjoinAccountActions.ts +++ b/packages/suite/src/actions/wallet/coinjoinAccountActions.ts @@ -1,51 +1,51 @@ -import { ScanAccountProgress, BroadcastedTransactionDetails } from '@trezor/coinjoin'; -import TrezorConnect from '@trezor/connect'; -import { promiseAllSequence } from '@trezor/utils'; -import { notificationsActions } from '@suite-common/toast-notifications'; import { isDevEnv } from '@suite-common/suite-utils'; -import type { NetworkAccount, Network, NetworkSymbol } from '@suite-common/wallet-config'; -import { Account } from '@suite-common/wallet-types'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import type { Network, NetworkAccount, NetworkSymbol } from '@suite-common/wallet-config'; import { accountsActions, selectAccountByKey, - transactionsActions, - selectSelectedDevice, selectDevices, + selectSelectedDevice, + transactionsActions, } from '@suite-common/wallet-core'; +import { Account } from '@suite-common/wallet-types'; import { getAccountTransactions, sortByBIP44AddressIndex, substituteBip43Path, } from '@suite-common/wallet-utils'; +import { BroadcastedTransactionDetails, ScanAccountProgress } from '@trezor/coinjoin'; +import TrezorConnect from '@trezor/connect'; +import { promiseAllSequence } from '@trezor/utils'; -import { CoinjoinService, COORDINATOR_FEE_RATE_MULTIPLIER } from 'src/services/coinjoin'; -import type { CoinjoinSymbol } from 'src/services/coinjoin'; -import { - getAccountProgressHandle, - getRegisterAccountParams, - isCoinjoinSupportedSymbol, -} from 'src/utils/wallet/coinjoinUtils'; -import { Dispatch, GetState } from 'src/types/suite'; -import { - CoinjoinAccount, - CoinjoinConfig, - CoinjoinDiscoveryCheckpoint, - CoinjoinSessionParameters, -} from 'src/types/wallet/coinjoin'; +import { openModal } from 'src/actions/suite/modalActions'; +import { selectIsDeviceLocked } from 'src/reducers/suite/suiteReducer'; import { - selectCoinjoinAccounts, selectCoinjoinAccountByKey, + selectCoinjoinAccounts, selectCoinjoinSessionBlockerByAccountKey, + selectHasAnonymitySetError, selectIsAccountWithSessionByAccountKey, selectIsAccountWithSessionInCriticalPhaseByAccountKey, selectIsAnySessionInCriticalPhase, - selectHasAnonymitySetError, selectIsNothingToAnonymizeByAccountKey, selectSessionByAccountKey, selectWeightedAnonymityByAccountKey, } from 'src/reducers/wallet/coinjoinReducer'; -import { openModal } from 'src/actions/suite/modalActions'; -import { selectIsDeviceLocked } from 'src/reducers/suite/suiteReducer'; +import { COORDINATOR_FEE_RATE_MULTIPLIER, CoinjoinService } from 'src/services/coinjoin'; +import type { CoinjoinSymbol } from 'src/services/coinjoin'; +import { Dispatch, GetState } from 'src/types/suite'; +import { + CoinjoinAccount, + CoinjoinConfig, + CoinjoinDiscoveryCheckpoint, + CoinjoinSessionParameters, +} from 'src/types/wallet/coinjoin'; +import { + getAccountProgressHandle, + getRegisterAccountParams, + isCoinjoinSupportedSymbol, +} from 'src/utils/wallet/coinjoinUtils'; import * as coinjoinClientActions from './coinjoinClientActions'; import { goto } from '../suite/routerActions'; diff --git a/packages/suite/src/actions/wallet/coinjoinClientActions.ts b/packages/suite/src/actions/wallet/coinjoinClientActions.ts index 6b8706ee4c5..de7faa609d4 100644 --- a/packages/suite/src/actions/wallet/coinjoinClientActions.ts +++ b/packages/suite/src/actions/wallet/coinjoinClientActions.ts @@ -1,41 +1,41 @@ -import TrezorConnect from '@trezor/connect'; +import { Feature, selectIsFeatureDisabled } from '@suite-common/message-system'; +import { getDeviceInstances } from '@suite-common/suite-utils'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import { selectAccountByKey, selectDevices } from '@suite-common/wallet-core'; +import { Account, AddressDisplayOptions } from '@suite-common/wallet-types'; +import { getUtxoOutpoint } from '@suite-common/wallet-utils'; import { - CoinjoinStatusEvent, + CoinjoinClientEvents, CoinjoinClientVersion, - CoinjoinRoundEvent, - SerializedCoinjoinRound, CoinjoinRequestEvent, CoinjoinResponseEvent, - CoinjoinClientEvents, + CoinjoinRoundEvent, + CoinjoinStatusEvent, RoundPhase, + SerializedCoinjoinRound, } from '@trezor/coinjoin'; -import { arrayDistinct, arrayToDictionary, promiseAllSequence } from '@trezor/utils'; +import TrezorConnect from '@trezor/connect'; import { getOsName } from '@trezor/env-utils'; -import { selectAccountByKey, selectDevices } from '@suite-common/wallet-core'; -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 { arrayDistinct, arrayToDictionary, promiseAllSequence } from '@trezor/utils'; +import { onCancel as closeModal, openModal } from 'src/actions/suite/modalActions'; +import { selectAddressDisplayType, selectIsDeviceLocked } from 'src/reducers/suite/suiteReducer'; import { - prepareCoinjoinTransaction, - getSessionDeadline, - getEstimatedTimePerRound, - isCoinjoinSupportedSymbol, -} from 'src/utils/wallet/coinjoinUtils'; + selectCoinjoinAccounts, + selectRoundsDurationInHours, + selectRoundsLeftByAccountKey, + selectRoundsNeededByAccountKey, +} from 'src/reducers/wallet/coinjoinReducer'; import type { CoinjoinSymbol } from 'src/services/coinjoin'; import { CoinjoinService, getCoinjoinConfig } from 'src/services/coinjoin'; import { Dispatch, GetState } from 'src/types/suite'; -import { CoinjoinAccount, EndRoundState, CoinjoinDebugSettings } from 'src/types/wallet/coinjoin'; -import { onCancel as closeModal, openModal } from 'src/actions/suite/modalActions'; +import { CoinjoinAccount, CoinjoinDebugSettings, EndRoundState } from 'src/types/wallet/coinjoin'; import { - selectRoundsNeededByAccountKey, - selectRoundsLeftByAccountKey, - selectRoundsDurationInHours, - selectCoinjoinAccounts, -} from 'src/reducers/wallet/coinjoinReducer'; -import { selectAddressDisplayType, selectIsDeviceLocked } from 'src/reducers/suite/suiteReducer'; + getEstimatedTimePerRound, + getSessionDeadline, + isCoinjoinSupportedSymbol, + prepareCoinjoinTransaction, +} from 'src/utils/wallet/coinjoinUtils'; import * as COINJOIN from './constants/coinjoinConstants'; diff --git a/packages/suite/src/actions/wallet/constants/index.ts b/packages/suite/src/actions/wallet/constants/index.ts index 0d2dccae6d4..bcca341d7b7 100644 --- a/packages/suite/src/actions/wallet/constants/index.ts +++ b/packages/suite/src/actions/wallet/constants/index.ts @@ -1,16 +1,16 @@ -import * as SIGN_VERIFY from './signVerifyConstants'; -import * as RECEIVE from './receiveConstants'; -import * as WALLET from './walletConstants'; +import * as ACCOUNT_SEARCH from './accountSearch'; +import * as CARDANO_STAKING from './cardanoStakingConstants'; +import * as COINJOIN from './coinjoinConstants'; +import * as FORM_DRAFT from './formDraftConstants'; import * as GRAPH from './graphConstants'; +import * as RECEIVE from './receiveConstants'; +import * as SIGN_VERIFY from './signVerifyConstants'; import * as TRADING_BUY from './tradingBuyConstants'; +import * as TRADING_COMMON from './tradingCommonConstants'; import * as TRADING_EXCHANGE from './tradingExchangeConstants'; import * as TRADING_INFO from './tradingInfoConstants'; import * as TRADING_SELL from './tradingSellConstants'; -import * as TRADING_COMMON from './tradingCommonConstants'; -import * as ACCOUNT_SEARCH from './accountSearch'; -import * as FORM_DRAFT from './formDraftConstants'; -import * as CARDANO_STAKING from './cardanoStakingConstants'; -import * as COINJOIN from './coinjoinConstants'; +import * as WALLET from './walletConstants'; export { SIGN_VERIFY, diff --git a/packages/suite/src/actions/wallet/formDraftActions.ts b/packages/suite/src/actions/wallet/formDraftActions.ts index 3d22da1e63e..a052dfe0a60 100644 --- a/packages/suite/src/actions/wallet/formDraftActions.ts +++ b/packages/suite/src/actions/wallet/formDraftActions.ts @@ -1,7 +1,7 @@ import { FieldValues } from 'react-hook-form'; -import { getFormDraftKey } from '@suite-common/wallet-utils'; import type { FormDraftKeyPrefix } from '@suite-common/wallet-types'; +import { getFormDraftKey } from '@suite-common/wallet-utils'; import { Dispatch, GetState } from 'src/types/suite'; diff --git a/packages/suite/src/actions/wallet/graphActions.ts b/packages/suite/src/actions/wallet/graphActions.ts index 225d4f9671f..edfa6ae1e20 100644 --- a/packages/suite/src/actions/wallet/graphActions.ts +++ b/packages/suite/src/actions/wallet/graphActions.ts @@ -1,27 +1,27 @@ -import { isWithinInterval, fromUnixTime } from 'date-fns'; +import { fromUnixTime, isWithinInterval } from 'date-fns'; -import { tryGetAccountIdentity, isTrezorConnectBackendType } from '@suite-common/wallet-utils'; -import TrezorConnect, { StaticSessionId } from '@trezor/connect'; import { selectIsElectrumBackendSelected } from '@suite-common/wallet-core'; +import { isTrezorConnectBackendType, tryGetAccountIdentity } from '@suite-common/wallet-utils'; +import TrezorConnect, { StaticSessionId } from '@trezor/connect'; +import { State } from 'src/reducers/wallet/graphReducer'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; 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, + enhanceBlockchainAccountHistory, + ensureHistoryRates, } from 'src/utils/wallet/graph'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { State } from 'src/reducers/wallet/graphReducer'; import { - ACCOUNT_GRAPH_SUCCESS, ACCOUNT_GRAPH_FAIL, + ACCOUNT_GRAPH_START, + ACCOUNT_GRAPH_SUCCESS, AGGREGATED_GRAPH_START, AGGREGATED_GRAPH_SUCCESS, - ACCOUNT_GRAPH_START, SET_SELECTED_RANGE, SET_SELECTED_VIEW, } from './constants/graphConstants'; diff --git a/packages/suite/src/actions/wallet/moveLabelsForRbfActions.ts b/packages/suite/src/actions/wallet/moveLabelsForRbfActions.ts index fd3c16db986..61abbec705a 100644 --- a/packages/suite/src/actions/wallet/moveLabelsForRbfActions.ts +++ b/packages/suite/src/actions/wallet/moveLabelsForRbfActions.ts @@ -1,10 +1,10 @@ -import { findChainedTransactions, findTransactions } from '@suite-common/wallet-utils'; import { AccountLabels, AccountOutputLabels } from '@suite-common/metadata-types'; import { AccountKey, WalletAccountTransaction } from '@suite-common/wallet-types'; +import { findChainedTransactions, findTransactions } from '@suite-common/wallet-utils'; +import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; 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/publicKeyActions.ts b/packages/suite/src/actions/wallet/publicKeyActions.ts index ec8bb14921b..548095ae421 100644 --- a/packages/suite/src/actions/wallet/publicKeyActions.ts +++ b/packages/suite/src/actions/wallet/publicKeyActions.ts @@ -1,11 +1,11 @@ import { UserContextPayload } from '@suite-common/suite-types'; import { notificationsActions } from '@suite-common/toast-notifications'; -import TrezorConnect, { Success, Unsuccessful } from '@trezor/connect'; import { selectSelectedDevice } from '@suite-common/wallet-core'; import { getDerivationType } from '@suite-common/wallet-utils'; +import TrezorConnect, { Success, Unsuccessful } from '@trezor/connect'; import { onCancel, openModal, preserve } from 'src/actions/suite/modalActions'; -import { GetState, Dispatch } from 'src/types/suite'; +import { Dispatch, GetState } from 'src/types/suite'; export const openXpubModal = (params?: Pick, 'isConfirmed'>) => diff --git a/packages/suite/src/actions/wallet/receiveActions.ts b/packages/suite/src/actions/wallet/receiveActions.ts index bcb045fac65..f0f4510ae25 100644 --- a/packages/suite/src/actions/wallet/receiveActions.ts +++ b/packages/suite/src/actions/wallet/receiveActions.ts @@ -1,12 +1,12 @@ -import { notificationsActions } from '@suite-common/toast-notifications'; import { UserContextPayload } from '@suite-common/suite-types'; +import { notificationsActions } from '@suite-common/toast-notifications'; import { confirmAddressOnDeviceThunk, selectSelectedDevice } 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 { RECEIVE } from 'src/actions/wallet/constants'; import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; +import { Dispatch, GetState } from 'src/types/suite'; export type ReceiveAction = | { type: typeof RECEIVE.DISPOSE } diff --git a/packages/suite/src/actions/wallet/selectedAccountActions.ts b/packages/suite/src/actions/wallet/selectedAccountActions.ts index 0a7230ffccb..33e5542c883 100644 --- a/packages/suite/src/actions/wallet/selectedAccountActions.ts +++ b/packages/suite/src/actions/wallet/selectedAccountActions.ts @@ -1,20 +1,20 @@ +import * as comparisonUtils from '@suite-common/suite-utils'; +import { networks } from '@suite-common/wallet-config'; +import { DiscoveryStatus } from '@suite-common/wallet-constants'; import { - selectDeviceDiscovery, - selectSelectedDevice, accountsActions, blockchainActions, - discoveryActions, deviceActions, + discoveryActions, + selectDeviceDiscovery, + selectSelectedDevice, } from '@suite-common/wallet-core'; import { SelectedAccountStatus } from '@suite-common/wallet-types'; -import { networks } from '@suite-common/wallet-config'; -import { DiscoveryStatus } from '@suite-common/wallet-constants'; -import * as comparisonUtils from '@suite-common/suite-utils'; import { ROUTER } from 'src/actions/suite/constants'; import * as metadataActions from 'src/actions/suite/metadataActions'; +import { Action, AppState, Dispatch, GetState } from 'src/types/suite'; import { getSelectedAccount } from 'src/utils/wallet/accountUtils'; -import { Action, Dispatch, GetState, AppState } from 'src/types/suite'; const getAccountState = (state: AppState): SelectedAccountStatus => { const device = selectSelectedDevice(state); diff --git a/packages/suite/src/actions/wallet/send/sendFormThunks.ts b/packages/suite/src/actions/wallet/send/sendFormThunks.ts index b74127fb1eb..b7d477a0f64 100644 --- a/packages/suite/src/actions/wallet/send/sendFormThunks.ts +++ b/packages/suite/src/actions/wallet/send/sendFormThunks.ts @@ -1,35 +1,35 @@ import { G } from '@mobily/ts-belt'; import { isRejected } from '@reduxjs/toolkit'; +import { MetadataAddPayload } from '@suite-common/metadata-types'; import { createThunk } from '@suite-common/redux-utils'; import { - Account, - FormState, - GeneralPrecomposedTransactionFinal, - PrecomposedTransactionFinalRbf, -} from '@suite-common/wallet-types'; -import { + cancelSignSendFormTransactionThunk, enhancePrecomposedTransactionThunk, pushSendFormTransactionThunk, replaceTransactionThunk, + selectPrecomposedSendForm, selectSelectedDevice, selectSendFormDrafts, - signTransactionThunk, sendFormActions, - selectPrecomposedSendForm, - cancelSignSendFormTransactionThunk, + signTransactionThunk, } from '@suite-common/wallet-core'; +import { + Account, + FormState, + GeneralPrecomposedTransactionFinal, + PrecomposedTransactionFinalRbf, +} from '@suite-common/wallet-types'; import { isCardanoTx, isRbfTransaction } from '@suite-common/wallet-utils'; -import { MetadataAddPayload } from '@suite-common/metadata-types'; import { getSynchronize } from '@trezor/utils'; +import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; +import * as modalActions from 'src/actions/suite/modalActions'; +import { selectMetadata } from 'src/reducers/suite/metadataReducer'; import { - selectSelectedAccountKey, selectIsSelectedAccountLoaded, + selectSelectedAccountKey, } from 'src/reducers/wallet/selectedAccountReducer'; -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'; diff --git a/packages/suite/src/actions/wallet/signVerifyActions.ts b/packages/suite/src/actions/wallet/signVerifyActions.ts index e5094a1c9c7..76798177138 100644 --- a/packages/suite/src/actions/wallet/signVerifyActions.ts +++ b/packages/suite/src/actions/wallet/signVerifyActions.ts @@ -1,11 +1,11 @@ -import TrezorConnect, { Unsuccessful, Success } from '@trezor/connect'; import { notificationsActions } from '@suite-common/toast-notifications'; import { selectSelectedDevice } from '@suite-common/wallet-core'; import { AddressDisplayOptions } from '@suite-common/wallet-types'; +import TrezorConnect, { Success, Unsuccessful } from '@trezor/connect'; +import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; 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'; diff --git a/packages/suite/src/actions/wallet/stake/stakeFormActions.ts b/packages/suite/src/actions/wallet/stake/stakeFormActions.ts index d65525e08bc..4e65cc7569c 100644 --- a/packages/suite/src/actions/wallet/stake/stakeFormActions.ts +++ b/packages/suite/src/actions/wallet/stake/stakeFormActions.ts @@ -1,19 +1,19 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { FeeLevel } from '@trezor/connect'; -import { - calculateTotal, - calculateMax, - getExternalComposeOutput, - formatAmount, -} from '@suite-common/wallet-utils'; +import { NetworkSymbol, getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { ComposeActionContext } from '@suite-common/wallet-core'; import { - StakeFormState, + ExternalOutput, PrecomposedLevels, PrecomposedTransaction, - ExternalOutput, + StakeFormState, } from '@suite-common/wallet-types'; -import { ComposeActionContext } from '@suite-common/wallet-core'; -import { getNetworkDisplaySymbol, NetworkSymbol } from '@suite-common/wallet-config'; +import { + calculateMax, + calculateTotal, + formatAmount, + getExternalComposeOutput, +} from '@suite-common/wallet-utils'; +import { FeeLevel } from '@trezor/connect'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; type StakingParams = { feeInBaseUnits: string; diff --git a/packages/suite/src/actions/wallet/stake/stakeFormEthereumActions.ts b/packages/suite/src/actions/wallet/stake/stakeFormEthereumActions.ts index 917b9698221..6c61f596f4a 100644 --- a/packages/suite/src/actions/wallet/stake/stakeFormEthereumActions.ts +++ b/packages/suite/src/actions/wallet/stake/stakeFormEthereumActions.ts @@ -1,27 +1,27 @@ 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 { calculateEthFee, isPending, getAccountIdentity } from '@suite-common/wallet-utils'; -import { - StakeFormState, - PrecomposedTransaction, - PrecomposedTransactionFinal, - ExternalOutput, - AddressDisplayOptions, -} from '@suite-common/wallet-types'; +import { type NetworkSymbol } from '@suite-common/wallet-config'; import { MIN_ETH_AMOUNT_FOR_STAKING, MIN_ETH_BALANCE_FOR_STAKING, MIN_ETH_FOR_WITHDRAWALS, UNSTAKE_INTERCHANGES, } from '@suite-common/wallet-constants'; -import { selectSelectedDevice, ComposeActionContext } from '@suite-common/wallet-core'; -import { type NetworkSymbol } from '@suite-common/wallet-config'; +import { ComposeActionContext, selectSelectedDevice } from '@suite-common/wallet-core'; +import { + AddressDisplayOptions, + ExternalOutput, + PrecomposedTransaction, + PrecomposedTransactionFinal, + StakeFormState, +} from '@suite-common/wallet-types'; +import { calculateEthFee, getAccountIdentity, isPending } from '@suite-common/wallet-utils'; +import TrezorConnect, { FeeLevel } from '@trezor/connect'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Dispatch, GetState } from 'src/types/suite'; import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; +import { Dispatch, GetState } from 'src/types/suite'; import { getStakeTxGasLimit, prepareClaimEthTx, diff --git a/packages/suite/src/actions/wallet/stake/stakeFormSolanaActions.ts b/packages/suite/src/actions/wallet/stake/stakeFormSolanaActions.ts index ec16f718ced..1b1d19f0fe6 100644 --- a/packages/suite/src/actions/wallet/stake/stakeFormSolanaActions.ts +++ b/packages/suite/src/actions/wallet/stake/stakeFormSolanaActions.ts @@ -1,15 +1,4 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import TrezorConnect, { FeeLevel } from '@trezor/connect'; import { notificationsActions } from '@suite-common/toast-notifications'; -import { networkAmountToSmallestUnit } from '@suite-common/wallet-utils'; -import { - StakeFormState, - PrecomposedTransaction, - PrecomposedTransactionFinal, - ExternalOutput, - AddressDisplayOptions, -} from '@suite-common/wallet-types'; -import { ComposeActionContext, selectSelectedDevice } from '@suite-common/wallet-core'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { MIN_SOL_AMOUNT_FOR_STAKING, @@ -17,9 +6,20 @@ import { MIN_SOL_FOR_WITHDRAWALS, SOL_STAKING_OPERATION_FEE, } from '@suite-common/wallet-constants'; +import { ComposeActionContext, selectSelectedDevice } from '@suite-common/wallet-core'; +import { + AddressDisplayOptions, + ExternalOutput, + PrecomposedTransaction, + PrecomposedTransactionFinal, + StakeFormState, +} from '@suite-common/wallet-types'; +import { networkAmountToSmallestUnit } from '@suite-common/wallet-utils'; +import TrezorConnect, { FeeLevel } from '@trezor/connect'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Dispatch, GetState } from 'src/types/suite'; import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; +import { Dispatch, GetState } from 'src/types/suite'; import { getPubKeyFromAddress, prepareClaimSolTx, diff --git a/packages/suite/src/actions/wallet/stakeActions.ts b/packages/suite/src/actions/wallet/stakeActions.ts index 8b5a374eaea..5dbd6878191 100644 --- a/packages/suite/src/actions/wallet/stakeActions.ts +++ b/packages/suite/src/actions/wallet/stakeActions.ts @@ -1,13 +1,12 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import TrezorConnect from '@trezor/connect'; +import { notificationsActions } from '@suite-common/toast-notifications'; import { - selectSelectedDevice, + ComposeActionContext, replaceTransactionThunk, - syncAccountsWithBlockchainThunk, + selectSelectedDevice, stakeActions, - ComposeActionContext, + syncAccountsWithBlockchainThunk, } from '@suite-common/wallet-core'; -import { notificationsActions } from '@suite-common/toast-notifications'; +import { PrecomposedTransactionFinal, StakeFormState, StakeType } from '@suite-common/wallet-types'; import { formatNetworkAmount, isRbfTransaction, @@ -15,13 +14,14 @@ import { isSupportedSolStakingNetworkSymbol, tryGetAccountIdentity, } from '@suite-common/wallet-utils'; -import { StakeFormState, PrecomposedTransactionFinal, StakeType } from '@suite-common/wallet-types'; +import TrezorConnect from '@trezor/connect'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Dispatch, GetState } from 'src/types/suite'; -import * as modalActions from '../suite/modalActions'; import * as stakeFormEthereumActions from './stake/stakeFormEthereumActions'; import * as stakeFormSolanaActions from './stake/stakeFormSolanaActions'; +import * as modalActions from '../suite/modalActions'; import { openModal } from '../suite/modalActions'; export const composeTransaction = diff --git a/packages/suite/src/actions/wallet/tokenActions.ts b/packages/suite/src/actions/wallet/tokenActions.ts index 86e4b11be9d..7b398a138bf 100644 --- a/packages/suite/src/actions/wallet/tokenActions.ts +++ b/packages/suite/src/actions/wallet/tokenActions.ts @@ -1,7 +1,7 @@ -import { TokenInfo } from '@trezor/connect'; -import * as accountUtils from '@suite-common/wallet-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; import { accountsActions } from '@suite-common/wallet-core'; +import * as accountUtils from '@suite-common/wallet-utils'; +import { TokenInfo } from '@trezor/connect'; import { Dispatch } from 'src/types/suite'; import { Account } from 'src/types/wallet'; diff --git a/packages/suite/src/actions/wallet/trading/__fixtures__/tradingCommonActions/store.ts b/packages/suite/src/actions/wallet/trading/__fixtures__/tradingCommonActions/store.ts index 7777304550f..bff2bf73890 100644 --- a/packages/suite/src/actions/wallet/trading/__fixtures__/tradingCommonActions/store.ts +++ b/packages/suite/src/actions/wallet/trading/__fixtures__/tradingCommonActions/store.ts @@ -1,7 +1,7 @@ -import { Account } from 'src/types/wallet'; -import { tradingReducer } from 'src/reducers/wallet/tradingReducer'; -import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; import { transactionsReducer } from 'src/reducers/wallet'; +import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; +import { tradingReducer } from 'src/reducers/wallet/tradingReducer'; +import { Account } from 'src/types/wallet'; export const ACCOUNT: Account = { networkType: 'bitcoin', diff --git a/packages/suite/src/actions/wallet/trading/__tests__/tradingCommonActions.test.ts b/packages/suite/src/actions/wallet/trading/__tests__/tradingCommonActions.test.ts index 98142299e04..acc3be8ef01 100644 --- a/packages/suite/src/actions/wallet/trading/__tests__/tradingCommonActions.test.ts +++ b/packages/suite/src/actions/wallet/trading/__tests__/tradingCommonActions.test.ts @@ -1,17 +1,17 @@ import { State as DeviceState } from '@suite-common/wallet-core'; import type { DeepPartial } from '@trezor/type-utils'; -import { configureStore } from 'src/support/tests/configureStore'; -import { tradingReducer, ComposedTransactionInfo } from 'src/reducers/wallet/tradingReducer'; -import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; -import { transactionsReducer, accountsReducer } from 'src/reducers/wallet'; -import { SuiteState } from 'src/reducers/suite/suiteReducer'; import { DEFAULT_STORE } from 'src/actions/wallet/trading/__fixtures__/tradingCommonActions/store'; import { VERIFY_BUY_ADDRESS_FIXTURES, VERIFY_EXCHANGE_ADDRESS_FIXTURES, } from 'src/actions/wallet/trading/__fixtures__/tradingCommonActions/verifyAddress'; import * as tradingCommonActions from 'src/actions/wallet/trading/tradingCommonActions'; +import { SuiteState } from 'src/reducers/suite/suiteReducer'; +import { accountsReducer, transactionsReducer } from 'src/reducers/wallet'; +import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; +import { ComposedTransactionInfo, tradingReducer } from 'src/reducers/wallet/tradingReducer'; +import { configureStore } from 'src/support/tests/configureStore'; interface InitialState { device?: DeepPartial; diff --git a/packages/suite/src/actions/wallet/trading/tradingCommonActions.ts b/packages/suite/src/actions/wallet/trading/tradingCommonActions.ts index 0fab8cb0fba..5b4a4929760 100644 --- a/packages/suite/src/actions/wallet/trading/tradingCommonActions.ts +++ b/packages/suite/src/actions/wallet/trading/tradingCommonActions.ts @@ -1,8 +1,13 @@ import { CryptoId } from 'invity-api'; -import { isDesktop } from '@trezor/env-utils'; +import type { TradingType } from '@suite-common/invity'; import { notificationsActions } from '@suite-common/toast-notifications'; -import { PROTO } from '@trezor/connect'; +import { + confirmAddressOnDeviceThunk, + selectSelectedDevice, + toggleRememberDevice, +} from '@suite-common/wallet-core'; +import { AddressDisplayOptions, Output } from '@suite-common/wallet-types/src'; import { amountToSmallestUnit, formatAmount, @@ -10,23 +15,18 @@ import { hasNetworkFeatures, parseFormDraftKey, } from '@suite-common/wallet-utils'; -import { Output, AddressDisplayOptions } from '@suite-common/wallet-types/src'; -import { - confirmAddressOnDeviceThunk, - selectSelectedDevice, - toggleRememberDevice, -} from '@suite-common/wallet-core'; -import type { TradingType } from '@suite-common/invity'; +import { PROTO } from '@trezor/connect'; +import { isDesktop } from '@trezor/env-utils'; -import { GetState, Dispatch } from 'src/types/suite'; import * as modalActions from 'src/actions/suite/modalActions'; -import { getUnusedAddressFromAccount } from 'src/utils/wallet/trading/tradingUtils'; -import { Account } from 'src/types/wallet'; -import { ComposedTransactionInfo } from 'src/reducers/wallet/tradingReducer'; -import { submitRequestForm as envSubmitRequestForm } from 'src/utils/suite/env'; +import { TRADING_BUY, TRADING_COMMON, TRADING_EXCHANGE } from 'src/actions/wallet/constants'; import * as formDraftActions from 'src/actions/wallet/formDraftActions'; import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; -import { TRADING_BUY, TRADING_COMMON, TRADING_EXCHANGE } from 'src/actions/wallet/constants'; +import { ComposedTransactionInfo } from 'src/reducers/wallet/tradingReducer'; +import { Dispatch, GetState } from 'src/types/suite'; +import { Account } from 'src/types/wallet'; +import { submitRequestForm as envSubmitRequestForm } from 'src/utils/suite/env'; +import { getUnusedAddressFromAccount } from 'src/utils/wallet/trading/tradingUtils'; export type TradingCommonAction = | { diff --git a/packages/suite/src/actions/wallet/tradingBuyActions.ts b/packages/suite/src/actions/wallet/tradingBuyActions.ts index efa470c2b47..3fd8ae4dbc1 100644 --- a/packages/suite/src/actions/wallet/tradingBuyActions.ts +++ b/packages/suite/src/actions/wallet/tradingBuyActions.ts @@ -1,19 +1,19 @@ import { BuyListResponse, BuyProviderInfo, - BuyTradeQuoteRequest, BuyTrade, + BuyTradeQuoteRequest, CryptoId, FiatCurrencyCode, } from 'invity-api'; import { invityAPI, regional } from '@suite-common/invity'; -import { Account } from 'src/types/wallet'; -import { Dispatch } from 'src/types/suite'; import * as modalActions from 'src/actions/suite/modalActions'; import { verifyAddress as verifyBuyAddress } from 'src/actions/wallet/trading/tradingCommonActions'; +import { Dispatch } from 'src/types/suite'; import { TradingFiatCurrenciesProps } from 'src/types/trading/trading'; +import { Account } from 'src/types/wallet'; import { TRADING_BUY, TRADING_COMMON } from './constants'; diff --git a/packages/suite/src/actions/wallet/tradingExchangeActions.ts b/packages/suite/src/actions/wallet/tradingExchangeActions.ts index 0a713f883ae..1f91b682a68 100644 --- a/packages/suite/src/actions/wallet/tradingExchangeActions.ts +++ b/packages/suite/src/actions/wallet/tradingExchangeActions.ts @@ -1,19 +1,19 @@ import { + CryptoId, ExchangeListResponse, ExchangeProviderInfo, - ExchangeTradeQuoteRequest, ExchangeTrade, - CryptoId, + ExchangeTradeQuoteRequest, } from 'invity-api'; import { invityAPI } from '@suite-common/invity'; -import { Account } from 'src/types/wallet'; -import { Dispatch } from 'src/types/suite'; import * as modalActions from 'src/actions/suite/modalActions'; import { verifyAddress as verifyExchangeAddress } from 'src/actions/wallet/trading/tradingCommonActions'; +import { Dispatch } from 'src/types/suite'; +import { Account } from 'src/types/wallet'; -import { TRADING_EXCHANGE, TRADING_COMMON } from './constants'; +import { TRADING_COMMON, TRADING_EXCHANGE } from './constants'; export interface ExchangeInfo { exchangeList?: ExchangeListResponse; diff --git a/packages/suite/src/actions/wallet/tradingSellActions.ts b/packages/suite/src/actions/wallet/tradingSellActions.ts index 17e05d39b00..49ca303725b 100644 --- a/packages/suite/src/actions/wallet/tradingSellActions.ts +++ b/packages/suite/src/actions/wallet/tradingSellActions.ts @@ -8,9 +8,9 @@ import { import { invityAPI } from '@suite-common/invity'; -import { Account } from 'src/types/wallet'; -import { Dispatch } from 'src/types/suite'; import * as modalActions from 'src/actions/suite/modalActions'; +import { Dispatch } from 'src/types/suite'; +import { Account } from 'src/types/wallet'; import { TRADING_COMMON, TRADING_SELL } from './constants'; diff --git a/packages/suite/src/components/backup/AfterBackupCheckboxes.tsx b/packages/suite/src/components/backup/AfterBackupCheckboxes.tsx index 8d2bb9fae80..3f9064d396a 100644 --- a/packages/suite/src/components/backup/AfterBackupCheckboxes.tsx +++ b/packages/suite/src/components/backup/AfterBackupCheckboxes.tsx @@ -1,9 +1,9 @@ -import { spacings } from '@trezor/theme'; 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 { CheckItem, Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; 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 84a505a4f34..28897fdaa21 100644 --- a/packages/suite/src/components/backup/BackupSeedCard.tsx +++ b/packages/suite/src/components/backup/BackupSeedCard.tsx @@ -2,7 +2,7 @@ import { ReactNode, SyntheticEvent } from 'react'; import styled, { useTheme } from 'styled-components'; -import { variables, Checkbox, Card, Icon, IconName } from '@trezor/components'; +import { Card, Checkbox, Icon, IconName, variables } from '@trezor/components'; import { spacingsPx, typography } from '@trezor/theme'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/components/backup/BackupSeedCards.tsx b/packages/suite/src/components/backup/BackupSeedCards.tsx index 5b8e7e05069..b793c86d0c8 100644 --- a/packages/suite/src/components/backup/BackupSeedCards.tsx +++ b/packages/suite/src/components/backup/BackupSeedCards.tsx @@ -4,7 +4,7 @@ import { variables } from '@trezor/components'; import { ConfirmKey, toggleCheckboxByKey } from 'src/actions/backup/backupActions'; import { Translation } from 'src/components/suite/Translation'; -import { useSelector, useDispatch } from 'src/hooks/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { BackupSeedCard } from './BackupSeedCard'; diff --git a/packages/suite/src/components/backup/PreBackupCheckboxes.tsx b/packages/suite/src/components/backup/PreBackupCheckboxes.tsx index e3828faf90d..dcbebb6efce 100644 --- a/packages/suite/src/components/backup/PreBackupCheckboxes.tsx +++ b/packages/suite/src/components/backup/PreBackupCheckboxes.tsx @@ -1,9 +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 { CheckItem, Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; export const PreBackupCheckboxes = () => { const backup = useSelector(state => state.backup); diff --git a/packages/suite/src/components/backup/index.ts b/packages/suite/src/components/backup/index.ts index 6a1a227c4c7..96bddcad6ff 100644 --- a/packages/suite/src/components/backup/index.ts +++ b/packages/suite/src/components/backup/index.ts @@ -1,5 +1,5 @@ import { AfterBackupCheckboxes } from './AfterBackupCheckboxes'; -import { PreBackupCheckboxes } from './PreBackupCheckboxes'; import { BackupSeedCards } from './BackupSeedCards'; +import { PreBackupCheckboxes } from './PreBackupCheckboxes'; export { PreBackupCheckboxes, AfterBackupCheckboxes, BackupSeedCards }; diff --git a/packages/suite/src/components/dashboard/DashboardSection.tsx b/packages/suite/src/components/dashboard/DashboardSection.tsx index 3f3a8093a55..7616e1e6c88 100644 --- a/packages/suite/src/components/dashboard/DashboardSection.tsx +++ b/packages/suite/src/components/dashboard/DashboardSection.tsx @@ -1,6 +1,6 @@ -import { Ref, forwardRef, ReactElement, HTMLAttributes } from 'react'; +import { HTMLAttributes, ReactElement, Ref, forwardRef } from 'react'; -import { H3, Column, Row } from '@trezor/components'; +import { Column, H3, Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; type DashboardSectionProps = HTMLAttributes & { diff --git a/packages/suite/src/components/firmware/Buttons/FirmwareButtonsRow.tsx b/packages/suite/src/components/firmware/Buttons/FirmwareButtonsRow.tsx index 575b7c9b82f..668fcd74dd0 100644 --- a/packages/suite/src/components/firmware/Buttons/FirmwareButtonsRow.tsx +++ b/packages/suite/src/components/firmware/Buttons/FirmwareButtonsRow.tsx @@ -1,5 +1,5 @@ -import { spacings } from '@trezor/theme'; import { Row } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { FirmwareCloseButton } from './FirmwareCloseButton'; diff --git a/packages/suite/src/components/firmware/CheckSeedStep/CheckSeedStep.tsx b/packages/suite/src/components/firmware/CheckSeedStep/CheckSeedStep.tsx index d9c8c589bb3..179f7df71a5 100644 --- a/packages/suite/src/components/firmware/CheckSeedStep/CheckSeedStep.tsx +++ b/packages/suite/src/components/firmware/CheckSeedStep/CheckSeedStep.tsx @@ -2,13 +2,13 @@ import { useState } from 'react'; import styled from 'styled-components'; +import { selectIsDeviceBackedUp, selectSelectedDeviceLabelOrName } from '@suite-common/wallet-core'; import { Button, Checkbox, Column, variables } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; -import { selectIsDeviceBackedUp, selectSelectedDeviceLabelOrName } from '@suite-common/wallet-core'; -import { useDevice, useSelector } from 'src/hooks/suite'; -import { Translation } from 'src/components/suite'; import { OnboardingStepBox } from 'src/components/onboarding'; +import { Translation } from 'src/components/suite'; +import { useDevice, useSelector } from 'src/hooks/suite'; import { FirmwareButtonsRow } from '../Buttons/FirmwareButtonsRow'; import { FirmwareSwitchWarning } from '../FirmwareSwitchWarning'; diff --git a/packages/suite/src/components/firmware/FirmwareInitial.tsx b/packages/suite/src/components/firmware/FirmwareInitial.tsx index c4a54a9933b..94fc11ba310 100644 --- a/packages/suite/src/components/firmware/FirmwareInitial.tsx +++ b/packages/suite/src/components/firmware/FirmwareInitial.tsx @@ -2,23 +2,23 @@ import { useState } from 'react'; import styled from 'styled-components'; +import { useFirmwareInstallation } from '@suite-common/firmware'; import { ExtendedMessageDescriptor } from '@suite-common/intl-types'; +import { AcquiredDevice } from '@suite-common/suite-types'; import { getFwUpdateVersion } from '@suite-common/suite-utils'; +import { selectDevices } from '@suite-common/wallet-core'; import { Note, variables } from '@trezor/components'; -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 { getFirmwareVersion, isBitcoinOnlyDevice } from '@trezor/device-utils'; import { spacingsPx } from '@trezor/theme'; -import { useFirmwareInstallation } from '@suite-common/firmware'; +import { FirmwareInstallButton, FirmwareOffer } from 'src/components/firmware'; import { - OnboardingStepBox, OnboardingButtonSkip, + OnboardingStepBox, SkipStepConfirmation, } from 'src/components/onboarding'; import { useDevice, useOnboarding, useSelector } from 'src/hooks/suite'; -import { FirmwareInstallButton, FirmwareOffer } from 'src/components/firmware'; import { PrerequisitesGuide, Translation } from '../suite'; import { FirmwareButtonsRow } from './Buttons/FirmwareButtonsRow'; diff --git a/packages/suite/src/components/firmware/FirmwareInstallation.tsx b/packages/suite/src/components/firmware/FirmwareInstallation.tsx index 28ffd154125..e7e37ff7013 100644 --- a/packages/suite/src/components/firmware/FirmwareInstallation.tsx +++ b/packages/suite/src/components/firmware/FirmwareInstallation.tsx @@ -1,16 +1,16 @@ import styled from 'styled-components'; +import { useFirmwareInstallation } from '@suite-common/firmware'; import { Button } from '@trezor/components'; import { UI } from '@trezor/connect'; import { spacingsPx } from '@trezor/theme'; -import { useFirmwareInstallation } from '@suite-common/firmware'; -import { Translation, WebUsbButton } from 'src/components/suite'; import { FirmwareOffer, FirmwareProgressBar, ReconnectDevicePrompt } from 'src/components/firmware'; import { OnboardingStepBox } from 'src/components/onboarding'; -import { TrezorDevice } from 'src/types/suite'; -import { selectIsActionAbortable, selectHasTransportOfType } from 'src/reducers/suite/suiteReducer'; +import { Translation, WebUsbButton } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; +import { selectHasTransportOfType, selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; +import { TrezorDevice } from 'src/types/suite'; 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 9bbc1f7f41a..5fd72641f2f 100644 --- a/packages/suite/src/components/firmware/FirmwareOffer.tsx +++ b/packages/suite/src/components/firmware/FirmwareOffer.tsx @@ -1,18 +1,18 @@ import styled from 'styled-components'; +import { useFirmwareInstallation } from '@suite-common/firmware'; import { getChangelogUrl, getFwUpdateVersion, parseFirmwareChangelog, } from '@suite-common/suite-utils'; import { Icon, Markdown, Tooltip, variables } from '@trezor/components'; -import { getFirmwareVersion } from '@trezor/device-utils'; import { FirmwareType } from '@trezor/connect'; +import { getFirmwareVersion } from '@trezor/device-utils'; import { spacingsPx } from '@trezor/theme'; -import { useFirmwareInstallation } from '@suite-common/firmware'; import { Translation, TrezorLink } from 'src/components/suite'; -import { useTranslation, useSelector } from 'src/hooks/suite'; +import { useSelector, useTranslation } from 'src/hooks/suite'; import { getSuiteFirmwareTypeString } from 'src/utils/firmware'; const FwVersionWrapper = styled.div` diff --git a/packages/suite/src/components/firmware/FirmwareProgressBar.tsx b/packages/suite/src/components/firmware/FirmwareProgressBar.tsx index 102e041c21d..088f6b264d3 100644 --- a/packages/suite/src/components/firmware/FirmwareProgressBar.tsx +++ b/packages/suite/src/components/firmware/FirmwareProgressBar.tsx @@ -1,9 +1,9 @@ import styled, { useTheme } from 'styled-components'; +import { FirmwareOperationStatus, useFirmwareInstallation } from '@suite-common/firmware'; +import { TranslationKey } from '@suite-common/intl-types'; import { Box, Column, Icon, ProgressBar, Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { TranslationKey } from '@suite-common/intl-types'; -import { FirmwareOperationStatus, useFirmwareInstallation } from '@suite-common/firmware'; import { Translation } from '../suite'; diff --git a/packages/suite/src/components/firmware/ReconnectDevicePrompt.tsx b/packages/suite/src/components/firmware/ReconnectDevicePrompt.tsx index 8d5fa54c31c..eb1c1892116 100644 --- a/packages/suite/src/components/firmware/ReconnectDevicePrompt.tsx +++ b/packages/suite/src/components/firmware/ReconnectDevicePrompt.tsx @@ -1,17 +1,17 @@ import * as semver from 'semver'; -import { getFirmwareVersion } from '@trezor/device-utils'; -import { H2, DeviceAnimation, NewModal, Paragraph, BulletList, Column } from '@trezor/components'; +import { useFirmwareInstallation } from '@suite-common/firmware'; +import { TranslationKey } from '@suite-common/intl-types'; +import { selectSelectedDeviceLabelOrName } from '@suite-common/wallet-core'; +import { BulletList, Column, DeviceAnimation, H2, NewModal, Paragraph } from '@trezor/components'; import { DEVICE, Device, DeviceModelInternal, UI } from '@trezor/connect'; +import { getFirmwareVersion } from '@trezor/device-utils'; import { ConfirmOnDevice } from '@trezor/product-components'; -import { TranslationKey } from '@suite-common/intl-types'; import { spacings } from '@trezor/theme'; -import { selectSelectedDeviceLabelOrName } from '@suite-common/wallet-core'; -import { useFirmwareInstallation } from '@suite-common/firmware'; -import { useDevice, useSelector } from 'src/hooks/suite'; -import { DeviceConfirmImage } from 'src/components/suite/DeviceConfirmImage'; import { Translation, WebUsbButton } from 'src/components/suite'; +import { DeviceConfirmImage } from 'src/components/suite/DeviceConfirmImage'; +import { useDevice, useSelector } from 'src/hooks/suite'; import { selectHasTransportOfType } from 'src/reducers/suite/suiteReducer'; const RebootDeviceGraphics = ({ diff --git a/packages/suite/src/components/firmware/SelectCustomFirmware.tsx b/packages/suite/src/components/firmware/SelectCustomFirmware.tsx index b56ee2c692b..4d813b5142e 100644 --- a/packages/suite/src/components/firmware/SelectCustomFirmware.tsx +++ b/packages/suite/src/components/firmware/SelectCustomFirmware.tsx @@ -8,10 +8,10 @@ import { GITHUB_FW_BINARIES_URL } from '@trezor/urls'; import { Translation, TrezorLink } from 'src/components/suite'; import { DropZone } from 'src/components/suite/DropZone'; -import type { ExtendedMessageDescriptor } from 'src/types/suite'; -import { validateFirmware } from 'src/utils/firmware'; import { InstructionStep } from 'src/components/suite/InstructionStep'; import { useDevice } from 'src/hooks/suite'; +import type { ExtendedMessageDescriptor } from 'src/types/suite'; +import { validateFirmware } from 'src/utils/firmware'; const Container = styled.div` width: 100%; diff --git a/packages/suite/src/components/guide/Feedback.tsx b/packages/suite/src/components/guide/Feedback.tsx index 01bb8166c6f..8185f5ad990 100644 --- a/packages/suite/src/components/guide/Feedback.tsx +++ b/packages/suite/src/components/guide/Feedback.tsx @@ -1,26 +1,26 @@ -import { useState, useCallback, ReactNode, ChangeEvent } from 'react'; +import { ChangeEvent, ReactNode, useCallback, useState } from 'react'; import styled, { css } from 'styled-components'; -import { analytics, EventType } from '@trezor/suite-analytics'; +import { FeedbackCategory, FeedbackType, Rating, UserData } from '@suite-common/suite-types'; +import { Button, CollapsibleBox, Select, Textarea, variables } from '@trezor/components'; import { getFirmwareVersion } from '@trezor/device-utils'; -import { Textarea, Select, variables, Button, CollapsibleBox } from '@trezor/components'; -import { Rating, FeedbackCategory, FeedbackType, UserData } from '@suite-common/suite-types'; import { + getCommitHash, getEnvironment, + getOsName, + getSuiteVersion, getUserAgent, getWindowHeight, getWindowWidth, - getOsName, - getCommitHash, - getSuiteVersion, } from '@trezor/env-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { spacingsPx } from '@trezor/theme'; +import { sendFeedback, setView } from 'src/actions/suite/guideActions'; +import { GuideContent, GuideHeader, GuideViewWrapper } from 'src/components/guide'; 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}; diff --git a/packages/suite/src/components/guide/Guide.tsx b/packages/suite/src/components/guide/Guide.tsx index 9095fc845c7..ea74d81d9ba 100644 --- a/packages/suite/src/components/guide/Guide.tsx +++ b/packages/suite/src/components/guide/Guide.tsx @@ -2,20 +2,20 @@ 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 { EventType, analytics } from '@trezor/suite-analytics'; +import { spacingsPx, typography, zIndices } from '@trezor/theme'; -import { Translation } from 'src/components/suite'; import { setView } from 'src/actions/suite/guideActions'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { - GuideHeader, - GuideContent, - GuideViewWrapper, GuideCategories, + GuideContent, + GuideHeader, GuideSearch, + GuideViewWrapper, } from 'src/components/guide'; +import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; 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 07d1e47f2fe..38f8b4feadd 100644 --- a/packages/suite/src/components/guide/GuideArticle.tsx +++ b/packages/suite/src/components/guide/GuideArticle.tsx @@ -2,10 +2,10 @@ 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 { GuideContent, GuideHeader, GuideMarkdown, GuideViewWrapper } from 'src/components/guide'; import { Translation } from 'src/components/suite'; import { useGuideLoadArticle } from 'src/hooks/guide'; +import { useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; const ArticleWrapper = styled.div` diff --git a/packages/suite/src/components/guide/GuideCategories.tsx b/packages/suite/src/components/guide/GuideCategories.tsx index cb1a1e2dcf0..b0e080a932a 100644 --- a/packages/suite/src/components/guide/GuideCategories.tsx +++ b/packages/suite/src/components/guide/GuideCategories.tsx @@ -2,8 +2,8 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; -import { variables } from '@trezor/components'; import { GuideCategory } from '@suite-common/suite-types'; +import { variables } from '@trezor/components'; import { GuideNode } from 'src/components/guide'; diff --git a/packages/suite/src/components/guide/GuideCategory.tsx b/packages/suite/src/components/guide/GuideCategory.tsx index ed040e3c6ae..8df5130ddb8 100644 --- a/packages/suite/src/components/guide/GuideCategory.tsx +++ b/packages/suite/src/components/guide/GuideCategory.tsx @@ -2,18 +2,18 @@ import styled from 'styled-components'; import { variables } from '@trezor/components'; +import { setView } from 'src/actions/suite/guideActions'; import { - GuideHeader, + GuideCategories, GuideContent, - GuideViewWrapper, + GuideHeader, GuideNode, - GuideCategories, + GuideViewWrapper, } from 'src/components/guide'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; -import { setView } from 'src/actions/suite/guideActions'; -import { getNodeTitle } from 'src/utils/suite/guide'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { getNodeTitle } from 'src/utils/suite/guide'; const Section = styled.div` margin-bottom: 20px; diff --git a/packages/suite/src/components/guide/GuideHeader.tsx b/packages/suite/src/components/guide/GuideHeader.tsx index 79ea11ffac4..cb13196215d 100644 --- a/packages/suite/src/components/guide/GuideHeader.tsx +++ b/packages/suite/src/components/guide/GuideHeader.tsx @@ -1,15 +1,15 @@ import { useContext } from 'react'; -import styled, { css } from 'styled-components'; import { transparentize } from 'polished'; +import styled, { css } from 'styled-components'; -import { analytics, EventType } from '@trezor/suite-analytics'; import { IconButton, variables } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { typography, zIndices } from '@trezor/theme'; import { close } from 'src/actions/suite/guideActions'; +import { ContentScrolledContext, HeaderBreadcrumb } from 'src/components/guide'; import { useDispatch } from 'src/hooks/suite'; -import { HeaderBreadcrumb, ContentScrolledContext } from 'src/components/guide'; 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 2ac7e6472f5..dda5b6c79f3 100644 --- a/packages/suite/src/components/guide/GuideHint.tsx +++ b/packages/suite/src/components/guide/GuideHint.tsx @@ -1,4 +1,4 @@ -import { Children, BlockquoteHTMLAttributes, cloneElement, isValidElement } from 'react'; +import { BlockquoteHTMLAttributes, Children, cloneElement, isValidElement } from 'react'; import styled from 'styled-components'; diff --git a/packages/suite/src/components/guide/GuideNode.tsx b/packages/suite/src/components/guide/GuideNode.tsx index e8483c31c93..abe1e49c5c9 100644 --- a/packages/suite/src/components/guide/GuideNode.tsx +++ b/packages/suite/src/components/guide/GuideNode.tsx @@ -2,16 +2,16 @@ import { ReactNode } from 'react'; import styled, { useTheme } from 'styled-components'; -import { analytics, EventType } from '@trezor/suite-analytics'; +import { GuideNode as GuideNodeType } from '@suite-common/suite-types'; import { resolveStaticPath } from '@suite-common/suite-utils'; import { Icon, variables } from '@trezor/components'; -import { GuideNode as GuideNodeType } from '@suite-common/suite-types'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { borders, spacings } from '@trezor/theme'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { openNode } from 'src/actions/suite/guideActions'; -import { getNodeTitle } from 'src/utils/suite/guide'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { getNodeTitle } from 'src/utils/suite/guide'; const NodeButton = styled.button` display: flex; diff --git a/packages/suite/src/components/guide/GuideRouter.tsx b/packages/suite/src/components/guide/GuideRouter.tsx index b748d7c0e70..cf00fcdfc78 100644 --- a/packages/suite/src/components/guide/GuideRouter.tsx +++ b/packages/suite/src/components/guide/GuideRouter.tsx @@ -1,21 +1,21 @@ import { FreeFocusInside } from 'react-focus-lock'; -import styled, { css, keyframes } from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; +import styled, { css, keyframes } from 'styled-components'; -import { variables, Backdrop } from '@trezor/components'; +import { Backdrop, variables } from '@trezor/components'; import { useOnce } from '@trezor/react-utils'; import { zIndices } from '@trezor/theme'; -import { useSelector } from 'src/hooks/suite'; import { - SupportFeedbackSelection, + Feedback, Guide, GuideArticle, GuideCategory, - Feedback, + SupportFeedbackSelection, } from 'src/components/guide'; -import { useGuide, GUIDE_ANIMATION_DURATION_MS } from 'src/hooks/guide'; +import { GUIDE_ANIMATION_DURATION_MS, useGuide } from 'src/hooks/guide'; +import { useSelector } from 'src/hooks/suite'; const fullHeightStyle = css` position: absolute; diff --git a/packages/suite/src/components/guide/GuideSearch.tsx b/packages/suite/src/components/guide/GuideSearch.tsx index cde56565947..116a0ab5507 100644 --- a/packages/suite/src/components/guide/GuideSearch.tsx +++ b/packages/suite/src/components/guide/GuideSearch.tsx @@ -1,15 +1,15 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { Icon, Input, Spinner, variables } from '@trezor/components'; import type { GuideCategory } from '@suite-common/suite-types'; +import { Icon, Input, Spinner, variables } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; -import { Translation } from 'src/components/suite'; -import { useTranslation } from 'src/hooks/suite'; import { GuideNode } from 'src/components/guide'; +import { Translation } from 'src/components/suite'; import { useGuideSearch } from 'src/hooks/guide'; +import { useTranslation } from 'src/hooks/suite'; 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 dd3c2839f5d..554866d1bc1 100644 --- a/packages/suite/src/components/guide/GuideViewWrapper.tsx +++ b/packages/suite/src/components/guide/GuideViewWrapper.tsx @@ -1,4 +1,4 @@ -import { createContext, useCallback, useState, ReactNode, UIEventHandler } from 'react'; +import { ReactNode, UIEventHandler, createContext, useCallback, useState } from 'react'; import styled from 'styled-components'; diff --git a/packages/suite/src/components/guide/HeaderBreadcrumb.tsx b/packages/suite/src/components/guide/HeaderBreadcrumb.tsx index ade4f6acd67..67bc452ee82 100644 --- a/packages/suite/src/components/guide/HeaderBreadcrumb.tsx +++ b/packages/suite/src/components/guide/HeaderBreadcrumb.tsx @@ -1,17 +1,17 @@ -import styled from 'styled-components'; import { darken } from 'polished'; +import styled from 'styled-components'; -import { analytics, EventType } from '@trezor/suite-analytics'; -import { variables } from '@trezor/components'; import type { GuideCategory } from '@suite-common/suite-types'; +import { variables } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { openNode, setView } from 'src/actions/suite/guideActions'; 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 { useDispatch, useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { findAncestorNodes, getNodeTitle } from 'src/utils/suite/guide'; const BreadcrumbWrapper = styled.span` font-size: ${variables.FONT_SIZE.SMALL}; diff --git a/packages/suite/src/components/guide/OpenGuideFromTooltip.tsx b/packages/suite/src/components/guide/OpenGuideFromTooltip.tsx index 03eebc2f149..93c2578b579 100644 --- a/packages/suite/src/components/guide/OpenGuideFromTooltip.tsx +++ b/packages/suite/src/components/guide/OpenGuideFromTooltip.tsx @@ -1,10 +1,10 @@ import { MouseEvent } from 'react'; -import styled, { useTheme } from 'styled-components'; import { transparentize } from 'polished'; +import styled, { useTheme } from 'styled-components'; -import { borders, spacingsPx, typography } from '@trezor/theme'; import { Icon } from '@trezor/components'; +import { borders, spacingsPx, typography } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { useGuideOpenNode } from 'src/hooks/guide'; diff --git a/packages/suite/src/components/guide/SupportFeedbackSelection.tsx b/packages/suite/src/components/guide/SupportFeedbackSelection.tsx index 42552ad6529..0e7bf8a1c4a 100644 --- a/packages/suite/src/components/guide/SupportFeedbackSelection.tsx +++ b/packages/suite/src/components/guide/SupportFeedbackSelection.tsx @@ -1,18 +1,18 @@ import styled from 'styled-components'; -import { TREZOR_FORUM_URL, TREZOR_SUPPORT_URL } from '@trezor/urls'; -import { analytics, EventType } from '@trezor/suite-analytics'; -import { resolveStaticPath, isDevEnv } from '@suite-common/suite-utils'; +import { isDevEnv, resolveStaticPath } from '@suite-common/suite-utils'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; import { Icon, Link, variables } from '@trezor/components'; -import { isDesktop } from '@trezor/env-utils'; import { getFirmwareVersion } from '@trezor/device-utils'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { isDesktop } from '@trezor/env-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { borders } from '@trezor/theme'; +import { TREZOR_FORUM_URL, TREZOR_SUPPORT_URL } from '@trezor/urls'; -import { Translation } from 'src/components/suite'; import { setView } from 'src/actions/suite/guideActions'; +import { GuideContent, GuideHeader, GuideViewWrapper } from 'src/components/guide'; +import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { GuideViewWrapper, GuideHeader, GuideContent } from 'src/components/guide'; import { UpdateState } from 'src/reducers/suite/desktopUpdateReducer'; const Section = styled.div` diff --git a/packages/suite/src/components/guide/index.tsx b/packages/suite/src/components/guide/index.tsx index cbed590e860..f77b50af9f8 100644 --- a/packages/suite/src/components/guide/index.tsx +++ b/packages/suite/src/components/guide/index.tsx @@ -1,19 +1,19 @@ -import { GuideContent } from './GuideContent'; -import { GuideButton } from './GuideButton'; -import { GuideRouter } from './GuideRouter'; -import { GuideHeader } from './GuideHeader'; -import { HeaderBreadcrumb } from './HeaderBreadcrumb'; -import { GuideNode } from './GuideNode'; -import { GuideViewWrapper, ContentScrolledContext } from './GuideViewWrapper'; -import { GuideCategories } from './GuideCategories'; -import { GuideSearch } from './GuideSearch'; import { Feedback } from './Feedback'; -import { SupportFeedbackSelection } from './SupportFeedbackSelection'; import { Guide } from './Guide'; import { GuideArticle } from './GuideArticle'; +import { GuideButton } from './GuideButton'; +import { GuideCategories } from './GuideCategories'; import { GuideCategory } from './GuideCategory'; -import { OpenGuideFromTooltip } from './OpenGuideFromTooltip'; +import { GuideContent } from './GuideContent'; +import { GuideHeader } from './GuideHeader'; import { GuideMarkdown } from './GuideMarkdown'; +import { GuideNode } from './GuideNode'; +import { GuideRouter } from './GuideRouter'; +import { GuideSearch } from './GuideSearch'; +import { ContentScrolledContext, GuideViewWrapper } from './GuideViewWrapper'; +import { HeaderBreadcrumb } from './HeaderBreadcrumb'; +import { OpenGuideFromTooltip } from './OpenGuideFromTooltip'; +import { SupportFeedbackSelection } from './SupportFeedbackSelection'; export { GuideContent, diff --git a/packages/suite/src/components/onboarding/CollapsibleOnboardingCard.tsx b/packages/suite/src/components/onboarding/CollapsibleOnboardingCard.tsx index b99959e8a13..de0e28f79af 100644 --- a/packages/suite/src/components/onboarding/CollapsibleOnboardingCard.tsx +++ b/packages/suite/src/components/onboarding/CollapsibleOnboardingCard.tsx @@ -1,9 +1,8 @@ -import { ReactNode, HTMLAttributes } from 'react'; +import { HTMLAttributes, ReactNode } from 'react'; -import styled, { css } from 'styled-components'; import { motion } from 'framer-motion'; +import styled, { css } from 'styled-components'; -import { Elevation, borders, mapElevationToBackground, zIndices, spacings } from '@trezor/theme'; import { ElevationUp, H2, @@ -15,6 +14,7 @@ import { useElevation, variables, } from '@trezor/components'; +import { Elevation, borders, mapElevationToBackground, spacings, zIndices } from '@trezor/theme'; const headerVariants = { closed: { diff --git a/packages/suite/src/components/onboarding/Hologram.tsx b/packages/suite/src/components/onboarding/Hologram.tsx index 43ca1341a61..739344586da 100644 --- a/packages/suite/src/components/onboarding/Hologram.tsx +++ b/packages/suite/src/components/onboarding/Hologram.tsx @@ -2,12 +2,12 @@ import { useRef } from 'react'; import styled from 'styled-components'; -import { selectSelectedDevice } 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 { selectSelectedDevice } from '@suite-common/wallet-core'; +import { Banner, DeviceAnimation, variables } from '@trezor/components'; import { DeviceModelInternal } from '@trezor/connect'; +import { typography } from '@trezor/theme'; +import { TREZOR_RESELLERS_URL, TREZOR_SUPPORT_URL } from '@trezor/urls'; import { Translation, TrezorLink } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/onboarding/OnboardingLayout.tsx b/packages/suite/src/components/onboarding/OnboardingLayout.tsx index 18d9ca75dfe..e9e2bbbbb41 100644 --- a/packages/suite/src/components/onboarding/OnboardingLayout.tsx +++ b/packages/suite/src/components/onboarding/OnboardingLayout.tsx @@ -1,20 +1,20 @@ -import { useMemo, ReactNode } from 'react'; +import { ReactNode, useMemo } from 'react'; import styled from 'styled-components'; +import { selectBannerMessage } from '@suite-common/message-system'; 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 { spacings, spacingsPx, zIndices } from '@trezor/theme'; +import { TREZOR_SUPPORT_URL } from '@trezor/urls'; -import { 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 { OnboardingProgressBar } from 'src/components/onboarding'; +import { Translation } from 'src/components/suite'; import { MessageSystemBanner } from 'src/components/suite/banners'; +import steps from 'src/config/onboarding/steps'; +import { MAX_ONBOARDING_WIDTH } from 'src/constants/suite/layout'; +import { useOnboarding, useSelector } from 'src/hooks/suite'; import { ModalContextProvider } from 'src/support/suite/ModalContext'; import { TrafficLightOffset } from '../suite/TrafficLightOffset'; diff --git a/packages/suite/src/components/onboarding/OnboardingOption.tsx b/packages/suite/src/components/onboarding/OnboardingOption.tsx index f73377d27d9..bcf1849532a 100644 --- a/packages/suite/src/components/onboarding/OnboardingOption.tsx +++ b/packages/suite/src/components/onboarding/OnboardingOption.tsx @@ -1,4 +1,4 @@ -import { ReactNode, HTMLAttributes } from 'react'; +import { HTMLAttributes, ReactNode } from 'react'; import styled, { css } from 'styled-components'; diff --git a/packages/suite/src/components/onboarding/OnboardingProgressBar.tsx b/packages/suite/src/components/onboarding/OnboardingProgressBar.tsx index c264037019e..5453a811d46 100644 --- a/packages/suite/src/components/onboarding/OnboardingProgressBar.tsx +++ b/packages/suite/src/components/onboarding/OnboardingProgressBar.tsx @@ -1,4 +1,4 @@ -import { ReactNode, Fragment } from 'react'; +import { Fragment, ReactNode } from 'react'; import styled, { css, useTheme } from 'styled-components'; diff --git a/packages/suite/src/components/onboarding/OnboardingStepBox.tsx b/packages/suite/src/components/onboarding/OnboardingStepBox.tsx index ef55575ea90..7b5d49b1654 100644 --- a/packages/suite/src/components/onboarding/OnboardingStepBox.tsx +++ b/packages/suite/src/components/onboarding/OnboardingStepBox.tsx @@ -3,11 +3,11 @@ 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 { Backdrop } from '@trezor/components'; +import TrezorConnect from '@trezor/connect'; import { ConfirmOnDevice } from '@trezor/product-components'; +import { spacingsPx, zIndices } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import messages from 'src/support/messages'; diff --git a/packages/suite/src/components/onboarding/SkipStepConfirmation.tsx b/packages/suite/src/components/onboarding/SkipStepConfirmation.tsx index 6d2dc226722..4797f98a84f 100644 --- a/packages/suite/src/components/onboarding/SkipStepConfirmation.tsx +++ b/packages/suite/src/components/onboarding/SkipStepConfirmation.tsx @@ -2,10 +2,10 @@ import { ReactNode } from 'react'; import { NewModal } from '@trezor/components'; -import * as STEP from 'src/constants/onboarding/steps'; -import { AnyStepId } from 'src/types/onboarding'; import { Translation } from 'src/components/suite'; +import * as STEP from 'src/constants/onboarding/steps'; import { useOnboarding } from 'src/hooks/suite'; +import { AnyStepId } from 'src/types/onboarding'; type SkipStepConfirmationProps = { onCancel: () => void; diff --git a/packages/suite/src/components/onboarding/index.ts b/packages/suite/src/components/onboarding/index.ts index 1c2f868ddbe..fdbc248f16c 100644 --- a/packages/suite/src/components/onboarding/index.ts +++ b/packages/suite/src/components/onboarding/index.ts @@ -1,12 +1,12 @@ -import { OnboardingOption, OptionsWrapper, OptionsDivider } from './OnboardingOption'; -import { OnboardingButtonCta } from './Buttons/OnboardingButtonCta'; import { OnboardingButtonBack } from './Buttons/OnboardingButtonBack'; +import { OnboardingButtonCta } from './Buttons/OnboardingButtonCta'; import { OnboardingButtonSkip } from './Buttons/OnboardingButtonSkip'; -import { OnboardingLayout } from './OnboardingLayout'; import { Hologram } from './Hologram'; +import { OnboardingLayout } from './OnboardingLayout'; +import { OnboardingOption, OptionsDivider, OptionsWrapper } from './OnboardingOption'; +import { OnboardingProgressBar } from './OnboardingProgressBar'; import { OnboardingStepBox, type OnboardingStepBoxProps } from './OnboardingStepBox'; import { SkipStepConfirmation } from './SkipStepConfirmation'; -import { OnboardingProgressBar } from './OnboardingProgressBar'; export { OnboardingButtonCta, diff --git a/packages/suite/src/components/recovery/SelectRecoveryType.tsx b/packages/suite/src/components/recovery/SelectRecoveryType.tsx index b693128c007..8ddba042ca3 100644 --- a/packages/suite/src/components/recovery/SelectRecoveryType.tsx +++ b/packages/suite/src/components/recovery/SelectRecoveryType.tsx @@ -1,4 +1,4 @@ -import { OnboardingOption, OptionsWrapper, OptionsDivider } from 'src/components/onboarding'; +import { OnboardingOption, OptionsDivider, OptionsWrapper } from 'src/components/onboarding'; import { Translation } from 'src/components/suite'; interface SelectRecoveryTypeProps { diff --git a/packages/suite/src/components/recovery/SelectRecoveryWord.tsx b/packages/suite/src/components/recovery/SelectRecoveryWord.tsx index 0e91e53d7b2..23186d73d4a 100644 --- a/packages/suite/src/components/recovery/SelectRecoveryWord.tsx +++ b/packages/suite/src/components/recovery/SelectRecoveryWord.tsx @@ -1,5 +1,5 @@ -import { useRecovery } from 'src/hooks/suite'; import { WordInput, WordInputAdvanced } from 'src/components/suite'; +import { useRecovery } from 'src/hooks/suite'; export const SelectRecoveryWord = () => { const { wordRequestInputType } = useRecovery(); diff --git a/packages/suite/src/components/recovery/SelectWordCount.tsx b/packages/suite/src/components/recovery/SelectWordCount.tsx index 9c5e08b4b98..9dc3c68682f 100644 --- a/packages/suite/src/components/recovery/SelectWordCount.tsx +++ b/packages/suite/src/components/recovery/SelectWordCount.tsx @@ -1,8 +1,8 @@ import styled from 'styled-components'; -import { OnboardingOption, OptionsWrapper, OptionsDivider } from 'src/components/onboarding'; -import { WordCount } from 'src/types/recovery'; +import { OnboardingOption, OptionsDivider, OptionsWrapper } from 'src/components/onboarding'; import { Translation } from 'src/components/suite'; +import { WordCount } from 'src/types/recovery'; const StyledOption = styled(OnboardingOption)` justify-content: center; diff --git a/packages/suite/src/components/recovery/index.tsx b/packages/suite/src/components/recovery/index.tsx index 08bdc3d5dde..0e3200bdfb7 100644 --- a/packages/suite/src/components/recovery/index.tsx +++ b/packages/suite/src/components/recovery/index.tsx @@ -1,5 +1,5 @@ -import { SelectWordCount } from './SelectWordCount'; import { SelectRecoveryType } from './SelectRecoveryType'; import { SelectRecoveryWord } from './SelectRecoveryWord'; +import { SelectWordCount } from './SelectWordCount'; export { SelectWordCount, SelectRecoveryType, SelectRecoveryWord }; diff --git a/packages/suite/src/components/settings/DeviceBanner.tsx b/packages/suite/src/components/settings/DeviceBanner.tsx index a382edf73fd..b451ba9c116 100644 --- a/packages/suite/src/components/settings/DeviceBanner.tsx +++ b/packages/suite/src/components/settings/DeviceBanner.tsx @@ -2,11 +2,11 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; -import { Card, Column, LottieAnimation, Paragraph, Row, variables, Text } from '@trezor/components'; +import { Card, Column, LottieAnimation, Paragraph, Row, Text, variables } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { useDevice, useSelector } from 'src/hooks/suite'; import { WebUsbButton } from 'src/components/suite/WebUsbButton'; +import { useDevice, useSelector } from 'src/hooks/suite'; import { selectHasTransportOfType } from 'src/reducers/suite/suiteReducer'; import { AcquireDeviceButton } from '../suite/AcquireDeviceButton'; diff --git a/packages/suite/src/components/settings/SettingsLayout.tsx b/packages/suite/src/components/settings/SettingsLayout.tsx index 172a71801a6..c3da74e0f99 100644 --- a/packages/suite/src/components/settings/SettingsLayout.tsx +++ b/packages/suite/src/components/settings/SettingsLayout.tsx @@ -3,16 +3,16 @@ import { ReactNode, useMemo } from 'react'; import { Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { useDiscovery, useDispatch, useLayout, useSelector } from 'src/hooks/suite'; -import { SettingsLoading } from 'src/views/settings/SettingsLoader'; +import { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite'; import { - PageHeader, NavigationItem, + PageHeader, SubpageNavigation, } from 'src/components/suite/layouts/SuiteLayout'; -import { goto } from 'src/actions/suite/routerActions'; +import { useDiscovery, useDispatch, useLayout, useSelector } from 'src/hooks/suite'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; -import { Translation } from 'src/components/suite'; +import { SettingsLoading } from 'src/views/settings/SettingsLoader'; type SettingsLayoutProps = { title?: string; diff --git a/packages/suite/src/components/settings/SettingsSection.tsx b/packages/suite/src/components/settings/SettingsSection.tsx index 8f94fd9da66..3fcc378f4f9 100644 --- a/packages/suite/src/components/settings/SettingsSection.tsx +++ b/packages/suite/src/components/settings/SettingsSection.tsx @@ -1,6 +1,6 @@ import React, { ReactNode } from 'react'; -import { IconName, Card, Column, useMediaQuery, variables, InfoItem } from '@trezor/components'; +import { Card, Column, IconName, InfoItem, useMediaQuery, variables } from '@trezor/components'; import { spacings } from '@trezor/theme'; type SettingsSectionProps = { diff --git a/packages/suite/src/components/settings/SettingsSectionItem.tsx b/packages/suite/src/components/settings/SettingsSectionItem.tsx index 111a8543d3b..99e71d4cd46 100644 --- a/packages/suite/src/components/settings/SettingsSectionItem.tsx +++ b/packages/suite/src/components/settings/SettingsSectionItem.tsx @@ -1,8 +1,8 @@ import { ReactNode } from 'react'; import { SectionItem } from 'src/components/suite'; -import { useAnchor } from 'src/hooks/suite/useAnchor'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useAnchor } from 'src/hooks/suite/useAnchor'; interface SettingsSectionItemProps { anchorId: SettingsAnchor; diff --git a/packages/suite/src/components/suite/AccountLabel.tsx b/packages/suite/src/components/suite/AccountLabel.tsx index 8d57a7a9f3c..0ae0e79f17c 100644 --- a/packages/suite/src/components/suite/AccountLabel.tsx +++ b/packages/suite/src/components/suite/AccountLabel.tsx @@ -1,13 +1,13 @@ import styled from 'styled-components'; -import { BadgeSize, Row } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import type { AccountType, - NetworkSymbol, Bip43Path, + NetworkSymbol, NetworkType, } from '@suite-common/wallet-config'; +import { BadgeSize, Row } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { useDefaultAccountLabel } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/suite/AccountTypeBadge.tsx b/packages/suite/src/components/suite/AccountTypeBadge.tsx index 1f84ba86562..1d9bdb78679 100644 --- a/packages/suite/src/components/suite/AccountTypeBadge.tsx +++ b/packages/suite/src/components/suite/AccountTypeBadge.tsx @@ -1,6 +1,6 @@ -import { Badge, BadgeSize } from '@trezor/components'; -import { getAccountTypeName } from '@suite-common/wallet-utils'; import { AccountType, Bip43Path, NetworkType } from '@suite-common/wallet-config'; +import { getAccountTypeName } from '@suite-common/wallet-utils'; +import { Badge, BadgeSize } from '@trezor/components'; import { Translation } from './Translation'; diff --git a/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx b/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx index 69581e68bb9..052339ff85a 100644 --- a/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx +++ b/packages/suite/src/components/suite/AmountUnitSwitchWrapper.tsx @@ -2,8 +2,8 @@ import { MouseEvent, ReactNode } from 'react'; import styled from 'styled-components'; -import { TOOLTIP_DELAY_NONE, TOOLTIP_DELAY_NORMAL, Tooltip } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import { TOOLTIP_DELAY_NONE, TOOLTIP_DELAY_NORMAL, Tooltip } from '@trezor/components'; import { mediaQueries } from '@trezor/styles'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; diff --git a/packages/suite/src/components/suite/ChangeDeviceLabel.tsx b/packages/suite/src/components/suite/ChangeDeviceLabel.tsx index 90626fc69fc..14b32b05dff 100644 --- a/packages/suite/src/components/suite/ChangeDeviceLabel.tsx +++ b/packages/suite/src/components/suite/ChangeDeviceLabel.tsx @@ -1,18 +1,18 @@ -import { useState, ChangeEventHandler } from 'react'; +import { ChangeEventHandler, useState } from 'react'; import styled from 'styled-components'; -import { analytics, EventType } from '@trezor/suite-analytics'; +import { selectDeviceLabel, selectDeviceName } from '@suite-common/wallet-core'; import { Button, Input } from '@trezor/components'; -import { isAscii } from '@trezor/utils'; -import { spacingsPx } from '@trezor/theme'; import { breakpointMediaQueries } from '@trezor/styles'; -import { selectDeviceLabel, selectDeviceName } from '@suite-common/wallet-core'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { spacingsPx } from '@trezor/theme'; +import { isAscii } from '@trezor/utils'; -import { Translation } from 'src/components/suite'; -import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; +import { Translation } from 'src/components/suite'; import { MAX_LABEL_LENGTH } from 'src/constants/suite/device'; +import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; const Container = styled.div<{ $isVertical?: boolean }>` display: flex; diff --git a/packages/suite/src/components/suite/CheckItem.tsx b/packages/suite/src/components/suite/CheckItem.tsx index 8280cbab275..12808495ba0 100644 --- a/packages/suite/src/components/suite/CheckItem.tsx +++ b/packages/suite/src/components/suite/CheckItem.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react'; -import { Checkbox, Paragraph, Column } from '@trezor/components'; +import { Checkbox, Column, Paragraph } from '@trezor/components'; interface CheckItemProps { title: ReactNode; diff --git a/packages/suite/src/components/suite/CoinGroup/CoinGroup.tsx b/packages/suite/src/components/suite/CoinGroup/CoinGroup.tsx index ea0bc6aa4ae..e2ca6c622ab 100644 --- a/packages/suite/src/components/suite/CoinGroup/CoinGroup.tsx +++ b/packages/suite/src/components/suite/CoinGroup/CoinGroup.tsx @@ -4,10 +4,10 @@ import styled from 'styled-components'; import type { 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 { useDispatch } from 'src/hooks/suite'; import { CoinGroupHeader } from './CoinGroupHeader'; import { CoinListProps } from '../CoinList/CoinList'; diff --git a/packages/suite/src/components/suite/CoinList/Coin.tsx b/packages/suite/src/components/suite/CoinList/Coin.tsx index f846095f179..a65ea34b3cc 100644 --- a/packages/suite/src/components/suite/CoinList/Coin.tsx +++ b/packages/suite/src/components/suite/CoinList/Coin.tsx @@ -3,12 +3,12 @@ import { MouseEvent } from 'react'; import { transparentize } from 'polished'; import styled, { css, useTheme } from 'styled-components'; -import { variables, Icon } from '@trezor/components'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import { typography } from '@trezor/theme'; import { TranslationKey } from '@suite-common/intl-types'; +import { NetworkSymbol } from '@suite-common/wallet-config'; +import { Icon, variables } from '@trezor/components'; import { focusStyleTransition, getFocusShadowStyle } from '@trezor/components/src/utils/utils'; import { CoinLogo } from '@trezor/product-components'; +import { typography } from '@trezor/theme'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/CoinList/CoinList.tsx b/packages/suite/src/components/suite/CoinList/CoinList.tsx index 3813ab66946..859c16bcf5b 100644 --- a/packages/suite/src/components/suite/CoinList/CoinList.tsx +++ b/packages/suite/src/components/suite/CoinList/CoinList.tsx @@ -1,15 +1,15 @@ import styled from 'styled-components'; import { getCoinUnavailabilityMessage } from '@suite-common/suite-utils'; +import { Network, NetworkSymbol } from '@suite-common/wallet-config'; 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 { getCoinLabel } from 'src/utils/suite/getCoinLabel'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; +import { getCoinLabel } from 'src/utils/suite/getCoinLabel'; import { Coin } from './Coin'; diff --git a/packages/suite/src/components/suite/ConnectDevicePrompt.tsx b/packages/suite/src/components/suite/ConnectDevicePrompt.tsx index 8cd53af6bc3..a1214d03839 100644 --- a/packages/suite/src/components/suite/ConnectDevicePrompt.tsx +++ b/packages/suite/src/components/suite/ConnectDevicePrompt.tsx @@ -1,13 +1,13 @@ -import styled, { useTheme } from 'styled-components'; import { motion } from 'framer-motion'; +import styled, { useTheme } from 'styled-components'; import { - variables, - motionEasing, - LottieAnimation, - useElevation, ElevationUp, Icon, + LottieAnimation, + motionEasing, + useElevation, + variables, } from '@trezor/components'; import { isDesktop } from '@trezor/env-utils'; import { Elevation, mapElevationToBackground, mapElevationToBorder } from '@trezor/theme'; diff --git a/packages/suite/src/components/suite/DeviceAuthenticationExplainer.tsx b/packages/suite/src/components/suite/DeviceAuthenticationExplainer.tsx index 0064216452c..61ad3c3536a 100644 --- a/packages/suite/src/components/suite/DeviceAuthenticationExplainer.tsx +++ b/packages/suite/src/components/suite/DeviceAuthenticationExplainer.tsx @@ -1,7 +1,7 @@ import styled, { css } from 'styled-components'; -import { Icon, IconName, variables } from '@trezor/components'; import { TranslationKey } from '@suite-common/intl-types'; +import { Icon, IconName, variables } from '@trezor/components'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/DeviceConfirmImage.tsx b/packages/suite/src/components/suite/DeviceConfirmImage.tsx index 649fc8bc6b0..613af2b0178 100644 --- a/packages/suite/src/components/suite/DeviceConfirmImage.tsx +++ b/packages/suite/src/components/suite/DeviceConfirmImage.tsx @@ -1,5 +1,5 @@ import { TrezorDevice } from '@suite-common/suite-types'; -import { Image, ImageProps, ImageKey } from '@trezor/components'; +import { Image, ImageKey, ImageProps } from '@trezor/components'; import { Device } from '@trezor/connect'; interface DeviceConfirmImageProps extends Omit { diff --git a/packages/suite/src/components/suite/DeviceDisplay/DisplayPaginatedText.tsx b/packages/suite/src/components/suite/DeviceDisplay/DisplayPaginatedText.tsx index f8b8e9984a0..b76c6262c0f 100644 --- a/packages/suite/src/components/suite/DeviceDisplay/DisplayPaginatedText.tsx +++ b/packages/suite/src/components/suite/DeviceDisplay/DisplayPaginatedText.tsx @@ -1,13 +1,13 @@ import styled from 'styled-components'; -import { DeviceModelInternal } from '@trezor/connect'; import { Icon, IconName, IconProps } from '@trezor/components'; +import { DeviceModelInternal } from '@trezor/connect'; import { handleOnCopy } from 'src/utils/suite/deviceDisplay'; -import { ResultRow, parseTextToPagesAndLines } from './parseTextToPagesAndLines'; import { DeviceDisplayText } from './DeviceDisplayText'; import { DisplayPageSeparator } from './DisplayPageSeparator'; +import { ResultRow, parseTextToPagesAndLines } from './parseTextToPagesAndLines'; // 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/__tests__/DeviceDisplay.test.tsx b/packages/suite/src/components/suite/DeviceDisplay/__tests__/DeviceDisplay.test.tsx index c5bd163a430..f87d3c0d11c 100644 --- a/packages/suite/src/components/suite/DeviceDisplay/__tests__/DeviceDisplay.test.tsx +++ b/packages/suite/src/components/suite/DeviceDisplay/__tests__/DeviceDisplay.test.tsx @@ -3,11 +3,11 @@ import { prepareDeviceReducer } from '@suite-common/wallet-core'; import { DeviceModelInternal } from '@trezor/connect'; import { DeepPartial } from '@trezor/type-utils'; +import suiteReducer from '../../../../reducers/suite/suiteReducer'; +import { extraDependencies } from '../../../../support/extraDependencies'; +import { renderWithProviders } from '../../../../support/tests/hooksHelper'; 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/parseTextToPagesAndLines.ts b/packages/suite/src/components/suite/DeviceDisplay/parseTextToPagesAndLines.ts index b21ca10bf7c..f810c0935b5 100644 --- a/packages/suite/src/components/suite/DeviceDisplay/parseTextToPagesAndLines.ts +++ b/packages/suite/src/components/suite/DeviceDisplay/parseTextToPagesAndLines.ts @@ -1,10 +1,10 @@ import { DeviceModelInternal } from '@trezor/connect'; import { - MAX_ROWS_PER_PAGE, - MAX_CHARACTERS_ON_ROW, CHARACTER_OFFSET_FOR_CONTINUES_ARROW, CHARACTER_OFFSET_FOR_NEXT_ARROW, + MAX_CHARACTERS_ON_ROW, + MAX_ROWS_PER_PAGE, } from '../../../constants/suite/device'; export type ParseTextToLinesParams = { diff --git a/packages/suite/src/components/suite/DropZone.tsx b/packages/suite/src/components/suite/DropZone.tsx index 31f3b87a0fb..20126daf4b3 100644 --- a/packages/suite/src/components/suite/DropZone.tsx +++ b/packages/suite/src/components/suite/DropZone.tsx @@ -1,4 +1,4 @@ -import { useRef, useCallback, useMemo, useState, MouseEvent, DragEvent, ChangeEvent } from 'react'; +import { ChangeEvent, DragEvent, MouseEvent, useCallback, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; diff --git a/packages/suite/src/components/suite/Error.tsx b/packages/suite/src/components/suite/Error.tsx index e621b9e03c5..dd8f3520a3d 100644 --- a/packages/suite/src/components/suite/Error.tsx +++ b/packages/suite/src/components/suite/Error.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { H2, Paragraph, Button, variables } from '@trezor/components'; +import { Button, H2, Paragraph, variables } from '@trezor/components'; import { db } from 'src/storage'; import { reloadApp } from 'src/utils/suite/reload'; diff --git a/packages/suite/src/components/suite/Experiment/ExperimentWrapper.tsx b/packages/suite/src/components/suite/Experiment/ExperimentWrapper.tsx index 6d87c345fe7..c0be37f3702 100644 --- a/packages/suite/src/components/suite/Experiment/ExperimentWrapper.tsx +++ b/packages/suite/src/components/suite/Experiment/ExperimentWrapper.tsx @@ -1,6 +1,6 @@ import { ReactElement } from 'react'; -import { useExperiment, ExperimentId } from '@suite-common/message-system'; +import { ExperimentId, useExperiment } from '@suite-common/message-system'; interface ExperimentWrapperProps { id: ExperimentId; diff --git a/packages/suite/src/components/suite/FiatValue.tsx b/packages/suite/src/components/suite/FiatValue.tsx index 0b658d625a6..e54b6740367 100644 --- a/packages/suite/src/components/suite/FiatValue.tsx +++ b/packages/suite/src/components/suite/FiatValue.tsx @@ -1,17 +1,17 @@ import { ReactElement } from 'react'; -import styled from 'styled-components'; import type { FormatNumberOptions } from '@formatjs/intl'; +import styled from 'styled-components'; import { useFormatters } from '@suite-common/formatters'; -import { SkeletonRectangle } from '@trezor/components'; import { selectIsSpecificCoinDefinitionKnown } from '@suite-common/token-definitions'; import { TokenAddress } from '@suite-common/wallet-types'; +import { SkeletonRectangle } from '@trezor/components'; +import { HiddenPlaceholder } from 'src/components/suite'; import { useLoadingSkeleton, useSelector } from 'src/hooks/suite'; import type { UseFiatFromCryptoValueParams } from 'src/hooks/suite/useFiatFromCryptoValue'; import { useFiatFromCryptoValue } from 'src/hooks/suite/useFiatFromCryptoValue'; -import { HiddenPlaceholder } from 'src/components/suite'; import { HiddenPlaceholderProps } from './HiddenPlaceholder'; diff --git a/packages/suite/src/components/suite/FormattedCryptoAmount.tsx b/packages/suite/src/components/suite/FormattedCryptoAmount.tsx index 1cf5dba1570..16975871c3f 100644 --- a/packages/suite/src/components/suite/FormattedCryptoAmount.tsx +++ b/packages/suite/src/components/suite/FormattedCryptoAmount.tsx @@ -1,23 +1,23 @@ import styled from 'styled-components'; +import { isSignValuePositive } from '@suite-common/formatters'; +import { SignValue } from '@suite-common/suite-types'; import { + type NetworkSymbolExtended, getDisplaySymbol, getNetworkOptional, - type NetworkSymbolExtended, } from '@suite-common/wallet-config'; -import { SignValue } from '@suite-common/suite-types'; import { formatCoinBalance, localizeNumber, networkAmountToSmallestUnit, } from '@suite-common/wallet-utils'; -import { isSignValuePositive } from '@suite-common/formatters'; import { Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; -import { useSelector } from 'src/hooks/suite'; import { HiddenPlaceholder, Sign } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; +import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; 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 2bd138a8c08..47b7f2982c4 100644 --- a/packages/suite/src/components/suite/FormattedNftAmount.tsx +++ b/packages/suite/src/components/suite/FormattedNftAmount.tsx @@ -2,15 +2,15 @@ import { useTheme } from 'styled-components'; import { SignValue } from '@suite-common/suite-types'; import { isNftMultitokenTransfer } from '@suite-common/wallet-utils'; -import { TokenTransfer } from '@trezor/connect'; import { Box, Column, Row, Text } from '@trezor/components'; -import { spacings, TypographyStyle } from '@trezor/theme'; +import { TokenTransfer } from '@trezor/connect'; +import { TypographyStyle, spacings } from '@trezor/theme'; import { HiddenPlaceholder, Sign, 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/useSelector'; import { useTranslation } from 'src/hooks/suite'; +import { useSelector } from 'src/hooks/suite/useSelector'; import { BlurUrls } from 'src/views/wallet/tokens/common/BlurUrls'; export interface FormattedNftAmountProps { diff --git a/packages/suite/src/components/suite/HomescreenGallery.tsx b/packages/suite/src/components/suite/HomescreenGallery.tsx index f5b3c5bc31c..53bf9de74d4 100644 --- a/packages/suite/src/components/suite/HomescreenGallery.tsx +++ b/packages/suite/src/components/suite/HomescreenGallery.tsx @@ -4,10 +4,10 @@ import { getNarrowedDeviceModelInternal, resolveStaticPath } from '@suite-common import { DeviceModelInternal } from '@trezor/connect'; import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; -import { getHomescreens } from 'src/constants/suite/homescreens'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; -import { imagePathToHex } from 'src/utils/suite/homescreen'; +import { getHomescreens } from 'src/constants/suite/homescreens'; import { useDevice, useDispatch } from 'src/hooks/suite'; +import { imagePathToHex } from 'src/utils/suite/homescreen'; type HomescreensType = ReturnType; type AnyImageName = HomescreensType[keyof HomescreensType][number]; diff --git a/packages/suite/src/components/suite/PinMatrix/PinInput/InputPin.tsx b/packages/suite/src/components/suite/PinMatrix/PinInput/InputPin.tsx index 53c7e459188..539b1b336c1 100644 --- a/packages/suite/src/components/suite/PinMatrix/PinInput/InputPin.tsx +++ b/packages/suite/src/components/suite/PinMatrix/PinInput/InputPin.tsx @@ -2,7 +2,7 @@ import { MouseEvent } from 'react'; import styled, { useTheme } from 'styled-components'; -import { variables, Icon, Input } from '@trezor/components'; +import { Icon, Input, variables } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; // eslint-disable-next-line local-rules/no-override-ds-component diff --git a/packages/suite/src/components/suite/PinMatrix/PinMatrix.tsx b/packages/suite/src/components/suite/PinMatrix/PinMatrix.tsx index 38a4dafeecc..aca418ee1f4 100644 --- a/packages/suite/src/components/suite/PinMatrix/PinMatrix.tsx +++ b/packages/suite/src/components/suite/PinMatrix/PinMatrix.tsx @@ -1,15 +1,15 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; import styled, { useTheme } from 'styled-components'; +import { variables } from '@trezor/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 { DeviceMatrixExplanation, Translation, TrezorLink } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; +import { TrezorDevice } from 'src/types/suite'; import { PinInput } from './PinInput/PinInput'; diff --git a/packages/suite/src/components/suite/Preloader/Preloader.tsx b/packages/suite/src/components/suite/Preloader/Preloader.tsx index 2db8119849a..8e1cb85dac7 100644 --- a/packages/suite/src/components/suite/Preloader/Preloader.tsx +++ b/packages/suite/src/components/suite/Preloader/Preloader.tsx @@ -1,36 +1,36 @@ -import { FC, useEffect, PropsWithChildren } from 'react'; +import { FC, PropsWithChildren, useEffect } from 'react'; import { - selectSelectedDevice, selectIsFirmwareAuthenticityCheckDismissed, + selectSelectedDevice, } 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 { useGuideKeyboard } from 'src/hooks/guide'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { useWindowVisibility } from 'src/hooks/suite/useWindowVisibility'; import { - selectPrerequisite, - selectIsLoggedOut, - selectSuiteFlags, selectIsFirmwareAuthenticityCheckEnabledAndHardFailed, + selectIsLoggedOut, selectIsTransportInitialized, + selectPrerequisite, + selectSuiteFlags, } from 'src/reducers/suite/suiteReducer'; +import type { AppState } from 'src/types/suite'; +import { Onboarding } from 'src/views/onboarding'; import { SuiteStart } from 'src/views/start/SuiteStart'; +import { ErrorPage } from 'src/views/suite/ErrorPage'; import { ViewOnlyPromo } from 'src/views/view-only/ViewOnlyPromo'; -import { useWindowVisibility } from 'src/hooks/suite/useWindowVisibility'; -import { SuiteLayout } from '../layouts/SuiteLayout/SuiteLayout'; -import { InitialLoading } from './InitialLoading'; import { DatabaseUpgradeModal } from './DatabaseUpgradeModal'; +import { InitialLoading } from './InitialLoading'; +import { RouterAppWithParams } from '../../../constants/suite/routes'; import { PrerequisitesGuide } from '../PrerequisitesGuide/PrerequisitesGuide'; -import { LoggedOutLayout } from '../layouts/LoggedOutLayout'; -import { WelcomeLayout } from '../layouts/WelcomeLayout/WelcomeLayout'; import { DeviceCompromised } from '../SecurityCheck/DeviceCompromised'; -import { RouterAppWithParams } from '../../../constants/suite/routes'; import { useReportDeviceCompromised } from '../SecurityCheck/useReportDeviceCompromised'; +import { LoggedOutLayout } from '../layouts/LoggedOutLayout'; +import { SuiteLayout } from '../layouts/SuiteLayout/SuiteLayout'; +import { WelcomeLayout } from '../layouts/WelcomeLayout/WelcomeLayout'; const ROUTES_TO_SKIP_FIRMWARE_CHECK: RouterAppWithParams['app'][] = [ 'settings', 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 ebce28719f5..cf621922fc7 100644 --- a/packages/suite/src/components/suite/Preloader/__tests__/Preloader.test.tsx +++ b/packages/suite/src/components/suite/Preloader/__tests__/Preloader.test.tsx @@ -2,10 +2,10 @@ 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 { findByTestId, renderWithProviders } from 'src/support/tests/hooksHelper'; -import { Preloader } from '../Preloader'; import { AppState } from '../../../../reducers/store'; +import { Preloader } from '../Preloader'; // render only Translation.id in data-test attribute jest.mock('src/components/suite/Translation', () => ({ diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceAcquire.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceAcquire.tsx index 947f62c61ec..1a9bc69385d 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceAcquire.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceAcquire.tsx @@ -4,11 +4,11 @@ import { acquireDevice } from '@suite-common/wallet-core'; import { Button } from '@trezor/components'; import { Translation, TroubleshootingTips } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; import { - TROUBLESHOOTING_TIP_RECONNECT, TROUBLESHOOTING_TIP_CLOSE_ALL_TABS, + TROUBLESHOOTING_TIP_RECONNECT, } from 'src/components/suite/troubleshooting/tips'; +import { useDevice, useDispatch } from 'src/hooks/suite'; export const DeviceAcquire = () => { const { isLocked } = useDevice(); diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceBootloader.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceBootloader.tsx index ea6b2d3e3aa..56e889938f3 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceBootloader.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceBootloader.tsx @@ -3,9 +3,9 @@ import styled from 'styled-components'; import { isDeviceWithButtons } from '@suite-common/suite-utils'; import { IconButton } from '@trezor/components'; +import { goto } from 'src/actions/suite/routerActions'; import { Translation, TroubleshootingTips } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { TrezorDevice } from 'src/types/suite'; const WhiteSpace = styled.div` diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceConnect.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceConnect.tsx index 4707675ac4a..1080d328dba 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceConnect.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceConnect.tsx @@ -1,11 +1,11 @@ import { Translation, TroubleshootingTips, WebUsbButton } from 'src/components/suite'; import { TROUBLESHOOTING_TIP_BRIDGE_STATUS, - TROUBLESHOOTING_TIP_SUITE_DESKTOP, TROUBLESHOOTING_TIP_CABLE, - TROUBLESHOOTING_TIP_USB, TROUBLESHOOTING_TIP_DIFFERENT_COMPUTER, + TROUBLESHOOTING_TIP_SUITE_DESKTOP, TROUBLESHOOTING_TIP_UDEV, + TROUBLESHOOTING_TIP_USB, } from 'src/components/suite/troubleshooting/tips'; interface DeviceConnectProps { diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceInitialize.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceInitialize.tsx index 1d96e2cc70b..1259da90a74 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceInitialize.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceInitialize.tsx @@ -2,10 +2,10 @@ import { MouseEvent } from 'react'; import { Button } from '@trezor/components'; +import { enableOnboardingReducer, resetOnboarding } from 'src/actions/onboarding/onboardingActions'; +import { goto } from 'src/actions/suite/routerActions'; import { Translation, TroubleshootingTips } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; -import { enableOnboardingReducer, resetOnboarding } from 'src/actions/onboarding/onboardingActions'; export const DeviceInitialize = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceNoFirmware.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceNoFirmware.tsx index a0ec44ad5a6..796a0197c3b 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceNoFirmware.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceNoFirmware.tsx @@ -2,9 +2,9 @@ import { MouseEventHandler } from 'react'; import { Button } from '@trezor/components'; +import { goto } from 'src/actions/suite/routerActions'; import { Translation, TroubleshootingTips } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; export const DeviceNoFirmware = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceRecoveryMode.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceRecoveryMode.tsx index b059028093c..059dde217a5 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceRecoveryMode.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceRecoveryMode.tsx @@ -2,8 +2,8 @@ import { MouseEventHandler } from 'react'; import { Button } from '@trezor/components'; -import { Translation, TroubleshootingTips } from 'src/components/suite'; import { rerun } from 'src/actions/recovery/recoveryActions'; +import { Translation, TroubleshootingTips } from 'src/components/suite'; import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; export const DeviceRecoveryMode = () => { diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUnreadable.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUnreadable.tsx index a47887f70d4..bca5f6c221e 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUnreadable.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUnreadable.tsx @@ -3,13 +3,13 @@ import { isLinux } from '@trezor/env-utils'; import { Translation, TroubleshootingTips } from 'src/components/suite'; import { - TROUBLESHOOTING_TIP_SUITE_DESKTOP, + TROUBLESHOOTING_TIP_CLOSE_ALL_TABS, TROUBLESHOOTING_TIP_DIFFERENT_COMPUTER, - TROUBLESHOOTING_TIP_UNREADABLE_HID, - TROUBLESHOOTING_TIP_SUITE_DESKTOP_TOGGLE_BRIDGE, TROUBLESHOOTING_TIP_RECONNECT, - TROUBLESHOOTING_TIP_CLOSE_ALL_TABS, + TROUBLESHOOTING_TIP_SUITE_DESKTOP, + TROUBLESHOOTING_TIP_SUITE_DESKTOP_TOGGLE_BRIDGE, TROUBLESHOOTING_TIP_UDEV, + TROUBLESHOOTING_TIP_UNREADABLE_HID, } from 'src/components/suite/troubleshooting/tips'; import { useSelector } from 'src/hooks/suite'; import type { TrezorDevice } from 'src/types/suite'; diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUpdateRequired.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUpdateRequired.tsx index 166a2405940..3c9e304ef90 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUpdateRequired.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUpdateRequired.tsx @@ -2,9 +2,9 @@ import { MouseEventHandler } from 'react'; import { Button } from '@trezor/components'; +import { goto } from 'src/actions/suite/routerActions'; import { Translation, TroubleshootingTips } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; export const DeviceUpdateRequired = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUsedElsewhere.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUsedElsewhere.tsx index 7cfb62eaf88..6862ff1596b 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUsedElsewhere.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/DeviceUsedElsewhere.tsx @@ -1,11 +1,11 @@ import { MouseEventHandler } from 'react'; import { Translation, TroubleshootingTips } from 'src/components/suite'; -import { useDevice } from 'src/hooks/suite'; import { - TROUBLESHOOTING_TIP_RECONNECT, TROUBLESHOOTING_TIP_CLOSE_ALL_TABS, + TROUBLESHOOTING_TIP_RECONNECT, } from 'src/components/suite/troubleshooting/tips'; +import { useDevice } from 'src/hooks/suite'; import { AcquireDeviceButton } from '../AcquireDeviceButton'; diff --git a/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx b/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx index de3421e3826..cac5e19832e 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/PrerequisitesGuide.tsx @@ -1,31 +1,31 @@ import { useMemo } from 'react'; -import styled from 'styled-components'; import { motion } from 'framer-motion'; +import styled from 'styled-components'; -import { getStatus, deviceNeedsAttention } from '@suite-common/suite-utils'; -import { Button, motionEasing } from '@trezor/components'; +import { deviceNeedsAttention, getStatus } from '@suite-common/suite-utils'; import { selectDevices, selectSelectedDevice } from '@suite-common/wallet-core'; +import { Button, motionEasing } from '@trezor/components'; +import { goto } from 'src/actions/suite/routerActions'; import { ConnectDevicePrompt, Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectHasTransportOfType, selectPrerequisite } from 'src/reducers/suite/suiteReducer'; -import { goto } from 'src/actions/suite/routerActions'; -import { Transport } from './Transport'; -import { DeviceConnect } from './DeviceConnect'; import { DeviceAcquire } from './DeviceAcquire'; -import { DeviceUnreadable } from './DeviceUnreadable'; -import { DeviceUnknown } from './DeviceUnknown'; -import { DeviceSeedless } from './DeviceSeedless'; -import { DeviceRecoveryMode } from './DeviceRecoveryMode'; -import { DeviceInitialize } from './DeviceInitialize'; import { DeviceBootloader } from './DeviceBootloader'; +import { DeviceConnect } from './DeviceConnect'; +import { DeviceDisconnectRequired } from './DeviceDisconnectRequired'; +import { DeviceInitialize } from './DeviceInitialize'; import { DeviceNoFirmware } from './DeviceNoFirmware'; +import { DeviceRecoveryMode } from './DeviceRecoveryMode'; +import { DeviceSeedless } from './DeviceSeedless'; +import { DeviceUnknown } from './DeviceUnknown'; +import { DeviceUnreadable } from './DeviceUnreadable'; import { DeviceUpdateRequired } from './DeviceUpdateRequired'; -import { DeviceDisconnectRequired } from './DeviceDisconnectRequired'; -import { MultiShareBackupInProgress } from './MultiShareBackupInProgress'; import { DeviceUsedElsewhere } from './DeviceUsedElsewhere'; +import { MultiShareBackupInProgress } from './MultiShareBackupInProgress'; +import { Transport } from './Transport'; 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 19e2f1f3190..cdd4ee8b485 100644 --- a/packages/suite/src/components/suite/PrerequisitesGuide/Transport.tsx +++ b/packages/suite/src/components/suite/PrerequisitesGuide/Transport.tsx @@ -2,15 +2,15 @@ import { isDesktop } from '@trezor/env-utils'; import { Translation, TroubleshootingTips } from 'src/components/suite'; import { - TROUBLESHOOTING_TIP_SUITE_DESKTOP, + TROUBLESHOOTING_ENABLE_IN_DEBUG, TROUBLESHOOTING_TIP_RESTART_COMPUTER, + TROUBLESHOOTING_TIP_SUITE_DESKTOP, TROUBLESHOOTING_TIP_WEBUSB_ENVIRONMENT, - TROUBLESHOOTING_ENABLE_IN_DEBUG, TipItem, } from 'src/components/suite/troubleshooting/tips'; -import { useBridgeDesktopApi } from '../../../hooks/suite/useBridgeDesktopApi'; import { useSelector } from '../../../hooks/suite'; +import { useBridgeDesktopApi } from '../../../hooks/suite/useBridgeDesktopApi'; import { selectIsDebugModeActive } from '../../../reducers/suite/suiteReducer'; const tipItems: TipItem[] = [ diff --git a/packages/suite/src/components/suite/QrCode.tsx b/packages/suite/src/components/suite/QrCode.tsx index 1e36a30755e..002d975a91a 100644 --- a/packages/suite/src/components/suite/QrCode.tsx +++ b/packages/suite/src/components/suite/QrCode.tsx @@ -1,7 +1,7 @@ import { QRCodeSVG } from 'qrcode.react'; import styled from 'styled-components'; -import { Icon, Tooltip, variables, intermediaryTheme } from '@trezor/components'; +import { Icon, Tooltip, intermediaryTheme, variables } from '@trezor/components'; import { CSSColor } from '@trezor/theme'; import { Translation } from './Translation'; diff --git a/packages/suite/src/components/suite/QuestionTooltip.tsx b/packages/suite/src/components/suite/QuestionTooltip.tsx index ab4ccc58c93..39d17008560 100644 --- a/packages/suite/src/components/suite/QuestionTooltip.tsx +++ b/packages/suite/src/components/suite/QuestionTooltip.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { Tooltip, H3 } from '@trezor/components'; +import { H3, Tooltip } from '@trezor/components'; import { Translation } from 'src/components/suite'; import { ExtendedMessageDescriptor } from 'src/types/suite'; diff --git a/packages/suite/src/components/suite/SecurityCheck/SecurityCheckLayout.tsx b/packages/suite/src/components/suite/SecurityCheck/SecurityCheckLayout.tsx index 7314f178b55..8d48e130c23 100644 --- a/packages/suite/src/components/suite/SecurityCheck/SecurityCheckLayout.tsx +++ b/packages/suite/src/components/suite/SecurityCheck/SecurityCheckLayout.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components'; -import { Image, variables } from '@trezor/components'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { Image, variables } from '@trezor/components'; import { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/suite/SecurityCheck/useReportDeviceCompromised.ts b/packages/suite/src/components/suite/SecurityCheck/useReportDeviceCompromised.ts index 9c20a9cfc43..65136105c4f 100644 --- a/packages/suite/src/components/suite/SecurityCheck/useReportDeviceCompromised.ts +++ b/packages/suite/src/components/suite/SecurityCheck/useReportDeviceCompromised.ts @@ -1,14 +1,14 @@ import { useEffect, useMemo } from 'react'; +import { isDeviceAcquired } from '@suite-common/suite-utils'; import { FIRMWARE } from '@trezor/connect'; import { getFirmwareVersion } from '@trezor/device-utils'; -import { isDeviceAcquired } from '@suite-common/suite-utils'; import { isArrayMember } from '@trezor/utils'; +import { hashCheckErrorScenarios } from 'src/constants/suite/firmware'; import { useDevice, useSelector } from 'src/hooks/suite'; -import { captureSentryMessage, withSentryScope } from 'src/utils/suite/sentry'; import { selectFirmwareRevisionCheckError } from 'src/reducers/suite/suiteReducer'; -import { hashCheckErrorScenarios } from 'src/constants/suite/firmware'; +import { captureSentryMessage, withSentryScope } from 'src/utils/suite/sentry'; export const reportCheckFail = ( checkType: 'Firmware revision' | 'Firmware hash' | 'Entropy', diff --git a/packages/suite/src/components/suite/Sign.tsx b/packages/suite/src/components/suite/Sign.tsx index 3355380e982..080a7ac7d91 100644 --- a/packages/suite/src/components/suite/Sign.tsx +++ b/packages/suite/src/components/suite/Sign.tsx @@ -1,7 +1,7 @@ import styled, { useTheme } from 'styled-components'; -import { SignValue } from '@suite-common/suite-types'; import { isSignValuePositive } from '@suite-common/formatters'; +import { SignValue } from '@suite-common/suite-types'; const StyledSign = styled.span<{ $color: string }>` color: ${({ $color }) => $color}; diff --git a/packages/suite/src/components/suite/StakeAmountWrapper.tsx b/packages/suite/src/components/suite/StakeAmountWrapper.tsx index 42637b68fdc..da8c4d38ae0 100644 --- a/packages/suite/src/components/suite/StakeAmountWrapper.tsx +++ b/packages/suite/src/components/suite/StakeAmountWrapper.tsx @@ -2,7 +2,7 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; -import { Tooltip, TOOLTIP_DELAY_NONE, TOOLTIP_DELAY_NORMAL } from '@trezor/components'; +import { TOOLTIP_DELAY_NONE, TOOLTIP_DELAY_NORMAL, Tooltip } from '@trezor/components'; import { mediaQueries } from '@trezor/styles'; import { goto } from 'src/actions/suite/routerActions'; diff --git a/packages/suite/src/components/suite/StakingFeature.tsx b/packages/suite/src/components/suite/StakingFeature.tsx index 580484f7cc9..553bdc14504 100644 --- a/packages/suite/src/components/suite/StakingFeature.tsx +++ b/packages/suite/src/components/suite/StakingFeature.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react'; -import { H3, Paragraph, IconCircle, IconName } from '@trezor/components'; +import { H3, IconCircle, IconName, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; interface StakingFeatureProps { diff --git a/packages/suite/src/components/suite/StakingProcess/StakingInfo.tsx b/packages/suite/src/components/suite/StakingProcess/StakingInfo.tsx index 5dd7b01be1f..56222444e56 100644 --- a/packages/suite/src/components/suite/StakingProcess/StakingInfo.tsx +++ b/packages/suite/src/components/suite/StakingProcess/StakingInfo.tsx @@ -1,22 +1,22 @@ import React from 'react'; import { useSelector } from 'react-redux'; -import { BulletList } from '@trezor/components'; -import { spacings } from '@trezor/theme'; +import { NetworkSymbol, NetworkType, getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { SOLANA_EPOCH_DAYS } from '@suite-common/wallet-constants'; import { - selectAccountStakeTransactions, - selectValidatorsQueue, - TransactionsRootState, + AccountsRootState, StakeRootState, + TransactionsRootState, + selectAccountStakeTransactions, selectPoolStatsApyData, - AccountsRootState, + selectValidatorsQueue, } from '@suite-common/wallet-core'; -import { SOLANA_EPOCH_DAYS } from '@suite-common/wallet-constants'; -import { getNetworkDisplaySymbol, NetworkSymbol, NetworkType } from '@suite-common/wallet-config'; +import { BulletList } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; -import { getDaysToAddToPool } from 'src/utils/suite/ethereumStaking'; import { CoinjoinRootState } from 'src/reducers/wallet/coinjoinReducer'; +import { getDaysToAddToPool } from 'src/utils/suite/ethereumStaking'; import { InfoRow } from './InfoRow'; diff --git a/packages/suite/src/components/suite/StakingProcess/UnstakingInfo.tsx b/packages/suite/src/components/suite/StakingProcess/UnstakingInfo.tsx index 766ca205078..607941de3e5 100644 --- a/packages/suite/src/components/suite/StakingProcess/UnstakingInfo.tsx +++ b/packages/suite/src/components/suite/StakingProcess/UnstakingInfo.tsx @@ -1,15 +1,15 @@ import React from 'react'; import { useSelector } from 'react-redux'; +import { NetworkSymbol, NetworkType, getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { SOLANA_EPOCH_DAYS } from '@suite-common/wallet-constants'; +import { StakeRootState, selectValidatorsQueue } from '@suite-common/wallet-core'; import { BulletList } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { selectValidatorsQueue, StakeRootState } from '@suite-common/wallet-core'; -import { getNetworkDisplaySymbol, NetworkSymbol, NetworkType } from '@suite-common/wallet-config'; -import { SOLANA_EPOCH_DAYS } from '@suite-common/wallet-constants'; import { Translation } from 'src/components/suite'; -import { getUnstakingPeriodInDays } from 'src/utils/suite/ethereumStaking'; import { CoinjoinRootState } from 'src/reducers/wallet/coinjoinReducer'; +import { getUnstakingPeriodInDays } from 'src/utils/suite/ethereumStaking'; import { InfoRow } from './InfoRow'; diff --git a/packages/suite/src/components/suite/Ticker/LastUpdateTooltip.tsx b/packages/suite/src/components/suite/Ticker/LastUpdateTooltip.tsx index 99291d926df..54d4b089f25 100644 --- a/packages/suite/src/components/suite/Ticker/LastUpdateTooltip.tsx +++ b/packages/suite/src/components/suite/Ticker/LastUpdateTooltip.tsx @@ -1,8 +1,8 @@ -import { FormattedRelativeTime } from 'react-intl'; import { ReactNode } from 'react'; +import { FormattedRelativeTime } from 'react-intl'; -import styled from 'styled-components'; import { differenceInMinutes } from 'date-fns'; +import styled from 'styled-components'; import { Tooltip } from '@trezor/components'; diff --git a/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx b/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx index 1b443f035b3..074c04a32b8 100644 --- a/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx +++ b/packages/suite/src/components/suite/Ticker/NoRatesTooltip.tsx @@ -2,7 +2,7 @@ import styled, { useTheme } from 'styled-components'; import { typography } from '@trezor/theme'; -import { Translation, TooltipSymbol } from 'src/components/suite'; +import { TooltipSymbol, Translation } from 'src/components/suite'; import { TranslationKey } from '../Translation'; diff --git a/packages/suite/src/components/suite/Ticker/PriceTicker.tsx b/packages/suite/src/components/suite/Ticker/PriceTicker.tsx index 176fe0ea861..3f5f09f7642 100644 --- a/packages/suite/src/components/suite/Ticker/PriceTicker.tsx +++ b/packages/suite/src/components/suite/Ticker/PriceTicker.tsx @@ -1,13 +1,13 @@ import styled from 'styled-components'; -import { typography } from '@trezor/theme'; -import type { TokenAddress } from '@suite-common/wallet-types'; import type { NetworkSymbol } from '@suite-common/wallet-config'; +import type { TokenAddress } from '@suite-common/wallet-types'; +import { typography } from '@trezor/theme'; import { FiatValue } from 'src/components/suite'; -import { NoRatesTooltip } from './NoRatesTooltip'; import { LastUpdateTooltip } from './LastUpdateTooltip'; +import { NoRatesTooltip } from './NoRatesTooltip'; 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 e196ff808d9..44bd749228a 100644 --- a/packages/suite/src/components/suite/Ticker/TrendTicker.tsx +++ b/packages/suite/src/components/suite/Ticker/TrendTicker.tsx @@ -1,16 +1,16 @@ import styled, { useTheme } from 'styled-components'; -import { spacingsPx, typography } from '@trezor/theme'; -import { Icon } from '@trezor/components'; -import { getFiatRateKey, localizePercentage } from '@suite-common/wallet-utils'; -import { selectFiatRatesByFiatRateKey } from '@suite-common/wallet-core'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import { selectFiatRatesByFiatRateKey } from '@suite-common/wallet-core'; import { TokenAddress } from '@suite-common/wallet-types'; +import { getFiatRateKey, localizePercentage } from '@suite-common/wallet-utils'; +import { Icon } from '@trezor/components'; +import { spacingsPx, typography } from '@trezor/theme'; 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 { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { NoRatesTooltip } from './NoRatesTooltip'; diff --git a/packages/suite/src/components/suite/TorLoader/TorLoader.tsx b/packages/suite/src/components/suite/TorLoader/TorLoader.tsx index 4b12b1b1903..6bfbd0f1ebd 100644 --- a/packages/suite/src/components/suite/TorLoader/TorLoader.tsx +++ b/packages/suite/src/components/suite/TorLoader/TorLoader.tsx @@ -1,14 +1,14 @@ -import { useState, useEffect, ComponentType } from 'react'; +import { ComponentType, useEffect, useState } from 'react'; import styled from 'styled-components'; import { Button, ModalProps } from '@trezor/components'; -import { TorStatus } from 'src/types/suite'; +import { toggleTor, updateTorStatus } from 'src/actions/suite/suiteActions'; 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 { TorStatus } from 'src/types/suite'; import { TorProgressBar } from './TorProgressBar'; diff --git a/packages/suite/src/components/suite/TorLoader/TorProgressBar.tsx b/packages/suite/src/components/suite/TorLoader/TorProgressBar.tsx index 6e388a414c6..b41743ddb85 100644 --- a/packages/suite/src/components/suite/TorLoader/TorProgressBar.tsx +++ b/packages/suite/src/components/suite/TorLoader/TorProgressBar.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { Button, ProgressBar, Icon, variables } from '@trezor/components'; +import { Button, Icon, ProgressBar, variables } from '@trezor/components'; import { borders } from '@trezor/theme'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/TrafficLightOffset.tsx b/packages/suite/src/components/suite/TrafficLightOffset.tsx index 72f8804cb77..557a36f4e89 100644 --- a/packages/suite/src/components/suite/TrafficLightOffset.tsx +++ b/packages/suite/src/components/suite/TrafficLightOffset.tsx @@ -2,8 +2,8 @@ import React from 'react'; import styled from 'styled-components'; -import { zIndices } from '@trezor/theme'; import { isDesktop, isMacOs } from '@trezor/env-utils'; +import { zIndices } from '@trezor/theme'; type Props = { children?: React.ReactNode; diff --git a/packages/suite/src/components/suite/UdevDownload.tsx b/packages/suite/src/components/suite/UdevDownload.tsx index 824d27465bd..dcdeb5f2658 100644 --- a/packages/suite/src/components/suite/UdevDownload.tsx +++ b/packages/suite/src/components/suite/UdevDownload.tsx @@ -2,9 +2,9 @@ import { useState } from 'react'; import styled from 'styled-components'; -import { DATA_URL, HELP_CENTER_UDEV_URL } from '@trezor/urls'; import { Button, Select, Spinner } from '@trezor/components'; import { spacings, typography } from '@trezor/theme'; +import { DATA_URL, HELP_CENTER_UDEV_URL } from '@trezor/urls'; import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/suite/UnstakingTxAmount.tsx b/packages/suite/src/components/suite/UnstakingTxAmount.tsx index b42fd7f620f..84836814d3b 100644 --- a/packages/suite/src/components/suite/UnstakingTxAmount.tsx +++ b/packages/suite/src/components/suite/UnstakingTxAmount.tsx @@ -3,8 +3,8 @@ import React from 'react'; import { WalletAccountTransaction } from '@suite-common/wallet-types'; import { formatNetworkAmount, - isUnstakeTx, getUnstakeAmountByEthereumDataHex, + isUnstakeTx, } from '@suite-common/wallet-utils'; import { FormattedCryptoAmount } from './FormattedCryptoAmount'; diff --git a/packages/suite/src/components/suite/WebUsbButton.tsx b/packages/suite/src/components/suite/WebUsbButton.tsx index dd65fe3ac91..199821bad91 100644 --- a/packages/suite/src/components/suite/WebUsbButton.tsx +++ b/packages/suite/src/components/suite/WebUsbButton.tsx @@ -1,6 +1,6 @@ +import { Button, ButtonProps, IconButton, Tooltip } from '@trezor/components'; 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'; diff --git a/packages/suite/src/components/suite/WordInput.tsx b/packages/suite/src/components/suite/WordInput.tsx index 0285d25bccd..208828b118c 100644 --- a/packages/suite/src/components/suite/WordInput.tsx +++ b/packages/suite/src/components/suite/WordInput.tsx @@ -1,13 +1,13 @@ -import { useEffect, useRef, memo, Children, ReactElement } from 'react'; -import { FixedSizeList as List } from 'react-window'; +import { Children, ReactElement, memo, useEffect, useRef } from 'react'; import { MenuListProps, SelectInstance, createFilter } from 'react-select'; import { useKeyPress } from 'react-use'; +import { FixedSizeList as List } from 'react-window'; import styled from 'styled-components'; import { Select, variables } from '@trezor/components'; -import { bip39 } from '@trezor/crypto-utils'; import TrezorConnect, { UI } from '@trezor/connect'; +import { bip39 } from '@trezor/crypto-utils'; import { createTimeoutPromise } from '@trezor/utils'; import { useTranslation } from 'src/hooks/suite/useTranslation'; diff --git a/packages/suite/src/components/suite/WordInputAdvanced.tsx b/packages/suite/src/components/suite/WordInputAdvanced.tsx index 04d249577ff..5b0e3e9fa26 100644 --- a/packages/suite/src/components/suite/WordInputAdvanced.tsx +++ b/packages/suite/src/components/suite/WordInputAdvanced.tsx @@ -1,13 +1,13 @@ -import { useEffect, useCallback } from 'react'; +import { useCallback, useEffect } from 'react'; import styled from 'styled-components'; +import { Button, KEYBOARD_CODE, PinButton } from '@trezor/components'; +import TrezorConnect, { DeviceModelInternal, UI } from '@trezor/connect'; import { HELP_CENTER_ADVANCED_RECOVERY_URL } from '@trezor/urls'; -import { Button, PinButton, KEYBOARD_CODE } from '@trezor/components'; import { createTimeoutPromise } from '@trezor/utils'; -import TrezorConnect, { DeviceModelInternal, UI } from '@trezor/connect'; -import { Translation, TrezorLink, DeviceMatrixExplanation } from 'src/components/suite'; +import { DeviceMatrixExplanation, Translation, TrezorLink } from 'src/components/suite'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/__tests__/NumberInput.test.tsx b/packages/suite/src/components/suite/__tests__/NumberInput.test.tsx index 86350448489..4649f5b9adb 100644 --- a/packages/suite/src/components/suite/__tests__/NumberInput.test.tsx +++ b/packages/suite/src/components/suite/__tests__/NumberInput.test.tsx @@ -1,16 +1,16 @@ -import { Provider } from 'react-redux'; import { useForm } from 'react-hook-form'; +import { Provider } from 'react-redux'; import { render } from '@testing-library/react'; -import { Store } from 'redux'; import userEvent from '@testing-library/user-event'; +import { Store } from 'redux'; -import { NumberInput } from '@trezor/product-components'; import { configureMockStore } from '@suite-common/test-utils'; +import { NumberInput } from '@trezor/product-components'; +import { Locale } from 'src/config/suite/languages'; import suiteReducer, { SuiteState } from 'src/reducers/suite/suiteReducer'; import { ThemeProvider } from 'src/support/suite/ThemeProvider'; -import { Locale } from 'src/config/suite/languages'; const onChangeMock = jest.fn(); diff --git a/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx b/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx index 6b48261ca37..50e2e4e49a6 100644 --- a/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx +++ b/packages/suite/src/components/suite/banners/MessageSystemBanner.tsx @@ -2,12 +2,12 @@ import { useMemo } from 'react'; import { messageSystemActions } from '@suite-common/message-system'; import { Message } from '@suite-common/suite-types'; -import { Row, Banner as WarningComponent, Banner, BannerProps } from '@trezor/components'; +import { Banner, BannerProps, Row, Banner as WarningComponent } 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 { getTorUrlIfAvailable } from 'src/utils/suite/tor'; 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 371ee225593..25f01b7a0a1 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/FailedBackupBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/FailedBackupBanner.tsx @@ -1,9 +1,9 @@ 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 { Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch } from 'src/hooks/suite'; export const FailedBackup = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/FirmwareAuthenticityCheckBanner.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/FirmwareAuthenticityCheckBanner.tsx index c238240b430..84622f0c7bb 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/FirmwareAuthenticityCheckBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/FirmwareAuthenticityCheckBanner.tsx @@ -1,15 +1,15 @@ import { TranslationKey } from '@suite-common/intl-types'; import { Banner, Row } from '@trezor/components'; import { FirmwareHashCheckError, FirmwareRevisionCheckError } from '@trezor/connect'; +import { spacings } from '@trezor/theme'; import { HELP_CENTER_FIRMWARE_REVISION_CHECK, TREZOR_SUPPORT_FW_REVISION_CHECK_FAILED_URL, } from '@trezor/urls'; -import { spacings } from '@trezor/theme'; import { Translation, TrezorLink } from 'src/components/suite'; -import { useSelector } from 'src/hooks/suite'; import { SkippedHashCheckError } from 'src/constants/suite/firmware'; +import { useSelector } from 'src/hooks/suite'; import { selectFirmwareHashCheckErrorIfEnabled, selectFirmwareRevisionCheckErrorIfEnabled, diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/NoBackupBanner.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/NoBackupBanner.tsx index 7057c4f5eb2..e57404dcaae 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/NoBackupBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/NoBackupBanner.tsx @@ -1,7 +1,7 @@ import { Banner } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite'; import { useDispatch, useTranslation } from 'src/hooks/suite'; export const NoBackup = () => { diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/SafetyChecksBanner.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/SafetyChecksBanner.tsx index 9fdaebd1d5b..8e81e2beedd 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/SafetyChecksBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/SafetyChecksBanner.tsx @@ -1,9 +1,9 @@ -import { Row, Banner as WarningComponent, Banner } from '@trezor/components'; +import { Banner, Row, Banner as WarningComponent } from '@trezor/components'; -import { Translation } from 'src/components/suite'; -import { useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch } from 'src/hooks/suite'; 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 476b9530eea..a12eee9ed3e 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/SuiteBanners.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/SuiteBanners.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; import styled from 'styled-components'; @@ -7,24 +7,24 @@ import { selectSelectedDevice } from '@suite-common/wallet-core'; import { isDesktop } from '@trezor/env-utils'; import { spacingsPx } from '@trezor/theme'; -import { isTranslationMode } from 'src/utils/suite/l10n'; -import { useSelector } from 'src/hooks/suite'; import { MAX_CONTENT_WIDTH } from 'src/constants/suite/layout'; +import { useSelector } from 'src/hooks/suite'; import { selectFirmwareHashCheckErrorIfEnabled, selectFirmwareRevisionCheckErrorIfEnabled, selectTransportOfType, } from 'src/reducers/suite/suiteReducer'; +import { isTranslationMode } from 'src/utils/suite/l10n'; import { MessageSystemBanner } from '../MessageSystemBanner'; -import { NoConnectionBanner } from './NoConnectionBanner'; -import { UpdateBridge } from './UpdateBridgeBanner'; -import { NoBackup } from './NoBackupBanner'; import { FailedBackup } from './FailedBackupBanner'; +import { FirmwareAuthenticityCheckBanner } from './FirmwareAuthenticityCheckBanner'; +import { FirmwareHashMismatchOnLastUpdateBanner } from './FirmwareHashMismatchOnLastUpdateBanner'; +import { NoBackup } from './NoBackupBanner'; +import { NoConnectionBanner } from './NoConnectionBanner'; import { SafetyChecksBanner } from './SafetyChecksBanner'; import { TranslationMode } from './TranslationModeBanner'; -import { FirmwareHashMismatchOnLastUpdateBanner } from './FirmwareHashMismatchOnLastUpdateBanner'; -import { FirmwareAuthenticityCheckBanner } from './FirmwareAuthenticityCheckBanner'; +import { UpdateBridge } from './UpdateBridgeBanner'; const Container = styled.div<{ $isVisible?: boolean }>` width: 100%; diff --git a/packages/suite/src/components/suite/banners/SuiteBanners/UpdateBridgeBanner.tsx b/packages/suite/src/components/suite/banners/SuiteBanners/UpdateBridgeBanner.tsx index 2d62ac6f692..3ea67cd3cd3 100644 --- a/packages/suite/src/components/suite/banners/SuiteBanners/UpdateBridgeBanner.tsx +++ b/packages/suite/src/components/suite/banners/SuiteBanners/UpdateBridgeBanner.tsx @@ -1,7 +1,7 @@ import { Banner } from '@trezor/components'; -import { Translation } from 'src/components/suite'; import { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; export const UpdateBridge = () => { diff --git a/packages/suite/src/components/suite/graph/GraphRangeSelector.tsx b/packages/suite/src/components/suite/graph/GraphRangeSelector.tsx index e7bc6714438..e1583137fb8 100644 --- a/packages/suite/src/components/suite/graph/GraphRangeSelector.tsx +++ b/packages/suite/src/components/suite/graph/GraphRangeSelector.tsx @@ -1,23 +1,23 @@ -import { useState, useRef } from 'react'; +import { useRef, useState } from 'react'; -import styled, { css } from 'styled-components'; import { + differenceInMonths, + endOfToday, startOfDay, startOfToday, - endOfToday, subDays, subMonths, subYears, - differenceInMonths, } from 'date-fns'; +import styled, { css } from 'styled-components'; import { - variables, Dropdown, DropdownRef, + PopoverPlacement, Timerange, intermediaryTheme, - PopoverPlacement, + variables, } from '@trezor/components'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/graph/GraphScaleDropdownItem.tsx b/packages/suite/src/components/suite/graph/GraphScaleDropdownItem.tsx index b387f43993c..07c3c68bbe8 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 { useGraph } from 'src/hooks/suite'; import { GraphScale } from 'src/types/wallet/graph'; export const GraphScaleDropdownItem = (props: Omit, 'options'>) => { diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx index 3b04763c808..50943a1d83d 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipAccount.tsx @@ -1,16 +1,16 @@ import { TooltipProps } from 'recharts'; -import { NetworkSymbol } from '@suite-common/wallet-config'; import { Formatters, useFormatters } from '@suite-common/formatters'; import { SignOperator } from '@suite-common/suite-types'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; 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 type { CryptoGraphProps } from './TransactionsGraph'; const formatAmount = ( amount: string | undefined, diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipBase.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipBase.tsx index 4abafe436a0..da4505b14a4 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipBase.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipBase.tsx @@ -1,12 +1,12 @@ import { useEffect } from 'react'; -import styled from 'styled-components'; import { TooltipProps } from 'recharts'; +import styled from 'styled-components'; -import { variables, Row } from '@trezor/components'; +import { Row, variables } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Translation, FormattedDate } from 'src/components/suite'; +import { FormattedDate, Translation } from 'src/components/suite'; import { CommonAggregatedHistory, GraphRange } from 'src/types/wallet/graph'; // Used for triggering custom Tooltip alignment diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipDashboard.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipDashboard.tsx index 8cafbf8f962..57f0fd81e33 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipDashboard.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphTooltipDashboard.tsx @@ -4,8 +4,8 @@ import { useFormatters } from '@suite-common/formatters'; import { CommonAggregatedHistory, GraphRange } from 'src/types/wallet/graph'; -import type { FiatGraphProps } from './TransactionsGraph'; import { GraphTooltipBase } from './GraphTooltipBase'; +import type { FiatGraphProps } from './TransactionsGraph'; interface GraphTooltipDashboardProps extends TooltipProps { selectedRange: GraphRange; diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphXAxisTick.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphXAxisTick.tsx index f59e6d2e6d6..e3e83a8ee2d 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphXAxisTick.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphXAxisTick.tsx @@ -1,7 +1,7 @@ import { FormattedDate } from 'react-intl'; -import { useTheme } from 'styled-components'; import { differenceInMonths } from 'date-fns'; +import { useTheme } from 'styled-components'; import { GraphRange } from 'src/types/wallet/graph'; diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx index d2288abde5b..af81ca62ca4 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/GraphYAxisTick.tsx @@ -1,4 +1,4 @@ -import { useRef, useLayoutEffect } from 'react'; +import { useLayoutEffect, useRef } from 'react'; import { useTheme } from 'styled-components'; diff --git a/packages/suite/src/components/suite/graph/TransactionsGraph/TransactionsGraph.tsx b/packages/suite/src/components/suite/graph/TransactionsGraph/TransactionsGraph.tsx index 2af44e2c6d1..5b398abce62 100644 --- a/packages/suite/src/components/suite/graph/TransactionsGraph/TransactionsGraph.tsx +++ b/packages/suite/src/components/suite/graph/TransactionsGraph/TransactionsGraph.tsx @@ -1,27 +1,27 @@ import { memo, useState } from 'react'; +import { Bar, CartesianGrid, Cell, ComposedChart, Line, Tooltip, XAxis, YAxis } from 'recharts'; import styled, { useTheme } from 'styled-components'; -import { ComposedChart, Tooltip, Bar, YAxis, XAxis, Line, CartesianGrid, Cell } from 'recharts'; import { Icon, variables } from '@trezor/components'; import { zIndices } from '@trezor/theme'; +import { GraphRangeSelector, GraphSkeleton } from 'src/components/suite'; import { useGraph } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; import { - GraphRange, AggregatedAccountHistory, AggregatedDashboardHistory, + GraphRange, } from 'src/types/wallet/graph'; -import { calcYDomain, calcFakeGraphDataForTimestamps, calcXDomain } from 'src/utils/wallet/graph'; -import { GraphSkeleton, GraphRangeSelector } from 'src/components/suite'; +import { calcFakeGraphDataForTimestamps, calcXDomain, calcYDomain } from 'src/utils/wallet/graph'; +import { GraphBar } from './GraphBar'; import { GraphResponsiveContainer } from './GraphResponsiveContainer'; +import { GraphTooltipAccount } from './GraphTooltipAccount'; +import { GraphTooltipDashboard } from './GraphTooltipDashboard'; import { GraphXAxisTick } from './GraphXAxisTick'; import { GraphYAxisTick } from './GraphYAxisTick'; -import { GraphBar } from './GraphBar'; -import { GraphTooltipDashboard } from './GraphTooltipDashboard'; -import { GraphTooltipAccount } from './GraphTooltipAccount'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/labeling/AccountLabeling.tsx b/packages/suite/src/components/suite/labeling/AccountLabeling.tsx index 891f3fd72eb..ed8665f8b14 100644 --- a/packages/suite/src/components/suite/labeling/AccountLabeling.tsx +++ b/packages/suite/src/components/suite/labeling/AccountLabeling.tsx @@ -1,12 +1,12 @@ -import { findAccountDevice } from '@suite-common/wallet-utils'; import { isSelectedDevice } from '@suite-common/suite-utils'; import { selectDevices, selectSelectedDevice } from '@suite-common/wallet-core'; +import { findAccountDevice } from '@suite-common/wallet-utils'; import { BadgeProps } from '@trezor/components'; import { AccountLabel } from 'src/components/suite'; -import { Account as WalletAccount } from 'src/types/wallet'; import { useSelector } from 'src/hooks/suite'; import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; +import { Account as WalletAccount } from 'src/types/wallet'; import { WalletLabeling } from './WalletLabeling'; diff --git a/packages/suite/src/components/suite/labeling/AddressLabeling.tsx b/packages/suite/src/components/suite/labeling/AddressLabeling.tsx index 37f8e303666..62e67775c6c 100644 --- a/packages/suite/src/components/suite/labeling/AddressLabeling.tsx +++ b/packages/suite/src/components/suite/labeling/AddressLabeling.tsx @@ -1,5 +1,5 @@ -import { findAccountsByAddress } from '@suite-common/wallet-utils'; import type { NetworkSymbol } from '@suite-common/wallet-config'; +import { findAccountsByAddress } from '@suite-common/wallet-utils'; import { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx b/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx index fbd9f60bedb..c91d8d8ee74 100644 --- a/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx +++ b/packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx @@ -1,23 +1,23 @@ -import { useEffect, useState, useMemo, useRef } from 'react'; +import { useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; import { Button, DropdownMenuItemProps, Row } from '@trezor/components'; -import type { TimerId } from '@trezor/type-utils'; import { StaticSessionId } from '@trezor/connect'; +import type { TimerId } from '@trezor/type-utils'; -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 { useDiscovery, useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsLabelingAvailableForEntity, selectIsLabelingInitPossible, } from 'src/reducers/suite/metadataReducer'; +import { MetadataAddPayload } from 'src/types/suite/metadata'; -import { Props, ExtendedProps } from './definitions'; -import { withEditable } from './withEditable'; +import { ExtendedProps, Props } from './definitions'; import { withDropdown } from './withDropdown'; +import { withEditable } from './withEditable'; import { AccountTypeBadge } from '../../AccountTypeBadge'; const LabelValue = styled.div` diff --git a/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts b/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts index a01776c289b..bd4e1db9069 100644 --- a/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts +++ b/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts @@ -1,7 +1,7 @@ import { ReactNode } from 'react'; -import { DropdownMenuItemProps } from '@trezor/components'; import { AccountType, Bip43Path, NetworkType } from '@suite-common/wallet-config'; +import { DropdownMenuItemProps } from '@trezor/components'; import { MetadataAddPayload } from 'src/types/suite/metadata'; diff --git a/packages/suite/src/components/suite/labeling/MetadataLabeling/withEditable.tsx b/packages/suite/src/components/suite/labeling/MetadataLabeling/withEditable.tsx index 9b21ca2449b..b9b3120e99f 100644 --- a/packages/suite/src/components/suite/labeling/MetadataLabeling/withEditable.tsx +++ b/packages/suite/src/components/suite/labeling/MetadataLabeling/withEditable.tsx @@ -1,15 +1,15 @@ import { - useEffect, - useState, - useCallback, - useRef, FunctionComponent, PropsWithChildren, + useCallback, + useEffect, + useRef, + useState, } from 'react'; import styled, { useTheme } from 'styled-components'; -import { Icon, AutoScalingInput } from '@trezor/components'; +import { AutoScalingInput, Icon } from '@trezor/components'; const IconWrapper = styled.div<{ $bgColor: string }>` display: flex; diff --git a/packages/suite/src/components/suite/labeling/WalletLabeling.tsx b/packages/suite/src/components/suite/labeling/WalletLabeling.tsx index b2f0f6ba4e1..6f65a1ffd26 100644 --- a/packages/suite/src/components/suite/labeling/WalletLabeling.tsx +++ b/packages/suite/src/components/suite/labeling/WalletLabeling.tsx @@ -2,10 +2,10 @@ import { useCallback } from 'react'; import styled from 'styled-components'; -import { TrezorDevice } from 'src/types/suite'; -import { useTranslation } from 'src/hooks/suite/useTranslation'; import { useSelector } from 'src/hooks/suite/useSelector'; +import { useTranslation } from 'src/hooks/suite/useTranslation'; import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer'; +import { TrezorDevice } from 'src/types/suite'; 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 a0e5ebfbec3..395c2b57125 100644 --- a/packages/suite/src/components/suite/layouts/LoggedOutLayout.tsx +++ b/packages/suite/src/components/suite/layouts/LoggedOutLayout.tsx @@ -2,15 +2,15 @@ import { ReactNode, useRef, useState } from 'react'; import { ElevationContext, ElevationUp, NewModal } 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 { useResetScrollOnUrl } from 'src/hooks/suite/useResetScrollOnUrl'; +import { LayoutContext, LayoutContextPayload } from 'src/support/suite/LayoutContext'; +import { ModalContextProvider } from 'src/support/suite/ModalContext'; import { Metadata } from '../Metadata'; -import { ModalSwitcher } from '../modals/ModalSwitcher/ModalSwitcher'; +import { TrafficLightOffset } from '../TrafficLightOffset'; import { AppWrapper, Body, @@ -19,7 +19,7 @@ import { PageWrapper, Wrapper, } from './SuiteLayout/SuiteLayout'; -import { TrafficLightOffset } from '../TrafficLightOffset'; +import { ModalSwitcher } from '../modals/ModalSwitcher/ModalSwitcher'; interface LoggedOutLayout { children: ReactNode; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/CoinjoinBars/CoinjoinStatusBar.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/CoinjoinBars/CoinjoinStatusBar.tsx index 194ed953898..9262a5a447e 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/CoinjoinBars/CoinjoinStatusBar.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/CoinjoinBars/CoinjoinStatusBar.tsx @@ -1,25 +1,25 @@ import styled, { css } from 'styled-components'; import { - selectSelectedDevice, - selectDevices, selectAccountByKey, selectDeviceThunk, + selectDevices, + selectSelectedDevice, } from '@suite-common/wallet-core'; -import { ProgressPie, variables } from '@trezor/components'; import { WalletParams } from '@suite-common/wallet-types'; +import { ProgressPie, variables } from '@trezor/components'; -import { useDispatch } from 'src/hooks/suite'; -import { CoinjoinSession } from 'src/types/wallet/coinjoin'; -import { ROUND_PHASE_MESSAGES } from 'src/constants/suite/coinjoin'; import { goto } from 'src/actions/suite/routerActions'; +import { CountdownTimer, Translation, WalletLabeling } from 'src/components/suite'; +import { ROUND_PHASE_MESSAGES } from 'src/constants/suite/coinjoin'; +import { useDispatch } from 'src/hooks/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectRouterParams } from 'src/reducers/suite/routerReducer'; import { - selectSessionProgressByAccountKey, selectRoundsDurationInHours, + selectSessionProgressByAccountKey, } from 'src/reducers/wallet/coinjoinReducer'; -import { CountdownTimer, Translation, WalletLabeling } from 'src/components/suite'; +import { CoinjoinSession } from 'src/types/wallet/coinjoin'; const SPACING = 6; 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 6f31b2ce056..0857aade7ed 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceSelector.tsx @@ -1,22 +1,22 @@ -import { useState, useEffect, useRef } from 'react'; +import { useEffect, useRef, useState } from 'react'; import styled, { css } from 'styled-components'; import { selectDevicesCount, selectSelectedDevice } from '@suite-common/wallet-core'; -import type { TimerId } from '@trezor/type-utils'; -import { borders, spacingsPx } from '@trezor/theme'; -import { focusStyleTransition, getFocusShadowStyle } from '@trezor/components/src/utils/utils'; import { Icon, Tooltip } from '@trezor/components'; +import { focusStyleTransition, getFocusShadowStyle } from '@trezor/components/src/utils/utils'; +import { borders, spacingsPx } from '@trezor/theme'; +import type { TimerId } from '@trezor/type-utils'; -import { SHAKE } from 'src/support/suite/styles/animations'; import { goto } from 'src/actions/suite/routerActions'; import { useDiscovery, useDispatch, useSelector } from 'src/hooks/suite'; +import { SHAKE } from 'src/support/suite/styles/animations'; import { ViewOnlyTooltip } from 'src/views/view-only/ViewOnlyTooltip'; import { SidebarDeviceStatus } from './SidebarDeviceStatus'; -import { ExpandedSidebarOnly } from '../Sidebar/ExpandedSidebarOnly'; import { useResponsiveContext } from '../../../../../support/suite/ResponsiveContext'; import { Translation } from '../../../Translation'; +import { ExpandedSidebarOnly } from '../Sidebar/ExpandedSidebarOnly'; 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 0423e483085..d08207084a1 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceStatus.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceStatus.tsx @@ -2,16 +2,16 @@ import { MouseEventHandler } from 'react'; import styled from 'styled-components'; -import { DeviceModelInternal } from '@trezor/connect'; -import { spacings } from '@trezor/theme'; +import { selectDeviceLabelOrNameById } from '@suite-common/wallet-core'; import { Row, Tooltip } from '@trezor/components'; +import { DeviceModelInternal } from '@trezor/connect'; import { RotateDeviceImage } from '@trezor/product-components'; -import { selectDeviceLabelOrNameById } from '@suite-common/wallet-core'; +import { spacings } from '@trezor/theme'; -import { DeviceStatusText } from 'src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText'; +import { useSelector } from 'src/hooks/suite'; import { TrezorDevice } from 'src/types/suite'; import { DeviceDetail } from 'src/views/suite/SwitchDevice/DeviceItem/DeviceDetail'; -import { useSelector } from 'src/hooks/suite'; +import { DeviceStatusText } from 'src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText'; type DeviceStatusProps = { deviceModel: DeviceModelInternal; 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 4b347645c08..0fc745d98cf 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/SidebarDeviceStatus.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/DeviceSelector/SidebarDeviceStatus.tsx @@ -1,12 +1,12 @@ import { MouseEventHandler } from 'react'; -import { acquireDevice, selectSelectedDevice, selectDevices } from '@suite-common/wallet-core'; import * as deviceUtils from '@suite-common/suite-utils'; +import { acquireDevice, selectDevices, selectSelectedDevice } from '@suite-common/wallet-core'; import { TrezorDevice } from 'src/types/suite'; -import { useDispatch, useSelector } from '../../../../../hooks/suite'; import { DeviceStatus } from './DeviceStatus'; +import { useDispatch, useSelector } from '../../../../../hooks/suite'; import { useIsSidebarCollapsed } from '../Sidebar/utils'; const needsRefresh = (device?: TrezorDevice) => { 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 e412e0bae12..d8c1c7c7566 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileActionItem.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileActionItem.tsx @@ -1,4 +1,4 @@ -import { useMemo, ReactNode, HTMLAttributes } from 'react'; +import { HTMLAttributes, ReactNode, useMemo } from 'react'; import styled, { useTheme } from 'styled-components'; 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 22d31307d99..ac414e0606d 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenu.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenu.tsx @@ -2,13 +2,13 @@ import { useState } from 'react'; import styled, { useTheme } from 'styled-components'; -import { zIndices } from '@trezor/theme'; import { Icon, variables } from '@trezor/components'; +import { zIndices } from '@trezor/theme'; -import { DeviceSelector } from '../DeviceSelector/DeviceSelector'; -import { MobileNavigation } from './MobileNavigation'; import { MobileMenuActions } from './MobileMenuActions'; +import { MobileNavigation } from './MobileNavigation'; import { TrafficLightOffset } from '../../../TrafficLightOffset'; +import { DeviceSelector } from '../DeviceSelector/DeviceSelector'; const BackgroundContainer = styled.div` background: ${({ theme }) => theme.backgroundSurfaceElevation1}; 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 f0397fae8c0..39f2d001232 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenuActions.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileMenuActions.tsx @@ -7,10 +7,10 @@ import type { Route } from '@suite-common/suite-types'; import { setDiscreetMode } from 'src/actions/settings/walletSettingsActions'; import { goto } from 'src/actions/suite/routerActions'; 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 { useDispatch, useSelector } from 'src/hooks/suite'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; +import { selectIsDiscreteModeActive } from 'src/reducers/wallet/settingsReducer'; import { MobileActionItem } from './MobileActionItem'; import { useEnabledBackends } from '../utils'; 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 19b02c1ee16..f924174acd9 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/MobileMenu/MobileNavigation.tsx @@ -4,11 +4,11 @@ import styled, { css } from 'styled-components'; import { variables } from '@trezor/components'; import { typography } from '@trezor/theme'; -import { findRouteByName } from 'src/utils/suite/router'; +import { goto } from 'src/actions/suite/routerActions'; import { 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 { useAccountSearch, useDispatch, useSelector } from 'src/hooks/suite'; +import { findRouteByName } from 'src/utils/suite/router'; interface ComponentProps { isActive: boolean; 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 34f74c60d0d..1eeb9866cf1 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActions.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActions.tsx @@ -1,19 +1,19 @@ import styled from 'styled-components'; -import { EventType, analytics } from '@trezor/suite-analytics'; +import { hasNetworkFeatures } from '@suite-common/wallet-utils'; import { ButtonGroup, Dropdown, DropdownMenuItemProps, IconName } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; 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'; import { goto } from 'src/actions/suite/routerActions'; import { AppNavigationTooltip } from 'src/components/suite/AppNavigation/AppNavigationTooltip'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { TradeActions } from 'src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions'; +import { Translation } from 'src/components/suite/Translation'; import { HeaderActionButton } from 'src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActionButton'; +import { TradeActions } from 'src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions'; +import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; import { selectWindowSize } from 'src/reducers/suite/windowReducer'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { WalletParams } from 'src/types/wallet'; const Container = styled.div` display: flex; 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 f286fd1d751..8cc296ea31a 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageHeader.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/PageHeader.tsx @@ -5,11 +5,11 @@ 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 { HEADER_HEIGHT } from 'src/constants/suite/layout'; +import { useSelector } from 'src/hooks/suite'; +import { selectIsAccountTabPage, selectRouteName } from 'src/reducers/suite/routerReducer'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { HeaderActions } from './HeaderActions'; import { PageName } from './PageNames/PageName'; 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 f2b44601429..aca3a9bc4d6 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,18 +1,18 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } 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 { spacingsPx, typography, zIndices } from '@trezor/theme'; import { - MetadataLabeling, AccountLabel, - FormattedCryptoAmount, - FiatValue, AmountUnitSwitchWrapper, + FiatValue, + FormattedCryptoAmount, + MetadataLabeling, } from 'src/components/suite'; import { useDefaultAccountLabel, useSelector } from 'src/hooks/suite'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; 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 bea86202091..db167afdce4 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,7 @@ import { useEffect, useState } from 'react'; -import { spacings } from '@trezor/theme'; import { Account } from '@suite-common/wallet-types'; +import { spacings } from '@trezor/theme'; import { ACCOUNT_INFO_HEIGHT } from 'src/components/wallet/WalletLayout/AccountTopPanel/AccountTopPanel'; 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 57b82b335ba..283c8ed0771 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,12 +1,12 @@ import styled from 'styled-components'; -import { IconButton } from '@trezor/components'; +import { Route } from '@suite-common/suite-types'; import { Account } from '@suite-common/wallet-types'; +import { IconButton } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; -import { Route } from '@suite-common/suite-types'; -import { useDispatch } from 'src/hooks/suite'; import { goto } from 'src/actions/suite/routerActions'; +import { useDispatch } from 'src/hooks/suite'; import { AccountDetails } from './AccountDetails'; 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 3fa29879bbe..da2f44c73aa 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,7 +1,7 @@ import styled from 'styled-components'; -import { H2 } from '@trezor/components'; import { TranslationKey } from '@suite-common/intl-types'; +import { H2 } from '@trezor/components'; import { Translation } from 'src/components/suite'; 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 d1d60c89f99..21924fc50cc 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,13 +1,13 @@ 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'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { SettingsName } from './SettingsName'; -import { BasicName } from './BasicName'; import { AccountName } from './AccountName/AccountName'; import { AccountSubpageName } from './AccountName/AccountSubpageName'; +import { BasicName } from './BasicName'; +import { SettingsName } from './SettingsName'; interface PageNameProps { backRoute?: Route['name']; 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 6a9cc4d8825..e71d7dbe36d 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 @@ -2,15 +2,15 @@ import { useState } from 'react'; import styled from 'styled-components'; -import { desktopApi } from '@trezor/suite-desktop-api'; import { IconButton } from '@trezor/components'; +import { desktopApi } from '@trezor/suite-desktop-api'; import { spacingsPx } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; 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'; 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 1765ad1ee6d..8546b78f311 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/PageHeader/TradeActions.tsx @@ -1,17 +1,17 @@ import styled, { css } from 'styled-components'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { SelectedAccountStatus } from '@suite-common/wallet-types'; import { Row, variables } from '@trezor/components'; import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; -import { analytics, EventType } from '@trezor/suite-analytics'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { EventType, analytics } from '@trezor/suite-analytics'; 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 { HeaderActionButton } from 'src/components/suite/layouts/SuiteLayout/PageHeader/HeaderActionButton'; +import { useDispatch, useSelector } from 'src/hooks/suite'; 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 d12db574639..718b2279202 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Navigation.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Navigation.tsx @@ -4,9 +4,9 @@ import styled from 'styled-components'; import { spacingsPx } from '@trezor/theme'; -import { isCollapsedSidebar } from './consts'; import { NavigationItem, NavigationItemProps } from './NavigationItem'; import { NotificationDropdown } from './NotificationDropdown'; +import { isCollapsedSidebar } from './consts'; const Nav = styled.nav` display: flex; 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 d83c24ab93b..483fe827e7b 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NavigationItem.tsx @@ -3,24 +3,24 @@ import { MouseEvent } from 'react'; import styled, { css, useTheme } from 'styled-components'; import { ExtendedMessageDescriptor, TranslationKey } from '@suite-common/intl-types'; +import { Route } from '@suite-common/suite-types'; +import { Icon, IconName, IconSize, Paragraph, Tooltip, useElevation } from '@trezor/components'; +import { getFocusShadowStyle } from '@trezor/components/src/utils/utils'; import { Elevation, + TypographyStyle, borders, mapElevationToBackground, spacingsPx, - TypographyStyle, } from '@trezor/theme'; -import { getFocusShadowStyle } from '@trezor/components/src/utils/utils'; -import { Route } from '@suite-common/suite-types'; -import { Icon, IconName, IconSize, useElevation, Paragraph, Tooltip } from '@trezor/components'; +import { goto } from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite/Translation'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; -import { ExpandedSidebarOnly } from './ExpandedSidebarOnly'; import { CollapsedSidebarOnly } from './CollapsedSidebarOnly'; +import { ExpandedSidebarOnly } from './ExpandedSidebarOnly'; 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 563639e8c4f..2fefe3b0b12 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NotificationDropdown.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NotificationDropdown.tsx @@ -1,12 +1,12 @@ -import { useRef, useCallback, useState } from 'react'; +import { useCallback, useRef, useState } from 'react'; import styled, { css } from 'styled-components'; -import { Box, useMediaQuery, variables, Popover, Menu } from '@trezor/components'; -import { spacings } from '@trezor/theme'; -import { analytics, EventType } from '@trezor/suite-analytics'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { Box, Menu, Popover, useMediaQuery, variables } from '@trezor/components'; import { useOnClickOutside } from '@trezor/react-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { spacings } from '@trezor/theme'; import { Notifications } from 'src/components/suite/notifications'; import { useDispatch } from 'src/hooks/suite'; 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 9dec46e258d..7bfe34c33d1 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 @@ -2,10 +2,10 @@ import { useTheme } from 'styled-components'; import { ComponentWithSubIcon, Icon, iconSizes } from '@trezor/components'; -import { useTranslation } from '../../../../../../hooks/suite'; -import { useEnabledBackends } from '../../utils'; import { NavBackends } from './NavBackends'; import { QuickActionButton } from './QuickActionButton'; +import { useTranslation } from '../../../../../../hooks/suite'; +import { useEnabledBackends } from '../../utils'; export const CustomBackend = () => { const theme = useTheme(); 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 ce09e6efee5..adb7837f0a7 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,11 @@ import styled from 'styled-components'; -import { Column, getIconSize, Icon, iconSizes } from '@trezor/components'; +import { Column, Icon, getIconSize, 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 { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; import { QuickActionButton } from './QuickActionButton'; 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 923b9d115e3..71106f97d57 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,9 +1,9 @@ import { Icon, iconSizes } from '@trezor/components'; +import { QuickActionButton } from './QuickActionButton'; import { setDiscreetMode } from '../../../../../../actions/settings/walletSettingsActions'; import { useDispatch, useSelector, useTranslation } from '../../../../../../hooks/suite'; import { selectIsDiscreteModeActive } from '../../../../../../reducers/wallet/settingsReducer'; -import { QuickActionButton } from './QuickActionButton'; export const HideBalances = () => { const dispatch = useDispatch(); 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 d86bfee4a8b..0f22163ca11 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 @@ -2,16 +2,16 @@ import React, { ReactNode, useRef } 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 { Dropdown, DropdownRef } from '@trezor/components'; import { CoinLogo } from '@trezor/product-components'; +import { spacingsPx, typography } from '@trezor/theme'; -import { Translation, StatusLight } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; +import { openModal } from 'src/actions/suite/modalActions'; import { goto } from 'src/actions/suite/routerActions'; +import { StatusLight, Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; 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)` 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 65d4aba36ba..04d25d29ce5 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 @@ -2,12 +2,12 @@ import styled from 'styled-components'; import { spacingsPx } from '@trezor/theme'; -import { Tor } from './Tor'; import { CustomBackend } from './CustomBackend'; import { DebugAndExperimental } from './DebugAndExperimental'; import { HideBalances } from './HideBalances'; -import { UpdateStatusActionBarIcon } from './Update/UpdateStatusActionBarIcon'; +import { Tor } from './Tor'; import { isCollapsedSidebar } from '../consts'; +import { UpdateStatusActionBarIcon } from './Update/UpdateStatusActionBarIcon'; const ActionsContainer = styled.div` display: flex; 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 0d0ced88f10..ef30dbc4d1e 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 @@ -4,13 +4,13 @@ import styled, { useTheme } from 'styled-components'; import { Column, - Row, Icon, - iconSizes, + IconName, + IconVariant, + Row, Text, getColorForIconVariant, - IconVariant, - IconName, + iconSizes, } from '@trezor/components'; import { borders, spacings, spacingsPx } from '@trezor/theme'; 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 240147c0351..58b0cc65d3a 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,14 +1,14 @@ import { useTheme } from 'styled-components'; -import { isDesktop } from '@trezor/env-utils'; import { Column, ComponentWithSubIcon, Icon, IconName, - iconSizes, IconVariant, + iconSizes, } from '@trezor/components'; +import { isDesktop } from '@trezor/env-utils'; import { spacings } from '@trezor/theme'; import { goto } from 'src/actions/suite/routerActions'; @@ -16,9 +16,9 @@ import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { TorStatus } from 'src/types/suite'; -import { selectTorState } from '../../../../../../reducers/suite/suiteReducer'; import { QuickActionButton } from './QuickActionButton'; import { TooltipRow } from './TooltipRow'; +import { selectTorState } from '../../../../../../reducers/suite/suiteReducer'; import { Translation, TranslationKey } from '../../../../Translation'; const torStatusTranslationMap: Record = { 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 f57fe1054c0..9912e1d5b74 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 @@ -2,7 +2,7 @@ import styled, { css } from 'styled-components'; import { spacingsPx } from '@trezor/theme'; -import { mapVariantToIconBackground, UpdateVariant } from './updateQuickActionTypes'; +import { UpdateVariant, mapVariantToIconBackground } from './updateQuickActionTypes'; type UpdateIconGroupProps = { $variant?: UpdateVariant; 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 06c47936f20..c68640c17f9 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 @@ -3,17 +3,17 @@ 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 { Elevation, borders, mapElevationToBackground, spacingsPx } from '@trezor/theme'; import { UpdateStatus, - UpdateStatusSuite, UpdateStatusDevice, - mapSuiteUpdateToClick, + UpdateStatusSuite, mapDeviceUpdateToClick, + mapSuiteUpdateToClick, } from './updateQuickActionTypes'; -import { Translation, TranslationKey } from '../../../../../Translation'; import { useDiscovery, useDispatch } from '../../../../../../../hooks/suite'; +import { Translation, TranslationKey } from '../../../../../Translation'; 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 de31f80190d..755da66ecf6 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,25 +1,25 @@ import { useDispatch } from 'react-redux'; -import styled, { css, DefaultTheme, useTheme } from 'styled-components'; +import styled, { DefaultTheme, css, useTheme } from 'styled-components'; -import { ComponentWithSubIcon, getIconSize, Icon, IconSize, iconSizes } from '@trezor/components'; -import { borders, Color, CSSColor } from '@trezor/theme'; +import { ComponentWithSubIcon, Icon, IconSize, getIconSize, iconSizes } from '@trezor/components'; import { isDesktop } from '@trezor/env-utils'; import { mapTrezorModelToIcon } from '@trezor/product-components'; +import { CSSColor, Color, borders } from '@trezor/theme'; import { useDevice } from '../../../../../../../hooks/suite'; import { QuickActionButton } from '../QuickActionButton'; import { UpdateIconGroup } from './UpdateIconGroup'; -import { useUpdateStatus } from './useUpdateStatus'; import { UpdateTooltip } from './UpdateTooltip'; import { + UpdateStatus, + UpdateVariant, mapDeviceUpdateToClick, mapSuiteUpdateToClick, mapUpdateStatusToIcon, mapUpdateStatusToVariant, - UpdateStatus, - UpdateVariant, } from './updateQuickActionTypes'; +import { useUpdateStatus } from './useUpdateStatus'; 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 d101ac493f1..f4c0e266de7 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,21 +1,21 @@ import styled, { useTheme } from 'styled-components'; -import { Column, getIconSize, Icon, IconSize, iconSizes } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { TranslationKey } from '@suite-common/intl-types'; +import { Column, Icon, IconSize, getIconSize, iconSizes } from '@trezor/components'; import { getFirmwareVersion } from '@trezor/device-utils'; import { isDesktop } from '@trezor/env-utils'; import { mapTrezorModelToIcon } from '@trezor/product-components'; +import { spacings } from '@trezor/theme'; -import { Translation } from '../../../../../Translation'; import { - mapUpdateStatusToIcon, - mapUpdateStatusToVariant, UpdateStatus, UpdateStatusDevice, UpdateStatusSuite, + mapUpdateStatusToIcon, + mapUpdateStatusToVariant, } from './updateQuickActionTypes'; import { useDevice, useSelector } from '../../../../../../../hooks/suite'; +import { Translation } from '../../../../../Translation'; 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 afca04ac4c2..2d49e083599 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 @@ -2,14 +2,14 @@ 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 { CSSColor, Color } from '@trezor/theme'; -import { goto } from '../../../../../../../actions/suite/routerActions'; import { installUpdate, openJustUpdatedChangelog, setUpdateModalVisibility, } from '../../../../../../../actions/suite/desktopUpdateActions'; +import { goto } from '../../../../../../../actions/suite/routerActions'; import { Dispatch } from '../../../../../../../types/suite'; export const updateVariants = ['tertiary', 'info', 'purple'] as const; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/useUpdateStatus.ts b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/useUpdateStatus.ts index 1223444bef2..c74b9fd8ddc 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/useUpdateStatus.ts +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/QuickActions/Update/useUpdateStatus.ts @@ -1,9 +1,9 @@ +import { UpdateStatus, UpdateStatusDevice, UpdateStatusSuite } from './updateQuickActionTypes'; import { useDevice, useSelector } from '../../../../../../../hooks/suite'; import { DesktopUpdateState, UpdateState, } from '../../../../../../../reducers/suite/desktopUpdateReducer'; -import { UpdateStatus, UpdateStatusSuite, UpdateStatusDevice } from './updateQuickActionTypes'; type UpdateStatusData = { updateStatus: UpdateStatus; 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 e0b5de1fa69..abff6d072dc 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Sidebar.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/Sidebar.tsx @@ -8,10 +8,10 @@ import { Elevation, mapElevationToBackground, mapElevationToBorder, zIndices } f import { AccountsMenu } from 'src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu'; import { useActions } from 'src/hooks/suite'; -import { QuickActions } from './QuickActions/QuickActions'; import { Navigation } from './Navigation'; -import { DeviceSelector } from '../DeviceSelector/DeviceSelector'; +import { QuickActions } from './QuickActions/QuickActions'; import { TrafficLightOffset } from '../../../TrafficLightOffset'; +import { DeviceSelector } from '../DeviceSelector/DeviceSelector'; import { UpdateNotificationBanner } from './QuickActions/Update/UpdateNotificationBanner'; import { useUpdateStatus } from './QuickActions/Update/useUpdateStatus'; import { setSidebarWidth as setSidebarWidthInRedux } from '../../../../../actions/suite/suiteActions'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/SubpageNavigation.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/SubpageNavigation.tsx index e1a0b328a9b..4b76df89a72 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/SubpageNavigation.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/SubpageNavigation.tsx @@ -1,12 +1,12 @@ import styled from 'styled-components'; -import { spacingsPx, zIndices } from '@trezor/theme'; -import { Tabs } from '@trezor/components'; import { Route } from '@suite-common/suite-types'; +import { Tabs } from '@trezor/components'; +import { spacingsPx, zIndices } from '@trezor/theme'; +import { HEADER_HEIGHT } from 'src/constants/suite/layout'; import { useSelector } from 'src/hooks/suite'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; -import { HEADER_HEIGHT } from 'src/constants/suite/layout'; import { AppNavigationTooltip } from '../../AppNavigation/AppNavigationTooltip'; diff --git a/packages/suite/src/components/suite/layouts/SuiteLayout/SuiteLayout.tsx b/packages/suite/src/components/suite/layouts/SuiteLayout/SuiteLayout.tsx index d39ee43d90a..a689ee28658 100644 --- a/packages/suite/src/components/suite/layouts/SuiteLayout/SuiteLayout.tsx +++ b/packages/suite/src/components/suite/layouts/SuiteLayout/SuiteLayout.tsx @@ -1,4 +1,4 @@ -import { useRef, useState, ReactNode, useEffect, useCallback } from 'react'; +import { ReactNode, useCallback, useEffect, useRef, useState } from 'react'; import styled from 'styled-components'; @@ -11,28 +11,28 @@ import { } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; -import { SuiteBanners } from 'src/components/suite/banners'; +import { GuideButton, GuideRouter } from 'src/components/guide'; import { Metadata } from 'src/components/suite'; -import { GuideRouter, GuideButton } from 'src/components/guide'; -import { HORIZONTAL_LAYOUT_PADDINGS, MAX_CONTENT_WIDTH } from 'src/constants/suite/layout'; +import { SuiteBanners } from 'src/components/suite/banners'; import { DiscoveryProgress } from 'src/components/wallet'; +import { MobileAccountsMenu } from 'src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu'; +import { HORIZONTAL_LAYOUT_PADDINGS, MAX_CONTENT_WIDTH } from 'src/constants/suite/layout'; import { useLayoutSize, useSelector } from 'src/hooks/suite'; -import { LayoutContext, LayoutContextPayload } from 'src/support/suite/LayoutContext'; -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 { useResetScrollOnUrl } from 'src/hooks/suite/useResetScrollOnUrl'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { LayoutContext, LayoutContextPayload } from 'src/support/suite/LayoutContext'; +import { ModalContextProvider } from 'src/support/suite/ModalContext'; import { ResponsiveContextProvider, useResponsiveContext, } from 'src/support/suite/ResponsiveContext'; -import { ModalSwitcher } from '../../modals/ModalSwitcher/ModalSwitcher'; +import { CoinjoinBars } from './CoinjoinBars/CoinjoinBars'; import { MobileMenu } from './MobileMenu/MobileMenu'; import { Sidebar } from './Sidebar/Sidebar'; -import { CoinjoinBars } from './CoinjoinBars/CoinjoinBars'; import { useAppShortcuts } from './useAppShortcuts'; +import { ModalSwitcher } from '../../modals/ModalSwitcher/ModalSwitcher'; export const SCROLL_WRAPPER_ID = 'layout-scroll'; export const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/layouts/WelcomeLayout/NavSettings.tsx b/packages/suite/src/components/suite/layouts/WelcomeLayout/NavSettings.tsx index af81685d8fd..fe28c478068 100644 --- a/packages/suite/src/components/suite/layouts/WelcomeLayout/NavSettings.tsx +++ b/packages/suite/src/components/suite/layouts/WelcomeLayout/NavSettings.tsx @@ -1,8 +1,8 @@ import { IconButton } from '@trezor/components'; +import { goto } from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; export const NavSettings = () => { 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 345d0978325..615d66272d1 100644 --- a/packages/suite/src/components/suite/layouts/WelcomeLayout/WelcomeLayout.tsx +++ b/packages/suite/src/components/suite/layouts/WelcomeLayout/WelcomeLayout.tsx @@ -1,32 +1,32 @@ import { ReactNode } from 'react'; -import styled from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; +import styled from 'styled-components'; +import { selectBannerMessage } from '@suite-common/message-system'; import { Button, - variables, - useElevation, - ElevationUp, - ElevationDown, - ElevationContext, Column, + ElevationContext, + ElevationDown, + ElevationUp, Row, + useElevation, + variables, } 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 { Elevation, mapElevationToBackground, spacings, spacingsPx } from '@trezor/theme'; import { TrezorLogo } from '@trezor/product-components'; +import { useOnce } from '@trezor/react-utils'; +import { Elevation, mapElevationToBackground, spacings, spacingsPx } from '@trezor/theme'; +import { SUITE_URL, TREZOR_URL } from '@trezor/urls'; +import { GuideButton, GuideRouter } from 'src/components/guide'; import { Translation } from 'src/components/suite'; // importing directly, otherwise unit tests fail, seems to be a styled-components issue -import { useSelector } from 'src/hooks/suite'; import { MessageSystemBanner } from 'src/components/suite/banners'; -import { GuideButton, GuideRouter } from 'src/components/guide'; -import { useGuide } from 'src/hooks/guide'; import { MAX_ONBOARDING_WIDTH } from 'src/constants/suite/layout'; +import { useGuide } from 'src/hooks/guide'; +import { useSelector } from 'src/hooks/suite'; import { NavSettings } from './NavSettings'; import { TrafficLightOffset } from '../../TrafficLightOffset'; diff --git a/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx b/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx index b95487436bb..77f258c01a8 100644 --- a/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx +++ b/packages/suite/src/components/suite/modals/ConfirmEvmExplanationModal.tsx @@ -1,16 +1,16 @@ import styled from 'styled-components'; -import { Image, NewModal, Paragraph } from '@trezor/components'; -import { Account } from '@suite-common/wallet-types'; import { networks } from '@suite-common/wallet-config'; -import { spacings } from '@trezor/theme'; +import { Account } from '@suite-common/wallet-types'; +import { Image, NewModal, Paragraph } from '@trezor/components'; import { CoinLogo } from '@trezor/product-components'; +import { spacings } from '@trezor/theme'; -import { Translation } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; +import { SUITE } from 'src/actions/suite/constants'; import { onCancel } from 'src/actions/suite/modalActions'; +import { Translation } from 'src/components/suite'; import { TranslationKey } from 'src/components/suite/Translation'; -import { SUITE } from 'src/actions/suite/constants'; +import { useDispatch, useSelector } from 'src/hooks/suite'; const ImageWrapper = styled.div` position: relative; diff --git a/packages/suite/src/components/suite/modals/Modal/DefaultRenderer.tsx b/packages/suite/src/components/suite/modals/Modal/DefaultRenderer.tsx index 387b8b94196..2de53e7061b 100644 --- a/packages/suite/src/components/suite/modals/Modal/DefaultRenderer.tsx +++ b/packages/suite/src/components/suite/modals/Modal/DefaultRenderer.tsx @@ -1,7 +1,7 @@ import { ReactPortal } from 'react'; import { createPortal } from 'react-dom'; -import { Modal, ModalProps, Icon, intermediaryTheme } from '@trezor/components'; +import { Icon, Modal, ModalProps, intermediaryTheme } from '@trezor/components'; import { useGuide } from 'src/hooks/guide'; import { useLayoutSize } from 'src/hooks/suite/useLayoutSize'; diff --git a/packages/suite/src/components/suite/modals/Modal/DialogRenderer.tsx b/packages/suite/src/components/suite/modals/Modal/DialogRenderer.tsx index 043638a9229..5baa4d98410 100644 --- a/packages/suite/src/components/suite/modals/Modal/DialogRenderer.tsx +++ b/packages/suite/src/components/suite/modals/Modal/DialogRenderer.tsx @@ -6,7 +6,7 @@ import { DialogModal as BaseDialogModal, DialogModalProps } from '@trezor/compon import { useModalTarget } from 'src/support/suite/ModalContext'; import { ModalEnvironment } from '../ModalEnvironment'; -import { ModalProps, Modal } from './Modal'; +import { Modal, ModalProps } from './Modal'; /** * @deprecated Use NewModal. diff --git a/packages/suite/src/components/suite/modals/ModalSwitcher/DiscoveryLoader.tsx b/packages/suite/src/components/suite/modals/ModalSwitcher/DiscoveryLoader.tsx index 0bb9894c8f6..faed18f50dc 100644 --- a/packages/suite/src/components/suite/modals/ModalSwitcher/DiscoveryLoader.tsx +++ b/packages/suite/src/components/suite/modals/ModalSwitcher/DiscoveryLoader.tsx @@ -1,11 +1,11 @@ -import { H3, Spinner, Column } from '@trezor/components'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { Column, H3, Spinner } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; import { CardWithDevice } from 'src/views/suite/SwitchDevice/CardWithDevice'; import { SwitchDeviceModal } from 'src/views/suite/SwitchDevice/SwitchDeviceModal'; -import { useSelector } from 'src/hooks/suite'; export const DiscoveryLoader = () => { const device = useSelector(selectSelectedDevice); diff --git a/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx b/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx index 083bd676671..57ed7346677 100644 --- a/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx +++ b/packages/suite/src/components/suite/modals/ModalSwitcher/ForegroundAppModal.tsx @@ -1,17 +1,17 @@ import { FunctionComponent } from 'react'; -import { FirmwareUpdate } from 'src/views/firmware/FirmwareUpdate'; +import { closeModalApp } from 'src/actions/suite/routerActions'; +import { useDispatch } from 'src/hooks/suite'; +import type { ForegroundAppRoute } from 'src/types/suite'; +import { Backup } from 'src/views/backup/Backup'; import { FirmwareCustom } from 'src/views/firmware/FirmwareCustom'; +import { FirmwareUpdate } from 'src/views/firmware/FirmwareUpdate'; import { Recovery } from 'src/views/recovery'; -import { Backup } from 'src/views/backup/Backup'; -import { useDispatch } from 'src/hooks/suite'; -import { closeModalApp } from 'src/actions/suite/routerActions'; +import { SwitchDevice } from 'src/views/suite/SwitchDevice/SwitchDevice'; import { BridgeUnavailable } from 'src/views/suite/bridge'; +import { BridgeRequested } from 'src/views/suite/bridge-requested'; 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 { BridgeRequested } from 'src/views/suite/bridge-requested'; import { MultiShareBackupModal } from '../ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupModal'; diff --git a/packages/suite/src/components/suite/modals/ModalSwitcher/ModalSwitcher.tsx b/packages/suite/src/components/suite/modals/ModalSwitcher/ModalSwitcher.tsx index be17cf14e3e..e418edd72b4 100644 --- a/packages/suite/src/components/suite/modals/ModalSwitcher/ModalSwitcher.tsx +++ b/packages/suite/src/components/suite/modals/ModalSwitcher/ModalSwitcher.tsx @@ -1,8 +1,8 @@ import { usePreferredModal } from 'src/hooks/suite/usePreferredModal'; -import { ReduxModal } from '../ReduxModal/ReduxModal'; -import { ForegroundAppModal } from './ForegroundAppModal'; import { DiscoveryLoader } from './DiscoveryLoader'; +import { ForegroundAppModal } from './ForegroundAppModal'; +import { ReduxModal } from '../ReduxModal/ReduxModal'; /** Displays whichever redux modal or foreground app should be displayed */ export const ModalSwitcher = () => { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/CardanoWithdrawModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/CardanoWithdrawModal.tsx index b95512c34f2..26a271edc44 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/CardanoWithdrawModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/CardanoWithdrawModal.tsx @@ -1,10 +1,10 @@ -import { Icon, Link, NewModal, Row, Column, Text, Card, Paragraph } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { getNetworkName } from '@suite-common/wallet-utils'; +import { Card, Column, Icon, Link, NewModal, Paragraph, Row, Text } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; import { useCardanoStaking } from 'src/hooks/wallet/useCardanoStaking'; -import { Translation } from 'src/components/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; export const CardanoWithdrawModal = ({ onCancel }: { onCancel: () => void }) => { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmAddressModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmAddressModal.tsx index ea86a427493..cf98615a5c5 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmAddressModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmAddressModal.tsx @@ -1,12 +1,12 @@ import { useCallback } from 'react'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; import { getDisplaySymbol, getNetwork, getNetworkDisplaySymbol, getNetworkFeatures, } from '@suite-common/wallet-config'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; import { showAddress } from 'src/actions/wallet/receiveActions'; import { Translation } from 'src/components/suite'; 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 891e5aa5626..ce29035af1c 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/ConfirmValueModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/ConfirmValueModal.tsx @@ -1,31 +1,31 @@ -import { useEffect, ReactNode } from 'react'; +import { ReactNode, useEffect } from 'react'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { selectSelectedDevice, selectSelectedDeviceLabelOrName } from '@suite-common/wallet-core'; +import { Account } from '@suite-common/wallet-types'; import { - Tooltip, - NewModal, Banner, + Card, + Column, + NewModal, NewModalProps, Paragraph, Row, - Column, - Card, + Tooltip, } from '@trezor/components'; import { copyToClipboard } from '@trezor/dom-utils'; -import { selectSelectedDevice, selectSelectedDeviceLabelOrName } from '@suite-common/wallet-core'; -import { Account } from '@suite-common/wallet-types'; -import { palette, spacings } from '@trezor/theme'; import { ConfirmOnDevice } from '@trezor/product-components'; +import { palette, spacings } from '@trezor/theme'; -import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; +import { MODAL } from 'src/actions/suite/constants'; +import { Translation } from 'src/components/suite'; 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 { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; import { DisplayMode, ThunkAction } from 'src/types/suite'; -import { TransactionReviewStepIndicator } from '../TransactionReviewModal/TransactionReviewOutputList/TransactionReviewStepIndicator'; import { TransactionReviewOutputElement } from '../TransactionReviewModal/TransactionReviewOutputList/TransactionReviewOutputElement'; +import { TransactionReviewStepIndicator } from '../TransactionReviewModal/TransactionReviewOutputList/TransactionReviewStepIndicator'; export interface ConfirmValueModalProps extends Pick { 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 fcfb3f256dd..184a8a5a279 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/DeviceDisconnected.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/DeviceDisconnected.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { Paragraph, Image, variables } from '@trezor/components'; +import { Image, Paragraph, variables } from '@trezor/components'; import { borders } from '@trezor/theme'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmXpubModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmXpubModal.tsx index d1b53a2a32e..15509f6b8b9 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/ConfirmXpubModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/ConfirmXpubModal.tsx @@ -1,12 +1,12 @@ +import { getNetwork } from '@suite-common/wallet-config'; import { selectSelectedDevice } from '@suite-common/wallet-core'; import { convertTaprootXpub } from '@trezor/utils'; -import { getNetwork } from '@suite-common/wallet-config'; -import { Translation } from 'src/components/suite'; import { showXpub } from 'src/actions/wallet/publicKeyActions'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; +import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; +import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { DisplayMode } from 'src/types/suite'; import { ConfirmValueModal, ConfirmValueModalProps } from './ConfirmValueModal/ConfirmValueModal'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/CopyAddressModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/CopyAddressModal.tsx index 22c88220ec2..725a5789474 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/CopyAddressModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/CopyAddressModal.tsx @@ -1,14 +1,14 @@ import { useState } from 'react'; -import { copyToClipboard } from '@trezor/dom-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; -import { H2, Card, Paragraph, NewModal, Checkbox } from '@trezor/components'; import { AddressType } from '@suite-common/wallet-types'; +import { Card, Checkbox, H2, NewModal, Paragraph } from '@trezor/components'; +import { copyToClipboard } from '@trezor/dom-utils'; import { spacings } from '@trezor/theme'; -import { useDispatch } from 'src/hooks/suite/useDispatch'; -import { Translation } from 'src/components/suite'; import { setFlag } from 'src/actions/suite/suiteActions'; +import { Translation } from 'src/components/suite'; +import { useDispatch } from 'src/hooks/suite/useDispatch'; const getAddressTypeText = (addressType: AddressType) => { switch (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 dcb4989647e..ef9fa11783e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceConfirmationModal/NoBackupModal.tsx @@ -1,11 +1,11 @@ -import { NewModal, Paragraph, H2 } from '@trezor/components'; +import { H2, NewModal, Paragraph } 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 { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch } from 'src/hooks/suite/useDispatch'; 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 1a83d6c6f21..53b6cc7745c 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmActionModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmActionModal.tsx @@ -2,15 +2,15 @@ import { useIntl } from 'react-intl'; import styled from 'styled-components'; -import TrezorConnect from '@trezor/connect'; import { H2, NewModal } from '@trezor/components'; +import TrezorConnect from '@trezor/connect'; 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 { Translation } from 'src/components/suite/Translation'; import messages from 'src/support/messages'; +import { TrezorDevice } from 'src/types/suite'; const ImageWrapper = styled.div` display: flex; 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 3fdc5ded1ed..f9abe034021 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmFingerprintModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/ConfirmFingerprintModal.tsx @@ -2,9 +2,9 @@ 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 { Modal, ModalProps, Translation } from 'src/components/suite'; +import { TrezorDevice } from 'src/types/suite'; 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 083bfb81f10..8e678636a26 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/DeviceContextModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/DeviceContextModal.tsx @@ -1,24 +1,24 @@ import { useIntl } from 'react-intl'; -import TrezorConnect, { UI } from '@trezor/connect'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import TrezorConnect, { UI } from '@trezor/connect'; -import messages from 'src/support/messages'; import { MODAL } from 'src/actions/suite/constants'; -import { useSelector } from 'src/hooks/suite'; import { - PinModal, - PinInvalidModal, - PassphraseModal, - PassphraseOnDeviceModal, ConfirmActionModal, - ConfirmFingerprintModal, - WordModal, - WordAdvancedModal, - TransactionReviewModal, ConfirmAddressModal, + ConfirmFingerprintModal, ConfirmXpubModal, + PassphraseModal, + PassphraseOnDeviceModal, + PinInvalidModal, + PinModal, + TransactionReviewModal, + WordAdvancedModal, + WordModal, } from 'src/components/suite/modals'; +import { useSelector } from 'src/hooks/suite'; +import messages from 'src/support/messages'; import type { ReduxModalProps } from '../ReduxModal'; 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 ff9b639a8fc..e547385a214 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseModal.tsx @@ -1,23 +1,23 @@ import { useCallback } from 'react'; -import { Paragraph, Column, H3, List, Icon } from '@trezor/components'; import { - selectIsDiscoveryAuthConfirmationRequired, onPassphraseSubmit, selectDeviceModel, + selectIsDiscoveryAuthConfirmationRequired, } from '@suite-common/wallet-core'; +import { Column, H3, Icon, List, Paragraph } from '@trezor/components'; import TrezorConnect from '@trezor/connect'; +import { PassphraseTypeCard } from '@trezor/product-components'; 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 { OpenGuideFromTooltip } from 'src/components/guide'; import { Translation } from 'src/components/suite'; +import { TrezorLink } from 'src/components/suite/TrezorLink'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import type { TrezorDevice } from 'src/types/suite'; -import { OpenGuideFromTooltip } from 'src/components/guide'; import { CardWithDevice } from 'src/views/suite/SwitchDevice/CardWithDevice'; import { SwitchDeviceModal } from 'src/views/suite/SwitchDevice/SwitchDeviceModal'; -import { TrezorLink } from 'src/components/suite/TrezorLink'; import { PassphraseWalletConfirmation } from './PassphraseWalletConfirmation'; 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 02fadac7cf6..08ba9a41207 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseOnDeviceModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseOnDeviceModal.tsx @@ -2,20 +2,20 @@ import { useIntl } from 'react-intl'; import styled from 'styled-components'; -import { H2, NewModal, Paragraph } from '@trezor/components'; -import { ConfirmOnDevice } from '@trezor/product-components'; import { - selectSelectedDeviceLabelOrName, selectIsDiscoveryAuthConfirmationRequired, + selectSelectedDeviceLabelOrName, } from '@suite-common/wallet-core'; +import { H2, NewModal, Paragraph } from '@trezor/components'; import TrezorConnect from '@trezor/connect'; +import { ConfirmOnDevice } from '@trezor/product-components'; import { spacings } from '@trezor/theme'; +import { DeviceConfirmImage } from 'src/components/suite/DeviceConfirmImage'; import { Translation } from 'src/components/suite/Translation'; import { useSelector } from 'src/hooks/suite'; -import { DeviceConfirmImage } from 'src/components/suite/DeviceConfirmImage'; -import type { TrezorDevice } from 'src/types/suite'; import messages from 'src/support/messages'; +import type { TrezorDevice } from 'src/types/suite'; const ImageWrapper = styled.div` display: flex; 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 3617a89b11b..a4f220ede03 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep1.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep1.tsx @@ -1,15 +1,15 @@ import { Dispatch } from 'react'; +import { Button, Card, Column, H3, Paragraph, Row } from '@trezor/components'; +import { CoinLogo } from '@trezor/product-components'; import { spacings } from '@trezor/theme'; -import { Column, Card, Row, Button, H3, Paragraph } from '@trezor/components'; import { HELP_CENTER_PASSPHRASE_URL } from '@trezor/urls'; -import { CoinLogo } from '@trezor/product-components'; -import { Translation } from 'src/components/suite/Translation'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { onCancel as onCancelModal } from 'src/actions/suite/modalActions'; +import { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite/Translation'; import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; import { ContentType } from './types'; 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 2054bd3bc49..eab9031fa95 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep2.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep2.tsx @@ -1,6 +1,6 @@ import { Dispatch } from 'react'; -import { Button, Text, Banner, Card, Icon, H3, Column, List } from '@trezor/components'; +import { Banner, Button, Card, Column, H3, Icon, List, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite/Translation'; 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 412d8b03231..7c1c4824120 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep3.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PassphraseWalletConfirmationStep3.tsx @@ -1,10 +1,10 @@ +import { selectDeviceFeatures, selectDeviceModel } from '@suite-common/wallet-core'; 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 { Translation } from 'src/components/suite/Translation'; 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 8531f4ab686..be1abc8b29e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinInvalidModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinInvalidModal.tsx @@ -3,10 +3,10 @@ import styled from 'styled-components'; import { selectSelectedDeviceLabelOrName } 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'; +import { Translation } from 'src/components/suite/Translation'; import { useSelector } from 'src/hooks/suite'; +import { TrezorDevice } from 'src/types/suite'; const Divider = styled.div` margin-bottom: 10px; 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 d0c618d13c4..849f3607244 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/PinModal.tsx @@ -1,13 +1,13 @@ import styled from 'styled-components'; -import TrezorConnect from '@trezor/connect'; import { selectSelectedDeviceLabelOrName } from '@suite-common/wallet-core'; +import TrezorConnect from '@trezor/connect'; import { Modal, ModalProps, PinMatrix, Translation } from 'src/components/suite'; import { PIN_MATRIX_MAX_WIDTH } from 'src/components/suite/PinMatrix/PinMatrix'; +import { useSelector } from 'src/hooks/suite'; import { usePin } from 'src/hooks/suite/usePinModal'; import { TrezorDevice } from 'src/types/suite'; -import { useSelector } from 'src/hooks/suite'; const StyledModal = styled(Modal)<{ $isExtended: boolean }>` width: unset; 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 f5afc55cfab..184bf4ea0a8 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordAdvancedModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordAdvancedModal.tsx @@ -2,16 +2,16 @@ import { useIntl } from 'react-intl'; import styled from 'styled-components'; -import TrezorConnect from '@trezor/connect'; import { Paragraph } from '@trezor/components'; +import TrezorConnect from '@trezor/connect'; import { HELP_CENTER_ADVANCED_RECOVERY_URL } from '@trezor/urls'; import { - Translation, - WordInputAdvanced, - TrezorLink, Modal, ModalProps, + Translation, + TrezorLink, + WordInputAdvanced, } from 'src/components/suite'; import messages from 'src/support/messages'; 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 41a6cc7e43e..4a44cd58359 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/DeviceContextModal/WordModal.tsx @@ -4,7 +4,7 @@ import styled from 'styled-components'; import TrezorConnect from '@trezor/connect'; -import { Translation, WordInput, Modal, ModalProps } from 'src/components/suite'; +import { Modal, ModalProps, Translation, WordInput } from 'src/components/suite'; 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 debac0d4ce0..f47e76b10e5 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/ReduxModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/ReduxModal.tsx @@ -2,8 +2,8 @@ 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'; +import { DeviceContextModal } from './DeviceContextModal/DeviceContextModal'; import { UserContextModal } from './UserContextModal/UserContextModal'; export type ReduxModalProps< 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 7ad012d947a..873a0517b4e 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,10 @@ -import { Banner } from '@trezor/components'; import { networks } from '@suite-common/wallet-config'; -import { spacings } from '@trezor/theme'; import { StakeType } from '@suite-common/wallet-types'; +import { Banner } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; +import { Account } from 'src/types/wallet'; type TransactionReviewEvmExplanationProps = { account: Account; 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 8cea753405d..6a9e3d43370 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModal.tsx @@ -1,5 +1,5 @@ import { UserContextPayload } from '@suite-common/suite-types'; -import { selectStake, cancelSignSendFormTransactionThunk } from '@suite-common/wallet-core'; +import { cancelSignSendFormTransactionThunk, selectStake } from '@suite-common/wallet-core'; import { cancelSignTx as cancelSignStakingTx } from 'src/actions/wallet/stakeActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; 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 048f004d851..210bfdd62a2 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx @@ -2,35 +2,35 @@ import { useState } from 'react'; import styled from 'styled-components'; -import { variables } from '@trezor/components'; -import { Deferred } from '@trezor/utils'; +import { networks } from '@suite-common/wallet-config'; import { DeviceRootState, - selectSelectedDevice, + SendState, + StakeState, selectPrecomposedSendForm, + selectSelectedDevice, selectSendFormReviewButtonRequestsCount, selectStakePrecomposedForm, - StakeState, - SendState, } from '@suite-common/wallet-core'; import { FormState, StakeFormState } from '@suite-common/wallet-types'; import { constructTransactionReviewOutputs, - isRbfTransaction, getTxStakeNameByDataHex, + isRbfTransaction, } from '@suite-common/wallet-utils'; +import { variables } from '@trezor/components'; import { ConfirmOnDevice } from '@trezor/product-components'; -import { networks } from '@suite-common/wallet-config'; +import { Deferred } from '@trezor/utils'; +import { Modal, Translation } from 'src/components/suite'; 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 { selectAccountIncludingChosenInTrading } from 'src/reducers/wallet/selectedAccountReducer'; +import { getTransactionReviewModalActionText } from 'src/utils/suite/transactionReview'; -import { TransactionReviewSummary } from './TransactionReviewSummary'; -import { TransactionReviewOutputList } from './TransactionReviewOutputList/TransactionReviewOutputList'; import { TransactionReviewEvmExplanation } from './TransactionReviewEvmExplanation'; +import { TransactionReviewOutputList } from './TransactionReviewOutputList/TransactionReviewOutputList'; +import { TransactionReviewSummary } from './TransactionReviewSummary'; import { ConfirmActionModal } from '../DeviceContextModal/ConfirmActionModal'; const StyledModal = styled(Modal)` 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 ef47c1ed585..d7de163a5ef 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,7 +1,7 @@ import styled, { useTheme } from 'styled-components'; -import { variables, Card, Icon } from '@trezor/components'; import { GeneralPrecomposedTransactionFinal } from '@suite-common/wallet-types'; +import { Card, Icon, variables } from '@trezor/components'; import { borders, typography, zIndices } from '@trezor/theme'; import { Translation } from 'src/components/suite'; 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 1ebd681211a..926c0110ced 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,24 +1,24 @@ import { ReactNode, forwardRef } from 'react'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { formatNetworkAmount, formatAmount, isTestnet } from '@suite-common/wallet-utils'; +import { TranslationKey } from '@suite-common/intl-types'; +import { NetworkSymbol, getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { BTC_LOCKTIME_VALUE } from '@suite-common/wallet-constants'; -import { getNetworkDisplaySymbol, NetworkSymbol } from '@suite-common/wallet-config'; import { ReviewOutput, StakeType } from '@suite-common/wallet-types'; -import { TranslationKey } from '@suite-common/intl-types'; +import { formatAmount, formatNetworkAmount, isTestnet } from '@suite-common/wallet-utils'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import type { Account } from 'src/types/wallet'; -import { useDisplayMode, useTranslation } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; +import { useDisplayMode, useTranslation } from 'src/hooks/suite'; +import type { Account } from 'src/types/wallet'; +import { + OutputElementLine, + TransactionReviewOutputElement, +} from './TransactionReviewOutputElement'; import { TransactionReviewStepIndicator, TransactionReviewStepIndicatorProps, } from './TransactionReviewStepIndicator'; -import { - TransactionReviewOutputElement, - OutputElementLine, -} from './TransactionReviewOutputElement'; 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 dfad1d18aa9..1443b1b340a 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,16 +1,16 @@ -import { forwardRef, ReactNode } from 'react'; +import { ReactNode, forwardRef } from 'react'; import styled from 'styled-components'; -import { variables } from '@trezor/components'; import { type NetworkSymbol } from '@suite-common/wallet-config'; -import { TokenInfo } from '@trezor/connect'; import { amountToSmallestUnit } from '@suite-common/wallet-utils'; +import { variables } from '@trezor/components'; +import { TokenInfo } from '@trezor/connect'; import { zIndices } from '@trezor/theme'; -import { Account } from 'src/types/wallet'; import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { DisplayMode } from 'src/types/suite'; +import { Account } from 'src/types/wallet'; import { TransactionReviewStepIndicatorProps } from './TransactionReviewStepIndicator'; import { DeviceDisplay } from '../../../../DeviceDisplay/DeviceDisplay'; 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 0c6ea927d3e..adca3da1996 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 @@ -2,23 +2,23 @@ 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 { notificationsActions } from '@suite-common/toast-notifications'; import { TranslationKey } from '@suite-common/intl-types'; -import { copyToClipboard, download } from '@trezor/dom-utils'; +import { notificationsActions } from '@suite-common/toast-notifications'; import type { FormState, GeneralPrecomposedTransactionFinal } from '@suite-common/wallet-types'; -import { getTransactionReviewOutputState } from '@suite-common/wallet-utils'; import { ReviewOutput, StakeFormState, StakeType } from '@suite-common/wallet-types'; +import { getTransactionReviewOutputState } from '@suite-common/wallet-utils'; +import { Banner, Button, variables } from '@trezor/components'; +import { copyToClipboard, download } from '@trezor/dom-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; 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 { useDispatch } from 'src/hooks/suite'; +import type { Account } from 'src/types/wallet'; -import { TransactionReviewTotalOutput } from './TransactionReviewTotalOutput'; -import { TransactionReviewOutput } from './TransactionReviewOutput'; import { TransactionReviewDetails } from './TransactionReviewDetails'; +import { TransactionReviewOutput } from './TransactionReviewOutput'; +import { TransactionReviewTotalOutput } from './TransactionReviewTotalOutput'; const Content = styled.div` display: flex; 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 a9f771312bf..66c1b7b79b1 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,27 +1,27 @@ import { forwardRef } from 'react'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { StakeType } from '@suite-common/wallet-types'; import { formatAmount, formatNetworkAmount, - isTestnet, - getTransactionReviewOutputState, - getIsUpdatedSendFlow, getIsUpdatedEthereumSendFlow, + getIsUpdatedSendFlow, + getTransactionReviewOutputState, + isTestnet, } from '@suite-common/wallet-utils'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; -import { StakeType } from '@suite-common/wallet-types'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { TrezorDevice } from 'src/types/suite'; import { Translation } from 'src/components/suite/Translation'; import { useSelector } from 'src/hooks/suite/useSelector'; +import { TrezorDevice } from 'src/types/suite'; -import { TransactionReviewStepIndicator } from './TransactionReviewStepIndicator'; import { - TransactionReviewOutputElement, OutputElementLine, + TransactionReviewOutputElement, } from './TransactionReviewOutputElement'; import type { TransactionReviewOutputListProps } from './TransactionReviewOutputList'; +import { TransactionReviewStepIndicator } from './TransactionReviewStepIndicator'; 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 c679b612b54..b26a3b9df6d 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewSummary.tsx @@ -1,19 +1,19 @@ 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 { formatDuration } from '@suite-common/suite-utils'; import { Network, NetworkType } from '@suite-common/wallet-config'; import { GeneralPrecomposedTransactionFinal, StakeType } from '@suite-common/wallet-types'; +import { formatAmount, formatNetworkAmount, getFee, getFeeUnits } from '@suite-common/wallet-utils'; +import { Icon, variables } from '@trezor/components'; import { CoinLogo } from '@trezor/product-components'; +import { borders, spacingsPx, typography } from '@trezor/theme'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Translation, FormattedCryptoAmount, AccountLabel } from 'src/components/suite'; -import { Account } from 'src/types/wallet'; +import { AccountLabel, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; +import { Account } from 'src/types/wallet'; 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 b6e485ea950..ea1105d5726 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UnhideTokenModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UnhideTokenModal.tsx @@ -1,18 +1,18 @@ import { useState } from 'react'; -import { H2, Paragraph, Card, Checkbox, NewModal } from '@trezor/components'; import { DefinitionType, - tokenDefinitionsActions, TokenManagementAction, + tokenDefinitionsActions, } from '@suite-common/token-definitions'; +import { Card, Checkbox, H2, NewModal, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { setFlag } from 'src/actions/suite/suiteActions'; import { Translation } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; import { useDispatch } from 'src/hooks/suite/useDispatch'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { useSelector } from 'src/hooks/suite'; -import { setFlag } from 'src/actions/suite/suiteActions'; interface UnhideTokenModalProps { address: string; 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 202911e6be1..d513ec8ca24 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,13 +1,13 @@ -import { Paragraph, Column } from '@trezor/components'; import { - Bip43PathTemplate, AccountType, + Bip43PathTemplate, NetworkType, getNetwork, } from '@suite-common/wallet-config'; +import { Account } from '@suite-common/wallet-types'; import { getAccountTypeDesc, getAccountTypeUrl } from '@suite-common/wallet-utils'; +import { Column, Paragraph } from '@trezor/components'; 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'; 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 fdf7cb5822d..e2a113bb0ad 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,8 +1,8 @@ import styled from 'styled-components'; -import { Column, Paragraph, Select } from '@trezor/components'; -import { getAccountTypeName, getAccountTypeTech } from '@suite-common/wallet-utils'; import { NetworkAccount, NetworkSymbol, NetworkType } from '@suite-common/wallet-config'; +import { getAccountTypeName, getAccountTypeTech } from '@suite-common/wallet-utils'; +import { Column, Paragraph, Select } from '@trezor/components'; import { spacings, typography } from '@trezor/theme'; import { Translation } from 'src/components/suite/Translation'; 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 3bd13c9e911..61a6f50ab24 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 @@ -1,16 +1,16 @@ import { useCallback } from 'react'; -import { analytics, EventType } from '@trezor/suite-analytics'; -import { UnavailableCapability } from '@trezor/connect'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; import { Network, NetworkAccount } from '@suite-common/wallet-config'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { UnavailableCapability } from '@trezor/connect'; +import { EventType, analytics } from '@trezor/suite-analytics'; -import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; import { useAccountSearch, useSelector } from 'src/hooks/suite'; +import { Account } from 'src/types/wallet'; -import { AddCoinjoinAccountButton } from './AddCoinjoinAccountButton'; import { AddButton } from './AddButton'; +import { AddCoinjoinAccountButton } from './AddCoinjoinAccountButton'; const verifyAvailability = ({ emptyAccounts, 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 64a40b715b6..712d3d86cc0 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,7 +1,7 @@ import { ReactNode } from 'react'; -import { ButtonProps, Tooltip, NewModal } from '@trezor/components'; import { Network } from '@suite-common/wallet-config'; +import { ButtonProps, NewModal, Tooltip } from '@trezor/components'; import { Translation } from 'src/components/suite'; 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 0106aee57aa..2fda4dcc42a 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 @@ -1,20 +1,20 @@ import { useState } from 'react'; -import { createTimeoutPromise } from '@trezor/utils'; -import { UnavailableCapabilities } from '@trezor/connect'; -import { isDesktop } from '@trezor/env-utils'; -import { isDevEnv } from '@suite-common/suite-utils'; import { RequestEnableTorResponse } from '@suite-common/suite-config'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { isDevEnv } from '@suite-common/suite-utils'; import { Network, NetworkAccount, NetworkSymbol } from '@suite-common/wallet-config'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { UnavailableCapabilities } from '@trezor/connect'; +import { isDesktop } from '@trezor/env-utils'; +import { createTimeoutPromise } from '@trezor/utils'; -import { Translation } from 'src/components/suite'; -import { useSelector, useDispatch } from 'src/hooks/suite'; -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 { toggleTor } from 'src/actions/suite/suiteActions'; +import { createCoinjoinAccount } from 'src/actions/wallet/coinjoinAccountActions'; +import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectTorState } from 'src/reducers/suite/suiteReducer'; +import { Account } from 'src/types/wallet'; 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 7c51abfe5f1..68cc5f2bfe7 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 @@ -2,27 +2,27 @@ import { useState } from 'react'; import styled from 'styled-components'; +import { Network, NetworkAccount, NetworkSymbol, networks } from '@suite-common/wallet-config'; import { accountsActions } from '@suite-common/wallet-core'; -import { arrayPartition } from '@trezor/utils'; -import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; -import { networks, Network, NetworkSymbol, NetworkAccount } from '@suite-common/wallet-config'; import { CollapsibleBox, NewModal, Tooltip } from '@trezor/components'; +import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; import { spacings, spacingsPx } from '@trezor/theme'; +import { arrayPartition } from '@trezor/utils'; -import { Translation, CoinList } from 'src/components/suite'; -import { Account } from 'src/types/wallet'; -import { TrezorDevice } from 'src/types/suite'; -import { useSelector, useDispatch } from 'src/hooks/suite'; import { changeCoinVisibility } from 'src/actions/settings/walletSettingsActions'; import { goto } from 'src/actions/suite/routerActions'; -import { selectIsPublic } from 'src/reducers/wallet/coinjoinReducer'; +import { CoinList, Translation } from 'src/components/suite'; import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; +import { selectIsPublic } from 'src/reducers/wallet/coinjoinReducer'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; +import { TrezorDevice } from 'src/types/suite'; +import { Account } from 'src/types/wallet'; import { AccountTypeSelect } from './AccountTypeSelect/AccountTypeSelect'; -import { SelectNetwork } from './SelectNetwork'; import { AddAccountButton } from './AddAccountButton/AddAccountButton'; +import { SelectNetwork } from './SelectNetwork'; 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 8b2b5d37650..82d1d51b0a1 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddTokenModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AddTokenModal.tsx @@ -1,16 +1,16 @@ -import { useCallback, useEffect, useState, ChangeEvent } from 'react'; +import { ChangeEvent, useCallback, useEffect, useState } from 'react'; +import { isAddressValid, tryGetAccountIdentity } from '@suite-common/wallet-utils'; +import { Button, Input } from '@trezor/components'; 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 { EventType, analytics } from '@trezor/suite-analytics'; 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 { Account } from 'src/types/wallet'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { Account } from 'src/types/wallet'; interface AddTokenModalProps { onCancel: () => void; 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 19a1ab47bfb..98b5b1eefc6 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,13 +1,13 @@ import styled from 'styled-components'; +import { type NetworkSymbol, getNetwork } from '@suite-common/wallet-config'; import { variables } from '@trezor/components'; -import { getNetwork, type NetworkSymbol } from '@suite-common/wallet-config'; 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 { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; +import { getCoinLabel } from 'src/utils/suite/getCoinLabel'; import { CustomBackends } from './CustomBackends/CustomBackends'; 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 0cc9f84a96f..c9b15cf48b7 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,6 +1,6 @@ import { Input, Spinner, Tooltip } from '@trezor/components'; -import { Translation, StatusLight } from 'src/components/suite'; +import { StatusLight, Translation } 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 d3fa134c974..bdae13d781f 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 @@ -2,9 +2,9 @@ import { useMemo } from 'react'; import styled from 'styled-components'; +import { Network } from '@suite-common/wallet-config'; import { Select } from '@trezor/components'; 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'; 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 8b8599d7811..aa122a931a9 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,10 +1,10 @@ import styled from 'styled-components'; -import { Paragraph } from '@trezor/components'; import { type NetworkSymbol } from '@suite-common/wallet-config'; +import { Paragraph } from '@trezor/components'; -import { useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite/Translation'; +import { useSelector } from 'src/hooks/suite'; // 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 ca65428034f..3eb92cff6f6 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 @@ -2,19 +2,19 @@ import { useState } from 'react'; import styled from 'styled-components'; -import { Input, Button, H3, CollapsibleBox, Column } from '@trezor/components'; import { Network } from '@suite-common/wallet-config'; +import { Button, CollapsibleBox, Column, H3, Input } from '@trezor/components'; 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 { TooltipSymbol, Translation } from 'src/components/suite'; +import { useBackendsForm, useDefaultUrls } from 'src/hooks/settings/backends'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectTorState } from 'src/reducers/suite/suiteReducer'; -import ConnectionInfo from './ConnectionInfo'; import { BackendInput } from './BackendInput'; import { BackendTypeSelect } from './BackendTypeSelect'; +import ConnectionInfo from './ConnectionInfo'; import { TorModal, TorResult } from './TorModal'; // eslint-disable-next-line local-rules/no-override-ds-component 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 20b63bba831..fa99505736e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ApplicationLogModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ApplicationLogModal.tsx @@ -4,16 +4,16 @@ import styled from 'styled-components'; import { selectLogs } from '@suite-common/logger'; import { - Switch, - NewModal, Card, - Paragraph, - Text, - Row, Column, H4, - variables, + NewModal, + Paragraph, + Row, + Switch, + Text, useScrollShadow, + variables, } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceModal.tsx index 0dc5ece3a7b..a96b1ec3aa7 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/AuthenticateDeviceModal.tsx @@ -1,9 +1,9 @@ import { useState } from 'react'; import { checkDeviceAuthenticityThunk } from '@suite-common/device-authenticity'; -import { NewModal, List, IconName, Paragraph, Icon } from '@trezor/components'; -import { selectSelectedDeviceAuthenticity } from '@suite-common/wallet-core'; import { TranslationKey } from '@suite-common/intl-types'; +import { selectSelectedDeviceAuthenticity } from '@suite-common/wallet-core'; +import { Icon, IconName, List, NewModal, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { onCancel, openModal } from 'src/actions/suite/modalActions'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/BackgroundGalleryModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/BackgroundGalleryModal.tsx index 49b1260e519..521f3705afa 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/BackgroundGalleryModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/BackgroundGalleryModal.tsx @@ -1,4 +1,4 @@ -import { Translation, Modal, HomescreenGallery } from 'src/components/suite'; +import { HomescreenGallery, Modal, Translation } from 'src/components/suite'; type BackgroundGalleryModalProps = { onCancel: () => void; 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 0add1860480..4e02a86aa98 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CancelCoinjoinModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CancelCoinjoinModal.tsx @@ -2,11 +2,11 @@ import styled from 'styled-components'; import { Button } from '@trezor/components'; -import { useSelector } from 'src/hooks/suite/useSelector'; +import { stopCoinjoinSession } from 'src/actions/wallet/coinjoinClientActions'; import { Modal, Translation } from 'src/components/suite'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { useDispatch } from 'src/hooks/suite'; -import { stopCoinjoinSession } from 'src/actions/wallet/coinjoinClientActions'; +import { useSelector } from 'src/hooks/suite/useSelector'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; const StyledModal = styled(Modal)` width: 435px; 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 4641d1c2608..0e11083d351 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,17 +1,17 @@ import { useEffect } from 'react'; -import { Paragraph, Tooltip, Banner, Card, Column, InfoItem, NewModal } from '@trezor/components'; -import { spacings } from '@trezor/theme'; -import { getStakingDataForNetwork } from '@suite-common/wallet-utils'; -import type { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import type { SelectedAccountLoaded } from '@suite-common/wallet-types'; +import { getStakingDataForNetwork } from '@suite-common/wallet-utils'; +import { Banner, Card, Column, InfoItem, NewModal, Paragraph, Tooltip } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { Fees } from 'src/components/wallet/Fees/Fees'; -import { Translation, FiatValue, FormattedCryptoAmount } from 'src/components/suite'; import { useDevice, useSelector } from 'src/hooks/suite'; +import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; import { useClaimEthForm } from 'src/hooks/wallet/useClaimEthForm'; import { CRYPTO_INPUT } from 'src/types/wallet/stakeForms'; -import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; interface ClaimModalModalProps { onCancel?: () => void; 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 e3c3f5409d9..0319d45e44f 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CoinjoinSuccessModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/CoinjoinSuccessModal.tsx @@ -1,16 +1,16 @@ -import styled from 'styled-components'; import { transparentize } from 'polished'; +import styled from 'styled-components'; -import { Button, Icon, variables } from '@trezor/components'; import { selectAccountByKey } from '@suite-common/wallet-core'; import { WalletParams } from '@suite-common/wallet-types'; +import { Button, Icon, variables } from '@trezor/components'; -import { useDispatch } from 'src/hooks/suite'; +import { onCancel as closeModal } from 'src/actions/suite/modalActions'; import { goto } from 'src/actions/suite/routerActions'; +import { Modal, Translation } from 'src/components/suite'; +import { useDispatch } from 'src/hooks/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectRouterParams } from 'src/reducers/suite/routerReducer'; -import { onCancel as closeModal } from 'src/actions/suite/modalActions'; -import { Modal, Translation } from 'src/components/suite'; const StyledModal = styled(Modal)` width: 435px; 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 7ed151df01a..216270b5d46 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConfirmUnverifiedModal.tsx @@ -1,14 +1,14 @@ import { useEffect } from 'react'; -import { Button, H3, NewModal, Paragraph } from '@trezor/components'; import { selectSelectedDeviceLabelOrName } from '@suite-common/wallet-core'; +import { Button, H3, NewModal, Paragraph } from '@trezor/components'; +import { applySettings } from 'src/actions/settings/deviceSettingsActions'; +import { onCancel } from 'src/actions/suite/modalActions'; 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 { onCancel } from 'src/actions/suite/modalActions'; -import { applySettings } from 'src/actions/settings/deviceSettingsActions'; interface ConfirmUnverifiedModalProps { action: { diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConnectPopupModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConnectPopupModal.tsx index 0f17eefc057..0edeb6829b1 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConnectPopupModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/ConnectPopupModal.tsx @@ -1,4 +1,4 @@ -import { H2, Paragraph, NewModal } from '@trezor/components'; +import { H2, NewModal, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; 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 057a998e77f..785885e8887 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 @@ -2,15 +2,15 @@ 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 { Icon, IconName } from '@trezor/components'; import { borders, typography } from '@trezor/theme'; +import { toggleAutostopCoinjoin } from 'src/actions/wallet/coinjoinAccountActions'; import { Translation } from 'src/components/suite'; +import { useDispatch } from 'src/hooks/suite/useDispatch'; 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'; 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 4ff1b5509d1..c7b718bfd1f 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,13 +1,13 @@ import styled, { useTheme } from 'styled-components'; -import { Spinner, Icon } from '@trezor/components'; import { RoundPhase } from '@trezor/coinjoin'; +import { Icon, Spinner } from '@trezor/components'; 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 { Translation } from 'src/components/suite/Translation'; +import { SESSION_PHASE_MESSAGES } from 'src/constants/suite/coinjoin'; +import { CoinjoinSession, SessionPhase } from 'src/types/wallet/coinjoin'; 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 6781a3896c4..1af0a738d9e 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,16 +1,16 @@ import styled from 'styled-components'; -import { variables, Image } from '@trezor/components'; +import { Image, variables } 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 { ROUND_PHASE_MESSAGES } from 'src/constants/suite/coinjoin'; import { useCoinjoinSessionPhase } from 'src/hooks/coinjoin'; +import { useDevice, useSelector } from 'src/hooks/suite'; +import { selectCoinjoinAccountByKey } from 'src/reducers/wallet/coinjoinReducer'; -import { CoinjoinPhaseProgress } from './CoinjoinPhaseProgress'; import { AutoStopButton } from './AutoStopButton'; +import { CoinjoinPhaseProgress } from './CoinjoinPhaseProgress'; 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 a37f0afcfc9..580f5e6f27d 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,10 @@ import { useState } from 'react'; -import { Column, NewModal, Card, Banner, H3, Paragraph } from '@trezor/components'; +import { Banner, Card, Column, H3, NewModal, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Translation, CheckItem } from 'src/components/suite'; import { deviceAuthenticityOptOut } from 'src/actions/suite/suiteActions'; +import { CheckItem, Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; type DeviceAuthenticityOptOutModalProps = { 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 1f1da76a37f..2555cbd24fd 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorModal.tsx @@ -2,17 +2,17 @@ import { useState } from 'react'; import styled from 'styled-components'; -import { Button, H3, Paragraph, variables } from '@trezor/components'; import { UserContextPayload } from '@suite-common/suite-types'; +import { type NetworkSymbol, getNetwork } from '@suite-common/wallet-config'; import { blockchainActions } from '@suite-common/wallet-core'; -import { getNetwork, type NetworkSymbol } from '@suite-common/wallet-config'; +import { Button, H3, Paragraph, variables } from '@trezor/components'; import { CoinLogo } from '@trezor/product-components'; import { Modal, Translation } from 'src/components/suite'; +import { AdvancedCoinSettingsModal } from 'src/components/suite/modals'; +import { useCustomBackends } from 'src/hooks/settings/backends'; import { useDispatch } from 'src/hooks/suite'; 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; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorStopCoinjoinModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorStopCoinjoinModal.tsx index ff58083e293..47ff7b703ea 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorStopCoinjoinModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/DisableTorStopCoinjoinModal.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components'; -import { Button, Paragraph } from '@trezor/components'; import { UserContextPayload } from '@suite-common/suite-types'; +import { Button, Paragraph } from '@trezor/components'; import { Modal, Translation } from 'src/components/suite'; 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 82701d30d3e..b5355d6691d 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,10 @@ import { useState } from 'react'; -import { Column, NewModal, Banner, Card, H3, Paragraph } from '@trezor/components'; +import { Banner, Card, Column, H3, NewModal, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Translation, CheckItem } from 'src/components/suite'; import { toggleCheckFirmwareAuthenticity } from 'src/actions/suite/suiteActions'; +import { CheckItem, Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; type DeviceAuthenticityOptOutModalProps = { 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 74361ba357b..0337dd667ac 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,8 +1,8 @@ -import { useState, useRef, useEffect } from 'react'; +import { useEffect, useRef, useState } from 'react'; import styled from 'styled-components'; -import { Switch, Input, variables } from '@trezor/components'; +import { Input, Switch, variables } from '@trezor/components'; import { Translation } from 'src/components/suite'; 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 57545227c97..2fccf2876e6 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,11 @@ import { useState } from 'react'; +import { AnimatePresence, motion } from 'framer-motion'; 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 { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { Icon, Paragraph, motionAnimation } from '@trezor/components'; +import { borders, spacingsPx, typography } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { useSelector, useTranslation } from 'src/hooks/suite'; 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 02e42190ac4..e46079d39c2 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 @@ -3,17 +3,17 @@ import { useState } from 'react'; import styled from 'styled-components'; import { UserContextPayload } from '@suite-common/suite-types'; -import { parseCSV } from '@suite-common/wallet-utils'; import { networksCollection } from '@suite-common/wallet-config'; +import { parseCSV } from '@suite-common/wallet-utils'; -import { Translation, Modal } from 'src/components/suite'; -import type { ExtendedMessageDescriptor } from 'src/types/suite'; +import { Modal, Translation } from 'src/components/suite'; import { DropZone } from 'src/components/suite/DropZone'; +import type { ExtendedMessageDescriptor } from 'src/types/suite'; import { DelimiterForm } from './DelimiterForm'; import { ExampleCSV } from './ExampleCSV'; -import { TabSelection, TabId } from './TabSelection'; import { InputCSV } from './InputCSV'; +import { TabId, TabSelection } from './TabSelection'; const StyledModal = styled(Modal)` width: 600px; 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 4f657d3308e..b6aa80176b7 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 @@ -2,7 +2,7 @@ import { useRef } from 'react'; import styled from 'styled-components'; -import { Textarea, Button } from '@trezor/components'; +import { Button, Textarea } from '@trezor/components'; import { Translation } from 'src/components/suite'; 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 675e3d953b6..fa02c6761c6 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,13 @@ 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 { Button, NewModal, Paragraph, Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import type { Deferred } from '@trezor/utils'; +import { connectProvider } from 'src/actions/suite/metadataProviderActions'; import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; -import { connectProvider } from 'src/actions/suite/metadataProviderActions'; import { MetadataProviderType } from 'src/types/suite/metadata'; import { DropboxLogo } from './DropboxLogo'; 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 68e27f135ca..83dc093b042 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MoreRoundsNeededModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MoreRoundsNeededModal.tsx @@ -2,9 +2,9 @@ import styled, { useTheme } from 'styled-components'; 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'; +import { useDispatch } from 'src/hooks/suite'; const StyledModal = styled(Modal)` width: 435px; 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 3bb0d782f90..9c0d8c4f129 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 @@ -2,18 +2,18 @@ import { useState } from 'react'; import { selectSelectedDevice } from '@suite-common/wallet-core'; import { NewModal, NewModalProps } from '@trezor/components'; +import TrezorConnect, { PROTO } from '@trezor/connect'; +import { ConfirmOnDevice } from '@trezor/product-components'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { HELP_CENTER_KEEPING_SEED_SAFE_URL, - TREZOR_SUPPORT_RECOVERY_ISSUES_URL, HELP_CENTER_UPGRADING_TO_MULTI_SHARE_URL, + TREZOR_SUPPORT_RECOVERY_ISSUES_URL, } from '@trezor/urls'; -import TrezorConnect, { PROTO } from '@trezor/connect'; -import { EventType, analytics } from '@trezor/suite-analytics'; -import { ConfirmOnDevice } from '@trezor/product-components'; -import { useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; +import { useSelector } from 'src/hooks/suite'; import { MultiShareBackupStep1 } from './MultiShareBackupStep1'; import { MultiShareBackupStep2to4 } from './MultiShareBackupStep2to4'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep1.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep1.tsx index b697f4ac6a9..37bebdb3308 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep1.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep1.tsx @@ -1,6 +1,6 @@ import { Dispatch, SetStateAction } from 'react'; -import { Checkbox, Paragraph, Card, Column, H4 } from '@trezor/components'; +import { Card, Checkbox, Column, H4, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep2to4.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep2to4.tsx index 9794cb1f33d..99112673911 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep2to4.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep2to4.tsx @@ -1,21 +1,21 @@ import { ReactNode } from 'react'; +import { TranslationKey } from '@suite-common/intl-types'; import { BulletList, BulletListItemState, - Paragraph, - Grid, Card, + Flex, + FlexDirection, + Grid, Icon, IconName, - Flex, Note, + Paragraph, Row, - FlexDirection, } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { ESHOP_KEEP_METAL_SINGLE_SHARE_URL, HELP_CENTER_SEED_CARD_URL } from '@trezor/urls'; -import { TranslationKey } from '@suite-common/intl-types'; import { Translation, TrezorLink } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5.tsx index c8867402140..59795ba47bf 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/MultiShareBackupModal/MultiShareBackupStep5.tsx @@ -1,16 +1,16 @@ +import { TranslationKey } from '@suite-common/intl-types'; import { + Banner, Card, Column, - Paragraph, - Icon, - H4, Grid, - List, - Banner, + H4, + Icon, IconName, + List, + Paragraph, } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { TranslationKey } from '@suite-common/intl-types'; import { Translation } from 'src/components/suite'; 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 d6e7b47ea51..1a6bf4bd92a 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,5 @@ -import { Button, Column, H3, Text } from '@trezor/components'; import { authorizeDeviceThunk, switchDuplicatedDevice } from '@suite-common/wallet-core'; +import { Button, Column, H3, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; 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 59cbb19e6ba..21912cf690d 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PassphraseMismatchModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PassphraseMismatchModal.tsx @@ -1,14 +1,14 @@ -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 { Button, Column, H3, Text } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { useDevice, useDispatch } from 'src/hooks/suite'; -import { CardWithDevice } from 'src/views/suite/SwitchDevice/CardWithDevice'; import { addWalletThunk, redirectAfterWalletSelectedThunk, } from 'src/actions/wallet/addWalletThunk'; +import { useDevice, useDispatch } from 'src/hooks/suite'; +import { CardWithDevice } from 'src/views/suite/SwitchDevice/CardWithDevice'; import { SwitchDeviceModal } from 'src/views/suite/SwitchDevice/SwitchDeviceModal'; import { Translation } from '../../../Translation'; 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 ab636e11977..48ef4e1ffec 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PinMismatchModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/PinMismatchModal.tsx @@ -2,8 +2,8 @@ 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 { Modal, ModalProps, Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; // eslint-disable-next-line local-rules/no-override-ds-component 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 3c2c1e97297..98f2b67f956 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/QrScannerModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/QrScannerModal.tsx @@ -1,9 +1,9 @@ -import { lazy, Suspense, useState } from 'react'; +import { Suspense, lazy, useState } from 'react'; import styled from 'styled-components'; import { UserContextPayload } from '@suite-common/suite-types'; -import { Icon, Paragraph, NewModalProps, NewModal, Row, Column, Card } from '@trezor/components'; +import { Card, Column, Icon, NewModal, NewModalProps, Paragraph, Row } from '@trezor/components'; import { borders, spacings } from '@trezor/theme'; import { HELP_CENTER_QR_CODE_URL } from '@trezor/urls'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/RequestEnableTorModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/RequestEnableTorModal.tsx index 279a8e2d841..08d68067a31 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/RequestEnableTorModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/RequestEnableTorModal.tsx @@ -2,9 +2,9 @@ import { useEffect } from 'react'; import styled from 'styled-components'; -import { Button, Paragraph } from '@trezor/components'; -import { UserContextPayload } from '@suite-common/suite-types'; import { RequestEnableTorResponse } from '@suite-common/suite-config'; +import { UserContextPayload } from '@suite-common/suite-types'; +import { Button, Paragraph } from '@trezor/components'; import { Modal, Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; 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 dc5ca558ab6..c6244186d33 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/SafetyChecksModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/SafetyChecksModal.tsx @@ -1,20 +1,20 @@ import { useState } from 'react'; import { - Radio, - Paragraph, Banner, + Card, + Column, NewModal, NewModalProps, - Column, - Card, + Paragraph, + Radio, 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 { Translation } from 'src/components/suite'; +import { useDevice, useDispatch } from 'src/hooks/suite'; /** * 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/StakeInANutshellModal/StakeInANutshellModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeInANutshellModal/StakeInANutshellModal.tsx index 8d61270ecdf..3d787a6c035 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeInANutshellModal/StakeInANutshellModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/StakeInANutshellModal/StakeInANutshellModal.tsx @@ -1,30 +1,30 @@ import React from 'react'; +import { TranslationKey } from '@suite-common/intl-types'; +import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { selectValidatorsQueueData } from '@suite-common/wallet-core'; import { + Badge, + CollapsibleBox, + Column, + Divider, Icon, IconName, - Paragraph, - NewModal, - Badge, List, - Column, + NewModal, + Paragraph, Row, Text, - Divider, - CollapsibleBox, } from '@trezor/components'; -import { TranslationKey } from '@suite-common/intl-types'; import { spacings } from '@trezor/theme'; -import { selectValidatorsQueueData } from '@suite-common/wallet-core'; -import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { openModal } from 'src/actions/suite/modalActions'; import { Translation } from 'src/components/suite'; +import { StakingInfo } from 'src/components/suite/StakingProcess/StakingInfo'; +import { UnstakingInfo } from 'src/components/suite/StakingProcess/UnstakingInfo'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { openModal } from 'src/actions/suite/modalActions'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { getUnstakingPeriodInDays } from 'src/utils/suite/ethereumStaking'; -import { StakingInfo } from 'src/components/suite/StakingProcess/StakingInfo'; -import { UnstakingInfo } from 'src/components/suite/StakingProcess/UnstakingInfo'; interface StakingDetails { id: number; 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 105a8597409..9c97d7408c3 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,9 +1,9 @@ import React from 'react'; -import { Row, Text, InfoItem } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import { InfoItem, Row, Text } from '@trezor/components'; -import { Translation, FormattedCryptoAmount, FiatValue } from 'src/components/suite'; +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; interface AvailableBalanceProps { formattedBalance: string; 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 b7103520c62..c1391d79b55 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,15 +1,15 @@ import { useState } from 'react'; -import { Checkbox, NewModal, Column, Banner, Card } from '@trezor/components'; -import { spacings } from '@trezor/theme'; +import { type NetworkType, getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { SOLANA_EPOCH_DAYS } from '@suite-common/wallet-constants'; import { selectValidatorsQueueData } from '@suite-common/wallet-core'; +import { Banner, Card, Checkbox, Column, NewModal } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { HELP_CENTER_ETH_STAKING } from '@trezor/urls'; -import { getNetworkDisplaySymbol, type NetworkType } from '@suite-common/wallet-config'; -import { SOLANA_EPOCH_DAYS } from '@suite-common/wallet-constants'; +import { openModal } from 'src/actions/suite/modalActions'; 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 { getDaysToAddToPoolInitial } from 'src/utils/suite/ethereumStaking'; 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 f414327d7b1..848c86f188d 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,25 +1,25 @@ -import { Banner, Column, Text } from '@trezor/components'; -import { getInputState, getStakingLimitsByNetwork } from '@suite-common/wallet-utils'; import { useFormatters } from '@suite-common/formatters'; import { formInputsMaxLength } from '@suite-common/validators'; -import { spacings } from '@trezor/theme'; import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; -import { BigNumber } from '@trezor/utils'; -import { InputWithOptions } from '@trezor/product-components'; import { StakeFormState } from '@suite-common/wallet-types'; +import { getInputState, getStakingLimitsByNetwork } from '@suite-common/wallet-utils'; +import { Banner, Column, Text } from '@trezor/components'; +import { InputWithOptions } from '@trezor/product-components'; +import { spacings } from '@trezor/theme'; +import { BigNumber } from '@trezor/utils'; import { FiatValue, Translation } from 'src/components/suite'; import { useSelector, useTranslation } from 'src/hooks/suite'; import { useStakeEthFormContext } from 'src/hooks/wallet/useStakeEthForm'; +import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { CRYPTO_INPUT, FIAT_INPUT } from 'src/types/wallet/stakeForms'; +import { validateStakingMax } from 'src/utils/suite/staking'; import { - validateDecimals, validateCryptoLimits, + validateDecimals, validateMin, validateReserveOrBalance, } from 'src/utils/suite/validation'; -import { FIAT_INPUT, CRYPTO_INPUT } from 'src/types/wallet/stakeForms'; -import { validateStakingMax } from 'src/utils/suite/staking'; -import { selectLanguage } from 'src/reducers/suite/suiteReducer'; export const Inputs = () => { const { translationString } = useTranslation(); 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 30779454531..f4bb884d782 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,10 +1,10 @@ -import { Tooltip, NewModal } from '@trezor/components'; +import { NewModal, Tooltip } from '@trezor/components'; import { Translation } from 'src/components/suite'; -import { useStakeEthFormContext } from 'src/hooks/wallet/useStakeEthForm'; import { useDevice } from 'src/hooks/suite'; -import { CRYPTO_INPUT, FIAT_INPUT } from 'src/types/wallet/stakeForms'; import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; +import { useStakeEthFormContext } from 'src/hooks/wallet/useStakeEthForm'; +import { CRYPTO_INPUT, FIAT_INPUT } from 'src/types/wallet/stakeForms'; export const StakeButton = () => { const { device, isLocked } = useDevice(); 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 5818b0cdc4b..0da667cec90 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,13 +1,13 @@ -import { Column, Card } from '@trezor/components'; +import { Card, Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { useStakeEthFormContext } from 'src/hooks/wallet/useStakeEthForm'; import { Translation } from 'src/components/suite'; import { Fees } from 'src/components/wallet/Fees/Fees'; +import { useStakeEthFormContext } from 'src/hooks/wallet/useStakeEthForm'; -import { Inputs } from './Inputs'; -import { ConfirmStakeEthModal } from './ConfirmStakeEthModal'; import { AvailableBalance } from './AvailableBalance'; +import { ConfirmStakeEthModal } from './ConfirmStakeEthModal'; +import { Inputs } from './Inputs'; export const StakeEthForm = () => { const { 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 6aeec5ae102..9d3c940bb9a 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,13 +1,13 @@ -import { Grid, NewModal, useMediaQuery, variables } from '@trezor/components'; import { SelectedAccountLoaded } from '@suite-common/wallet-types'; +import { Grid, NewModal, useMediaQuery, variables } from '@trezor/components'; 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 { StakeEthForm } from './StakeEthForm/StakeEthForm'; import { StakingInfoCards } from './StakingInfoCards/StakingInfoCards'; interface StakeModalModalProps { 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 fbaa0b2c14d..9145fad1e73 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,15 @@ import React from 'react'; import { useSelector } from 'react-redux'; -import { selectPoolStatsApyData, StakeRootState } from '@suite-common/wallet-core'; +import { StakeRootState, selectPoolStatsApyData } from '@suite-common/wallet-core'; import { Column, Grid, Image, Paragraph, Text } from '@trezor/components'; import { negativeSpacings, spacings } from '@trezor/theme'; import { HELP_CENTER_ETH_STAKING, HELP_CENTER_SOL_STAKING } from '@trezor/urls'; +import { FiatValue, FormattedCryptoAmount, TrezorLink } from 'src/components/suite'; 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 { calculateGains } from 'src/utils/suite/staking'; export const EstimatedGains = () => { 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 683eae98028..d177de2e339 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,8 +1,8 @@ import { CollapsibleBox, Column, H3 } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Translation } from 'src/components/suite/Translation'; import { StakingInfo } from 'src/components/suite/StakingProcess/StakingInfo'; +import { Translation } from 'src/components/suite/Translation'; import { EstimatedGains } from './EstimatedGains'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TorLoadingModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TorLoadingModal.tsx index 1378ecdc8f6..baceef6c674 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TorLoadingModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TorLoadingModal.tsx @@ -2,7 +2,7 @@ import styled from 'styled-components'; import { UserContextPayload } from '@suite-common/suite-types'; -import { TorLoader, Modal } from 'src/components/suite'; +import { Modal, TorLoader } from 'src/components/suite'; const SmallModal = styled(Modal)` width: 560px; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TradingTermsModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TradingTermsModal.tsx index ed9560c770c..de599b6cd0a 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TradingTermsModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TradingTermsModal.tsx @@ -2,16 +2,16 @@ import { CryptoId } from 'invity-api'; import { Column, + H4, IconCircle, IconCircleProps, - Paragraph, - NewModal, List, - H4, + NewModal, + Paragraph, } from '@trezor/components'; -import type { Deferred } from '@trezor/utils'; -import { spacings } from '@trezor/theme'; import { mapTrezorModelToIconDeprecated } from '@trezor/product-components'; +import { spacings } from '@trezor/theme'; +import type { Deferred } from '@trezor/utils'; import { Translation } from 'src/components/suite'; import { useDevice } from 'src/hooks/suite'; 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 50780f77d9d..3a3f43a0397 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,28 +1,28 @@ import styled from 'styled-components'; import { fromWei } from 'web3-utils'; +import { Network } from '@suite-common/wallet-config'; +import { getFeeRate, getFeeUnits, getTxIcon, isPending } from '@suite-common/wallet-utils'; import { - Icon, - Text, - H3, - useElevation, Card, + Divider, + Grid, + H3, + Icon, InfoItem, + InfoItemProps, InfoSegments, Row, - InfoItemProps, - Grid, - Divider, + Text, + useElevation, } from '@trezor/components'; -import { Network } from '@suite-common/wallet-config'; -import { getTxIcon, isPending, getFeeUnits, getFeeRate } from '@suite-common/wallet-utils'; -import { Elevation, borders, mapElevationToBorder, spacings, spacingsPx } from '@trezor/theme'; import { CoinLogo } from '@trezor/product-components'; +import { Elevation, borders, mapElevationToBorder, spacings, spacingsPx } from '@trezor/theme'; -import { Translation, FormattedDateWithBullet } from 'src/components/suite'; -import { WalletAccountTransaction } from 'src/types/wallet'; -import { TransactionHeader } from 'src/components/wallet/TransactionItem/TransactionHeader'; +import { FormattedDateWithBullet, Translation } from 'src/components/suite'; import { IOAddress } from 'src/components/suite/copy/IOAddress'; +import { TransactionHeader } from 'src/components/wallet/TransactionItem/TransactionHeader'; +import { WalletAccountTransaction } from 'src/types/wallet'; const IconWrapper = styled.div<{ $elevation: Elevation }>` display: flex; 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 ce866c50484..91bbbcd7dc2 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 @@ -1,10 +1,10 @@ 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 { ChainedTransactions } from '@suite-common/wallet-types'; +import { variables } from '@trezor/components'; -import { TrezorLink, Translation } from 'src/components/suite'; +import { Translation, TrezorLink } from 'src/components/suite'; import { TransactionItem } from 'src/components/wallet/TransactionItem/TransactionItem'; import { AffectedTransactionItem } from './ChangeFee/AffectedTransactionItem'; 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 2f84d55b040..50cdf31ce7f 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,7 +1,7 @@ import styled, { useTheme } from 'styled-components'; -import { Icon, variables } from '@trezor/components'; import { WalletAccountTransaction } from '@suite-common/wallet-types'; +import { Icon, variables } from '@trezor/components'; import { truncateMiddle } from '@trezor/utils'; import { FormattedDate } from 'src/components/suite'; 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 7b1bcb8bf00..8a49d063657 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 @@ -5,9 +5,9 @@ import { Button } from '@trezor/components'; import { Translation } from 'src/components/suite'; import { useRbfContext } from 'src/hooks/wallet/useRbfForm'; +import { AffectedTransactionItem } from './AffectedTransactionItem'; import { GreyCard } from './GreyCard'; import { WarnHeader } from './WarnHeader'; -import { AffectedTransactionItem } from './AffectedTransactionItem'; const ChainedTxs = styled.div` display: flex; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/BumpFeeModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/BumpFeeModal.tsx index 011b84e427e..8514b98636f 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/BumpFeeModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/BumpFeeModal.tsx @@ -4,11 +4,11 @@ import { WalletAccountTransactionWithRequiredRbfParams, } from '@suite-common/wallet-types'; +import { ChangeFee } from './ChangeFee'; +import { ReplaceTxButton } from './ReplaceTxButton'; import { RbfContext, useRbf } from '../../../../../../../hooks/wallet/useRbfForm'; -import { TxDetailModalBase } from '../TxDetailModalBase'; import { Translation } from '../../../../../Translation'; -import { ReplaceTxButton } from './ReplaceTxButton'; -import { ChangeFee } from './ChangeFee'; +import { TxDetailModalBase } from '../TxDetailModalBase'; type BumpFeeModalProps = { tx: WalletAccountTransactionWithRequiredRbfParams; 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 53b9bcd41d9..ae1885abd13 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,17 +1,17 @@ import { ReactNode } from 'react'; -import { Divider, Card, InfoItem, Row, Text } from '@trezor/components'; -import { formatNetworkAmount, getFeeUnits } from '@suite-common/wallet-utils'; import { WalletAccountTransaction } from '@suite-common/wallet-types'; +import { formatNetworkAmount, getFeeUnits } from '@suite-common/wallet-utils'; +import { Card, Divider, InfoItem, Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Translation, FiatValue, FormattedCryptoAmount } from 'src/components/suite'; +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; -import { useRbfContext, UseRbfProps } from 'src/hooks/wallet/useRbfForm'; +import { UseRbfProps, useRbfContext } from 'src/hooks/wallet/useRbfForm'; -import { RbfFees } from './RbfFees'; import { AffectedTransactions } from './AffectedTransactions'; import { DecreasedOutputs } from './DecreasedOutputs'; +import { RbfFees } from './RbfFees'; /* children are only for test purposes, this prop is not available in regular build */ interface ChangeFeeProps extends UseRbfProps { 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 f67534611ac..da10a66a344 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,10 +1,10 @@ import { ReactNode } from 'react'; -import styled from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; +import styled from 'styled-components'; -import { Icon, variables, Radio, motionAnimation } from '@trezor/components'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; +import { Icon, Radio, motionAnimation, variables } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { FormattedCryptoAmount, HiddenPlaceholder } from 'src/components/suite'; 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 4effaf18ad0..0b625efd712 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,4 +1,4 @@ -import { ReactNode, HTMLAttributes } from 'react'; +import { HTMLAttributes, ReactNode } from 'react'; import styled, { useTheme } from 'styled-components'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/AdvancedTxDetails.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/AdvancedTxDetails.tsx index 7c23ac5e74c..06dfcc1ef1e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/AdvancedTxDetails.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/AdvancedTxDetails.tsx @@ -1,17 +1,17 @@ import { useState } from 'react'; -import { Tabs, Card } 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 { ChainedTransactions, WalletAccountTransaction } from '@suite-common/wallet-types'; +import { isTestnet } from '@suite-common/wallet-utils'; +import { Card, Tabs } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { AmountDetails } from './AmountDetails'; +import { Data } from './Data'; import { IODetails } from './IODetails/IODetails'; import { ChainedTxs } from '../../ChainedTxs'; -import { Data } from './Data'; export type TabID = 'amount' | 'io' | 'chained' | 'data'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/AmountDetails.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/AmountDetails.tsx index ea7e6e3f210..b4893be354e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/AmountDetails.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/AmountDetails.tsx @@ -1,4 +1,8 @@ -import { Table, Text } from '@trezor/components'; +import { + selectHistoricFiatRates, + selectHistoricFiatRatesByTimestamp, +} from '@suite-common/wallet-core'; +import { Timestamp, TokenAddress } from '@suite-common/wallet-types'; import { formatAmount, formatCardanoDeposit, @@ -6,22 +10,18 @@ import { formatNetworkAmount, getFiatRateKey, getTxOperation, + isStakeTypeTx, isTxFeePaid, roundTimestampToNearestPastHour, - isStakeTypeTx, } from '@suite-common/wallet-utils'; +import { Table, Text } from '@trezor/components'; import { BigNumber } from '@trezor/utils'; -import { - selectHistoricFiatRates, - selectHistoricFiatRatesByTimestamp, -} from '@suite-common/wallet-core'; -import { Timestamp, TokenAddress } from '@suite-common/wallet-types'; +import { FiatValue, FormattedCryptoAmount, FormattedDate, Translation } from 'src/components/suite'; +import { AmountComponent } from 'src/components/wallet/AmountComponent'; 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 { AmountComponent } from 'src/components/wallet/AmountComponent'; type AmountDetailsProps = { tx: WalletAccountTransaction; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/Data.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/Data.tsx index 8e979113f82..ec794724f26 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/Data.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/Data.tsx @@ -1,9 +1,9 @@ import styled from 'styled-components'; +import { TranslationKey } from '@suite-common/intl-types'; import { WalletAccountTransaction } from '@suite-common/wallet-types'; -import { Paragraph, InfoItem, Column } from '@trezor/components'; +import { Column, InfoItem, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { TranslationKey } from '@suite-common/intl-types'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/IODetails/AnalyzeInExplorerBanner.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/IODetails/AnalyzeInExplorerBanner.tsx index 0ea69b197d0..573e48162af 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/IODetails/AnalyzeInExplorerBanner.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/IODetails/AnalyzeInExplorerBanner.tsx @@ -1,9 +1,9 @@ -import { Banner, Paragraph, H4, Column } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { selectBlockchainExplorerBySymbol } from '@suite-common/wallet-core'; +import { Banner, Column, H4, Paragraph } from '@trezor/components'; -import { useExternalLink, useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; +import { useExternalLink, useSelector } from 'src/hooks/suite'; type AnalyzeInExplorerBannerProps = { txid: string; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/IODetails/IODetails.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/IODetails/IODetails.tsx index d454c319943..5d47b403c6f 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/IODetails/IODetails.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/AdvancedTxDetails/IODetails/IODetails.tsx @@ -2,27 +2,27 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; -import { spacings } from '@trezor/theme'; +import { type NetworkSymbolExtended, isNetworkSymbol } from '@suite-common/wallet-config'; import { WalletAccountTransaction } from '@suite-common/wallet-types'; import { formatAmount, formatNetworkAmount, isNftTokenTransfer } from '@suite-common/wallet-utils'; import { AnonymitySet, TokenTransfer } from '@trezor/blockchain-link'; import { - Icon, CollapsibleBox, - Divider, Column, - Row, - Text, + Divider, Grid, - InfoSegments, H4, + Icon, + InfoSegments, + Row, + Text, } from '@trezor/components'; -import { isNetworkSymbol, type NetworkSymbolExtended } from '@suite-common/wallet-config'; +import { spacings } from '@trezor/theme'; import { FormattedCryptoAmount, FormattedNftAmount, Translation } from 'src/components/suite'; -import { useSelector } from 'src/hooks/suite/useSelector'; -import { UtxoAnonymity } from 'src/components/wallet'; import { IOAddress } from 'src/components/suite/copy/IOAddress'; +import { UtxoAnonymity } from 'src/components/wallet'; +import { useSelector } from 'src/hooks/suite/useSelector'; import { AnalyzeInExplorerBanner } from './AnalyzeInExplorerBanner'; diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/DetailModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/DetailModal.tsx index 23dc18ba69a..978edd909bc 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/DetailModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/Detail/DetailModal.tsx @@ -1,13 +1,13 @@ +import { getNetwork } from '@suite-common/wallet-config'; +import { selectAccountByKey, selectIsPhishingTransaction } from '@suite-common/wallet-core'; import { Account, ChainedTransactions, WalletAccountTransaction } from '@suite-common/wallet-types'; import { getAccountKey } from '@suite-common/wallet-utils'; -import { selectAccountByKey, selectIsPhishingTransaction } from '@suite-common/wallet-core'; -import { getNetwork } from '@suite-common/wallet-config'; import { NewModal } from '@trezor/components'; import { AdvancedTxDetails, TabID } from './AdvancedTxDetails/AdvancedTxDetails'; import { useSelector } from '../../../../../../../hooks/suite'; -import { TxDetailModalBase } from '../TxDetailModalBase'; import { Translation } from '../../../../../Translation'; +import { TxDetailModalBase } from '../TxDetailModalBase'; type DetailModalProps = { tx: WalletAccountTransaction; 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 006d0ac59fe..a93d21eae8d 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,15 +1,15 @@ -import { useState, useMemo } from 'react'; +import { useMemo, useState } from 'react'; -import { isPending, findChainedTransactions, getAccountKey } from '@suite-common/wallet-utils'; import { getNetwork } from '@suite-common/wallet-config'; import { selectAccountByKey, selectAllPendingTransactions } from '@suite-common/wallet-core'; import { WalletAccountTransactionWithRequiredRbfParams } from '@suite-common/wallet-types'; +import { findChainedTransactions, getAccountKey, isPending } from '@suite-common/wallet-utils'; import { useSelector } from 'src/hooks/suite'; import { Account, WalletAccountTransaction } from 'src/types/wallet'; -import { TabID } from './Detail/AdvancedTxDetails/AdvancedTxDetails'; import { BumpFeeModal } from './ChangeFee/BumpFeeModal'; +import { TabID } from './Detail/AdvancedTxDetails/AdvancedTxDetails'; import { DetailModal } from './Detail/DetailModal'; const hasRbfParams = ( diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModalBase.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModalBase.tsx index 1466d3a1c68..13a03bdc668 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModalBase.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/TxDetailModalBase.tsx @@ -1,18 +1,18 @@ import { ReactNode } from 'react'; -import { NewModal, Column, Banner } from '@trezor/components'; -import { HELP_CENTER_ZERO_VALUE_ATTACKS } from '@trezor/urls'; -import { getAccountKey } from '@suite-common/wallet-utils'; import { getNetwork } from '@suite-common/wallet-config'; import { selectAccountByKey, - selectTransactionConfirmations, selectIsPhishingTransaction, + selectTransactionConfirmations, } from '@suite-common/wallet-core'; +import { getAccountKey } from '@suite-common/wallet-utils'; +import { Banner, Column, NewModal } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { HELP_CENTER_ZERO_VALUE_ATTACKS } from '@trezor/urls'; -import { useSelector } from 'src/hooks/suite'; import { Translation, TrezorLink } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; import { Account, WalletAccountTransaction } from 'src/types/wallet'; import { BasicTxDetails } from './BasicTxDetails'; 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 88a66fefaef..6f316c16fe5 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnecoCoinjoinModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UnecoCoinjoinModal.tsx @@ -1,18 +1,18 @@ -import styled from 'styled-components'; import { transparentize } from 'polished'; +import styled from 'styled-components'; import { selectIsAccountWithRatesByKey } from '@suite-common/wallet-core'; -import { Button, variables } from '@trezor/components'; import { formatAmount, getAccountDecimals } from '@suite-common/wallet-utils'; +import { Button, variables } from '@trezor/components'; -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 { UNECONOMICAL_COINJOIN_THRESHOLD } from 'src/services/coinjoin'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { FiatValue, FormattedCryptoAmount, Modal, Translation } from 'src/components/suite'; +import { useDispatch } from 'src/hooks/suite/useDispatch'; import { useSelector } from 'src/hooks/suite/useSelector'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { UNECONOMICAL_COINJOIN_THRESHOLD } from 'src/services/coinjoin'; const StyledModal = styled(Modal)` width: 500px; 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 3bf8abea5bf..b23a3b39ccd 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,12 +1,12 @@ import { useState } from 'react'; -import { Checkbox, NewModal, Column, Banner, Card, IconName } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { Banner, Card, Checkbox, Column, IconName, NewModal } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { openModal } from 'src/actions/suite/modalActions'; import { 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'; interface EverstakeModalProps { 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 c282d502181..15b99b79226 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,22 +1,22 @@ -import { Text, Column, FractionButtonProps } from '@trezor/components'; -import { spacings } from '@trezor/theme'; -import { formInputsMaxLength } from '@suite-common/validators'; import { useFormatters } from '@suite-common/formatters'; +import { formInputsMaxLength } from '@suite-common/validators'; +import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { UnstakeFormState } from '@suite-common/wallet-core'; import { getInputState, getNonComposeErrorMessage, getStakingDataForNetwork, } from '@suite-common/wallet-utils'; +import { Column, FractionButtonProps, Text } from '@trezor/components'; import { InputWithOptions } from '@trezor/product-components'; -import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; -import { UnstakeFormState } from '@suite-common/wallet-core'; +import { spacings } from '@trezor/theme'; import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; -import { CRYPTO_INPUT, FIAT_INPUT, OUTPUT_AMOUNT } from 'src/types/wallet/stakeForms'; import { useSelector, useTranslation } from 'src/hooks/suite'; -import { validateDecimals, validateCryptoLimits, validateMin } from 'src/utils/suite/validation'; import { useUnstakeEthFormContext } from 'src/hooks/wallet/useUnstakeEthForm'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { CRYPTO_INPUT, FIAT_INPUT, OUTPUT_AMOUNT } from 'src/types/wallet/stakeForms'; +import { validateCryptoLimits, validateDecimals, validateMin } from 'src/utils/suite/validation'; export const Inputs = () => { const { translationString } = useTranslation(); 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 cc1ef2a9596..6db212c3309 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,10 +1,10 @@ -import { Tooltip, Button } from '@trezor/components'; +import { Button, Tooltip } 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'; import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; import { useUnstakeEthFormContext } from 'src/hooks/wallet/useUnstakeEthForm'; +import { CRYPTO_INPUT, FIAT_INPUT } from 'src/types/wallet/stakeForms'; export const UnstakeButton = () => { const { device, isLocked } = useDevice(); 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 3db184c6c3e..b91d788faf1 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,12 +1,12 @@ -import { InfoItem, Tooltip, Banner, Column, Card } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { selectValidatorsQueueData } from '@suite-common/wallet-core'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; import { getStakingDataForNetwork } from '@suite-common/wallet-utils'; +import { Banner, Card, Column, InfoItem, Tooltip } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Translation } from 'src/components/suite'; -import { useSelector } from 'src/hooks/suite'; import { Fees } from 'src/components/wallet/Fees/Fees'; +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'; 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 c496b2d5b2c..9095dbc662a 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,3 +1,4 @@ +import { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { CollapsibleBox, Column, @@ -8,11 +9,10 @@ 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 { useSelector } from 'src/hooks/suite'; import { UnstakeEthFormContext, useUnstakeEthForm } from 'src/hooks/wallet/useUnstakeEthForm'; import { UnstakeButton } from './UnstakeEthForm/UnstakeButton'; 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 0b35bbbca86..402d721f64e 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UserContextModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/UserContextModal.tsx @@ -1,56 +1,56 @@ 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'; +import { onCancel as onCancelAction } from 'src/actions/suite/modalActions'; import { - PinMismatchModal, - PassphraseDuplicateModal, - TradingTermsModal, - ConfirmAddressModal, - ConfirmXpubModal, - TransactionReviewModal, - ImportTransactionModal, AddAccountModal, - QrScannerModal, - BackgroundGalleryModal, - TxDetailModal, - ApplicationLogModal, - WipeDeviceModal, - MetadataProviderModal, - AdvancedCoinSettingsModal, AddTokenModal, - SafetyChecksModal, - DisableTorModal, - DisableTorStopCoinjoinModal, - RequestEnableTorModal, - TorLoadingModal, + AdvancedCoinSettingsModal, + ApplicationLogModal, + AuthenticateDeviceFailModal, + AuthenticateDeviceModal, + BackgroundGalleryModal, CancelCoinjoinModal, - CriticalCoinjoinPhaseModal, + ClaimModal, CoinjoinSuccessModal, - MoreRoundsNeededModal, - UnecoCoinjoinModal, - AuthenticateDeviceModal, - AuthenticateDeviceFailModal, + ConfirmAddressModal, + ConfirmUnverifiedAddressModal, + ConfirmUnverifiedProceedModal, + ConfirmUnverifiedXpubModal, + ConfirmXpubModal, + ConnectPopupModal, + CopyAddressModal, + CriticalCoinjoinPhaseModal, DeviceAuthenticityOptOutModal, + DisableTorModal, + DisableTorStopCoinjoinModal, + ImportTransactionModal, + MetadataProviderModal, + MoreRoundsNeededModal, + PassphraseDuplicateModal, + PinMismatchModal, + QrScannerModal, + RequestEnableTorModal, + SafetyChecksModal, StakeInANutshellModal, StakeModal, - UnstakeModal, - ClaimModal, - CopyAddressModal, + TorLoadingModal, + TradingTermsModal, + TransactionReviewModal, + TxDetailModal, + UnecoCoinjoinModal, UnhideTokenModal, - ConfirmUnverifiedAddressModal, - ConfirmUnverifiedXpubModal, - ConfirmUnverifiedProceedModal, - ConnectPopupModal, + UnstakeModal, + WipeDeviceModal, } from 'src/components/suite/modals'; +import { useDispatch } from 'src/hooks/suite'; import type { AcquiredDevice } from 'src/types/suite'; import type { ReduxModalProps } from '../ReduxModal'; -import { EverstakeModal } from './UnstakeModal/EverstakeModal'; -import { PassphraseMismatchModal } from './PassphraseMismatchModal'; import { FirmwareRevisionOptOutModal } from './FirmwareRevisionOptOutModal'; +import { PassphraseMismatchModal } from './PassphraseMismatchModal'; import { CardanoWithdrawModal } from '../CardanoWithdrawModal'; +import { EverstakeModal } from './UnstakeModal/EverstakeModal'; /** Modals opened as a result of user action */ export const UserContextModal = ({ 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 306a5050ba9..748d770dcfe 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/WipeDeviceModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/WipeDeviceModal.tsx @@ -1,11 +1,11 @@ import { useState } from 'react'; -import { NewModal, Card, Column, H3, Paragraph } from '@trezor/components'; -import { spacings } from '@trezor/theme'; +import { Card, Column, H3, NewModal, Paragraph } from '@trezor/components'; import { isDeviceInBootloaderMode } from '@trezor/device-utils'; +import { spacings } from '@trezor/theme'; -import { Translation, CheckItem } from 'src/components/suite'; import { wipeDevice } from 'src/actions/settings/deviceSettingsActions'; +import { CheckItem, Translation } from 'src/components/suite'; import { useDevice, useDispatch } from 'src/hooks/suite'; type WipeDeviceModalProps = { diff --git a/packages/suite/src/components/suite/notifications/NotificationRenderer/ActionRenderer.tsx b/packages/suite/src/components/suite/notifications/NotificationRenderer/ActionRenderer.tsx index bc360ff255a..ea33f9f6569 100644 --- a/packages/suite/src/components/suite/notifications/NotificationRenderer/ActionRenderer.tsx +++ b/packages/suite/src/components/suite/notifications/NotificationRenderer/ActionRenderer.tsx @@ -1,8 +1,8 @@ import { acquireDevice, selectDeviceThunk } from '@suite-common/wallet-core'; import { DEVICE } from '@trezor/connect'; -import { useDispatch } from 'src/hooks/suite'; import { NotificationRendererProps, NotificationViewProps } from 'src/components/suite'; +import { useDispatch } from 'src/hooks/suite'; type ActionRendererProps = NotificationViewProps & NotificationRendererProps; diff --git a/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx b/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx index f579bd54ba1..7b571b765f0 100644 --- a/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx +++ b/packages/suite/src/components/suite/notifications/NotificationRenderer/CoinProtocolRenderer.tsx @@ -2,15 +2,15 @@ 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 { CoinLogo } from '@trezor/product-components'; +import { capitalizeFirstLetter } from '@trezor/utils'; import { fillSendForm, resetProtocol } from 'src/actions/suite/protocolActions'; import { Translation } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import type { NotificationRendererProps } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { ConditionalActionRenderer } from './ConditionalActionRenderer'; diff --git a/packages/suite/src/components/suite/notifications/NotificationRenderer/ConditionalActionRenderer.tsx b/packages/suite/src/components/suite/notifications/NotificationRenderer/ConditionalActionRenderer.tsx index ed48fb92f5f..ccbe6f87b8d 100644 --- a/packages/suite/src/components/suite/notifications/NotificationRenderer/ConditionalActionRenderer.tsx +++ b/packages/suite/src/components/suite/notifications/NotificationRenderer/ConditionalActionRenderer.tsx @@ -4,8 +4,8 @@ import styled from 'styled-components'; import { variables } from '@trezor/components'; -import type { ExtendedMessageDescriptor } from 'src/types/suite'; import type { NotificationRendererProps } from 'src/components/suite'; +import type { ExtendedMessageDescriptor } from 'src/types/suite'; const Header = styled.div` font-weight: ${variables.FONT_WEIGHT.MEDIUM}; diff --git a/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx b/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx index 769b82592ac..dc6a564b398 100644 --- a/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx +++ b/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx @@ -2,16 +2,16 @@ import type { ComponentType } from 'react'; import { useSelector } from 'react-redux'; import { AUTH_DEVICE, type NotificationEntry } from '@suite-common/toast-notifications'; +import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { selectSelectedDeviceLabelOrName } from '@suite-common/wallet-core'; import { DEVICE } from '@trezor/connect'; -import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; 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'; +import { TransactionRenderer } from './TransactionRenderer'; const simple = ( View: NotificationRendererProps['render'], diff --git a/packages/suite/src/components/suite/notifications/NotificationRenderer/TransactionRenderer.tsx b/packages/suite/src/components/suite/notifications/NotificationRenderer/TransactionRenderer.tsx index 5107b917bb5..a46bd6fc7c3 100644 --- a/packages/suite/src/components/suite/notifications/NotificationRenderer/TransactionRenderer.tsx +++ b/packages/suite/src/components/suite/notifications/NotificationRenderer/TransactionRenderer.tsx @@ -1,28 +1,28 @@ import { - selectSelectedDevice as selectDeviceSelector, - selectDevices, selectAccounts, selectBlockchainState, - selectTransactions, + selectSelectedDevice as selectDeviceSelector, selectDeviceThunk, + selectDevices, + selectTransactions, } from '@suite-common/wallet-core'; import { - findAccountsByNetwork, - findAccountsByDescriptor, findAccountDevice, - getAccountTransactions, + findAccountsByDescriptor, + findAccountsByNetwork, findTransaction, + getAccountTransactions, getConfirmations, isStakeTypeTx, } from '@suite-common/wallet-utils'; +import { goto } from 'src/actions/suite/routerActions'; import { AccountLabeling, HiddenPlaceholder, NotificationRendererProps, NotificationViewProps, } from 'src/components/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { getTxAnchor } from 'src/utils/suite/anchor'; 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 431174fab01..b629558478a 100644 --- a/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationGroup.tsx +++ b/packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationGroup.tsx @@ -1,8 +1,8 @@ -import { Paragraph, H4, Column } from '@trezor/components'; +import { Column, H4, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { AppState } from 'src/types/suite'; import { Translation } from 'src/components/suite'; +import { AppState } from 'src/types/suite'; import { getSeenAndUnseenNotifications } from 'src/utils/suite/notification'; import { NotificationList } from './NotificationList/NotificationList'; 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 ccbf8fbbeff..646d14a64eb 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 @@ -1,11 +1,11 @@ import type { NotificationEntry } from '@suite-common/toast-notifications'; -import { Button, Icon, ButtonProps, Paragraph, IconName, Row, Column } from '@trezor/components'; +import { Button, ButtonProps, Column, Icon, IconName, Paragraph, Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Translation, FormattedDateWithBullet } from 'src/components/suite'; -import { getNotificationIcon } from 'src/utils/suite/notification'; +import { FormattedDateWithBullet, Translation } from 'src/components/suite'; import { useLayoutSize } from 'src/hooks/suite'; import type { ExtendedMessageDescriptor, ToastNotificationVariant } from 'src/types/suite'; +import { getNotificationIcon } from 'src/utils/suite/notification'; export interface NotificationViewProps { notification: NotificationEntry; diff --git a/packages/suite/src/components/suite/notifications/Notifications/Notifications.tsx b/packages/suite/src/components/suite/notifications/Notifications/Notifications.tsx index 27a94329c41..99da276abdf 100644 --- a/packages/suite/src/components/suite/notifications/Notifications/Notifications.tsx +++ b/packages/suite/src/components/suite/notifications/Notifications/Notifications.tsx @@ -1,11 +1,11 @@ import { useState } from 'react'; -import { Tabs, Row, Divider, IconButton } from '@trezor/components'; +import { Divider, IconButton, Row, Tabs } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { SETTINGS } from 'src/config/suite'; +import { useSelector } from 'src/hooks/suite'; import { NotificationGroup } from './NotificationGroup/NotificationGroup'; diff --git a/packages/suite/src/components/suite/notifications/ToastNotification.tsx b/packages/suite/src/components/suite/notifications/ToastNotification.tsx index 0823e3162a2..e30f57224f7 100644 --- a/packages/suite/src/components/suite/notifications/ToastNotification.tsx +++ b/packages/suite/src/components/suite/notifications/ToastNotification.tsx @@ -2,8 +2,8 @@ import { useLayoutEffect, useRef, useState } from 'react'; import styled, { css, useTheme } from 'styled-components'; +import { NotificationEntry, notificationsActions } from '@suite-common/toast-notifications'; import { Button, Icon, variables } from '@trezor/components'; -import { notificationsActions, NotificationEntry } from '@suite-common/toast-notifications'; import { spacings } from '@trezor/theme'; import { NotificationRenderer, NotificationViewProps, Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/section/SectionItem.tsx b/packages/suite/src/components/suite/section/SectionItem.tsx index ff6e69cf981..e5ca067c169 100644 --- a/packages/suite/src/components/suite/section/SectionItem.tsx +++ b/packages/suite/src/components/suite/section/SectionItem.tsx @@ -1,8 +1,8 @@ -import { forwardRef, HTMLAttributes } from 'react'; +import { HTMLAttributes, forwardRef } from 'react'; import styled from 'styled-components'; -import { Flex, variables, useMediaQuery } from '@trezor/components'; +import { Flex, useMediaQuery, variables } from '@trezor/components'; import { OutlineHighlight } from 'src/components/OutlineHighlight'; import { SUBPAGE_NAV_HEIGHT } from 'src/constants/suite/layout'; diff --git a/packages/suite/src/components/suite/section/sectionStyles.tsx b/packages/suite/src/components/suite/section/sectionStyles.tsx index 59036d45380..2982eede136 100644 --- a/packages/suite/src/components/suite/section/sectionStyles.tsx +++ b/packages/suite/src/components/suite/section/sectionStyles.tsx @@ -1,6 +1,6 @@ import styled, { css } from 'styled-components'; -import { Select, variables, Button, SelectProps, ButtonProps } from '@trezor/components'; +import { Button, ButtonProps, Select, SelectProps, variables } 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 4ba64920a12..1edef3650b5 100644 --- a/packages/suite/src/components/suite/troubleshooting/TroubleshootingTips.tsx +++ b/packages/suite/src/components/suite/troubleshooting/TroubleshootingTips.tsx @@ -1,13 +1,13 @@ -import { useMemo, ReactNode } from 'react'; +import { ReactNode, useMemo } from 'react'; import styled from 'styled-components'; -import { variables, Button, CollapsibleBox, useElevation } from '@trezor/components'; -import { TREZOR_SUPPORT_DEVICE_URL } from '@trezor/urls'; +import { Button, CollapsibleBox, useElevation, variables } from '@trezor/components'; import TrezorConnect from '@trezor/connect'; import type TrezorConnectWeb from '@trezor/connect-web'; import { isAndroid } from '@trezor/env-utils'; import { Elevation, mapElevationToBorder } from '@trezor/theme'; +import { TREZOR_SUPPORT_DEVICE_URL } from '@trezor/urls'; import { Translation, TrezorLink } from 'src/components/suite'; diff --git a/packages/suite/src/components/suite/troubleshooting/tips/BridgeTip.tsx b/packages/suite/src/components/suite/troubleshooting/tips/BridgeTip.tsx index a83035af02e..6f063c979bd 100644 --- a/packages/suite/src/components/suite/troubleshooting/tips/BridgeTip.tsx +++ b/packages/suite/src/components/suite/troubleshooting/tips/BridgeTip.tsx @@ -4,9 +4,9 @@ import { typography } from '@trezor/theme'; import { TrezorLink } from 'src/components/suite'; import { Translation } from 'src/components/suite/Translation'; -import { useOpenSuiteDesktop } from 'src/hooks/suite/useOpenSuiteDesktop'; -import { useBridgeDesktopApi } from 'src/hooks/suite/useBridgeDesktopApi'; import { useSelector } from 'src/hooks/suite'; +import { useBridgeDesktopApi } from 'src/hooks/suite/useBridgeDesktopApi'; +import { useOpenSuiteDesktop } from 'src/hooks/suite/useOpenSuiteDesktop'; import { selectTransportOfType } from 'src/reducers/suite/suiteReducer'; export const Wrapper = styled.div` diff --git a/packages/suite/src/components/suite/troubleshooting/tips/UdevDescription.tsx b/packages/suite/src/components/suite/troubleshooting/tips/UdevDescription.tsx index dba81f91780..04d3e7ae280 100644 --- a/packages/suite/src/components/suite/troubleshooting/tips/UdevDescription.tsx +++ b/packages/suite/src/components/suite/troubleshooting/tips/UdevDescription.tsx @@ -2,10 +2,10 @@ import styled from 'styled-components'; import { typography } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; 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'; const Wrapper = styled.div` a { diff --git a/packages/suite/src/components/suite/troubleshooting/tips/index.tsx b/packages/suite/src/components/suite/troubleshooting/tips/index.tsx index 79cad6f530a..e5a7f060efd 100644 --- a/packages/suite/src/components/suite/troubleshooting/tips/index.tsx +++ b/packages/suite/src/components/suite/troubleshooting/tips/index.tsx @@ -1,13 +1,13 @@ import { ReactNode } from 'react'; -import { isWeb, isDesktop, isLinux, isAndroid } from '@trezor/env-utils'; -import { TREZOR_SUPPORT_DEVICE_URL } from '@trezor/urls'; import { Text } from '@trezor/components'; +import { isAndroid, isDesktop, isLinux, isWeb } from '@trezor/env-utils'; +import { TREZOR_SUPPORT_DEVICE_URL } from '@trezor/urls'; import { TrezorLink } from 'src/components/suite'; import { Translation } from 'src/components/suite/Translation'; -import { BridgeStatus, SuiteDesktopTip, BridgeToggle, Wrapper } from './BridgeTip'; +import { BridgeStatus, BridgeToggle, SuiteDesktopTip, Wrapper } from './BridgeTip'; import { UdevDescription } from './UdevDescription'; export type TipItem = { diff --git a/packages/suite/src/components/wallet/AccountExceptionLayout.tsx b/packages/suite/src/components/wallet/AccountExceptionLayout.tsx index b0c0eb14b0f..f811b44bd26 100644 --- a/packages/suite/src/components/wallet/AccountExceptionLayout.tsx +++ b/packages/suite/src/components/wallet/AccountExceptionLayout.tsx @@ -1,17 +1,17 @@ import React, { ReactNode } from 'react'; import { - H2, Button, - Card, ButtonProps, + Card, Column, - Row, - Paragraph, Divider, - IconName, + H2, IconCircle, IconCircleVariant, + IconName, + Paragraph, + Row, } from '@trezor/components'; import { spacings } from '@trezor/theme'; diff --git a/packages/suite/src/components/wallet/AmountComponent.tsx b/packages/suite/src/components/wallet/AmountComponent.tsx index 1cf4b448c00..3edab6fe077 100644 --- a/packages/suite/src/components/wallet/AmountComponent.tsx +++ b/packages/suite/src/components/wallet/AmountComponent.tsx @@ -1,9 +1,9 @@ -import { isNftTokenTransfer, formatAmount, getTxOperation } from '@suite-common/wallet-utils'; +import { formatAmount, getTxOperation, isNftTokenTransfer } from '@suite-common/wallet-utils'; import { TokenTransfer } from '@trezor/connect'; import { TypographyStyle } from '@trezor/theme'; -import { FormattedNftAmount } from 'src/components/suite/FormattedNftAmount'; import { FormattedCryptoAmount } from 'src/components/suite/FormattedCryptoAmount'; +import { FormattedNftAmount } from 'src/components/suite/FormattedNftAmount'; type AmountComponentProps = { transfer: TokenTransfer; diff --git a/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/CoinjoinAccountDiscoveryProgress.tsx b/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/CoinjoinAccountDiscoveryProgress.tsx index f295a9a905a..4299799be1d 100644 --- a/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/CoinjoinAccountDiscoveryProgress.tsx +++ b/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/CoinjoinAccountDiscoveryProgress.tsx @@ -2,6 +2,7 @@ import { useMemo } from 'react'; import styled, { useTheme } from 'styled-components'; +import { localizeNumber } from '@suite-common/wallet-utils'; import { Card, Column, @@ -11,7 +12,6 @@ import { ProgressBar, variables, } from '@trezor/components'; -import { localizeNumber } from '@suite-common/wallet-utils'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/RotatingFacts.tsx b/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/RotatingFacts.tsx index 3258cd2992b..684131a326c 100644 --- a/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/RotatingFacts.tsx +++ b/packages/suite/src/components/wallet/CoinjoinAccountDiscoveryProgress/RotatingFacts.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; -import styled from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; +import styled from 'styled-components'; import { motionEasing, variables } from '@trezor/components'; diff --git a/packages/suite/src/components/wallet/DiscoveryProgress.tsx b/packages/suite/src/components/wallet/DiscoveryProgress.tsx index 26c82c6f3d0..4ae2910d3d3 100644 --- a/packages/suite/src/components/wallet/DiscoveryProgress.tsx +++ b/packages/suite/src/components/wallet/DiscoveryProgress.tsx @@ -1,4 +1,4 @@ -import { ProgressBar, Box } from '@trezor/components'; +import { Box, ProgressBar } from '@trezor/components'; import { zIndices } from '@trezor/theme'; import { useDiscovery } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/wallet/Fees/CustomFee.tsx b/packages/suite/src/components/wallet/Fees/CustomFee.tsx index 585c3c5b66c..5a201429462 100644 --- a/packages/suite/src/components/wallet/Fees/CustomFee.tsx +++ b/packages/suite/src/components/wallet/Fees/CustomFee.tsx @@ -8,20 +8,20 @@ import { UseFormSetValue, } from 'react-hook-form'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Note, Banner, variables, Grid, Column, useMediaQuery, Text } from '@trezor/components'; -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 { FeeInfo, FormState } from '@suite-common/wallet-types'; +import { getFeeUnits, getInputState, isInteger } from '@suite-common/wallet-utils'; +import { Banner, Column, Grid, Note, Text, useMediaQuery, variables } from '@trezor/components'; +import { NumberInput } from '@trezor/product-components'; import { spacings } from '@trezor/theme'; import { HELP_CENTER_TRANSACTION_FEES_URL } from '@trezor/urls'; -import { NumberInput } from '@trezor/product-components'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { validateDecimals } from 'src/utils/suite/validation'; -import { useSelector, useTranslation } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; -import { selectLanguage } from 'src/reducers/suite/suiteReducer'; import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; +import { useSelector, useTranslation } from 'src/hooks/suite'; +import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { validateDecimals } from 'src/utils/suite/validation'; import { InputError } from '../InputError'; diff --git a/packages/suite/src/components/wallet/Fees/FeeDetails.tsx b/packages/suite/src/components/wallet/Fees/FeeDetails.tsx index 705bdb974ef..5b89cbd9504 100644 --- a/packages/suite/src/components/wallet/Fees/FeeDetails.tsx +++ b/packages/suite/src/components/wallet/Fees/FeeDetails.tsx @@ -1,16 +1,16 @@ -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; -import { spacings } from '@trezor/theme'; -import { Row, Text } from '@trezor/components'; -import { FeeLevel } from '@trezor/connect'; -import { getFeeUnits } from '@suite-common/wallet-utils'; import { formatDuration } from '@suite-common/suite-utils'; import { NetworkType } from '@suite-common/wallet-config'; import { + FeeInfo, PrecomposedTransaction, PrecomposedTransactionCardano, - FeeInfo, } from '@suite-common/wallet-types'; +import { getFeeUnits } from '@suite-common/wallet-utils'; +import { Row, Text } from '@trezor/components'; +import { FeeLevel } from '@trezor/connect'; +import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite/Translation'; diff --git a/packages/suite/src/components/wallet/Fees/Fees.tsx b/packages/suite/src/components/wallet/Fees/Fees.tsx index e2d2149be87..86b69817217 100644 --- a/packages/suite/src/components/wallet/Fees/Fees.tsx +++ b/packages/suite/src/components/wallet/Fees/Fees.tsx @@ -9,28 +9,28 @@ import { import { AnimatePresence, motion } from 'framer-motion'; -import { FeeLevel } from '@trezor/connect'; +import { TranslationKey } from '@suite-common/intl-types'; +import { + FeeInfo, + FormState, + PrecomposedLevels, + PrecomposedLevelsCardano, + PrecomposedTransactionFinal, +} from '@suite-common/wallet-types'; +import { formatNetworkAmount } from '@suite-common/wallet-utils'; import { Banner, - SelectBar, - Tooltip, Column, - Note, - motionEasing, InfoItem, + Note, Row, + SelectBar, Text, + Tooltip, + motionEasing, } from '@trezor/components'; -import { - FormState, - FeeInfo, - PrecomposedLevels, - PrecomposedLevelsCardano, - PrecomposedTransactionFinal, -} from '@suite-common/wallet-types'; +import { FeeLevel } from '@trezor/connect'; import { spacings } from '@trezor/theme'; -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'; diff --git a/packages/suite/src/components/wallet/FiatHeader.tsx b/packages/suite/src/components/wallet/FiatHeader.tsx index 27b9d70ebca..f87df5875a8 100644 --- a/packages/suite/src/components/wallet/FiatHeader.tsx +++ b/packages/suite/src/components/wallet/FiatHeader.tsx @@ -3,14 +3,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 type { NetworkSymbol } from '@suite-common/wallet-config'; +import { useShouldRedactNumbers } from '@suite-common/wallet-utils'; +import { typography } from '@trezor/theme'; import { HiddenPlaceholder, RedactNumericalValue } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; -import { selectLanguage } from 'src/reducers/suite/suiteReducer'; import { useFiatFromCryptoValue } from 'src/hooks/suite/useFiatFromCryptoValue'; +import { selectLanguage } from 'src/reducers/suite/suiteReducer'; 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 31cce366e10..230816aa285 100644 --- a/packages/suite/src/components/wallet/InputError.tsx +++ b/packages/suite/src/components/wallet/InputError.tsx @@ -1,8 +1,8 @@ import { MouseEventHandler } from 'react'; import { Button, Paragraph, Row } from '@trezor/components'; -import { Url } from '@trezor/urls'; import { spacings } from '@trezor/theme'; +import { Url } from '@trezor/urls'; import { LearnMoreButton } from '../suite/LearnMoreButton'; diff --git a/packages/suite/src/components/wallet/SearchAction.tsx b/packages/suite/src/components/wallet/SearchAction.tsx index 99a335a9d10..e9316fe2faa 100644 --- a/packages/suite/src/components/wallet/SearchAction.tsx +++ b/packages/suite/src/components/wallet/SearchAction.tsx @@ -1,13 +1,13 @@ -import { useCallback, useRef, Dispatch, SetStateAction, KeyboardEvent } from 'react'; +import { Dispatch, KeyboardEvent, SetStateAction, useCallback, useRef } 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 { Icon, Input, KEYBOARD_CODE, Row, motionEasing } from '@trezor/components'; +import { borders, spacingsPx } from '@trezor/theme'; -import { useTranslation } from 'src/hooks/suite/useTranslation'; import { TooltipSymbol, Translation } from 'src/components/suite'; +import { useTranslation } from 'src/hooks/suite/useTranslation'; 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 55398ee729e..61f75e7224d 100644 --- a/packages/suite/src/components/wallet/TokenIconSetWrapper.tsx +++ b/packages/suite/src/components/wallet/TokenIconSetWrapper.tsx @@ -1,17 +1,17 @@ import { selectCoinDefinitions } from '@suite-common/token-definitions'; -import { TokenIconSet } from '@trezor/product-components'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { selectCurrentFiatRates } from '@suite-common/wallet-core'; import { Account } from '@suite-common/wallet-types'; -import { NetworkSymbol } from '@suite-common/wallet-config'; +import { TokenIconSet } from '@trezor/product-components'; import { BigNumber } from '@trezor/utils'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { useSelector } from 'src/hooks/suite'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { + TokensWithRates, enhanceTokensWithRates, getTokens, sortTokensWithRates, - TokensWithRates, } from 'src/utils/wallet/tokenUtils'; type TokenIconSetWrapperProps = { diff --git a/packages/suite/src/components/wallet/TransactionItem/CoinjoinBatchItem.tsx b/packages/suite/src/components/wallet/TransactionItem/CoinjoinBatchItem.tsx index 3fd20637410..c53f6fb9552 100644 --- a/packages/suite/src/components/wallet/TransactionItem/CoinjoinBatchItem.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/CoinjoinBatchItem.tsx @@ -1,6 +1,9 @@ import styled from 'styled-components'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { useFormatters } from '@suite-common/formatters'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { selectHistoricFiatRates } from '@suite-common/wallet-core'; +import { Timestamp } from '@suite-common/wallet-types'; import { formatNetworkAmount, getFiatRateKey, @@ -9,22 +12,19 @@ import { sumTransactions, sumTransactionsFiat, } from '@suite-common/wallet-utils'; -import { useFormatters } from '@suite-common/formatters'; import { Box, CollapsibleBox, Row } from '@trezor/components'; import { borders, spacings } 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 { BigNumber } from '@trezor/utils/src/bigNumber'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; -import { WalletAccountTransaction } from 'src/types/wallet/index'; -import { HiddenPlaceholder, Translation, FormattedCryptoAmount } from 'src/components/suite'; +import { FormattedCryptoAmount, HiddenPlaceholder, Translation } from 'src/components/suite'; import { TransactionTimestamp } from 'src/components/wallet/TransactionTimestamp'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { WalletAccountTransaction } from 'src/types/wallet/index'; -import { TransactionTypeIcon } from './TransactionTypeIcon'; -import { TransactionTargetLayout } from './TransactionTargetLayout'; import { Content, Description, TimestampWrapper, TxTypeIconWrapper } from './CommonComponents'; +import { TransactionTargetLayout } from './TransactionTargetLayout'; +import { TransactionTypeIcon } from './TransactionTypeIcon'; const CryptoAmount = styled(FormattedCryptoAmount)` width: unset; diff --git a/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx b/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx index 8688434e024..8db3bce5013 100644 --- a/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/InstantStakeBadge.tsx @@ -1,17 +1,17 @@ -import { useSelector } from 'react-redux'; import { memo } from 'react'; +import { useSelector } from 'react-redux'; import styled from 'styled-components'; +import { NetworkSymbol, isNetworkSymbol } from '@suite-common/wallet-config'; 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 { Badge, Icon } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; -import { Translation, FormattedCryptoAmount } from 'src/components/suite'; -import { WalletAccountTransaction } from 'src/types/wallet'; +import { FormattedCryptoAmount, Translation } from 'src/components/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { WalletAccountTransaction } from 'src/types/wallet'; import { getInstantStakeType } from 'src/utils/suite/ethereumStaking'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionHeader.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionHeader.tsx index f60891a2634..8130e7926c8 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionHeader.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionHeader.tsx @@ -1,17 +1,17 @@ +import { getNetworkDisplaySymbol, isNetworkSymbol } from '@suite-common/wallet-config'; +import { StakeType } from '@suite-common/wallet-types'; import { getTxHeaderSymbol, isSupportedEthStakingNetworkSymbol, isSupportedSolStakingNetworkSymbol, } from '@suite-common/wallet-utils'; -import { AccountTransaction } from '@trezor/connect'; import { Row } from '@trezor/components'; +import { AccountTransaction } from '@trezor/connect'; import { spacings } from '@trezor/theme'; -import { getNetworkDisplaySymbol, isNetworkSymbol } from '@suite-common/wallet-config'; -import { StakeType } from '@suite-common/wallet-types'; +import { UnstakingTxAmount } from 'src/components/suite/UnstakingTxAmount'; import { useTranslation } from 'src/hooks/suite'; import { WalletAccountTransaction } from 'src/types/wallet'; -import { UnstakingTxAmount } from 'src/components/suite/UnstakingTxAmount'; import { BlurUrls } from 'src/views/wallet/tokens/common/BlurUrls'; type TransactionHeaderProps = { diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionHeading.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionHeading.tsx index 1758e7ca75f..d729d12948d 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionHeading.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionHeading.tsx @@ -2,8 +2,6 @@ import { useState } from 'react'; import styled, { useTheme } from 'styled-components'; -import { variables, Icon, Row } from '@trezor/components'; -import { HELP_CENTER_ZERO_VALUE_ATTACKS } from '@trezor/urls'; import { formatNetworkAmount, getTargetAmount, @@ -11,8 +9,10 @@ import { getTxOperation, isSupportedEthStakingNetworkSymbol, } from '@suite-common/wallet-utils'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { Icon, Row, variables } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { HELP_CENTER_ZERO_VALUE_ATTACKS } from '@trezor/urls'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { FormattedCryptoAmount, @@ -22,9 +22,9 @@ import { } from 'src/components/suite'; import { WalletAccountTransaction } from 'src/types/wallet'; +import { InstantStakeBadge } from './InstantStakeBadge'; import { TransactionHeader } from './TransactionHeader'; import { BlurWrapper } from './TransactionItemBlurWrapper'; -import { InstantStakeBadge } from './InstantStakeBadge'; const Wrapper = styled.span` display: flex; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx index aa3c714da9b..6bada3db02c 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionItem.tsx @@ -1,43 +1,43 @@ import { memo, useMemo, useState } from 'react'; -import styled from 'styled-components'; import { AnimatePresence } from 'framer-motion'; +import styled from 'styled-components'; +import { AccountType, Network } from '@suite-common/wallet-config'; import { selectIsPhishingTransaction } from '@suite-common/wallet-core'; -import { Button, Card, Link, Tooltip, Row, Column } from '@trezor/components'; import { formatNetworkAmount, + isStakeTypeTx, 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 { Button, Card, Column, Link, Row, Tooltip } from '@trezor/components'; import { spacings } from '@trezor/theme'; +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 { useAnchor } from 'src/hooks/suite/useAnchor'; -import { AccountTransactionBaseAnchor } from 'src/constants/suite/anchors'; +import { OutlineHighlight } from 'src/components/OutlineHighlight'; +import { Translation } from 'src/components/suite'; import { TransactionTimestamp } from 'src/components/wallet/TransactionTimestamp'; +import { AccountTransactionBaseAnchor } from 'src/constants/suite/anchors'; import { SUBPAGE_NAV_HEIGHT } from 'src/constants/suite/layout'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { useAnchor } from 'src/hooks/suite/useAnchor'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { AccountLabels } from 'src/types/suite/metadata'; +import { WalletAccountTransaction } from 'src/types/wallet'; import { getInstantStakeType } from 'src/utils/suite/ethereumStaking'; -import { OutlineHighlight } from 'src/components/OutlineHighlight'; -import { TransactionTypeIcon } from './TransactionTypeIcon'; +import { Content, TimestampWrapper, TxTypeIconWrapper } from './CommonComponents'; import { TransactionHeading } from './TransactionHeading'; +import { BlurWrapper } from './TransactionItemBlurWrapper'; +import { CoinjoinRow, DepositRow, FeeRow, WithdrawalRow } from './TransactionRow'; import { - TransactionTarget, - TokenTransfer, InternalTransfer, + TokenTransfer, + TransactionTarget, } from './TransactionTarget/TransactionTarget'; -import { FeeRow, WithdrawalRow, DepositRow, CoinjoinRow } from './TransactionRow'; -import { Content, TimestampWrapper, TxTypeIconWrapper } from './CommonComponents'; -import { BlurWrapper } from './TransactionItemBlurWrapper'; +import { TransactionTypeIcon } from './TransactionTypeIcon'; const Wrapper = styled.div<{ $isPhishingTransaction: boolean; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx index 9e71e0ec482..89c2b274ea7 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionRow.tsx @@ -1,19 +1,19 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { SignOperator } from '@suite-common/suite-types'; +import { selectHistoricFiatRatesByTimestamp } from '@suite-common/wallet-core'; +import { Timestamp } from '@suite-common/wallet-types'; import { - formatCardanoWithdrawal, formatCardanoDeposit, + formatCardanoWithdrawal, 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 { BigNumber } from '@trezor/utils/src/bigNumber'; -import { FiatValue, Translation, FormattedCryptoAmount } from 'src/components/suite'; -import { WalletAccountTransaction } from 'src/types/wallet'; -import { ExtendedMessageDescriptor } from 'src/types/suite'; +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { ExtendedMessageDescriptor } from 'src/types/suite'; +import { WalletAccountTransaction } from 'src/types/wallet'; import { TransactionTargetLayout } from './TransactionTargetLayout'; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx index 8a3d944b8de..c152c3ed5e6 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TargetAddressLabel.tsx @@ -1,11 +1,11 @@ import styled from 'styled-components'; -import { ArrayElement } from '@trezor/type-utils'; import type { NetworkSymbol } from '@suite-common/wallet-config'; +import { ArrayElement } from '@trezor/type-utils'; -import { WalletAccountTransaction } from 'src/types/wallet'; -import { Translation, AddressLabeling } from 'src/components/suite'; +import { AddressLabeling, Translation } from 'src/components/suite'; import { AccountLabels } from 'src/types/suite/metadata'; +import { WalletAccountTransaction } from 'src/types/wallet'; 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 a9295406413..c15bdbdcc96 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TokenTransferAddressLabel.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TokenTransferAddressLabel.tsx @@ -1,7 +1,7 @@ -import { ArrayElement } from '@trezor/type-utils'; import type { NetworkSymbol } from '@suite-common/wallet-config'; +import { ArrayElement } from '@trezor/type-utils'; -import { Translation, AddressLabeling } from 'src/components/suite'; +import { AddressLabeling, Translation } from 'src/components/suite'; import { WalletAccountTransaction } from 'src/types/wallet'; import { BlurWrapper } from '../TransactionItemBlurWrapper'; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx index 4ef47004a87..a6ff35388f5 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTarget/TransactionTarget.tsx @@ -1,34 +1,34 @@ -import { notificationsActions, ToastPayload } from '@suite-common/toast-notifications'; +import { ToastPayload, notificationsActions } from '@suite-common/toast-notifications'; +import { selectHistoricFiatRatesByTimestamp } from '@suite-common/wallet-core'; +import { Timestamp, TokenAddress } from '@suite-common/wallet-types'; import { - getTxOperation, - getTargetAmount, - isTestnet, formatAmount, formatNetworkAmount, getFiatRateKey, + getTargetAmount, + getTxOperation, + isTestnet, } 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, + FiatValue, FormattedCryptoAmount, + MetadataLabeling, + Translation, } 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 { selectLabelingValueBeingEdited } from 'src/reducers/suite/metadataReducer'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { AccountLabels } from 'src/types/suite/metadata'; +import { WalletAccountTransaction } from 'src/types/wallet'; -import { TokenTransferAddressLabel } from './TokenTransferAddressLabel'; import { TargetAddressLabel } from './TargetAddressLabel'; -import { TransactionTargetLayout } from '../TransactionTargetLayout'; +import { TokenTransferAddressLabel } from './TokenTransferAddressLabel'; import { AmountComponent } from '../../AmountComponent'; +import { TransactionTargetLayout } from '../TransactionTargetLayout'; 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 bf7eded0c7d..a65c049017f 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTargetLayout.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTargetLayout.tsx @@ -1,7 +1,7 @@ import { ReactNode } from 'react'; -import styled, { css } from 'styled-components'; import { motion } from 'framer-motion'; +import styled, { css } from 'styled-components'; import { motionAnimation } from '@trezor/components'; import { borders, spacingsPx, typography } from '@trezor/theme'; diff --git a/packages/suite/src/components/wallet/TransactionItem/TransactionTypeIcon.tsx b/packages/suite/src/components/wallet/TransactionItem/TransactionTypeIcon.tsx index 74d66ea5fef..d7ee65eabcc 100644 --- a/packages/suite/src/components/wallet/TransactionItem/TransactionTypeIcon.tsx +++ b/packages/suite/src/components/wallet/TransactionItem/TransactionTypeIcon.tsx @@ -1,7 +1,7 @@ import styled, { useTheme } from 'styled-components'; -import { Icon, IconProps } from '@trezor/components'; import { getTxIcon } from '@suite-common/wallet-utils'; +import { Icon, IconProps } from '@trezor/components'; import { WalletAccountTransaction } from 'src/types/wallet'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx index db58b438243..2ce765b6ccd 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx @@ -3,20 +3,20 @@ import { isSupportedEthStakingNetworkSymbol } from '@suite-common/wallet-utils'; import { Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Account } from 'src/types/wallet'; import { useSelector } from 'src/hooks/suite'; +import { Account } from 'src/types/wallet'; -import { AuthConfirmFailed } from './AuthConfirmFailed'; -import { BackendDisconnected } from './BackendDisconnected'; -import { DeviceUnavailable } from './DeviceUnavailable'; -import { XRPReserve } from './XRPReserve'; import { AccountImported } from './AccountImported'; import { AccountOutOfSync } from './AccountOutOfSync'; -import { TorDisconnected } from './TorDisconnected'; +import { AuthConfirmFailed } from './AuthConfirmFailed'; +import { BackendDisconnected } from './BackendDisconnected'; import { ContextMessage } from './ContextMessage'; -import { StakingBanner } from './StakingBanner'; +import { DeviceUnavailable } from './DeviceUnavailable'; import { EvmExplanationBanner } from './EvmExplanationBanner'; +import { StakingBanner } from './StakingBanner'; import { TaprootBanner } from './TaprootBanner'; +import { TorDisconnected } from './TorDisconnected'; +import { XRPReserve } from './XRPReserve'; type AccountBannersProps = { account?: Account; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BackendDisconnected.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BackendDisconnected.tsx index 006d880b71e..6185144d3ff 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BackendDisconnected.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/BackendDisconnected.tsx @@ -1,10 +1,10 @@ -import { tryGetAccountIdentity, isTrezorConnectBackendType } from '@suite-common/wallet-utils'; import type { NetworkSymbol } from '@suite-common/wallet-config'; +import { isTrezorConnectBackendType, tryGetAccountIdentity } from '@suite-common/wallet-utils'; import { Banner } from '@trezor/components'; import { Translation } from 'src/components/suite'; -import { useSelector } from 'src/hooks/suite'; import { useBackendReconnection } from 'src/hooks/settings/backends'; +import { useSelector } from 'src/hooks/suite'; const DisconnectedNotification = ({ symbol, diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/CloseableBanner.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/CloseableBanner.tsx index 50c9835f8c9..78b65662dc3 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/CloseableBanner.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/CloseableBanner.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react'; -import { Text, Banner, BannerProps, Column, Margin } from '@trezor/components'; +import { Banner, BannerProps, Column, Margin, Text } from '@trezor/components'; import { spacings } from '@trezor/theme/src'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx index 3193df434db..77dbf85b126 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx @@ -1,5 +1,5 @@ +import { Context, selectContextMessageContent } from '@suite-common/message-system'; import { Banner } from '@trezor/components'; -import { selectContextMessageContent, Context } from '@suite-common/message-system'; import { useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/DeviceUnavailable.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/DeviceUnavailable.tsx index f96ab940d26..1679e6b50e3 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/DeviceUnavailable.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/DeviceUnavailable.tsx @@ -1,8 +1,8 @@ import { Banner } from '@trezor/components'; -import { useDevice, useDispatch } from 'src/hooks/suite'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { Translation } from 'src/components/suite'; +import { useDevice, useDispatch } from 'src/hooks/suite'; export const DeviceUnavailable = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/EvmExplanationBanner.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/EvmExplanationBanner.tsx index 7f211191a70..59fc8b97687 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/EvmExplanationBanner.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/EvmExplanationBanner.tsx @@ -1,13 +1,13 @@ import { networks } from '@suite-common/wallet-config'; -import { Account } from 'src/types/wallet'; +import { SUITE } from 'src/actions/suite/constants'; 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 { useSelector } from 'src/hooks/suite/useSelector'; +import { Account } from 'src/types/wallet'; -import { CloseableBanner } from './CloseableBanner'; import { BannerPoints } from './BannerPoints'; +import { CloseableBanner } from './CloseableBanner'; interface EvmExplanationBannerProps { account?: Account; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/StakingBanner.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/StakingBanner.tsx index 08d897d7013..697e4571bc3 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/StakingBanner.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/StakingBanner.tsx @@ -1,24 +1,24 @@ 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 { NetworkType, getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { MIN_ETH_AMOUNT_FOR_STAKING, MIN_SOL_AMOUNT_FOR_STAKING, } from '@suite-common/wallet-constants'; +import { selectPoolStatsApyData } from '@suite-common/wallet-core'; +import { Account } from '@suite-common/wallet-types'; import { isSupportedEthStakingNetworkSymbol, isSupportedSolStakingNetworkSymbol, } from '@suite-common/wallet-utils'; -import { getNetworkDisplaySymbol, NetworkType } from '@suite-common/wallet-config'; +import { Banner, Button, Column, IconButton, Row, Text } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -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, selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; +import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { selectIsDebugModeActive, selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; interface StakingBannerProps { 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 6d17c0b1571..f946325affc 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/TaprootBanner.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/TaprootBanner.tsx @@ -2,14 +2,14 @@ import styled from 'styled-components'; import { getBip43Type } from '@suite-common/wallet-utils'; +import { setFlag } from 'src/actions/suite/suiteActions'; import { Translation } from 'src/components/suite'; -import { useSelector } from 'src/hooks/suite/useSelector'; import { useDispatch } from 'src/hooks/suite/useDispatch'; -import { setFlag } from 'src/actions/suite/suiteActions'; +import { useSelector } from 'src/hooks/suite/useSelector'; import { Account } from 'src/types/wallet'; -import { CloseableBanner } from './CloseableBanner'; import { BannerPoints } from './BannerPoints'; +import { CloseableBanner } from './CloseableBanner'; import { selectSuiteFlags } from '../../../../reducers/suite/suiteReducer'; interface TaprootBannerProps { diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/TorDisconnected.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/TorDisconnected.tsx index 7c7380977e3..5679444a3ff 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/TorDisconnected.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/TorDisconnected.tsx @@ -1,8 +1,8 @@ import { Banner } from '@trezor/components'; +import { toggleTor } from 'src/actions/suite/suiteActions'; import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { toggleTor } from 'src/actions/suite/suiteActions'; import { selectTorState } from 'src/reducers/suite/suiteReducer'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx index 3d4093ee973..ac48ec9c11e 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountBanners/XRPReserve.tsx @@ -1,7 +1,7 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; -import { HELP_CENTER_XRP_URL } from '@trezor/urls'; import { Banner } from '@trezor/components'; +import { HELP_CENTER_XRP_URL } from '@trezor/urls'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Translation } from 'src/components/suite'; import type { Account } from 'src/types/wallet/index'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountException.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountException.tsx index 1bf593f0505..7b5bbbf8812 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountException.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountException.tsx @@ -1,12 +1,12 @@ -import { H2, Column } from '@trezor/components'; import { SelectedAccountException } from '@suite-common/wallet-types'; +import { Column, H2 } from '@trezor/components'; -import { AuthFailed } from './AuthFailed'; -import { DiscoveryFailed } from './DiscoveryFailed'; -import { DiscoveryEmpty } from './DiscoveryEmpty'; import { AccountNotEnabled } from './AccountNotEnabled'; -import { AccountNotLoaded } from './AccountNotLoaded'; import { AccountNotExists } from './AccountNotExists'; +import { AccountNotLoaded } from './AccountNotLoaded'; +import { AuthFailed } from './AuthFailed'; +import { DiscoveryEmpty } from './DiscoveryEmpty'; +import { DiscoveryFailed } from './DiscoveryFailed'; const getExceptionPage = ( loader: SelectedAccountException['loader'], diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotEnabled.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotEnabled.tsx index 6caf9898d53..cbaf8c92e22 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotEnabled.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotEnabled.tsx @@ -1,9 +1,9 @@ import { Network } from '@suite-common/wallet-config'; import { changeCoinVisibility } from 'src/actions/settings/walletSettingsActions'; -import { useDevice, useDispatch } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { AccountExceptionLayout } from 'src/components/wallet'; +import { useDevice, useDispatch } from 'src/hooks/suite'; interface AccountNotEnabledProps { network: Network; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotLoaded.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotLoaded.tsx index ca1eb23c806..35226b8a0d4 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotLoaded.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountException/AccountNotLoaded.tsx @@ -1,8 +1,8 @@ import { restartDiscoveryThunk } from '@suite-common/wallet-core'; -import { useDevice, useDispatch } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { AccountExceptionLayout } from 'src/components/wallet'; +import { useDevice, useDispatch } from 'src/hooks/suite'; /** * Handler for 'bundle-exception' in discovery diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountException/AuthFailed.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountException/AuthFailed.tsx index 55386dc7d9f..1304b717cbb 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountException/AuthFailed.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountException/AuthFailed.tsx @@ -1,8 +1,8 @@ import { authorizeDeviceThunk } from '@suite-common/wallet-core'; -import { useDevice, useDispatch } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { AccountExceptionLayout } from 'src/components/wallet'; +import { useDevice, useDispatch } from 'src/hooks/suite'; export const AuthFailed = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountException/DiscoveryEmpty.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountException/DiscoveryEmpty.tsx index 9fb3102ba22..b0d23130eb4 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountException/DiscoveryEmpty.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountException/DiscoveryEmpty.tsx @@ -1,7 +1,7 @@ import { goto } from 'src/actions/suite/routerActions'; -import { useDevice, useDispatch } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; import { AccountExceptionLayout } from 'src/components/wallet'; +import { useDevice, useDispatch } from 'src/hooks/suite'; /** * Handler for invalid wallet setting, no coins in discovery diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountNavigation.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountNavigation.tsx index 2a223d66e40..2e961432bef 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountNavigation.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountNavigation.tsx @@ -1,17 +1,17 @@ -import { hasNetworkFeatures } from '@suite-common/wallet-utils'; import { getNetworkOptional } from '@suite-common/wallet-config'; +import { hasNetworkFeatures } from '@suite-common/wallet-utils'; 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 { goto } from 'src/actions/suite/routerActions'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { Translation } from 'src/components/suite/Translation'; import { NavigationItem, SubpageNavigation } from 'src/components/suite/layouts/SuiteLayout'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { - selectIsDebugModeActive, selectHasExperimentalFeature, + selectIsDebugModeActive, } from 'src/reducers/suite/suiteReducer'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { WalletParams } from 'src/types/wallet'; export const ACCOUNT_TABS = [ 'wallet-index', diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountTopPanel.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountTopPanel.tsx index 84251598c25..0439177e861 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountTopPanel.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountTopPanel/AccountTopPanel.tsx @@ -2,14 +2,14 @@ import { forwardRef } from 'react'; import styled from 'styled-components'; -import { spacingsPx, zIndices } from '@trezor/theme'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { SkeletonCircle, SkeletonRectangle } from '@trezor/components'; import { CoinLogo } from '@trezor/product-components'; +import { spacingsPx, zIndices } from '@trezor/theme'; -import { FormattedCryptoAmount, AmountUnitSwitchWrapper } from 'src/components/suite'; -import { useSelector } from 'src/hooks/suite'; +import { AmountUnitSwitchWrapper, FormattedCryptoAmount } from 'src/components/suite'; import { FiatHeader } from 'src/components/wallet/FiatHeader'; +import { useSelector } from 'src/hooks/suite'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; 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 6445bcee824..7089edf6059 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountGroup.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountGroup.tsx @@ -1,9 +1,9 @@ -import { useState, ReactNode } from 'react'; +import { ReactNode, useState } from 'react'; import styled from 'styled-components'; -import { Icon, Column, Text, Row, Box } from '@trezor/components'; -import { spacingsPx, spacings } from '@trezor/theme'; +import { Box, Column, Icon, Row, Text } from '@trezor/components'; +import { spacings, spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { Account } from 'src/types/wallet'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItem.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItem.tsx index a58c7cf6f2d..d9605af2d35 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItem.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItem.tsx @@ -1,18 +1,18 @@ -import { forwardRef, Ref } from 'react'; +import { Ref, forwardRef } from 'react'; import styled from 'styled-components'; -import { Column, Tooltip, TOOLTIP_DELAY_NORMAL } from '@trezor/components'; +import { Column, TOOLTIP_DELAY_NORMAL, Tooltip } from '@trezor/components'; -import { useDispatch } 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 { useDispatch } from 'src/hooks/suite'; +import { Account, AccountItemType } from 'src/types/wallet'; -import { ExpandedSidebarOnly } from '../../../../suite/layouts/SuiteLayout/Sidebar/ExpandedSidebarOnly'; -import { CollapsedSidebarOnly } from '../../../../suite/layouts/SuiteLayout/Sidebar/CollapsedSidebarOnly'; -import { AccountRow } from './AccountRow'; import { AccountItemLeft } from './AccountItemLeft'; +import { AccountRow } from './AccountRow'; +import { CollapsedSidebarOnly } from '../../../../suite/layouts/SuiteLayout/Sidebar/CollapsedSidebarOnly'; +import { ExpandedSidebarOnly } from '../../../../suite/layouts/SuiteLayout/Sidebar/ExpandedSidebarOnly'; export const CollapsedItem = styled(NavigationItemBase)<{ $isSelected: boolean }>` background: ${({ theme, $isSelected }) => $isSelected && theme.backgroundSurfaceElevation1}; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItemContent.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItemContent.tsx index f5cc07a0650..ea15f092b5b 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItemContent.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItemContent.tsx @@ -1,23 +1,18 @@ import styled from 'styled-components'; -import { Account } from '@suite-common/wallet-types'; -import { AccountType, NetworkSymbol } from '@suite-common/wallet-config'; import { useFormatters } from '@suite-common/formatters'; -import { spacings } from '@trezor/theme'; +import { AccountType, NetworkSymbol } from '@suite-common/wallet-config'; +import { Account } from '@suite-common/wallet-types'; +import { isTestnet } from '@suite-common/wallet-utils'; import { + Column, + Row, SkeletonRectangle, TOOLTIP_DELAY_LONG, TruncateWithTooltip, - Column, - Row, } from '@trezor/components'; -import { isTestnet } from '@suite-common/wallet-utils'; +import { spacings } from '@trezor/theme'; -import { useLoadingSkeleton, useSelector } from 'src/hooks/suite'; -import { - selectIsDiscreteModeActive, - selectLocalCurrency, -} from 'src/reducers/wallet/settingsReducer'; import { AccountLabel, CoinBalance, @@ -25,6 +20,11 @@ import { HiddenPlaceholder, Translation, } from 'src/components/suite'; +import { useLoadingSkeleton, useSelector } from 'src/hooks/suite'; +import { + selectIsDiscreteModeActive, + selectLocalCurrency, +} from 'src/reducers/wallet/settingsReducer'; import { AccountItemType } from 'src/types/wallet'; const AccountLabelContainer = styled.div` diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItemLeft.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItemLeft.tsx index ae60cb3f659..e35f5febad8 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItemLeft.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountItemLeft.tsx @@ -1,9 +1,9 @@ import { NetworkSymbol } from '@suite-common/wallet-config'; -import { CoinLogo } from '@trezor/product-components'; import { Column, Icon } from '@trezor/components'; +import { CoinLogo } from '@trezor/product-components'; -import { TokenIconSetWrapper } from '../../../TokenIconSetWrapper'; import { Account, AccountItemType } from '../../../../../types/wallet'; +import { TokenIconSetWrapper } from '../../../TokenIconSetWrapper'; const ICON_SIZE = 24; type AccountItemLeftProps = { diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountRow.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountRow.tsx index 67e3e36170c..32ed268f772 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountRow.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItem/AccountRow.tsx @@ -5,11 +5,11 @@ import styled from 'styled-components'; import { AccountType, NetworkSymbol } from '@suite-common/wallet-config'; import { spacingsPx, typography } from '@trezor/theme'; -import { Account, AccountItemType } from '../../../../../types/wallet'; import { Left } from './AccountItem'; -import { NavigationItemBase } from '../../../../suite/layouts/SuiteLayout/Sidebar/NavigationItem'; -import { AccountItemLeft } from './AccountItemLeft'; import { AccountItemContent } from './AccountItemContent'; +import { AccountItemLeft } from './AccountItemLeft'; +import { Account, AccountItemType } from '../../../../../types/wallet'; +import { NavigationItemBase } from '../../../../suite/layouts/SuiteLayout/Sidebar/NavigationItem'; type AccountRowProps = { isSelected: boolean; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemSkeleton.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemSkeleton.tsx index 5bfc2917292..3239943b176 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemSkeleton.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemSkeleton.tsx @@ -1,4 +1,4 @@ -import { SkeletonCircle, SkeletonRectangle, Row, Column } from '@trezor/components'; +import { Column, Row, SkeletonCircle, SkeletonRectangle } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { useLoadingSkeleton } from 'src/hooks/suite'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx index 373850bb912..ef69cfde0d7 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountItemsGroup.tsx @@ -1,17 +1,17 @@ import styled from 'styled-components'; -import { borders, spacingsPx, spacings } from '@trezor/theme'; import { selectCurrentFiatRates } from '@suite-common/wallet-core'; import { - getAccountTotalStakingBalance, getAccountTokensFiatBalance, + getAccountTotalStakingBalance, } from '@suite-common/wallet-utils'; import { Column } from '@trezor/components'; +import { borders, spacings, spacingsPx } from '@trezor/theme'; -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 { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { Account } from 'src/types/wallet'; import { AccountItem } from './AccountItem/AccountItem'; import { useIsSidebarCollapsed } from '../../../suite/layouts/SuiteLayout/Sidebar/utils'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountSection.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountSection.tsx index fdf79dcd751..783b1caced4 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountSection.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountSection.tsx @@ -1,11 +1,11 @@ -import { Account } from '@suite-common/wallet-types'; import { selectCoinDefinitions } from '@suite-common/token-definitions'; import { selectEthAccountHasStaked, selectSolAccountHasStaked } from '@suite-common/wallet-core'; +import { Account } from '@suite-common/wallet-types'; import { isSupportedStakingNetworkSymbol } from '@suite-common/wallet-utils'; import { useSelector } from 'src/hooks/suite'; -import { getTokens } from 'src/utils/wallet/tokenUtils'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; +import { getTokens } from 'src/utils/wallet/tokenUtils'; import { AccountItem } from './AccountItem/AccountItem'; import { AccountItemsGroup } from './AccountItemsGroup'; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsList.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsList.tsx index d1ac3fd8810..24d2bd57f7c 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsList.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsList.tsx @@ -1,25 +1,25 @@ -import { sortByCoin, getFailedAccounts, accountSearchFn } from '@suite-common/wallet-utils'; -import { Account } from '@suite-common/wallet-types'; +import { AccountType } from '@suite-common/wallet-config'; import { selectAccounts, selectSelectedDevice } from '@suite-common/wallet-core'; -import { spacings } from '@trezor/theme'; +import { Account } from '@suite-common/wallet-types'; +import { accountSearchFn, getFailedAccounts, sortByCoin } from '@suite-common/wallet-utils'; import { Column } from '@trezor/components'; -import { AccountType } from '@suite-common/wallet-config'; +import { spacings } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; import { useAccountSearch, + useDefaultAccountLabel, useDiscovery, useSelector, - useDefaultAccountLabel, } from 'src/hooks/suite'; 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 { AccountItemSkeleton } from './AccountItemSkeleton'; import { AccountSection } from './AccountSection'; -import { ExpandedSidebarOnly } from '../../../suite/layouts/SuiteLayout/Sidebar/ExpandedSidebarOnly'; +import { AccountsMenuNotice } from './AccountsMenuNotice'; import { CollapsedSidebarOnly } from '../../../suite/layouts/SuiteLayout/Sidebar/CollapsedSidebarOnly'; +import { ExpandedSidebarOnly } from '../../../suite/layouts/SuiteLayout/Sidebar/ExpandedSidebarOnly'; import { useIsSidebarCollapsed } from '../../../suite/layouts/SuiteLayout/Sidebar/utils'; 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 a09ede91887..77971fbabc6 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountsMenu.tsx @@ -2,22 +2,22 @@ import React from 'react'; import styled from 'styled-components'; -import { spacings, spacingsPx, zIndices } from '@trezor/theme'; import { selectSelectedDevice } from '@suite-common/wallet-core'; import { getFailedAccounts, sortByCoin } from '@suite-common/wallet-utils'; -import { useScrollShadow, Row, Column } from '@trezor/components'; +import { Column, Row, useScrollShadow } from '@trezor/components'; +import { spacings, spacingsPx, zIndices } from '@trezor/theme'; -import { useDiscovery, useSelector } from 'src/hooks/suite'; 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'; import { AccountsList } from './AccountsList'; import { AccountsMenuNotice } from './AccountsMenuNotice'; +import { AddAccountButton } from './AddAccountButton'; +import { CoinsFilter } from './CoinsFilter'; import { RefreshAfterDiscoveryNeeded } from './RefreshAfterDiscoveryNeeded'; -import { ExpandedSidebarOnly } from '../../../suite/layouts/SuiteLayout/Sidebar/ExpandedSidebarOnly'; import { CollapsedSidebarOnly } from '../../../suite/layouts/SuiteLayout/Sidebar/CollapsedSidebarOnly'; +import { ExpandedSidebarOnly } from '../../../suite/layouts/SuiteLayout/Sidebar/ExpandedSidebarOnly'; import { useIsSidebarCollapsed } from '../../../suite/layouts/SuiteLayout/Sidebar/utils'; const Wrapper = styled.div` diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx index 44ce2b64336..a80dc5f6fa2 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AddAccountButton.tsx @@ -1,10 +1,10 @@ -import { Tooltip, ButtonProps, IconButton, Button, TOOLTIP_DELAY_NORMAL } from '@trezor/components'; import { DiscoveryStatus } from '@suite-common/wallet-constants'; +import { Button, ButtonProps, IconButton, TOOLTIP_DELAY_NORMAL, Tooltip } from '@trezor/components'; +import { openModal } from 'src/actions/suite/modalActions'; 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 { TrezorDevice } from 'src/types/suite'; const getExplanationMessage = (device: TrezorDevice | undefined, discoveryIsRunning: boolean) => { let message; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/CoinsFilter.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/CoinsFilter.tsx index 7281ff2ba78..1ca1418391b 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/CoinsFilter.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/CoinsFilter.tsx @@ -1,14 +1,14 @@ +import { AnimatePresence, MotionProps, motion } from 'framer-motion'; import styled from 'styled-components'; -import { motion, AnimatePresence, MotionProps } from 'framer-motion'; +import { getNetwork } from '@suite-common/wallet-config'; import { TOOLTIP_DELAY_NORMAL, Tooltip, motionEasing } from '@trezor/components'; import { CoinLogo } from '@trezor/product-components'; import { borders, spacingsPx } from '@trezor/theme'; -import { getNetwork } from '@suite-common/wallet-config'; -import { useSelector, useAccountSearch } from 'src/hooks/suite'; -import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; +import { useAccountSearch, useSelector } from 'src/hooks/suite'; +import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; // eslint-disable-next-line local-rules/no-override-ds-component const StyledCoinLogo = styled(CoinLogo)<{ $isSelected?: boolean }>` diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu.tsx index 5a5eae0c7f6..5c49a69ad45 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/MobileAccountsMenu.tsx @@ -2,17 +2,17 @@ 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 { selectSelectedDevice } from '@suite-common/wallet-core'; +import { H2, Icon, variables } from '@trezor/components'; +import { spacingsPx, zIndices } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { useDiscovery, useSelector } from 'src/hooks/suite'; import { AccountSearchBox } from './AccountSearchBox'; +import { AccountsList } from './AccountsList'; import { AddAccountButton } from './AddAccountButton'; import { CoinsFilter } from './CoinsFilter'; -import { AccountsList } from './AccountsList'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/RefreshAfterDiscoveryNeeded.tsx b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/RefreshAfterDiscoveryNeeded.tsx index b8de5ccee66..987a4013404 100644 --- a/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/RefreshAfterDiscoveryNeeded.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/AccountsMenu/RefreshAfterDiscoveryNeeded.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import styled from 'styled-components'; import { AnimatePresence, MotionProps, motion } from 'framer-motion'; +import styled from 'styled-components'; -import { Button, IconButton, motionEasing, Row, Tooltip } from '@trezor/components'; -import { spacings, spacingsPx, typography } from '@trezor/theme'; import { selectSelectedDevice, startDiscoveryThunk } from '@suite-common/wallet-core'; +import { Button, IconButton, Row, Tooltip, motionEasing } from '@trezor/components'; +import { spacings, spacingsPx, typography } from '@trezor/theme'; -import { useRediscoveryNeeded, useDispatch, useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; +import { useDispatch, useRediscoveryNeeded, useSelector } from 'src/hooks/suite'; import { AccountsMenuNotice } from './AccountsMenuNotice'; import { useIsSidebarCollapsed } from '../../../suite/layouts/SuiteLayout/Sidebar/utils'; diff --git a/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/CoinjoinAccountDiscovery.tsx b/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/CoinjoinAccountDiscovery.tsx index f8c3f0cb6ce..02bee51df1f 100644 --- a/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/CoinjoinAccountDiscovery.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/CoinjoinAccountDiscovery.tsx @@ -1,11 +1,11 @@ import { useState } from 'react'; -import { toggleRememberDevice } from '@suite-common/wallet-core'; import { isDeviceRemembered } from '@suite-common/suite-utils'; +import { toggleRememberDevice } from '@suite-common/wallet-core'; -import { useDispatch, useDevice } from 'src/hooks/suite'; -import { TrezorDevice } from 'src/types/suite'; import { CoinjoinAccountDiscoveryProgress } from 'src/components/wallet'; +import { useDevice, useDispatch } from 'src/hooks/suite'; +import { TrezorDevice } from 'src/types/suite'; import { RememberWallet } from './RememberWallet'; diff --git a/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/RememberWallet.tsx b/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/RememberWallet.tsx index ec0fc90e211..bc8930311e2 100644 --- a/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/RememberWallet.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/CoinjoinAccountDiscovery/RememberWallet.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components'; -import { spacings, spacingsPx } from '@trezor/theme'; import { Card, Image, Note, Paragraph, Row, Switch } from '@trezor/components'; +import { spacings, spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/components/wallet/WalletLayout/WalletLayout.tsx b/packages/suite/src/components/wallet/WalletLayout/WalletLayout.tsx index fb3bfb686ef..e8fb35816a5 100644 --- a/packages/suite/src/components/wallet/WalletLayout/WalletLayout.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/WalletLayout.tsx @@ -1,19 +1,19 @@ import { ReactNode } from 'react'; -import { SkeletonRectangle, Column } from '@trezor/components'; +import { Column, SkeletonRectangle } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { PrimitiveType } from '@trezor/type-utils'; -import { AppState } from 'src/types/suite'; -import { useTranslation, useLayout } from 'src/hooks/suite'; -import { PageHeader } from 'src/components/suite/layouts/SuiteLayout'; import { TranslationKey } from 'src/components/suite/Translation'; +import { PageHeader } from 'src/components/suite/layouts/SuiteLayout'; +import { useLayout, useTranslation } from 'src/hooks/suite'; +import { AppState } from 'src/types/suite'; import { AccountBanners } from './AccountBanners/AccountBanners'; import { AccountException } from './AccountException/AccountException'; -import { CoinjoinAccountDiscovery } from './CoinjoinAccountDiscovery/CoinjoinAccountDiscovery'; -import { AccountTopPanel } from './AccountTopPanel/AccountTopPanel'; import { AccountNavigation } from './AccountTopPanel/AccountNavigation'; +import { AccountTopPanel } from './AccountTopPanel/AccountTopPanel'; +import { CoinjoinAccountDiscovery } from './CoinjoinAccountDiscovery/CoinjoinAccountDiscovery'; type WalletPageHeaderProps = { isSubpage?: boolean; diff --git a/packages/suite/src/components/wallet/WalletLayout/WalletSubpageHeading.tsx b/packages/suite/src/components/wallet/WalletLayout/WalletSubpageHeading.tsx index e45c45b9fe7..90f68b5038f 100644 --- a/packages/suite/src/components/wallet/WalletLayout/WalletSubpageHeading.tsx +++ b/packages/suite/src/components/wallet/WalletLayout/WalletSubpageHeading.tsx @@ -3,7 +3,7 @@ import { ReactNode } from 'react'; import { H2, Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { TranslationKey, Translation } from 'src/components/suite/Translation'; +import { Translation, TranslationKey } from 'src/components/suite/Translation'; type WalletSubpageHeadingProps = { title: TranslationKey; diff --git a/packages/suite/src/components/wallet/index.tsx b/packages/suite/src/components/wallet/index.tsx index 58f1cf981f6..3221790525e 100644 --- a/packages/suite/src/components/wallet/index.tsx +++ b/packages/suite/src/components/wallet/index.tsx @@ -1,12 +1,12 @@ -import { WalletLayout } from './WalletLayout/WalletLayout'; -import { WalletSubpageHeading } from './WalletLayout/WalletSubpageHeading'; -import { InputError } from './InputError'; import { AccountExceptionLayout } from './AccountExceptionLayout'; +import { CoinjoinAccountDiscoveryProgress } from './CoinjoinAccountDiscoveryProgress/CoinjoinAccountDiscoveryProgress'; import { DiscoveryProgress } from './DiscoveryProgress'; -import { UtxoAnonymity } from './UtxoAnonymity'; +import { InputError } from './InputError'; import { Pagination } from './Pagination'; import { TransactionTimestamp } from './TransactionTimestamp'; -import { CoinjoinAccountDiscoveryProgress } from './CoinjoinAccountDiscoveryProgress/CoinjoinAccountDiscoveryProgress'; +import { UtxoAnonymity } from './UtxoAnonymity'; +import { WalletLayout } from './WalletLayout/WalletLayout'; +import { WalletSubpageHeading } from './WalletLayout/WalletSubpageHeading'; export { WalletLayout, diff --git a/packages/suite/src/config/onboarding/steps.ts b/packages/suite/src/config/onboarding/steps.ts index aef8a9bb053..1eac62adc31 100644 --- a/packages/suite/src/config/onboarding/steps.ts +++ b/packages/suite/src/config/onboarding/steps.ts @@ -1,7 +1,7 @@ import { DeviceModelInternal } from '@trezor/connect'; -import type { Step } from 'src/types/onboarding'; import * as STEP from 'src/constants/onboarding/steps'; +import type { Step } from 'src/types/onboarding'; const commonPrerequisites: Step['prerequisites'] = [ 'transport-bridge', diff --git a/packages/suite/src/config/suite/settings.ts b/packages/suite/src/config/suite/settings.ts index 387d01b6148..759e25fdc81 100644 --- a/packages/suite/src/config/suite/settings.ts +++ b/packages/suite/src/config/suite/settings.ts @@ -1,5 +1,5 @@ -import { NotificationEntry } from '@suite-common/toast-notifications'; import { settingsCommonConfig } from '@suite-common/suite-config'; +import { NotificationEntry } from '@suite-common/toast-notifications'; const IMPORTANT_NOTIFICATION_TYPES: Array = [ 'tx-sent', diff --git a/packages/suite/src/constants/suite/experimental.ts b/packages/suite/src/constants/suite/experimental.ts index cf8112cac36..815b55df37d 100644 --- a/packages/suite/src/constants/suite/experimental.ts +++ b/packages/suite/src/constants/suite/experimental.ts @@ -1,8 +1,8 @@ import { TranslationKey } from '@suite-common/intl-types'; -import { desktopApi } from '@trezor/suite-desktop-api'; -import { EXPERIMENTAL_PASSWORD_MANAGER_KB_URL, HELP_CENTER_TOR_URL, Url } from '@trezor/urls'; import { Route } from '@suite-common/suite-types'; import { isDesktop } from '@trezor/env-utils'; +import { desktopApi } from '@trezor/suite-desktop-api'; +import { EXPERIMENTAL_PASSWORD_MANAGER_KB_URL, HELP_CENTER_TOR_URL, Url } from '@trezor/urls'; import { Dispatch } from '../../types/suite'; diff --git a/packages/suite/src/constants/suite/firmware.ts b/packages/suite/src/constants/suite/firmware.ts index 1776ccb28fd..b8cdaa0fab7 100644 --- a/packages/suite/src/constants/suite/firmware.ts +++ b/packages/suite/src/constants/suite/firmware.ts @@ -1,6 +1,6 @@ +import { isDevEnv } from '@suite-common/suite-utils'; import { FirmwareHashCheckError, FirmwareRevisionCheckError } from '@trezor/connect'; import { FilterPropertiesByType } from '@trezor/type-utils'; -import { isDevEnv } from '@suite-common/suite-utils'; /* * Various scenarios how firmware authenticity check errors are handled in Suite diff --git a/packages/suite/src/constants/suite/routes.ts b/packages/suite/src/constants/suite/routes.ts index eae5e34551c..a1c756e291d 100644 --- a/packages/suite/src/constants/suite/routes.ts +++ b/packages/suite/src/constants/suite/routes.ts @@ -1,7 +1,7 @@ -import { ArrayElement } from '@trezor/type-utils'; -import { Route } from '@suite-common/suite-types'; import { routes } from '@suite-common/suite-config'; +import { Route } from '@suite-common/suite-types'; import { AccountType, NetworkSymbol } from '@suite-common/wallet-config'; +import { ArrayElement } from '@trezor/type-utils'; import { RouteParams } from 'src/utils/suite/router'; diff --git a/packages/suite/src/hooks/coinjoin/useCoinjoinAccountLoadingProgress.ts b/packages/suite/src/hooks/coinjoin/useCoinjoinAccountLoadingProgress.ts index aa6360d18d4..1f650e574a1 100644 --- a/packages/suite/src/hooks/coinjoin/useCoinjoinAccountLoadingProgress.ts +++ b/packages/suite/src/hooks/coinjoin/useCoinjoinAccountLoadingProgress.ts @@ -2,14 +2,14 @@ import { useEffect, useReducer } from 'react'; import { ScanProgressInfo } from '@trezor/coinjoin'; -import { CoinjoinService } from 'src/services/coinjoin'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { TranslationKey } from 'src/components/suite/Translation'; import { useSelector } from 'src/hooks/suite/useSelector'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { CoinjoinService } from 'src/services/coinjoin'; import { getAccountProgressHandle, isCoinjoinSupportedSymbol, } from 'src/utils/wallet/coinjoinUtils'; -import { TranslationKey } from 'src/components/suite/Translation'; const INIT_THRESHOLD = 0.05; const MEMPOOL_THRESHOLD = 0.85; diff --git a/packages/suite/src/hooks/coinjoin/useCoinjoinSessionPhase.ts b/packages/suite/src/hooks/coinjoin/useCoinjoinSessionPhase.ts index 859abe9e2d3..d624080c740 100644 --- a/packages/suite/src/hooks/coinjoin/useCoinjoinSessionPhase.ts +++ b/packages/suite/src/hooks/coinjoin/useCoinjoinSessionPhase.ts @@ -1,4 +1,4 @@ -import { useEffect, useState, useCallback } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import { SESSION_PHASE_TRANSITION_DELAY } from 'src/constants/suite/coinjoin'; import { useSelector } from 'src/hooks/suite/useSelector'; diff --git a/packages/suite/src/hooks/guide/useGuide.ts b/packages/suite/src/hooks/guide/useGuide.ts index 840b2d2cfca..3cf98b4cfa7 100644 --- a/packages/suite/src/hooks/guide/useGuide.ts +++ b/packages/suite/src/hooks/guide/useGuide.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react'; -import { useDispatch, useSelector, useLayoutSize } from 'src/hooks/suite'; import { close, open } from 'src/actions/suite/guideActions'; +import { useDispatch, useLayoutSize, useSelector } from 'src/hooks/suite'; import { usePreferredModal } from '../suite/usePreferredModal'; diff --git a/packages/suite/src/hooks/guide/useGuideLoadArticle.ts b/packages/suite/src/hooks/guide/useGuideLoadArticle.ts index 29bd237765b..95417cda344 100644 --- a/packages/suite/src/hooks/guide/useGuideLoadArticle.ts +++ b/packages/suite/src/hooks/guide/useGuideLoadArticle.ts @@ -1,4 +1,4 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; import type { GuideNode } from '@suite-common/suite-types'; diff --git a/packages/suite/src/hooks/guide/useGuideOpenNode.ts b/packages/suite/src/hooks/guide/useGuideOpenNode.ts index 2b956af0c8a..7d6136fab77 100644 --- a/packages/suite/src/hooks/guide/useGuideOpenNode.ts +++ b/packages/suite/src/hooks/guide/useGuideOpenNode.ts @@ -1,9 +1,9 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; +import { EventType, analytics } from '@trezor/suite-analytics'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { openNode } from 'src/actions/suite/guideActions'; -import { getNodeById } from 'src/utils/suite/guide'; import { useGuide } from 'src/hooks/guide'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { getNodeById } from 'src/utils/suite/guide'; export const useGuideOpenNode = () => { const { isGuideOpen, openGuide } = useGuide(); diff --git a/packages/suite/src/hooks/guide/useGuideSearch.ts b/packages/suite/src/hooks/guide/useGuideSearch.ts index 913215ee606..3d48a502b99 100644 --- a/packages/suite/src/hooks/guide/useGuideSearch.ts +++ b/packages/suite/src/hooks/guide/useGuideSearch.ts @@ -1,6 +1,6 @@ -import { useState, useEffect, useMemo } from 'react'; +import { useEffect, useMemo, useState } from 'react'; -import { GuideCategory, GuideArticle } from '@suite-common/suite-types'; +import { GuideArticle, GuideCategory } from '@suite-common/suite-types'; import { loadPageMarkdownFile } from 'src/hooks/guide/useGuideLoadArticle'; diff --git a/packages/suite/src/hooks/settings/backends/useBackendReconnection.ts b/packages/suite/src/hooks/settings/backends/useBackendReconnection.ts index 24162a55fb0..9293c9c80a4 100644 --- a/packages/suite/src/hooks/settings/backends/useBackendReconnection.ts +++ b/packages/suite/src/hooks/settings/backends/useBackendReconnection.ts @@ -1,7 +1,7 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; -import { reconnectBlockchainThunk } from '@suite-common/wallet-core'; import { type NetworkSymbol } from '@suite-common/wallet-config'; +import { reconnectBlockchainThunk } from '@suite-common/wallet-core'; import { useDispatch } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/settings/backends/useBackendsForm.ts b/packages/suite/src/hooks/settings/backends/useBackendsForm.ts index 0de2dde370d..798ad3e0831 100644 --- a/packages/suite/src/hooks/settings/backends/useBackendsForm.ts +++ b/packages/suite/src/hooks/settings/backends/useBackendsForm.ts @@ -1,15 +1,15 @@ import { useState } from 'react'; import { useForm } from 'react-hook-form'; -import { analytics, EventType } from '@trezor/suite-analytics'; -import { isUrl } from '@trezor/utils'; +import { BackendType, NetworkSymbol } from '@suite-common/wallet-config'; 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 { isElectrumUrl } from '@suite-common/wallet-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { isUrl } from '@trezor/utils'; -import { isOnionUrl } from 'src/utils/suite/tor'; import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; +import { isOnionUrl } from 'src/utils/suite/tor'; export type BackendOption = BackendType | 'default'; diff --git a/packages/suite/src/hooks/settings/backends/useDefaultUrls.ts b/packages/suite/src/hooks/settings/backends/useDefaultUrls.ts index 88227386605..6b0eafc0f1e 100644 --- a/packages/suite/src/hooks/settings/backends/useDefaultUrls.ts +++ b/packages/suite/src/hooks/settings/backends/useDefaultUrls.ts @@ -1,7 +1,7 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; -import TrezorConnect, { BlockchainLink } from '@trezor/connect'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import TrezorConnect, { BlockchainLink } from '@trezor/connect'; export const useDefaultUrls = ( symbol: NetworkSymbol, diff --git a/packages/suite/src/hooks/settings/useNetworkSupport.ts b/packages/suite/src/hooks/settings/useNetworkSupport.ts index 8d2082a8cf5..3f71ddd0931 100644 --- a/packages/suite/src/hooks/settings/useNetworkSupport.ts +++ b/packages/suite/src/hooks/settings/useNetworkSupport.ts @@ -1,15 +1,15 @@ import { Network, getMainnets, getTestnets } from '@suite-common/wallet-config'; -import { selectSelectedDevice, selectDeviceSupportedNetworks } from '@suite-common/wallet-core'; +import { selectDeviceSupportedNetworks, selectSelectedDevice } from '@suite-common/wallet-core'; import { DeviceModelInternal } from '@trezor/connect'; import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; import { arrayPartition } from '@trezor/utils'; +import { EXPERIMENTAL_L2_NETWORKS } from 'src/actions/suite/constants/suiteConstants'; import { useSelector } from 'src/hooks/suite'; import { - selectIsDebugModeActive, selectHasExperimentalFeature, + selectIsDebugModeActive, } from 'src/reducers/suite/suiteReducer'; -import { EXPERIMENTAL_L2_NETWORKS } from 'src/actions/suite/constants/suiteConstants'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; export const useNetworkSupport = () => { diff --git a/packages/suite/src/hooks/suite/__fixtures__/useDiscovery.ts b/packages/suite/src/hooks/suite/__fixtures__/useDiscovery.ts index 918deb8ab5d..8cd30d80264 100644 --- a/packages/suite/src/hooks/suite/__fixtures__/useDiscovery.ts +++ b/packages/suite/src/hooks/suite/__fixtures__/useDiscovery.ts @@ -1,6 +1,6 @@ import { testMocks } from '@suite-common/test-utils'; -import { deviceActions, discoveryActions } from '@suite-common/wallet-core'; import { DiscoveryStatus } from '@suite-common/wallet-constants'; +import { deviceActions, discoveryActions } from '@suite-common/wallet-core'; const { getSuiteDevice } = testMocks; const DEV = getSuiteDevice(); diff --git a/packages/suite/src/hooks/suite/__tests__/useDiscovery.test.tsx b/packages/suite/src/hooks/suite/__tests__/useDiscovery.test.tsx index 82243cb45e5..db6b0a8339f 100644 --- a/packages/suite/src/hooks/suite/__tests__/useDiscovery.test.tsx +++ b/packages/suite/src/hooks/suite/__tests__/useDiscovery.test.tsx @@ -1,15 +1,15 @@ import { act } from '@testing-library/react'; import { combineReducers } from 'redux'; -import { prepareDiscoveryReducer, prepareDeviceReducer } from '@suite-common/wallet-core'; import { configureMockStore } from '@suite-common/test-utils'; +import { prepareDeviceReducer, prepareDiscoveryReducer } from '@suite-common/wallet-core'; -import { renderWithProviders } from 'src/support/tests/hooksHelper'; import suiteReducer from 'src/reducers/suite/suiteReducer'; import { extraDependencies } from 'src/support/extraDependencies'; +import { renderWithProviders } from 'src/support/tests/hooksHelper'; -import { useDiscovery } from '../useDiscovery'; import { actions } from '../__fixtures__/useDiscovery'; +import { useDiscovery } from '../useDiscovery'; const discoveryReducer = prepareDiscoveryReducer(extraDependencies); const deviceReducer = prepareDeviceReducer(extraDependencies); diff --git a/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx b/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx index 1c47a0454dc..7027f1907ae 100644 --- a/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx +++ b/packages/suite/src/hooks/suite/__tests__/useFilteredModal.test.tsx @@ -2,11 +2,11 @@ import { Provider } from 'react-redux'; import { render } from '@testing-library/react'; -import { configureStore } from 'src/support/tests/configureStore'; import type { State as ModalState } from 'src/reducers/suite/modalReducer'; +import { configureStore } from 'src/support/tests/configureStore'; -import { useFilteredModal } from '../useFilteredModal'; import { filters, fixtures } from '../__fixtures__/useFilteredModal'; +import { useFilteredModal } from '../useFilteredModal'; const mockStore = configureStore<{ modal: ModalState }, any>(); diff --git a/packages/suite/src/hooks/suite/useAccountSearch.ts b/packages/suite/src/hooks/suite/useAccountSearch.ts index 9457633ce96..59160dec64d 100644 --- a/packages/suite/src/hooks/suite/useAccountSearch.ts +++ b/packages/suite/src/hooks/suite/useAccountSearch.ts @@ -1,5 +1,5 @@ import * as accountSearchActions from 'src/actions/wallet/accountSearchActions'; -import { useSelector, useActions } from 'src/hooks/suite'; +import { useActions, useSelector } from 'src/hooks/suite'; export const useAccountSearch = () => { const { coinFilter, searchString } = useSelector(state => state.wallet.accountSearch); diff --git a/packages/suite/src/hooks/suite/useAnchor.ts b/packages/suite/src/hooks/suite/useAnchor.ts index e40d90acba9..158cac2f37b 100644 --- a/packages/suite/src/hooks/suite/useAnchor.ts +++ b/packages/suite/src/hooks/suite/useAnchor.ts @@ -1,4 +1,4 @@ -import { useRef, useEffect } from 'react'; +import { useEffect, useRef } from 'react'; import { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/suite/useCountdownTimer.ts b/packages/suite/src/hooks/suite/useCountdownTimer.ts index 92791519e5c..6a588feaf5c 100644 --- a/packages/suite/src/hooks/suite/useCountdownTimer.ts +++ b/packages/suite/src/hooks/suite/useCountdownTimer.ts @@ -1,4 +1,4 @@ -import { useEffect, useState, useCallback } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import intervalToDuration from 'date-fns/intervalToDuration'; diff --git a/packages/suite/src/hooks/suite/useDebugLanguageShortcut.ts b/packages/suite/src/hooks/suite/useDebugLanguageShortcut.ts index 063a7f602cd..cfaa25d0437 100644 --- a/packages/suite/src/hooks/suite/useDebugLanguageShortcut.ts +++ b/packages/suite/src/hooks/suite/useDebugLanguageShortcut.ts @@ -3,8 +3,8 @@ import { useCallback, useEffect } from 'react'; import { KEYBOARD_CODE } from '@trezor/components'; import { setLanguage } from 'src/actions/settings/languageActions'; -import LANGUAGES, { Locale } from 'src/config/suite/languages'; import { setAutodetect } from 'src/actions/suite/suiteActions'; +import LANGUAGES, { Locale } from 'src/config/suite/languages'; import { selectIsDebugModeActive, selectLanguage } from 'src/reducers/suite/suiteReducer'; import { useDispatch } from './useDispatch'; diff --git a/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts b/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts index 0a568111cfb..d48fb999af9 100644 --- a/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts +++ b/packages/suite/src/hooks/suite/useDefaultAccountLabel.ts @@ -1,7 +1,7 @@ import { useCallback } from 'react'; +import { AccountType, NetworkSymbol, getNetwork } from '@suite-common/wallet-config'; import { getTitleForCoinjoinAccount } from '@suite-common/wallet-utils'; -import { AccountType, getNetwork, NetworkSymbol } from '@suite-common/wallet-config'; import { useTranslation } from './useTranslation'; diff --git a/packages/suite/src/hooks/suite/useDevice.ts b/packages/suite/src/hooks/suite/useDevice.ts index b2e128da093..d6e3421a4ee 100644 --- a/packages/suite/src/hooks/suite/useDevice.ts +++ b/packages/suite/src/hooks/suite/useDevice.ts @@ -1,7 +1,7 @@ import { useCallback } from 'react'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; import { TrezorDevice } from '@suite-common/suite-types'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; import { selectIsDeviceOrUiLocked } from 'src/reducers/suite/suiteReducer'; diff --git a/packages/suite/src/hooks/suite/useDiscovery.ts b/packages/suite/src/hooks/suite/useDiscovery.ts index 73ea45eed31..6acff529c48 100644 --- a/packages/suite/src/hooks/suite/useDiscovery.ts +++ b/packages/suite/src/hooks/suite/useDiscovery.ts @@ -1,7 +1,7 @@ import { useCallback } from 'react'; -import { selectDiscoveryByDeviceState, selectSelectedDevice } from '@suite-common/wallet-core'; import { DiscoveryStatus } from '@suite-common/wallet-constants'; +import { selectDiscoveryByDeviceState, selectSelectedDevice } from '@suite-common/wallet-core'; import { DiscoveryStatusType } from 'src/types/wallet'; diff --git a/packages/suite/src/hooks/suite/useDisplayMode.ts b/packages/suite/src/hooks/suite/useDisplayMode.ts index b02c4f3d06e..6c0629a45cb 100644 --- a/packages/suite/src/hooks/suite/useDisplayMode.ts +++ b/packages/suite/src/hooks/suite/useDisplayMode.ts @@ -1,5 +1,5 @@ import { selectDeviceUnavailableCapabilities } from '@suite-common/wallet-core'; -import { AddressDisplayOptions, StakeType, ReviewOutput } from '@suite-common/wallet-types'; +import { AddressDisplayOptions, ReviewOutput, StakeType } from '@suite-common/wallet-types'; import { selectAddressDisplayType } from 'src/reducers/suite/suiteReducer'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; diff --git a/packages/suite/src/hooks/suite/useExternalLink.ts b/packages/suite/src/hooks/suite/useExternalLink.ts index e19c8b26912..11dfb85317c 100644 --- a/packages/suite/src/hooks/suite/useExternalLink.ts +++ b/packages/suite/src/hooks/suite/useExternalLink.ts @@ -1,8 +1,8 @@ import { useMemo } from 'react'; import { useSelector } from 'src/hooks/suite'; -import { getTorUrlIfAvailable } from 'src/utils/suite/tor'; import { selectTorState } from 'src/reducers/suite/suiteReducer'; +import { getTorUrlIfAvailable } from 'src/utils/suite/tor'; /** * Returns plain url or onion url if available and tor is active diff --git a/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts b/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts index d6a265bb15d..193b7f48e85 100644 --- a/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts +++ b/packages/suite/src/hooks/suite/useFiatFromCryptoValue.ts @@ -1,10 +1,10 @@ import { NetworkSymbol } from '@suite-common/wallet-config'; -import { getFiatRateKey, toFiatCurrency } from '@suite-common/wallet-utils'; import { selectFiatRatesByFiatRateKey } from '@suite-common/wallet-core'; import { TokenAddress } from '@suite-common/wallet-types'; +import { getFiatRateKey, toFiatCurrency } from '@suite-common/wallet-utils'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { useSelector } from 'src/hooks/suite'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; interface CommonOwnProps { amount: string; diff --git a/packages/suite/src/hooks/suite/useFilteredModal.ts b/packages/suite/src/hooks/suite/useFilteredModal.ts index fa5211e3a05..7120102d378 100644 --- a/packages/suite/src/hooks/suite/useFilteredModal.ts +++ b/packages/suite/src/hooks/suite/useFilteredModal.ts @@ -1,7 +1,7 @@ import { UserContextPayload } from '@suite-common/suite-types'; -import { useSelector } from 'src/hooks/suite'; import { MODAL } from 'src/actions/suite/constants'; +import { useSelector } from 'src/hooks/suite'; import type { State as ModalState } from 'src/reducers/suite/modalReducer'; type ModalContext = ModalState['context']; diff --git a/packages/suite/src/hooks/suite/useFormattersConfig.ts b/packages/suite/src/hooks/suite/useFormattersConfig.ts index 9ed1a2a81eb..95b2604762b 100644 --- a/packages/suite/src/hooks/suite/useFormattersConfig.ts +++ b/packages/suite/src/hooks/suite/useFormattersConfig.ts @@ -1,8 +1,8 @@ import { FormatterProviderConfig } from '@suite-common/formatters'; import { useSelector } from 'src/hooks/suite/useSelector'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; export const useFormattersConfig = (): FormatterProviderConfig => { const locale = useSelector(selectLanguage); diff --git a/packages/suite/src/hooks/suite/useGraph.ts b/packages/suite/src/hooks/suite/useGraph.ts index 6ba4babf55b..ea02162d2f5 100644 --- a/packages/suite/src/hooks/suite/useGraph.ts +++ b/packages/suite/src/hooks/suite/useGraph.ts @@ -1,5 +1,5 @@ -import { useSelector, useActions } from 'src/hooks/suite'; import * as graphActions from 'src/actions/wallet/graphActions'; +import { useActions, useSelector } from 'src/hooks/suite'; export const useGraph = () => { const selectedRange = useSelector(state => state.wallet.graph.selectedRange); diff --git a/packages/suite/src/hooks/suite/useLayout.tsx b/packages/suite/src/hooks/suite/useLayout.tsx index f932fafe986..14f97df3b8c 100644 --- a/packages/suite/src/hooks/suite/useLayout.tsx +++ b/packages/suite/src/hooks/suite/useLayout.tsx @@ -1,4 +1,4 @@ -import { useEffect, useContext } from 'react'; +import { useContext, useEffect } from 'react'; import { LayoutContext } from 'src/support/suite/LayoutContext'; diff --git a/packages/suite/src/hooks/suite/useMessageSystemStaking.ts b/packages/suite/src/hooks/suite/useMessageSystemStaking.ts index e7ab840b4e8..7ac06cf5668 100644 --- a/packages/suite/src/hooks/suite/useMessageSystemStaking.ts +++ b/packages/suite/src/hooks/suite/useMessageSystemStaking.ts @@ -1,7 +1,7 @@ import { - selectIsFeatureDisabled, Feature, selectFeatureMessageContent, + selectIsFeatureDisabled, } from '@suite-common/message-system'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; diff --git a/packages/suite/src/hooks/suite/useOnboarding.ts b/packages/suite/src/hooks/suite/useOnboarding.ts index ccb699ea8eb..f895c4b77ba 100644 --- a/packages/suite/src/hooks/suite/useOnboarding.ts +++ b/packages/suite/src/hooks/suite/useOnboarding.ts @@ -1,10 +1,10 @@ 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'; +import * as routerActions from 'src/actions/suite/routerActions'; import * as suiteActions from 'src/actions/suite/suiteActions'; -import { useActions, useSelector, useDispatch } from 'src/hooks/suite'; +import { useActions, useDispatch, useSelector } from 'src/hooks/suite'; export const useOnboarding = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/hooks/suite/usePasswords.ts b/packages/suite/src/hooks/suite/usePasswords.ts index a8aa47260b8..c4d8ef54250 100644 --- a/packages/suite/src/hooks/suite/usePasswords.ts +++ b/packages/suite/src/hooks/suite/usePasswords.ts @@ -1,15 +1,15 @@ -import { useState, useCallback } from 'react'; +import { useCallback, useState } from 'react'; import { selectSelectedDevice } 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 * as metadataProviderActions from 'src/actions/suite/metadataProviderActions'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectPasswordManagerState, selectSelectedProviderForPasswords, } from 'src/reducers/suite/metadataReducer'; +import type { PasswordEntry } from 'src/types/suite/metadata'; export const usePasswords = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/hooks/suite/usePreferredModal.ts b/packages/suite/src/hooks/suite/usePreferredModal.ts index 4ce3a490d4c..a3153ea7ca1 100644 --- a/packages/suite/src/hooks/suite/usePreferredModal.ts +++ b/packages/suite/src/hooks/suite/usePreferredModal.ts @@ -1,7 +1,7 @@ import { Route } from '@suite-common/suite-types'; import { MODAL } from 'src/actions/suite/constants'; -import { useSelector, useDiscovery } from 'src/hooks/suite'; +import { useDiscovery, useSelector } from 'src/hooks/suite'; import type { ForegroundAppRoute } from 'src/types/suite'; import { ModalAppParams } from 'src/utils/suite/router'; diff --git a/packages/suite/src/hooks/suite/useRecovery.ts b/packages/suite/src/hooks/suite/useRecovery.ts index 0e959adb6a2..7996d31e9b2 100644 --- a/packages/suite/src/hooks/suite/useRecovery.ts +++ b/packages/suite/src/hooks/suite/useRecovery.ts @@ -1,6 +1,6 @@ import * as recoveryActions from 'src/actions/recovery/recoveryActions'; -import { useActions, useSelector } from 'src/hooks/suite'; import { MODAL } from 'src/actions/suite/constants'; +import { useActions, useSelector } from 'src/hooks/suite'; const getWordRequestInputType = (request: string | undefined) => { switch (request) { diff --git a/packages/suite/src/hooks/suite/useSelector.ts b/packages/suite/src/hooks/suite/useSelector.ts index 0449578a3d8..3c8b95a2a58 100644 --- a/packages/suite/src/hooks/suite/useSelector.ts +++ b/packages/suite/src/hooks/suite/useSelector.ts @@ -1,4 +1,4 @@ -import { useSelector as useReduxSelector, shallowEqual, TypedUseSelectorHook } from 'react-redux'; +import { TypedUseSelectorHook, shallowEqual, useSelector as useReduxSelector } from 'react-redux'; import { AppState } from 'src/types/suite'; diff --git a/packages/suite/src/hooks/wallet/__fixtures__/useSendForm.ts b/packages/suite/src/hooks/wallet/__fixtures__/useSendForm.ts index c006cfadb88..e0859cddeca 100644 --- a/packages/suite/src/hooks/wallet/__fixtures__/useSendForm.ts +++ b/packages/suite/src/hooks/wallet/__fixtures__/useSendForm.ts @@ -1,10 +1,10 @@ import { combineReducers, createReducer } from '@reduxjs/toolkit'; +import { testMocks } from '@suite-common/test-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; 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'; diff --git a/packages/suite/src/hooks/wallet/__tests__/useExcludedUtxos.test.tsx b/packages/suite/src/hooks/wallet/__tests__/useExcludedUtxos.test.tsx index f8d81230ae0..225b3b5abe1 100644 --- a/packages/suite/src/hooks/wallet/__tests__/useExcludedUtxos.test.tsx +++ b/packages/suite/src/hooks/wallet/__tests__/useExcludedUtxos.test.tsx @@ -1,4 +1,4 @@ -import { useRef, useState, useEffect } from 'react'; +import { useEffect, useRef, useState } from 'react'; import { render, screen } from '@testing-library/react'; diff --git a/packages/suite/src/hooks/wallet/__tests__/useSendForm.test.tsx b/packages/suite/src/hooks/wallet/__tests__/useSendForm.test.tsx index 57072beedd0..adca846b100 100644 --- a/packages/suite/src/hooks/wallet/__tests__/useSendForm.test.tsx +++ b/packages/suite/src/hooks/wallet/__tests__/useSendForm.test.tsx @@ -1,22 +1,22 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } 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 { PROTO } from '@trezor/connect'; import { filterThunkActionTypes } from 'src/support/tests/configureStore'; import { - renderWithProviders, - waitForLoader, - findByTestId, UserAction, actionSequence, + findByTestId, + renderWithProviders, + waitForLoader, } from 'src/support/tests/hooksHelper'; -import SendIndex from 'src/views/wallet/send'; import { SendContextValues } from 'src/types/wallet/sendForm'; +import SendIndex from 'src/views/wallet/send'; import * as fixtures from '../__fixtures__/useSendForm'; import { useSendFormContext } from '../useSendForm'; diff --git a/packages/suite/src/hooks/wallet/form/useCoinjoinRegisteredUtxos.ts b/packages/suite/src/hooks/wallet/form/useCoinjoinRegisteredUtxos.ts index b2e2e550bbf..6cb827cfff6 100644 --- a/packages/suite/src/hooks/wallet/form/useCoinjoinRegisteredUtxos.ts +++ b/packages/suite/src/hooks/wallet/form/useCoinjoinRegisteredUtxos.ts @@ -1,8 +1,8 @@ import { useMemo } from 'react'; -import { AccountUtxo } from '@trezor/connect'; -import { getUtxoOutpoint } from '@suite-common/wallet-utils'; import { Account } from '@suite-common/wallet-types'; +import { getUtxoOutpoint } from '@suite-common/wallet-utils'; +import { AccountUtxo } from '@trezor/connect'; import { useSelector } from 'src/hooks/suite'; import { selectRegisteredUtxosByAccountKey } from 'src/reducers/wallet/coinjoinReducer'; diff --git a/packages/suite/src/hooks/wallet/form/useCoinjoinUnavailableUtxos.ts b/packages/suite/src/hooks/wallet/form/useCoinjoinUnavailableUtxos.ts index 2277d512d6d..2d1c7c3426f 100644 --- a/packages/suite/src/hooks/wallet/form/useCoinjoinUnavailableUtxos.ts +++ b/packages/suite/src/hooks/wallet/form/useCoinjoinUnavailableUtxos.ts @@ -1,16 +1,16 @@ 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 { getUtxoOutpoint } from '@suite-common/wallet-utils'; +import { AccountUtxo } from '@trezor/connect'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { useSelector, useTranslation } from 'src/hooks/suite'; -import { WabiSabiProtocolErrorCode } from 'src/types/wallet/coinjoin'; import { selectCoinjoinAccountByKey, selectCoinjoinClient, } from 'src/reducers/wallet/coinjoinReducer'; +import { WabiSabiProtocolErrorCode } from 'src/types/wallet/coinjoin'; interface UseCoinjoinUnavailableUtxosProps { account: Account; diff --git a/packages/suite/src/hooks/wallet/form/useCompose.ts b/packages/suite/src/hooks/wallet/form/useCompose.ts index 81aece00f18..2084d610185 100644 --- a/packages/suite/src/hooks/wallet/form/useCompose.ts +++ b/packages/suite/src/hooks/wallet/form/useCompose.ts @@ -1,23 +1,23 @@ -import { useEffect, useRef, useCallback, useState } from 'react'; +import { useCallback, useEffect, useRef, 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 { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; import { ComposeActionContext, composeSendFormTransactionFeeLevelsThunk, } from '@suite-common/wallet-core'; -import { findComposeErrors } from '@suite-common/wallet-utils'; import { FormState, - PrecomposedTransaction, - PrecomposedTransactionCardano, PrecomposedLevels, PrecomposedLevelsCardano, + PrecomposedTransaction, + PrecomposedTransactionCardano, } from '@suite-common/wallet-types'; -import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; +import { findComposeErrors } from '@suite-common/wallet-utils'; +import { FeeLevel } from '@trezor/connect'; +import { useDebounce } from '@trezor/react-utils'; import { signAndPushSendFormTransactionThunk } from 'src/actions/wallet/send/sendFormThunks'; import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/wallet/form/useExcludedUtxos.ts b/packages/suite/src/hooks/wallet/form/useExcludedUtxos.ts index 5318cf48a82..dc343512ab3 100644 --- a/packages/suite/src/hooks/wallet/form/useExcludedUtxos.ts +++ b/packages/suite/src/hooks/wallet/form/useExcludedUtxos.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react'; import { Account } from '@suite-common/wallet-types'; -import { getExcludedUtxos, GetExcludedUtxosProps } from '@suite-common/wallet-utils'; +import { GetExcludedUtxosProps, getExcludedUtxos } from '@suite-common/wallet-utils'; interface UseExcludedUtxosProps extends GetExcludedUtxosProps { account: Account; diff --git a/packages/suite/src/hooks/wallet/form/useFees.ts b/packages/suite/src/hooks/wallet/form/useFees.ts index 7d942fcb4eb..a024311fcf3 100644 --- a/packages/suite/src/hooks/wallet/form/useFees.ts +++ b/packages/suite/src/hooks/wallet/form/useFees.ts @@ -1,13 +1,13 @@ import { useEffect, useRef } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; -import { FeeLevel } from '@trezor/connect'; import { FeeInfo, FormState, PrecomposedLevels, PrecomposedLevelsCardano, } from '@suite-common/wallet-types'; +import { FeeLevel } from '@trezor/connect'; import { setLastUsedFeeLevel } from 'src/actions/settings/walletSettingsActions'; import { useDispatch } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/wallet/form/useSolanaSubscribeBlocks.ts b/packages/suite/src/hooks/wallet/form/useSolanaSubscribeBlocks.ts index 9bf5bea0597..ba667d4bef9 100644 --- a/packages/suite/src/hooks/wallet/form/useSolanaSubscribeBlocks.ts +++ b/packages/suite/src/hooks/wallet/form/useSolanaSubscribeBlocks.ts @@ -1,7 +1,7 @@ import { useEffect } from 'react'; -import TrezorConnect from '@trezor/connect'; import { Account } from '@suite-common/wallet-types'; +import TrezorConnect from '@trezor/connect'; export const useSolanaSubscribeBlocks = (account: Account) => { useEffect(() => { diff --git a/packages/suite/src/hooks/wallet/form/useStakeCompose.ts b/packages/suite/src/hooks/wallet/form/useStakeCompose.ts index 2b6469edee8..250e3d70772 100644 --- a/packages/suite/src/hooks/wallet/form/useStakeCompose.ts +++ b/packages/suite/src/hooks/wallet/form/useStakeCompose.ts @@ -1,16 +1,16 @@ -import { useEffect, useRef, useCallback, useState } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; -import { useDebounce } from '@trezor/react-utils'; -import { findComposeErrors } from '@suite-common/wallet-utils'; +import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; +import { ComposeActionContext, StakeContextValues } from '@suite-common/wallet-core'; import { - StakeFormState, - PrecomposedTransaction, PrecomposedLevels, + PrecomposedTransaction, + StakeFormState, } from '@suite-common/wallet-types'; -import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; +import { findComposeErrors } from '@suite-common/wallet-utils'; import { FeeLevel } from '@trezor/connect'; -import { ComposeActionContext, StakeContextValues } from '@suite-common/wallet-core'; +import { useDebounce } from '@trezor/react-utils'; import { composeTransaction } from 'src/actions/wallet/stakeActions'; import { useDispatch, useTranslation } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/wallet/form/useUtxoSelection.ts b/packages/suite/src/hooks/wallet/form/useUtxoSelection.ts index ddd7681dd8e..4e9bd617737 100644 --- a/packages/suite/src/hooks/wallet/form/useUtxoSelection.ts +++ b/packages/suite/src/hooks/wallet/form/useUtxoSelection.ts @@ -1,10 +1,10 @@ import { useEffect, useMemo } from 'react'; import { UseFormReturn } from 'react-hook-form'; +import { selectAccountTransactionsWithNulls } from '@suite-common/wallet-core'; import { ExcludedUtxos, FormState, UtxoSorting } from '@suite-common/wallet-types'; -import type { AccountUtxo, PROTO } from '@trezor/connect'; import { getUtxoOutpoint, isSameUtxo } from '@suite-common/wallet-utils'; -import { selectAccountTransactionsWithNulls } from '@suite-common/wallet-core'; +import type { AccountUtxo, PROTO } from '@trezor/connect'; import { useSelector } from 'src/hooks/suite'; import { sortUtxos } from 'src/utils/wallet/utxoSortingUtils'; diff --git a/packages/suite/src/hooks/wallet/sign-verify/useCopySignedMessage.ts b/packages/suite/src/hooks/wallet/sign-verify/useCopySignedMessage.ts index 64b108211cd..9f4c9d6823c 100644 --- a/packages/suite/src/hooks/wallet/sign-verify/useCopySignedMessage.ts +++ b/packages/suite/src/hooks/wallet/sign-verify/useCopySignedMessage.ts @@ -1,5 +1,5 @@ -import { copyToClipboard } from '@trezor/dom-utils'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { copyToClipboard } from '@trezor/dom-utils'; import { useDispatch } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/wallet/sign-verify/useSignAddressOptions.ts b/packages/suite/src/hooks/wallet/sign-verify/useSignAddressOptions.ts index b92587485c9..74a08c0183e 100644 --- a/packages/suite/src/hooks/wallet/sign-verify/useSignAddressOptions.ts +++ b/packages/suite/src/hooks/wallet/sign-verify/useSignAddressOptions.ts @@ -1,9 +1,9 @@ import { useMemo } from 'react'; import { useTranslation } from 'src/hooks/suite'; -import type { Account } from 'src/types/wallet'; -import type { ExtendedMessageDescriptor } from 'src/types/suite'; import type { State as RevealedAddresses } from 'src/reducers/wallet/receiveReducer'; +import type { ExtendedMessageDescriptor } from 'src/types/suite'; +import type { Account } from 'src/types/wallet'; export type AddressItem = { label: string; diff --git a/packages/suite/src/hooks/wallet/sign-verify/useSignVerifyForm.ts b/packages/suite/src/hooks/wallet/sign-verify/useSignVerifyForm.ts index 5970968139b..2b7a330661c 100644 --- a/packages/suite/src/hooks/wallet/sign-verify/useSignVerifyForm.ts +++ b/packages/suite/src/hooks/wallet/sign-verify/useSignVerifyForm.ts @@ -1,11 +1,11 @@ import { useEffect } from 'react'; -import { useForm, useController } from 'react-hook-form'; +import { useController, useForm } from 'react-hook-form'; import { yupResolver } from '@hookform/resolvers/yup'; import { yup } from '@suite-common/validators'; -import { isAddressValid } from '@suite-common/wallet-utils'; import { type NetworkSymbol } from '@suite-common/wallet-config'; +import { isAddressValid } from '@suite-common/wallet-utils'; import type { Account } from 'src/types/wallet'; diff --git a/packages/suite/src/hooks/wallet/trading/form/common/useTradingAccount.ts b/packages/suite/src/hooks/wallet/trading/form/common/useTradingAccount.ts index 35967c7ae7e..a7add8c6556 100644 --- a/packages/suite/src/hooks/wallet/trading/form/common/useTradingAccount.ts +++ b/packages/suite/src/hooks/wallet/trading/form/common/useTradingAccount.ts @@ -5,7 +5,7 @@ import { Account, SelectedAccountLoaded } from '@suite-common/wallet-types'; import { isTestnet } from '@suite-common/wallet-utils'; import { useSelector } from 'src/hooks/suite'; -import { tradingGetSortedAccounts, mapTestnetSymbol } from 'src/utils/wallet/trading/tradingUtils'; +import { mapTestnetSymbol, tradingGetSortedAccounts } from 'src/utils/wallet/trading/tradingUtils'; interface TradingUseAccountProps { tradingAccount: Account | undefined; diff --git a/packages/suite/src/hooks/wallet/trading/form/common/useTradingBuildAccountGroups.ts b/packages/suite/src/hooks/wallet/trading/form/common/useTradingBuildAccountGroups.ts index 2fd564832b4..7f0378260ab 100644 --- a/packages/suite/src/hooks/wallet/trading/form/common/useTradingBuildAccountGroups.ts +++ b/packages/suite/src/hooks/wallet/trading/form/common/useTradingBuildAccountGroups.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react'; -import { selectAccounts, selectSelectedDevice } from '@suite-common/wallet-core'; import type { TradingType } from '@suite-common/invity'; +import { selectAccounts, selectSelectedDevice } from '@suite-common/wallet-core'; import { useDefaultAccountLabel, useSelector } from 'src/hooks/suite'; import { selectAccountLabels } from 'src/reducers/suite/metadataReducer'; diff --git a/packages/suite/src/hooks/wallet/trading/form/common/useTradingCurrencySwitcher.ts b/packages/suite/src/hooks/wallet/trading/form/common/useTradingCurrencySwitcher.ts index 70467f868ef..db91dd098ef 100644 --- a/packages/suite/src/hooks/wallet/trading/form/common/useTradingCurrencySwitcher.ts +++ b/packages/suite/src/hooks/wallet/trading/form/common/useTradingCurrencySwitcher.ts @@ -16,8 +16,8 @@ import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { TradingAllFormProps, TradingSellExchangeFormProps } from 'src/types/trading/tradingForm'; import { SendContextValues } from 'src/types/wallet/sendForm'; import { - tradingGetRoundedFiatAmount, getTradingNetworkDecimals, + tradingGetRoundedFiatAmount, } from 'src/utils/wallet/trading/tradingUtils'; interface TradingUseCurrencySwitcherProps { diff --git a/packages/suite/src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected.ts b/packages/suite/src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected.ts index 3533310a9c9..335a9493f90 100644 --- a/packages/suite/src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected.ts +++ b/packages/suite/src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected.ts @@ -1,8 +1,8 @@ +import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { isTradingExchangeContext, isTradingSellContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; export const useTradingDeviceDisconnected = () => { const context = useTradingFormContext(); diff --git a/packages/suite/src/hooks/wallet/trading/form/common/useTradingExchangeQuotesFilter.ts b/packages/suite/src/hooks/wallet/trading/form/common/useTradingExchangeQuotesFilter.ts index f92918b453b..886fa93c14c 100644 --- a/packages/suite/src/hooks/wallet/trading/form/common/useTradingExchangeQuotesFilter.ts +++ b/packages/suite/src/hooks/wallet/trading/form/common/useTradingExchangeQuotesFilter.ts @@ -9,9 +9,9 @@ import { FORM_EXCHANGE_TYPE, } from 'src/constants/wallet/trading/form'; import type { - TradingExchangeFormProps, ExchangeType, RateType, + TradingExchangeFormProps, } from 'src/types/trading/tradingForm'; import { getCexQuotesByRateType } from 'src/utils/wallet/trading/exchangeUtils'; diff --git a/packages/suite/src/hooks/wallet/trading/form/common/useTradingFiatValues.tsx b/packages/suite/src/hooks/wallet/trading/form/common/useTradingFiatValues.tsx index 743b740e068..8490b181c78 100644 --- a/packages/suite/src/hooks/wallet/trading/form/common/useTradingFiatValues.tsx +++ b/packages/suite/src/hooks/wallet/trading/form/common/useTradingFiatValues.tsx @@ -2,7 +2,7 @@ import { useCallback, useEffect } from 'react'; import { FiatCurrencyCode } from 'invity-api'; -import { networks, NetworkSymbol } from '@suite-common/wallet-config'; +import { NetworkSymbol, networks } 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'; @@ -13,8 +13,8 @@ import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { TradingAccountOptionsGroupOptionProps } from 'src/types/trading/trading'; import { cryptoIdToSymbol, - mapTestnetSymbol, getTradingNetworkDecimals, + mapTestnetSymbol, } from 'src/utils/wallet/trading/tradingUtils'; interface TradingBalanceProps { diff --git a/packages/suite/src/hooks/wallet/trading/form/common/useTradingFormActions.ts b/packages/suite/src/hooks/wallet/trading/form/common/useTradingFormActions.ts index 40c7b7ab3eb..cde3272cade 100644 --- a/packages/suite/src/hooks/wallet/trading/form/common/useTradingFormActions.ts +++ b/packages/suite/src/hooks/wallet/trading/form/common/useTradingFormActions.ts @@ -36,13 +36,13 @@ import { TradingUseFormActionsProps, TradingUseFormActionsReturnProps, } from 'src/types/trading/tradingForm'; +import { tradingGetExchangeReceiveCryptoId } from 'src/utils/wallet/trading/exchangeUtils'; import { - tradingGetSortedAccounts, cryptoIdToSymbol, getAddressAndTokenFromAccountOptionsGroupProps, getTradingNetworkDecimals, + tradingGetSortedAccounts, } from 'src/utils/wallet/trading/tradingUtils'; -import { tradingGetExchangeReceiveCryptoId } from 'src/utils/wallet/trading/exchangeUtils'; /** * shareable sub-hook used in useTradingSellForm & useTradingExchangeForm diff --git a/packages/suite/src/hooks/wallet/trading/form/useTradingBuyForm.tsx b/packages/suite/src/hooks/wallet/trading/form/useTradingBuyForm.tsx index c75f5c2768b..62cba733abf 100644 --- a/packages/suite/src/hooks/wallet/trading/form/useTradingBuyForm.tsx +++ b/packages/suite/src/hooks/wallet/trading/form/useTradingBuyForm.tsx @@ -1,49 +1,49 @@ -import { useCallback, useState, useEffect, useRef } from 'react'; +import { useCallback, useEffect, useRef, useState } 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 useDebounce from 'react-use/lib/useDebounce'; +import { type TradingBuyType, invityAPI } from '@suite-common/invity'; 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 { invityAPI, type TradingBuyType } from '@suite-common/invity'; +import { formatAmount } from '@suite-common/wallet-utils'; +import { isDesktop } from '@trezor/env-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { createQuoteLink, createTxLink, getAmountLimits } from 'src/utils/wallet/trading/buyUtils'; -import { useFormDraft } from 'src/hooks/wallet/useFormDraft'; -import { UseTradingFormProps } from 'src/types/trading/trading'; -import { - addIdsToQuotes, - tradingGetSuccessQuotes, - cryptoIdToNetwork, - filterQuotesAccordingTags, - getTradingNetworkDecimals, -} from 'src/utils/wallet/trading/tradingUtils'; -import { TradingBuyFormContextProps, TradingBuyFormProps } from 'src/types/trading/tradingForm'; -import * as tradingInfoActions from 'src/actions/wallet/tradingInfoActions'; +import * as routerActions from 'src/actions/suite/routerActions'; import * as tradingCommonActions from 'src/actions/wallet/trading/tradingCommonActions'; import * as tradingBuyActions from 'src/actions/wallet/tradingBuyActions'; -import * as routerActions from 'src/actions/suite/routerActions'; -import useTradingPaymentMethod from 'src/hooks/wallet/trading/form/useTradingPaymentMethod'; -import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; -import { useTradingNavigation } from 'src/hooks/wallet/useTradingNavigation'; +import * as tradingInfoActions from 'src/actions/wallet/tradingInfoActions'; import { FORM_CRYPTO_INPUT, FORM_DEFAULT_CRYPTO_CURRENCY, FORM_FIAT_INPUT, FORM_PAYMENT_METHOD_SELECT, } from 'src/constants/wallet/trading/form'; -import { useTradingLoadData } from 'src/hooks/wallet/trading/useTradingLoadData'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { useTradingCurrencySwitcher } from 'src/hooks/wallet/trading/form/common/useTradingCurrencySwitcher'; import { useTradingModalCrypto } from 'src/hooks/wallet/trading/form/common/useTradingModalCrypto'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { useTradingPreviousRoute } from 'src/hooks/wallet/trading/form/common/useTradingPreviousRoute'; import { useTradingBuyFormDefaultValues } from 'src/hooks/wallet/trading/form/useTradingBuyFormDefaultValues'; +import useTradingPaymentMethod from 'src/hooks/wallet/trading/form/useTradingPaymentMethod'; +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { useTradingLoadData } from 'src/hooks/wallet/trading/useTradingLoadData'; +import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; +import { useFormDraft } from 'src/hooks/wallet/useFormDraft'; +import { useTradingNavigation } from 'src/hooks/wallet/useTradingNavigation'; +import { UseTradingFormProps } from 'src/types/trading/trading'; +import { TradingBuyFormContextProps, TradingBuyFormProps } from 'src/types/trading/tradingForm'; import type { AmountLimitProps } from 'src/utils/suite/validation'; -import { useTradingPreviousRoute } from 'src/hooks/wallet/trading/form/common/useTradingPreviousRoute'; +import { createQuoteLink, createTxLink, getAmountLimits } from 'src/utils/wallet/trading/buyUtils'; +import { + addIdsToQuotes, + cryptoIdToNetwork, + filterQuotesAccordingTags, + getTradingNetworkDecimals, + tradingGetSuccessQuotes, +} from 'src/utils/wallet/trading/tradingUtils'; import { useTradingInitializer } from './common/useTradingInitializer'; diff --git a/packages/suite/src/hooks/wallet/trading/form/useTradingBuyFormDefaultValues.tsx b/packages/suite/src/hooks/wallet/trading/form/useTradingBuyFormDefaultValues.tsx index 2e7464da4f7..d51acf9ece9 100644 --- a/packages/suite/src/hooks/wallet/trading/form/useTradingBuyFormDefaultValues.tsx +++ b/packages/suite/src/hooks/wallet/trading/form/useTradingBuyFormDefaultValues.tsx @@ -1,20 +1,20 @@ import { useMemo } from 'react'; -import { FiatCurrencyCode, CryptoId } from 'invity-api'; +import { CryptoId, FiatCurrencyCode } from 'invity-api'; import { networks } from '@suite-common/wallet-config'; import { BuyInfo } from 'src/actions/wallet/tradingBuyActions'; -import { Account } from 'src/types/wallet'; -import { buildFiatOption, getDefaultCountry } from 'src/utils/wallet/trading/tradingUtils'; -import { TradingBuyFormDefaultValuesProps } from 'src/types/trading/tradingForm'; -import { TradingPaymentMethodListProps } from 'src/types/trading/trading'; import { FORM_DEFAULT_FIAT_CURRENCY, FORM_DEFAULT_PAYMENT_METHOD, } from 'src/constants/wallet/trading/form'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { useSelector } from 'src/hooks/suite'; +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { TradingPaymentMethodListProps } from 'src/types/trading/trading'; +import { TradingBuyFormDefaultValuesProps } from 'src/types/trading/tradingForm'; +import { Account } from 'src/types/wallet'; +import { buildFiatOption, getDefaultCountry } from 'src/utils/wallet/trading/tradingUtils'; export const useTradingBuyFormDefaultValues = ( accountSymbol: Account['symbol'], diff --git a/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeForm.ts b/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeForm.ts index 8e796320b9f..326482882ad 100644 --- a/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeForm.ts +++ b/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeForm.ts @@ -1,4 +1,4 @@ -import { useCallback, useState, useEffect, useRef } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; import { useForm, useWatch } from 'react-hook-form'; import type { @@ -9,55 +9,55 @@ import type { } from 'invity-api'; import useDebounce from 'react-use/lib/useDebounce'; -import { amountToSmallestUnit, formatAmount, toFiatCurrency } from '@suite-common/wallet-utils'; +import { type TradingExchangeType, invityAPI } from '@suite-common/invity'; 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 { invityAPI, type TradingExchangeType } from '@suite-common/invity'; +import { Account } from '@suite-common/wallet-types'; +import { amountToSmallestUnit, formatAmount, toFiatCurrency } from '@suite-common/wallet-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; -import { useDispatch, useSelector } from 'src/hooks/suite'; +import * as tradingCommonActions from 'src/actions/wallet/trading/tradingCommonActions'; import { saveQuoteRequest, saveQuotes } from 'src/actions/wallet/tradingExchangeActions'; -import { - addIdsToQuotes, - tradingGetSuccessQuotes, - getTradingNetworkDecimals, - getUnusedAddressFromAccount, -} from 'src/utils/wallet/trading/tradingUtils'; -import { - tradingGetExchangeReceiveCryptoId, - createQuoteLink, - getAmountLimits, - getSuccessQuotesOrdered, -} from 'src/utils/wallet/trading/exchangeUtils'; +import * as tradingExchangeActions from 'src/actions/wallet/tradingExchangeActions'; +import { FORM_OUTPUT_AMOUNT, FORM_OUTPUT_FIAT } from 'src/constants/wallet/trading/form'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { useSolanaSubscribeBlocks } from 'src/hooks/wallet/form/useSolanaSubscribeBlocks'; +import { useTradingAccount } from 'src/hooks/wallet/trading/form/common/useTradingAccount'; +import { useTradingComposeTransaction } from 'src/hooks/wallet/trading/form/common/useTradingComposeTransaction'; +import { useTradingCurrencySwitcher } from 'src/hooks/wallet/trading/form/common/useTradingCurrencySwitcher'; +import { useTradingExchangeQuotesFilter } from 'src/hooks/wallet/trading/form/common/useTradingExchangeQuotesFilter'; +import { useTradingFiatValues } from 'src/hooks/wallet/trading/form/common/useTradingFiatValues'; +import { useTradingFormActions } from 'src/hooks/wallet/trading/form/common/useTradingFormActions'; +import { useTradingModalCrypto } from 'src/hooks/wallet/trading/form/common/useTradingModalCrypto'; +import { useTradingPreviousRoute } from 'src/hooks/wallet/trading/form/common/useTradingPreviousRoute'; +import { useTradingExchangeFormDefaultValues } from 'src/hooks/wallet/trading/form/useTradingExchangeFormDefaultValues'; +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { useTradingLoadData } from 'src/hooks/wallet/trading/useTradingLoadData'; +import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { useFormDraft } from 'src/hooks/wallet/useFormDraft'; import { useTradingNavigation } from 'src/hooks/wallet/useTradingNavigation'; -import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; -import { TradeExchange } from 'src/types/wallet/tradingCommonTypes'; +import { useTradingRecomposeAndSign } from 'src/hooks/wallet/useTradingRecomposeAndSign'; import { UseTradingFormProps } from 'src/types/trading/trading'; import { TradingExchangeFormContextProps, TradingExchangeFormProps, TradingExchangeStepType, } from 'src/types/trading/tradingForm'; -import { FORM_OUTPUT_AMOUNT, FORM_OUTPUT_FIAT } from 'src/constants/wallet/trading/form'; -import { useTradingExchangeFormDefaultValues } from 'src/hooks/wallet/trading/form/useTradingExchangeFormDefaultValues'; -import * as tradingExchangeActions from 'src/actions/wallet/tradingExchangeActions'; -import * as tradingCommonActions from 'src/actions/wallet/trading/tradingCommonActions'; -import { useTradingRecomposeAndSign } from 'src/hooks/wallet/useTradingRecomposeAndSign'; -import { useTradingLoadData } from 'src/hooks/wallet/trading/useTradingLoadData'; -import { useTradingComposeTransaction } from 'src/hooks/wallet/trading/form/common/useTradingComposeTransaction'; -import { useTradingFormActions } from 'src/hooks/wallet/trading/form/common/useTradingFormActions'; -import { useTradingCurrencySwitcher } from 'src/hooks/wallet/trading/form/common/useTradingCurrencySwitcher'; -import { useTradingModalCrypto } from 'src/hooks/wallet/trading/form/common/useTradingModalCrypto'; -import { useTradingAccount } from 'src/hooks/wallet/trading/form/common/useTradingAccount'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; -import { useTradingFiatValues } from 'src/hooks/wallet/trading/form/common/useTradingFiatValues'; +import { TradeExchange } from 'src/types/wallet/tradingCommonTypes'; import type { CryptoAmountLimitProps } from 'src/utils/suite/validation'; -import { useTradingExchangeQuotesFilter } from 'src/hooks/wallet/trading/form/common/useTradingExchangeQuotesFilter'; -import { useTradingPreviousRoute } from 'src/hooks/wallet/trading/form/common/useTradingPreviousRoute'; -import { useSolanaSubscribeBlocks } from 'src/hooks/wallet/form/useSolanaSubscribeBlocks'; +import { + createQuoteLink, + getAmountLimits, + getSuccessQuotesOrdered, + tradingGetExchangeReceiveCryptoId, +} from 'src/utils/wallet/trading/exchangeUtils'; +import { + addIdsToQuotes, + getTradingNetworkDecimals, + getUnusedAddressFromAccount, + tradingGetSuccessQuotes, +} from 'src/utils/wallet/trading/tradingUtils'; import { useTradingInitializer } from './common/useTradingInitializer'; diff --git a/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeFormDefaultValues.ts b/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeFormDefaultValues.ts index 606c76aa340..80f5f44c158 100644 --- a/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeFormDefaultValues.ts +++ b/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeFormDefaultValues.ts @@ -3,21 +3,6 @@ import { useMemo } from 'react'; import { DEFAULT_PAYMENT, DEFAULT_VALUES } from '@suite-common/wallet-constants'; import { FormState, Output } from '@suite-common/wallet-types'; -import { - buildFiatOption, - cryptoIdToSymbol, - getAddressAndTokenFromAccountOptionsGroupProps, -} from 'src/utils/wallet/trading/tradingUtils'; -import { Account } from 'src/types/wallet'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { useSelector } from 'src/hooks/suite'; -import { - TradingExchangeFormDefaultValuesProps, - ExchangeType, - KycFilter, - RateType, - RateTypeFilter, -} from 'src/types/trading/tradingForm'; import { EXCHANGE_COMPARATOR_KYC_FILTER, EXCHANGE_COMPARATOR_KYC_FILTER_ALL, @@ -28,9 +13,24 @@ import { FORM_RATE_FIXED, FORM_RATE_TYPE, } from 'src/constants/wallet/trading/form'; +import { useSelector } from 'src/hooks/suite'; +import { useTradingBuildAccountGroups } from 'src/hooks/wallet/trading/form/common/useTradingBuildAccountGroups'; import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { + ExchangeType, + KycFilter, + RateType, + RateTypeFilter, + TradingExchangeFormDefaultValuesProps, +} from 'src/types/trading/tradingForm'; +import { Account } from 'src/types/wallet'; import { tradingGetExchangeReceiveCryptoId } from 'src/utils/wallet/trading/exchangeUtils'; -import { useTradingBuildAccountGroups } from 'src/hooks/wallet/trading/form/common/useTradingBuildAccountGroups'; +import { + buildFiatOption, + cryptoIdToSymbol, + getAddressAndTokenFromAccountOptionsGroupProps, +} from 'src/utils/wallet/trading/tradingUtils'; export const useTradingExchangeFormDefaultValues = ( account: Account, diff --git a/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeWatchSendApproval.ts b/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeWatchSendApproval.ts index edaf9b80adf..5c28d87d897 100644 --- a/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeWatchSendApproval.ts +++ b/packages/suite/src/hooks/wallet/trading/form/useTradingExchangeWatchSendApproval.ts @@ -3,10 +3,10 @@ import { useTimeoutFn, useUnmount } from 'react-use'; import { ExchangeTrade } from 'invity-api'; -import { invityAPI, type TradingExchangeType } from '@suite-common/invity'; +import { type TradingExchangeType, invityAPI } from '@suite-common/invity'; -import { useDispatch } from 'src/hooks/suite'; import { saveSelectedQuote } from 'src/actions/wallet/tradingExchangeActions'; +import { useDispatch } from 'src/hooks/suite'; interface TradingUseExchangeWatchSendApprovalProps { selectedQuote?: ExchangeTrade; diff --git a/packages/suite/src/hooks/wallet/trading/form/useTradingSellForm.ts b/packages/suite/src/hooks/wallet/trading/form/useTradingSellForm.ts index bf09dcde579..d30281f78ed 100644 --- a/packages/suite/src/hooks/wallet/trading/form/useTradingSellForm.ts +++ b/packages/suite/src/hooks/wallet/trading/form/useTradingSellForm.ts @@ -1,29 +1,41 @@ -import { useCallback, useState, useEffect, useRef } from 'react'; +import { useCallback, useEffect, useRef, useState } 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 { type TradingSellType, invityAPI } from '@suite-common/invity'; 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 { invityAPI, type TradingSellType } from '@suite-common/invity'; +import { amountToSmallestUnit, formatAmount } from '@suite-common/wallet-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; -import { useDispatch, useSelector } from 'src/hooks/suite'; +import * as routerActions from 'src/actions/suite/routerActions'; +import * as tradingCommonActions from 'src/actions/wallet/trading/tradingCommonActions'; +import * as tradingInfoActions from 'src/actions/wallet/tradingInfoActions'; +import * as tradingSellActions from 'src/actions/wallet/tradingSellActions'; import { - addIdsToQuotes, - tradingGetSuccessQuotes, - filterQuotesAccordingTags, - getTradingNetworkDecimals, - getUnusedAddressFromAccount, -} from 'src/utils/wallet/trading/tradingUtils'; -import { createQuoteLink, getAmountLimits } from 'src/utils/wallet/trading/sellUtils'; + FORM_DEFAULT_CRYPTO_CURRENCY, + FORM_OUTPUT_AMOUNT, + FORM_OUTPUT_FIAT, + FORM_PAYMENT_METHOD_SELECT, +} from 'src/constants/wallet/trading/form'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { useSolanaSubscribeBlocks } from 'src/hooks/wallet/form/useSolanaSubscribeBlocks'; +import { useTradingAccount } from 'src/hooks/wallet/trading/form/common/useTradingAccount'; +import { useTradingComposeTransaction } from 'src/hooks/wallet/trading/form/common/useTradingComposeTransaction'; +import { useTradingCurrencySwitcher } from 'src/hooks/wallet/trading/form/common/useTradingCurrencySwitcher'; +import { useTradingFormActions } from 'src/hooks/wallet/trading/form/common/useTradingFormActions'; +import { useTradingPreviousRoute } from 'src/hooks/wallet/trading/form/common/useTradingPreviousRoute'; +import useTradingPaymentMethod from 'src/hooks/wallet/trading/form/useTradingPaymentMethod'; +import { useTradingSellFormDefaultValues } from 'src/hooks/wallet/trading/form/useTradingSellFormDefaultValues'; +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { useTradingLoadData } from 'src/hooks/wallet/trading/useTradingLoadData'; +import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { useFormDraft } from 'src/hooks/wallet/useFormDraft'; import { useTradingNavigation } from 'src/hooks/wallet/useTradingNavigation'; -import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; -import { TradeSell } from 'src/types/wallet/tradingCommonTypes'; +import { useTradingRecomposeAndSign } from 'src/hooks/wallet/useTradingRecomposeAndSign'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { TradingAccountOptionsGroupOptionProps, @@ -34,28 +46,16 @@ import { TradingSellFormProps, TradingSellStepType, } from 'src/types/trading/tradingForm'; -import { useTradingSellFormDefaultValues } from 'src/hooks/wallet/trading/form/useTradingSellFormDefaultValues'; -import useTradingPaymentMethod from 'src/hooks/wallet/trading/form/useTradingPaymentMethod'; -import { - FORM_DEFAULT_CRYPTO_CURRENCY, - FORM_OUTPUT_AMOUNT, - FORM_OUTPUT_FIAT, - FORM_PAYMENT_METHOD_SELECT, -} from 'src/constants/wallet/trading/form'; -import { useTradingRecomposeAndSign } from 'src/hooks/wallet/useTradingRecomposeAndSign'; -import * as tradingSellActions from 'src/actions/wallet/tradingSellActions'; -import * as routerActions from 'src/actions/suite/routerActions'; -import * as tradingCommonActions from 'src/actions/wallet/trading/tradingCommonActions'; -import * as tradingInfoActions from 'src/actions/wallet/tradingInfoActions'; -import { useTradingFormActions } from 'src/hooks/wallet/trading/form/common/useTradingFormActions'; -import { useTradingLoadData } from 'src/hooks/wallet/trading/useTradingLoadData'; -import { useTradingComposeTransaction } from 'src/hooks/wallet/trading/form/common/useTradingComposeTransaction'; -import { useTradingCurrencySwitcher } from 'src/hooks/wallet/trading/form/common/useTradingCurrencySwitcher'; -import { useTradingAccount } from 'src/hooks/wallet/trading/form/common/useTradingAccount'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { TradeSell } from 'src/types/wallet/tradingCommonTypes'; import type { AmountLimitProps } from 'src/utils/suite/validation'; -import { useTradingPreviousRoute } from 'src/hooks/wallet/trading/form/common/useTradingPreviousRoute'; -import { useSolanaSubscribeBlocks } from 'src/hooks/wallet/form/useSolanaSubscribeBlocks'; +import { createQuoteLink, getAmountLimits } from 'src/utils/wallet/trading/sellUtils'; +import { + addIdsToQuotes, + filterQuotesAccordingTags, + getTradingNetworkDecimals, + getUnusedAddressFromAccount, + tradingGetSuccessQuotes, +} from 'src/utils/wallet/trading/tradingUtils'; import { useTradingInitializer } from './common/useTradingInitializer'; diff --git a/packages/suite/src/hooks/wallet/trading/form/useTradingSellFormDefaultValues.ts b/packages/suite/src/hooks/wallet/trading/form/useTradingSellFormDefaultValues.ts index e13099e0515..b2d0b70f7a2 100644 --- a/packages/suite/src/hooks/wallet/trading/form/useTradingSellFormDefaultValues.ts +++ b/packages/suite/src/hooks/wallet/trading/form/useTradingSellFormDefaultValues.ts @@ -4,21 +4,21 @@ import { DEFAULT_PAYMENT, DEFAULT_VALUES } from '@suite-common/wallet-constants' import { FormState, Output } from '@suite-common/wallet-types'; import { SellInfo } from 'src/actions/wallet/tradingSellActions'; +import { + FORM_DEFAULT_FIAT_CURRENCY, + FORM_DEFAULT_PAYMENT_METHOD, +} from 'src/constants/wallet/trading/form'; +import { useSelector } from 'src/hooks/suite'; +import { useTradingBuildAccountGroups } from 'src/hooks/wallet/trading/form/common/useTradingBuildAccountGroups'; +import { TradingPaymentMethodListProps } from 'src/types/trading/trading'; +import { TradingSellFormDefaultValuesProps } from 'src/types/trading/tradingForm'; +import { Account } from 'src/types/wallet'; import { buildFiatOption, cryptoIdToSymbol, getAddressAndTokenFromAccountOptionsGroupProps, getDefaultCountry, } from 'src/utils/wallet/trading/tradingUtils'; -import { Account } from 'src/types/wallet'; -import { TradingPaymentMethodListProps } from 'src/types/trading/trading'; -import { TradingSellFormDefaultValuesProps } from 'src/types/trading/tradingForm'; -import { - FORM_DEFAULT_FIAT_CURRENCY, - FORM_DEFAULT_PAYMENT_METHOD, -} from 'src/constants/wallet/trading/form'; -import { useTradingBuildAccountGroups } from 'src/hooks/wallet/trading/form/common/useTradingBuildAccountGroups'; -import { useSelector } from 'src/hooks/suite'; export const useTradingSellFormDefaultValues = ( account: Account, diff --git a/packages/suite/src/hooks/wallet/trading/form/useTradingVerifyAccount.tsx b/packages/suite/src/hooks/wallet/trading/form/useTradingVerifyAccount.tsx index 05ec1599374..19f13e8a1a1 100644 --- a/packages/suite/src/hooks/wallet/trading/form/useTradingVerifyAccount.tsx +++ b/packages/suite/src/hooks/wallet/trading/form/useTradingVerifyAccount.tsx @@ -1,19 +1,16 @@ import { useEffect, useMemo, useState } from 'react'; import { useForm } from 'react-hook-form'; +import { TrezorDevice } from '@suite-common/suite-types'; import { selectSelectedDevice } 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 { openModal } from 'src/actions/suite/modalActions'; +import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; import { useDispatch, useSelector } from 'src/hooks/suite'; +import { useAccountAddressDictionary } from 'src/hooks/wallet/useAccounts'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; -import { openModal } from 'src/actions/suite/modalActions'; -import { - cryptoIdToSymbol, - getUnusedAddressFromAccount, - parseCryptoId, -} from 'src/utils/wallet/trading/tradingUtils'; import { TradingAccountType, TradingGetTranslationIdsProps, @@ -22,8 +19,11 @@ import { TradingVerifyFormAccountOptionProps, TradingVerifyFormProps, } from 'src/types/trading/tradingVerify'; -import { useAccountAddressDictionary } from 'src/hooks/wallet/useAccounts'; -import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; +import { + cryptoIdToSymbol, + getUnusedAddressFromAccount, + parseCryptoId, +} from 'src/utils/wallet/trading/tradingUtils'; const getSelectAccountOptions = ( suiteReceiveAccounts: Account[] | undefined, diff --git a/packages/suite/src/hooks/wallet/trading/useTradingDetail.ts b/packages/suite/src/hooks/wallet/trading/useTradingDetail.ts index 374c1ec3f5d..738be708e7a 100644 --- a/packages/suite/src/hooks/wallet/trading/useTradingDetail.ts +++ b/packages/suite/src/hooks/wallet/trading/useTradingDetail.ts @@ -3,13 +3,9 @@ import { createContext, useContext } from 'react'; import type { TradingType } from '@suite-common/invity'; import { useSelector } from 'src/hooks/suite'; -import { - TradingDetailContextValues, - TradingGetDetailDataOutputProps, - TradingUseDetailOutputProps, - TradingUseDetailProps, -} from 'src/types/trading/tradingDetail'; -import { Trade, TradeBuy } from 'src/types/wallet/tradingCommonTypes'; +import { useServerEnvironment } from 'src/hooks/wallet/trading/useServerEnviroment'; +import { useTradingLoadData } from 'src/hooks/wallet/trading/useTradingLoadData'; +import { useTradingWatchTrade } from 'src/hooks/wallet/trading/useTradingWatchTrade'; import { TradingGetDetailDataProps, TradingGetTypedInfoTradeProps, @@ -17,9 +13,13 @@ import { TradingTradeInfoMapProps, TradingTradeMapProps, } from 'src/types/trading/trading'; -import { useTradingLoadData } from 'src/hooks/wallet/trading/useTradingLoadData'; -import { useServerEnvironment } from 'src/hooks/wallet/trading/useServerEnviroment'; -import { useTradingWatchTrade } from 'src/hooks/wallet/trading/useTradingWatchTrade'; +import { + TradingDetailContextValues, + TradingGetDetailDataOutputProps, + TradingUseDetailOutputProps, + TradingUseDetailProps, +} from 'src/types/trading/tradingDetail'; +import { Trade, TradeBuy } from 'src/types/wallet/tradingCommonTypes'; const isBuyTrade = (trade: Trade): trade is TradeBuy => trade.tradeType === 'buy'; diff --git a/packages/suite/src/hooks/wallet/trading/useTradingInfo.ts b/packages/suite/src/hooks/wallet/trading/useTradingInfo.ts index af98ba9bdae..b6df2916882 100644 --- a/packages/suite/src/hooks/wallet/trading/useTradingInfo.ts +++ b/packages/suite/src/hooks/wallet/trading/useTradingInfo.ts @@ -3,10 +3,10 @@ import { useCallback } from 'react'; import { CoinInfo, CryptoId } from 'invity-api'; import { + NetworkSymbolExtended, getDisplaySymbol, getNetwork, getNetworkByTradeCryptoId, - NetworkSymbolExtended, } from '@suite-common/wallet-config'; import addressValidator from '@trezor/address-validator'; diff --git a/packages/suite/src/hooks/wallet/trading/useTradingWatchTrade.ts b/packages/suite/src/hooks/wallet/trading/useTradingWatchTrade.ts index 57eb1d7f50f..def42ed42e6 100644 --- a/packages/suite/src/hooks/wallet/trading/useTradingWatchTrade.ts +++ b/packages/suite/src/hooks/wallet/trading/useTradingWatchTrade.ts @@ -11,18 +11,18 @@ import { WatchSellTradeResponse, } from 'invity-api'; -import { invityAPI, type TradingType } from '@suite-common/invity'; +import { type TradingType, invityAPI } from '@suite-common/invity'; -import { Trade, TradeType } from 'src/types/wallet/tradingCommonTypes'; import { saveTrade as saveBuyTrade } from 'src/actions/wallet/tradingBuyActions'; import { saveTrade as saveExchangeTrade } from 'src/actions/wallet/tradingExchangeActions'; import { saveTrade as saveSellTrade } from 'src/actions/wallet/tradingSellActions'; +import { useFormDraft } from 'src/hooks/wallet/useFormDraft'; import { TradingTradeStatusType, TradingUseWatchTradeProps, TradingWatchTradeProps, } from 'src/types/trading/trading'; -import { useFormDraft } from 'src/hooks/wallet/useFormDraft'; +import { Trade, TradeType } from 'src/types/wallet/tradingCommonTypes'; export const tradeFinalStatuses: Record = { buy: ['SUCCESS', 'ERROR', 'BLOCKED'] satisfies BuyTradeFinalStatus[], diff --git a/packages/suite/src/hooks/wallet/useAccounts.ts b/packages/suite/src/hooks/wallet/useAccounts.ts index fcd8c6214d3..3986f766827 100644 --- a/packages/suite/src/hooks/wallet/useAccounts.ts +++ b/packages/suite/src/hooks/wallet/useAccounts.ts @@ -1,8 +1,8 @@ -import { useState, useEffect, useMemo } from 'react'; +import { useEffect, useMemo, useState } from 'react'; -import type { AccountAddress } from '@trezor/connect'; -import * as accountUtils from '@suite-common/wallet-utils'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import * as accountUtils from '@suite-common/wallet-utils'; +import type { AccountAddress } from '@trezor/connect'; import { useSelector } from 'src/hooks/suite'; import type { Account, Discovery } from 'src/types/wallet'; diff --git a/packages/suite/src/hooks/wallet/useBitcoinAmountUnit.ts b/packages/suite/src/hooks/wallet/useBitcoinAmountUnit.ts index 94d895b54a8..287a5d59f1d 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 { NetworkSymbol, getNetworkOptional } from '@suite-common/wallet-config'; import { selectDeviceUnavailableCapabilities } from '@suite-common/wallet-core'; -import { getNetworkOptional, NetworkSymbol } from '@suite-common/wallet-config'; +import { PROTO } from '@trezor/connect'; -import { useSelector } from 'src/hooks/suite/useSelector'; -import { useActions } from 'src/hooks/suite/useActions'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; +import { useActions } from 'src/hooks/suite/useActions'; +import { useSelector } from 'src/hooks/suite/useSelector'; export const useBitcoinAmountUnit = (symbol?: NetworkSymbol) => { const bitcoinAmountUnit = useSelector(state => state.wallet.settings.bitcoinAmountUnit); diff --git a/packages/suite/src/hooks/wallet/useCardanoStaking.ts b/packages/suite/src/hooks/wallet/useCardanoStaking.ts index 4714514bc66..4fdf7c90961 100644 --- a/packages/suite/src/hooks/wallet/useCardanoStaking.ts +++ b/packages/suite/src/hooks/wallet/useCardanoStaking.ts @@ -1,29 +1,29 @@ -import { useState, useCallback } from 'react'; +import { useCallback, useState } from 'react'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import { addFakePendingCardanoTxThunk, selectSelectedDevice } from '@suite-common/wallet-core'; +import { CardanoAction } from '@suite-common/wallet-types'; import { - isTestnet, + getAddressParameters, + getDelegationCertificates, getDerivationType, - getStakingPath, - getProtocolMagic, getNetworkId, + getNetworkName, + getProtocolMagic, + getStakePoolForDelegation, + getStakingPath, getUnusedChangeAddress, - getDelegationCertificates, getVotingCertificates, isPoolOverSaturated, - getStakePoolForDelegation, - getAddressParameters, - getNetworkName, + isTestnet, } from '@suite-common/wallet-utils'; -import { notificationsActions } from '@suite-common/toast-notifications'; import trezorConnect, { PROTO } from '@trezor/connect'; -import { addFakePendingCardanoTxThunk, selectSelectedDevice } from '@suite-common/wallet-core'; -import { CardanoAction } from '@suite-common/wallet-types'; -import { ActionAvailability, CardanoStaking } from 'src/types/wallet/cardanoStaking'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { setPendingStakeTx } from 'src/actions/wallet/cardanoStakingActions'; -import { AppState } from 'src/types/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsDeviceLocked } from 'src/reducers/suite/suiteReducer'; +import { AppState } from 'src/types/suite'; +import { ActionAvailability, CardanoStaking } from 'src/types/wallet/cardanoStaking'; const getDeviceAvailability = ( device: AppState['device']['selectedDevice'], diff --git a/packages/suite/src/hooks/wallet/useClaimEthForm.ts b/packages/suite/src/hooks/wallet/useClaimEthForm.ts index a494ab82404..f8b7e34298d 100644 --- a/packages/suite/src/hooks/wallet/useClaimEthForm.ts +++ b/packages/suite/src/hooks/wallet/useClaimEthForm.ts @@ -1,18 +1,18 @@ import { createContext, useCallback, useContext, useEffect, useMemo } from 'react'; import { useForm } from 'react-hook-form'; -import { getFeeInfo } from '@suite-common/wallet-utils'; import { PrecomposedTransactionFinal } from '@suite-common/wallet-types'; +import { getFeeInfo } from '@suite-common/wallet-utils'; +import { signTransaction } from 'src/actions/wallet/stakeActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { CRYPTO_INPUT, OUTPUT_AMOUNT, UseStakeFormsProps } from 'src/types/wallet/stakeForms'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { signTransaction } from 'src/actions/wallet/stakeActions'; +import { ClaimContextValues, ClaimFormState } from 'src/types/wallet/claimForm'; +import { CRYPTO_INPUT, OUTPUT_AMOUNT, UseStakeFormsProps } from 'src/types/wallet/stakeForms'; import { getEthNetworkAddresses, getStakeFormsDefaultValues, } from 'src/utils/suite/ethereumStaking'; -import { ClaimContextValues, ClaimFormState } from 'src/types/wallet/claimForm'; import { useFees } from './form/useFees'; import { useStakeCompose } from './form/useStakeCompose'; diff --git a/packages/suite/src/hooks/wallet/useFormDraft.ts b/packages/suite/src/hooks/wallet/useFormDraft.ts index b6f7da3f385..1f174b1bf53 100644 --- a/packages/suite/src/hooks/wallet/useFormDraft.ts +++ b/packages/suite/src/hooks/wallet/useFormDraft.ts @@ -2,8 +2,8 @@ import { FieldValues } from 'react-hook-form'; import { FormDraftKeyPrefix } from '@suite-common/wallet-types'; -import { useActions } from 'src/hooks/suite'; import * as formDraftActions from 'src/actions/wallet/formDraftActions'; +import { useActions } from 'src/hooks/suite'; export const useFormDraft = (keyPrefix: FormDraftKeyPrefix) => useActions({ diff --git a/packages/suite/src/hooks/wallet/useRbfForm.ts b/packages/suite/src/hooks/wallet/useRbfForm.ts index 003e84ebccd..d9017831810 100644 --- a/packages/suite/src/hooks/wallet/useRbfForm.ts +++ b/packages/suite/src/hooks/wallet/useRbfForm.ts @@ -1,22 +1,22 @@ -import { createContext, useContext, useState, useEffect, useMemo } from 'react'; +import { createContext, useContext, useEffect, useMemo, useState } from 'react'; import { useForm } from 'react-hook-form'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { DEFAULT_PAYMENT, DEFAULT_OPRETURN, DEFAULT_VALUES } from '@suite-common/wallet-constants'; -import { calculateChainedTransactionsFeeForRbf, getFeeInfo } from '@suite-common/wallet-utils'; +import type { NetworkType } from '@suite-common/wallet-config'; +import { DEFAULT_OPRETURN, DEFAULT_PAYMENT, DEFAULT_VALUES } from '@suite-common/wallet-constants'; import { - SelectedAccountLoaded, - RbfTransactionParams, ChainedTransactions, - FormState, FeeInfo, FormOptions, + FormState, + RbfTransactionParams, + SelectedAccountLoaded, } from '@suite-common/wallet-types'; -import type { NetworkType } from '@suite-common/wallet-config'; +import { calculateChainedTransactionsFeeForRbf, getFeeInfo } from '@suite-common/wallet-utils'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { useSelector } from 'src/hooks/suite'; -import { selectCurrentTargetAnonymity } from 'src/reducers/wallet/coinjoinReducer'; import { useCoinjoinRegisteredUtxos } from 'src/hooks/wallet/form/useCoinjoinRegisteredUtxos'; +import { selectCurrentTargetAnonymity } from 'src/reducers/wallet/coinjoinReducer'; import { useCompose } from './form/useCompose'; import { useFees } from './form/useFees'; diff --git a/packages/suite/src/hooks/wallet/useSendForm.ts b/packages/suite/src/hooks/wallet/useSendForm.ts index 6bfd9f8db6d..c8d32d7b949 100644 --- a/packages/suite/src/hooks/wallet/useSendForm.ts +++ b/packages/suite/src/hooks/wallet/useSendForm.ts @@ -1,43 +1,43 @@ -import { createContext, useContext, useCallback, useState, useEffect, useRef } from 'react'; -import { useForm, useFieldArray } from 'react-hook-form'; +import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react'; +import { useFieldArray, useForm } from 'react-hook-form'; -import { useDidUpdate } from '@trezor/react-utils'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; +import { selectCurrentFiatRates } from '@suite-common/wallet-core'; import { FormState } from '@suite-common/wallet-types'; import { - getDefaultValues, amountToSmallestUnit, formatAmount, + getDefaultValues, getFeeInfo, } 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 { useDidUpdate } from '@trezor/react-utils'; -import { useSelector, useDispatch } from 'src/hooks/suite'; +import { + getLastUsedFeeLevel, + setLastUsedFeeLevel, +} from 'src/actions/settings/walletSettingsActions'; +import { fillSendForm } from 'src/actions/suite/protocolActions'; +import { goto } from 'src/actions/suite/routerActions'; import { getSendFormDraftThunk, removeSendFormDraftThunk, saveSendFormDraftThunk, signAndPushSendFormTransactionThunk, } from 'src/actions/wallet/send/sendFormThunks'; -import { - getLastUsedFeeLevel, - setLastUsedFeeLevel, -} from 'src/actions/settings/walletSettingsActions'; -import { goto } from 'src/actions/suite/routerActions'; -import { fillSendForm } from 'src/actions/suite/protocolActions'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { AppState } from 'src/types/suite'; 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 { useExcludedUtxos } from './form/useExcludedUtxos'; import { useFees } from './form/useFees'; -import { useBitcoinAmountUnit } from './useBitcoinAmountUnit'; import { useUtxoSelection } from './form/useUtxoSelection'; -import { useExcludedUtxos } from './form/useExcludedUtxos'; +import { useBitcoinAmountUnit } from './useBitcoinAmountUnit'; import { useSendFormChangeHandlers } from './useSendFormChangeHandlers'; +import { useSendFormCompose } from './useSendFormCompose'; +import { useSendFormFields } from './useSendFormFields'; +import { useSendFormImport } from './useSendFormImport'; +import { useSendFormOutputs } from './useSendFormOutputs'; 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 e5a83f812a5..c307f71ba56 100644 --- a/packages/suite/src/hooks/wallet/useSendFormCompose.ts +++ b/packages/suite/src/hooks/wallet/useSendFormCompose.ts @@ -1,23 +1,23 @@ -import { useState, useRef, useEffect, useCallback, Dispatch, SetStateAction } from 'react'; +import { Dispatch, SetStateAction, useCallback, useEffect, useRef, useState } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; import { useDispatch } from 'react-redux'; import { isFulfilled } from '@reduxjs/toolkit'; +import { isChanged } from '@suite-common/suite-utils'; +import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; +import { composeSendFormTransactionFeeLevelsThunk } from '@suite-common/wallet-core'; import { - FormState, ExcludedUtxos, - PrecomposedTransaction, - PrecomposedTransactionCardano, + FormState, PrecomposedLevels, PrecomposedLevelsCardano, + PrecomposedTransaction, + PrecomposedTransactionCardano, } from '@suite-common/wallet-types'; -import { useDebounce } from '@trezor/react-utils'; -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 { useDebounce } from '@trezor/react-utils'; import { TranslationKey } from 'src/components/suite/Translation'; import { SendContextValues, UseSendFormState } from 'src/types/wallet/sendForm'; diff --git a/packages/suite/src/hooks/wallet/useSendFormFields.ts b/packages/suite/src/hooks/wallet/useSendFormFields.ts index 5b19dbe17bf..dc7d182177d 100644 --- a/packages/suite/src/hooks/wallet/useSendFormFields.ts +++ b/packages/suite/src/hooks/wallet/useSendFormFields.ts @@ -1,6 +1,9 @@ import { useCallback } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { selectCurrentFiatRates } from '@suite-common/wallet-core'; +import { FormOptions, FormState, Rate, TokenAddress } from '@suite-common/wallet-types'; import { amountToSmallestUnit, formatNetworkAmount, @@ -8,9 +11,6 @@ import { getFiatRateKey, toFiatCurrency, } from '@suite-common/wallet-utils'; -import { FormState, FormOptions, TokenAddress, Rate } from '@suite-common/wallet-types'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; -import { selectCurrentFiatRates } from '@suite-common/wallet-core'; import { TokenInfo } from '@trezor/blockchain-link-types'; import { SendContextValues, UseSendFormState } from 'src/types/wallet/sendForm'; diff --git a/packages/suite/src/hooks/wallet/useSendFormImport.ts b/packages/suite/src/hooks/wallet/useSendFormImport.ts index 2260c3d3687..eac7eab7166 100644 --- a/packages/suite/src/hooks/wallet/useSendFormImport.ts +++ b/packages/suite/src/hooks/wallet/useSendFormImport.ts @@ -1,7 +1,9 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; -import { DEFAULT_PAYMENT } from '@suite-common/wallet-constants'; import { FiatCurrencyCode, fiatCurrencies } from '@suite-common/suite-config'; +import { DEFAULT_PAYMENT } from '@suite-common/wallet-constants'; +import { updateFiatRatesThunk } from '@suite-common/wallet-core'; +import { FiatRates, FiatRatesResult, Output, Rate, Timestamp } from '@suite-common/wallet-types'; import { amountToSmallestUnit, formatAmount, @@ -9,12 +11,10 @@ import { getFiatRateKey, toFiatCurrency, } from '@suite-common/wallet-utils'; -import { Output, Timestamp, FiatRatesResult, Rate, FiatRates } from '@suite-common/wallet-types'; -import { updateFiatRatesThunk } from '@suite-common/wallet-core'; -import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; -import { useDispatch } from 'src/hooks/suite'; import { importSendFormRequestThunk } from 'src/actions/wallet/send/sendFormThunks'; +import { useDispatch } from 'src/hooks/suite'; +import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; 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 9225c0762de..f8a78d300ac 100644 --- a/packages/suite/src/hooks/wallet/useSendFormOutputs.ts +++ b/packages/suite/src/hooks/wallet/useSendFormOutputs.ts @@ -1,8 +1,8 @@ import { useCallback, useEffect } from 'react'; -import { useFieldArray, UseFormReturn } from 'react-hook-form'; +import { UseFormReturn, useFieldArray } from 'react-hook-form'; +import { DEFAULT_OPRETURN, DEFAULT_PAYMENT } from '@suite-common/wallet-constants'; 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'; diff --git a/packages/suite/src/hooks/wallet/useStakeEthForm.ts b/packages/suite/src/hooks/wallet/useStakeEthForm.ts index cab6526904f..dc7bc40ef52 100644 --- a/packages/suite/src/hooks/wallet/useStakeEthForm.ts +++ b/packages/suite/src/hooks/wallet/useStakeEthForm.ts @@ -4,7 +4,9 @@ import { useForm, useWatch } from 'react-hook-form'; import useDebounce from 'react-use/lib/useDebounce'; import { fromWei } from 'web3-utils'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { isChanged } from '@suite-common/suite-utils'; +import { StakeContextValues, selectFiatRatesByFiatRateKey } from '@suite-common/wallet-core'; +import { PrecomposedTransactionFinal, StakeFormState } from '@suite-common/wallet-types'; import { fromFiatCurrency, getFeeInfo, @@ -12,29 +14,27 @@ import { getStakingLimitsByNetwork, toFiatCurrency, } from '@suite-common/wallet-utils'; -import { isChanged } from '@suite-common/suite-utils'; -import { PrecomposedTransactionFinal, StakeFormState } from '@suite-common/wallet-types'; -import { StakeContextValues, selectFiatRatesByFiatRateKey } from '@suite-common/wallet-core'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; +import { signTransaction } from 'src/actions/wallet/stakeActions'; import { saveComposedTransactionInfo } from 'src/actions/wallet/trading/tradingCommonActions'; +import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { - UseStakeFormsProps, - FIAT_INPUT, CRYPTO_INPUT, + FIAT_INPUT, OUTPUT_AMOUNT, + UseStakeFormsProps, } from 'src/types/wallet/stakeForms'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { signTransaction } from 'src/actions/wallet/stakeActions'; import { getEthNetworkAddresses, getStakeFormsDefaultValues, } from 'src/utils/suite/ethereumStaking'; import type { CryptoAmountLimitProps } from 'src/utils/suite/validation'; +import { useFees } from './form/useFees'; import { useStakeCompose } from './form/useStakeCompose'; import { useFormDraft } from './useFormDraft'; -import { useFees } from './form/useFees'; export const StakeEthFormContext = createContext(null); StakeEthFormContext.displayName = 'StakeEthFormContext'; diff --git a/packages/suite/src/hooks/wallet/useTradingNavigation.ts b/packages/suite/src/hooks/wallet/useTradingNavigation.ts index 32a621d8964..c4c6196730d 100644 --- a/packages/suite/src/hooks/wallet/useTradingNavigation.ts +++ b/packages/suite/src/hooks/wallet/useTradingNavigation.ts @@ -1,8 +1,8 @@ import { useCallback } from 'react'; -import { Account } from 'src/types/wallet'; import { goto } from 'src/actions/suite/routerActions'; import { useDispatch } from 'src/hooks/suite'; +import { Account } from 'src/types/wallet'; export const useTradingNavigation = (account: Account) => { const dispatch = useDispatch(); diff --git a/packages/suite/src/hooks/wallet/useTradingRecomposeAndSign.ts b/packages/suite/src/hooks/wallet/useTradingRecomposeAndSign.ts index 534e01d97e5..316be9c49e2 100644 --- a/packages/suite/src/hooks/wallet/useTradingRecomposeAndSign.ts +++ b/packages/suite/src/hooks/wallet/useTradingRecomposeAndSign.ts @@ -1,12 +1,12 @@ 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'; -import { getFeeInfo } from '@suite-common/wallet-utils'; import { networks } from '@suite-common/wallet-config'; -import type { Account, FormOptions } from '@suite-common/wallet-types'; +import { DEFAULT_PAYMENT, DEFAULT_VALUES } from '@suite-common/wallet-constants'; import { composeSendFormTransactionFeeLevelsThunk } from '@suite-common/wallet-core'; +import { FormState } from '@suite-common/wallet-types'; +import type { Account, FormOptions } from '@suite-common/wallet-types'; +import { getFeeInfo } from '@suite-common/wallet-utils'; import { signAndPushSendFormTransactionThunk } from 'src/actions/wallet/send/sendFormThunks'; import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; diff --git a/packages/suite/src/hooks/wallet/useTradingRedirect.ts b/packages/suite/src/hooks/wallet/useTradingRedirect.ts index e74e6542125..ed3b2545051 100644 --- a/packages/suite/src/hooks/wallet/useTradingRedirect.ts +++ b/packages/suite/src/hooks/wallet/useTradingRedirect.ts @@ -7,13 +7,13 @@ import { 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 { saveComposedTransactionInfo } from 'src/actions/wallet/trading/tradingCommonActions'; import * as tradingBuyActions from 'src/actions/wallet/tradingBuyActions'; -import * as tradingSellActions from 'src/actions/wallet/tradingSellActions'; import * as tradingExchangeActions from 'src/actions/wallet/tradingExchangeActions'; -import { saveComposedTransactionInfo } from 'src/actions/wallet/trading/tradingCommonActions'; +import * as tradingSellActions from 'src/actions/wallet/tradingSellActions'; +import { useDispatch } from 'src/hooks/suite'; +import { Account } from 'src/types/wallet'; interface OfferRedirectParams { symbol: Account['symbol']; diff --git a/packages/suite/src/hooks/wallet/useUnstakeEthForm.ts b/packages/suite/src/hooks/wallet/useUnstakeEthForm.ts index d35f5430301..d37853220d9 100644 --- a/packages/suite/src/hooks/wallet/useUnstakeEthForm.ts +++ b/packages/suite/src/hooks/wallet/useUnstakeEthForm.ts @@ -3,6 +3,13 @@ import { useForm, useWatch } from 'react-hook-form'; import useDebounce from 'react-use/lib/useDebounce'; +import { isChanged } from '@suite-common/suite-utils'; +import { + UnstakeContextValues as UnstakeContextValuesBase, + UnstakeFormState, + selectFiatRatesByFiatRateKey, +} from '@suite-common/wallet-core'; +import { PrecomposedTransactionFinal } from '@suite-common/wallet-types'; import { fromFiatCurrency, getFeeInfo, @@ -10,24 +17,17 @@ import { getStakingDataForNetwork, toFiatCurrency, } from '@suite-common/wallet-utils'; -import { PrecomposedTransactionFinal } from '@suite-common/wallet-types'; -import { isChanged } from '@suite-common/suite-utils'; -import { - selectFiatRatesByFiatRateKey, - UnstakeContextValues as UnstakeContextValuesBase, - UnstakeFormState, -} from '@suite-common/wallet-core'; import { BigNumber } from '@trezor/utils'; +import { signTransaction } from 'src/actions/wallet/stakeActions'; import { useDispatch, useSelector } from 'src/hooks/suite'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { CRYPTO_INPUT, FIAT_INPUT, OUTPUT_AMOUNT, UseStakeFormsProps, } from 'src/types/wallet/stakeForms'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { signTransaction } from 'src/actions/wallet/stakeActions'; import { getEthNetworkAddresses, getStakeFormsDefaultValues, @@ -35,9 +35,9 @@ import { } from 'src/utils/suite/ethereumStaking'; import type { AmountLimitProps } from 'src/utils/suite/validation'; +import { useFees } from './form/useFees'; import { useStakeCompose } from './form/useStakeCompose'; import { useFormDraft } from './useFormDraft'; -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 2176d66ce38..858728672d2 100644 --- a/packages/suite/src/middlewares/backup/backupMiddleware.ts +++ b/packages/suite/src/middlewares/backup/backupMiddleware.ts @@ -1,8 +1,8 @@ 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'; +import { SUITE } from 'src/actions/suite/constants'; +import { Action, AppState, Dispatch } from 'src/types/suite'; const backup = (api: MiddlewareAPI) => diff --git a/packages/suite/src/middlewares/onboarding/__tests__/onboardingMiddleware.test.ts b/packages/suite/src/middlewares/onboarding/__tests__/onboardingMiddleware.test.ts index 1fcb39809e8..bd388540f7c 100644 --- a/packages/suite/src/middlewares/onboarding/__tests__/onboardingMiddleware.test.ts +++ b/packages/suite/src/middlewares/onboarding/__tests__/onboardingMiddleware.test.ts @@ -1,10 +1,10 @@ -import { configureStore } from 'src/support/tests/configureStore'; import { SUITE } from 'src/actions/suite/constants'; +import onboardingMiddlewares from 'src/middlewares/onboarding'; +import onboardingReducer from 'src/reducers/onboarding/index'; +import modalReducer from 'src/reducers/suite/modalReducer'; import routerReducer from 'src/reducers/suite/routerReducer'; import suiteReducer from 'src/reducers/suite/suiteReducer'; -import modalReducer from 'src/reducers/suite/modalReducer'; -import onboardingReducer from 'src/reducers/onboarding/index'; -import onboardingMiddlewares from 'src/middlewares/onboarding'; +import { configureStore } from 'src/support/tests/configureStore'; const middlewares = [...onboardingMiddlewares]; diff --git a/packages/suite/src/middlewares/onboarding/onboardingMiddleware.ts b/packages/suite/src/middlewares/onboarding/onboardingMiddleware.ts index 4497283d4bf..e44bffa6239 100644 --- a/packages/suite/src/middlewares/onboarding/onboardingMiddleware.ts +++ b/packages/suite/src/middlewares/onboarding/onboardingMiddleware.ts @@ -1,8 +1,8 @@ import { MiddlewareAPI } from 'redux'; -import { SUITE } from 'src/actions/suite/constants'; import * as onboardingActions from 'src/actions/onboarding/onboardingActions'; -import { AppState, Action, Dispatch } from 'src/types/suite'; +import { SUITE } from 'src/actions/suite/constants'; +import { Action, AppState, Dispatch } from 'src/types/suite'; const onboardingMiddleware = (api: MiddlewareAPI) => diff --git a/packages/suite/src/middlewares/recovery/recoveryMiddleware.ts b/packages/suite/src/middlewares/recovery/recoveryMiddleware.ts index 841bee40327..9b393c22501 100644 --- a/packages/suite/src/middlewares/recovery/recoveryMiddleware.ts +++ b/packages/suite/src/middlewares/recovery/recoveryMiddleware.ts @@ -1,12 +1,12 @@ import { MiddlewareAPI } from 'redux'; -import { UI } from '@trezor/connect'; import { deviceActions } from '@suite-common/wallet-core'; +import { UI } from '@trezor/connect'; -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 * as recoveryActions from 'src/actions/recovery/recoveryActions'; +import { SUITE } from 'src/actions/suite/constants'; +import { Action, AppState, Dispatch } from 'src/types/suite'; import { isRecoveryInProgress } from '../../utils/device/isRecoveryInProgress'; diff --git a/packages/suite/src/middlewares/suite/__tests__/buttonRequestMiddleware.test.ts b/packages/suite/src/middlewares/suite/__tests__/buttonRequestMiddleware.test.ts index 4b138b177ca..d4d88213034 100644 --- a/packages/suite/src/middlewares/suite/__tests__/buttonRequestMiddleware.test.ts +++ b/packages/suite/src/middlewares/suite/__tests__/buttonRequestMiddleware.test.ts @@ -1,15 +1,15 @@ -import { deviceActions } from '@suite-common/wallet-core'; import { connectInitThunk } from '@suite-common/connect-init'; -import { UI_EVENT, UI } from '@trezor/connect'; import { testMocks } from '@suite-common/test-utils'; +import { deviceActions } from '@suite-common/wallet-core'; +import { UI, UI_EVENT } from '@trezor/connect'; -import { configureStore } from 'src/support/tests/configureStore'; +import * as deviceSettingsActions from 'src/actions/settings/deviceSettingsActions'; import { SUITE } from 'src/actions/suite/constants'; +import buttonRequestMiddleware from 'src/middlewares/suite/buttonRequestMiddleware'; +import suiteMiddleware from 'src/middlewares/suite/suiteMiddleware'; import routerReducer from 'src/reducers/suite/routerReducer'; import suiteReducer from 'src/reducers/suite/suiteReducer'; -import * as deviceSettingsActions from 'src/actions/settings/deviceSettingsActions'; -import suiteMiddleware from 'src/middlewares/suite/suiteMiddleware'; -import buttonRequestMiddleware from 'src/middlewares/suite/buttonRequestMiddleware'; +import { configureStore } from 'src/support/tests/configureStore'; import { Action } from 'src/types/suite'; const { getSuiteDevice } = testMocks; diff --git a/packages/suite/src/middlewares/suite/__tests__/messageSystemMiddleware.test.ts b/packages/suite/src/middlewares/suite/__tests__/messageSystemMiddleware.test.ts index 7952dce7454..259e8d11c31 100644 --- a/packages/suite/src/middlewares/suite/__tests__/messageSystemMiddleware.test.ts +++ b/packages/suite/src/middlewares/suite/__tests__/messageSystemMiddleware.test.ts @@ -1,14 +1,14 @@ -import { combineReducers, Reducer } from '@reduxjs/toolkit'; +import { Reducer, combineReducers } from '@reduxjs/toolkit'; -import { configureMockStore } from '@suite-common/test-utils'; -import { prepareMessageSystemReducer, messageSystemActions } from '@suite-common/message-system'; +import { messageSystemActions, prepareMessageSystemReducer } from '@suite-common/message-system'; import * as messageSystemUtils from '@suite-common/message-system/src/messageSystemUtils'; +import { configureMockStore } from '@suite-common/test-utils'; import { prepareDeviceReducer } from '@suite-common/wallet-core'; +import { AppState } from 'src/reducers/store'; import suiteReducer from 'src/reducers/suite/suiteReducer'; -import { extraDependencies } from 'src/support/extraDependencies'; import WalletReducers from 'src/reducers/wallet'; -import { AppState } from 'src/reducers/store'; +import { extraDependencies } from 'src/support/extraDependencies'; import messageSystemMiddleware from '../messageSystemMiddleware'; diff --git a/packages/suite/src/middlewares/suite/__tests__/protocolMiddleware.test.ts b/packages/suite/src/middlewares/suite/__tests__/protocolMiddleware.test.ts index 281f464d6d1..1e97bc2f621 100644 --- a/packages/suite/src/middlewares/suite/__tests__/protocolMiddleware.test.ts +++ b/packages/suite/src/middlewares/suite/__tests__/protocolMiddleware.test.ts @@ -4,9 +4,9 @@ import { 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 { configureStore } from 'src/support/tests/configureStore'; import protocolMiddleware from '../protocolMiddleware'; diff --git a/packages/suite/src/middlewares/suite/__tests__/redirectMiddleware.test.ts b/packages/suite/src/middlewares/suite/__tests__/redirectMiddleware.test.ts index ccee94254e3..cb01070d687 100644 --- a/packages/suite/src/middlewares/suite/__tests__/redirectMiddleware.test.ts +++ b/packages/suite/src/middlewares/suite/__tests__/redirectMiddleware.test.ts @@ -1,18 +1,18 @@ import { Middleware } from 'redux'; +import { testMocks } from '@suite-common/test-utils'; import { deviceActions, prepareDeviceReducer } from '@suite-common/wallet-core'; import { DEVICE } from '@trezor/connect'; -import { testMocks } from '@suite-common/test-utils'; -import { configureStore } from 'src/support/tests/configureStore'; import * as routerActions from 'src/actions/suite/routerActions'; +import redirectMiddleware from 'src/middlewares/suite/redirectMiddleware'; +import suiteMiddleware from 'src/middlewares/suite/suiteMiddleware'; +import modalReducer from 'src/reducers/suite/modalReducer'; import routerReducer from 'src/reducers/suite/routerReducer'; import suiteReducer from 'src/reducers/suite/suiteReducer'; -import modalReducer from 'src/reducers/suite/modalReducer'; -import suiteMiddleware from 'src/middlewares/suite/suiteMiddleware'; -import redirectMiddleware from 'src/middlewares/suite/redirectMiddleware'; -import { Action } from 'src/types/suite'; import { extraDependencies } from 'src/support/extraDependencies'; +import { configureStore } from 'src/support/tests/configureStore'; +import { Action } from 'src/types/suite'; const { getSuiteDevice, getConnectDevice } = testMocks; diff --git a/packages/suite/src/middlewares/suite/__tests__/suiteMiddleware.test.ts b/packages/suite/src/middlewares/suite/__tests__/suiteMiddleware.test.ts index e2a6e879e75..b1d9703f36a 100644 --- a/packages/suite/src/middlewares/suite/__tests__/suiteMiddleware.test.ts +++ b/packages/suite/src/middlewares/suite/__tests__/suiteMiddleware.test.ts @@ -1,15 +1,15 @@ import { analyticsActions, prepareAnalyticsReducer } from '@suite-common/analytics'; import { prepareDeviceReducer } from '@suite-common/wallet-core'; -import { configureStore } from 'src/support/tests/configureStore'; import { ROUTER } from 'src/actions/suite/constants'; +import { appChanged } from 'src/actions/suite/suiteActions'; +import suiteMiddleware from 'src/middlewares/suite/suiteMiddleware'; +import modalReducer from 'src/reducers/suite/modalReducer'; import routerReducer from 'src/reducers/suite/routerReducer'; import suiteReducer from 'src/reducers/suite/suiteReducer'; -import modalReducer from 'src/reducers/suite/modalReducer'; -import suiteMiddleware from 'src/middlewares/suite/suiteMiddleware'; -import type { Action } from 'src/types/suite'; import { extraDependencies } from 'src/support/extraDependencies'; -import { appChanged } from 'src/actions/suite/suiteActions'; +import { configureStore } from 'src/support/tests/configureStore'; +import type { Action } from 'src/types/suite'; type SuiteState = ReturnType; type RouterState = ReturnType; diff --git a/packages/suite/src/middlewares/suite/analyticsMiddleware.ts b/packages/suite/src/middlewares/suite/analyticsMiddleware.ts index c2296c3741c..7348ca42791 100644 --- a/packages/suite/src/middlewares/suite/analyticsMiddleware.ts +++ b/packages/suite/src/middlewares/suite/analyticsMiddleware.ts @@ -1,23 +1,22 @@ -import { MiddlewareAPI } from 'redux'; import { isAnyOf } from '@reduxjs/toolkit'; +import { MiddlewareAPI } from 'redux'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { + INVALID_HASH_ERROR, + firmwareActions, + firmwareUpdate, + handleFwHashError, +} from '@suite-common/firmware'; import { getPhysicalDeviceCount } from '@suite-common/suite-utils'; import { + authorizeDeviceThunk, + deviceActions, discoveryActions, selectDevices, selectDevicesCount, - authorizeDeviceThunk, - deviceActions, } from '@suite-common/wallet-core'; -import { - firmwareActions, - handleFwHashError, - INVALID_HASH_ERROR, - firmwareUpdate, -} from '@suite-common/firmware'; -import { analytics, EventType } from '@trezor/suite-analytics'; -import { TRANSPORT, DEVICE } from '@trezor/connect'; +import { Account } from '@suite-common/wallet-types'; +import { DEVICE, TRANSPORT } from '@trezor/connect'; import { getBootloaderHash, getBootloaderVersion, @@ -26,21 +25,22 @@ import { hasBitcoinOnlyFirmware, isDeviceInBootloaderMode, } from '@trezor/device-utils'; -import { Account } from '@suite-common/wallet-types'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { SUITE, ROUTER } from 'src/actions/suite/constants'; +import { ROUTER, SUITE } from 'src/actions/suite/constants'; +import { updateLastAnonymityReportTimestamp } from 'src/actions/wallet/coinjoinAccountActions'; import { COINJOIN } from 'src/actions/wallet/constants'; +import { + selectAnonymityGainToReportByAccountKey, + selectCoinjoinAccountByKey, +} from 'src/reducers/wallet/coinjoinReducer'; +import type { Action, AppState, Dispatch } from 'src/types/suite'; import { getSuiteReadyPayload, redactRouterUrl, redactTransactionIdFromAnchor, } from 'src/utils/suite/analytics'; -import type { AppState, Action, Dispatch } from 'src/types/suite'; -import { - selectAnonymityGainToReportByAccountKey, - selectCoinjoinAccountByKey, -} from 'src/reducers/wallet/coinjoinReducer'; -import { updateLastAnonymityReportTimestamp } from 'src/actions/wallet/coinjoinAccountActions'; /* 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 a4b54a32911..377de766816 100644 --- a/packages/suite/src/middlewares/suite/buttonRequestMiddleware.ts +++ b/packages/suite/src/middlewares/suite/buttonRequestMiddleware.ts @@ -1,12 +1,12 @@ import { MiddlewareAPI } from 'redux'; -import { selectSelectedDevice, deviceActions } from '@suite-common/wallet-core'; -import TrezorConnect, { UI } from '@trezor/connect'; import { checkDeviceAuthenticityThunk } from '@suite-common/device-authenticity'; +import { deviceActions, selectSelectedDevice } from '@suite-common/wallet-core'; +import TrezorConnect, { UI } from '@trezor/connect'; -import { SUITE } from 'src/actions/suite/constants'; -import { AppState, Action, Dispatch } from 'src/types/suite'; import { ONBOARDING } from 'src/actions/onboarding/constants'; +import { SUITE } from 'src/actions/suite/constants'; +import { Action, AppState, Dispatch } from 'src/types/suite'; const buttonRequest = (api: MiddlewareAPI) => diff --git a/packages/suite/src/middlewares/suite/eventsMiddleware.ts b/packages/suite/src/middlewares/suite/eventsMiddleware.ts index 41cc44ad852..2a9cd5f73df 100644 --- a/packages/suite/src/middlewares/suite/eventsMiddleware.ts +++ b/packages/suite/src/middlewares/suite/eventsMiddleware.ts @@ -1,22 +1,22 @@ import { MiddlewareAPI } from 'redux'; -import { - selectDevices, - selectSelectedDevice, - accountsActions, - deviceActions, - authorizeDeviceThunk, -} from '@suite-common/wallet-core'; import * as deviceUtils from '@suite-common/suite-utils'; -import { DEVICE } from '@trezor/connect'; import { AUTH_DEVICE, notificationsActions, removeAccountEventsThunk, } from '@suite-common/toast-notifications'; +import { + accountsActions, + authorizeDeviceThunk, + deviceActions, + selectDevices, + selectSelectedDevice, +} from '@suite-common/wallet-core'; +import { DEVICE } from '@trezor/connect'; import { SUITE } from 'src/actions/suite/constants'; -import { AppState, Action, Dispatch } from 'src/types/suite'; +import { Action, AppState, Dispatch } from 'src/types/suite'; /* * Middleware for event notifications. diff --git a/packages/suite/src/middlewares/suite/logsMiddleware.ts b/packages/suite/src/middlewares/suite/logsMiddleware.ts index 80db722cae4..ae477aeb226 100644 --- a/packages/suite/src/middlewares/suite/logsMiddleware.ts +++ b/packages/suite/src/middlewares/suite/logsMiddleware.ts @@ -1,12 +1,13 @@ import { MiddlewareAPI } from 'redux'; -import { authorizeDeviceThunk, deviceActions, discoveryActions } from '@suite-common/wallet-core'; +import { analyticsActions } from '@suite-common/analytics'; import { addLog } from '@suite-common/logger'; -import { TRANSPORT, DEVICE } from '@trezor/connect'; +import { authorizeDeviceThunk, deviceActions, discoveryActions } from '@suite-common/wallet-core'; +import { DEVICE, TRANSPORT } from '@trezor/connect'; import { redactUserPathFromString } from '@trezor/utils'; -import { analyticsActions } from '@suite-common/analytics'; -import { AppState, Action, Dispatch } from 'src/types/suite'; +import { WALLET_SETTINGS } from 'src/actions/settings/constants'; +import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; import { DESKTOP_UPDATE, METADATA, @@ -15,8 +16,7 @@ import { ROUTER, SUITE, } from 'src/actions/suite/constants'; -import { WALLET_SETTINGS } from 'src/actions/settings/constants'; -import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; +import { Action, AppState, Dispatch } from 'src/types/suite'; import { redactTransactionIdFromAnchor } from 'src/utils/suite/analytics'; const log = diff --git a/packages/suite/src/middlewares/suite/messageSystemMiddleware.ts b/packages/suite/src/middlewares/suite/messageSystemMiddleware.ts index 0814967c184..829e7d53f7d 100644 --- a/packages/suite/src/middlewares/suite/messageSystemMiddleware.ts +++ b/packages/suite/src/middlewares/suite/messageSystemMiddleware.ts @@ -1,19 +1,19 @@ import { MiddlewareAPI } from 'redux'; -import { deviceActions, selectSelectedDevice } from '@suite-common/wallet-core'; -import { TRANSPORT, DEVICE } from '@trezor/connect'; import { - messageSystemActions, categorizeMessages, - getValidMessages, getValidExperimentIds, + getValidMessages, + messageSystemActions, } from '@suite-common/message-system'; +import { deviceActions, selectSelectedDevice } from '@suite-common/wallet-core'; +import { DEVICE, TRANSPORT } from '@trezor/connect'; -import { SUITE } from 'src/actions/suite/constants'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; -import { getIsTorEnabled } from 'src/utils/suite/tor'; -import type { AppState, Action, Dispatch } from 'src/types/suite'; +import { SUITE } from 'src/actions/suite/constants'; import { selectActiveTransports } from 'src/reducers/suite/suiteReducer'; +import type { Action, AppState, Dispatch } from 'src/types/suite'; +import { getIsTorEnabled } from 'src/utils/suite/tor'; // actions which can affect message system messages const actions = [ diff --git a/packages/suite/src/middlewares/suite/metadataMiddleware.ts b/packages/suite/src/middlewares/suite/metadataMiddleware.ts index 87e76735340..02c6f09b3c1 100644 --- a/packages/suite/src/middlewares/suite/metadataMiddleware.ts +++ b/packages/suite/src/middlewares/suite/metadataMiddleware.ts @@ -2,9 +2,9 @@ import { MiddlewareAPI } from 'redux'; import { accountsActions, deviceActions } from '@suite-common/wallet-core'; -import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; -import { AppState, Action, Dispatch } from 'src/types/suite'; import { METADATA_LABELING, ROUTER } from 'src/actions/suite/constants'; +import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; +import { Action, AppState, Dispatch } from 'src/types/suite'; const metadata = (api: MiddlewareAPI) => diff --git a/packages/suite/src/middlewares/suite/protocolMiddleware.ts b/packages/suite/src/middlewares/suite/protocolMiddleware.ts index e9818ca2c6c..588eaf3d6d0 100644 --- a/packages/suite/src/middlewares/suite/protocolMiddleware.ts +++ b/packages/suite/src/middlewares/suite/protocolMiddleware.ts @@ -1,9 +1,9 @@ import { MiddlewareAPI } from 'redux'; -import { notificationsActions, ToastPayload } from '@suite-common/toast-notifications'; +import { ToastPayload, notificationsActions } from '@suite-common/toast-notifications'; import { PROTOCOL } from 'src/actions/suite/constants'; -import type { AppState, Action, Dispatch } from 'src/types/suite'; +import type { Action, AppState, Dispatch } from 'src/types/suite'; // close custom protocol notification of given type const closeNotifications = (api: MiddlewareAPI, type: ToastPayload['type']) => { diff --git a/packages/suite/src/middlewares/suite/redirectMiddleware.ts b/packages/suite/src/middlewares/suite/redirectMiddleware.ts index d679cdbadb6..bd01f15c298 100644 --- a/packages/suite/src/middlewares/suite/redirectMiddleware.ts +++ b/packages/suite/src/middlewares/suite/redirectMiddleware.ts @@ -1,10 +1,10 @@ import { MiddlewareAPI } from 'redux'; -import { selectSelectedDevice, selectDevices, deviceActions } from '@suite-common/wallet-core'; +import { deviceActions, selectDevices, selectSelectedDevice } from '@suite-common/wallet-core'; import * as routerActions from 'src/actions/suite/routerActions'; -import { AppState, Action, Dispatch, TrezorDevice } from 'src/types/suite'; import { selectIsRouterLocked } from 'src/reducers/suite/suiteReducer'; +import { Action, AppState, Dispatch, TrezorDevice } from 'src/types/suite'; const handleDeviceRedirect = (dispatch: Dispatch, state: AppState, device?: TrezorDevice) => { // no device, no redirect diff --git a/packages/suite/src/middlewares/suite/routerMiddleware.ts b/packages/suite/src/middlewares/suite/routerMiddleware.ts index 6e25c1d2bb0..2a6a808ca89 100644 --- a/packages/suite/src/middlewares/suite/routerMiddleware.ts +++ b/packages/suite/src/middlewares/suite/routerMiddleware.ts @@ -1,7 +1,7 @@ import { MiddlewareAPI } from 'redux'; import { ROUTER } from 'src/actions/suite/constants'; -import { AppState, Action, Dispatch } from 'src/types/suite'; +import { Action, AppState, Dispatch } from 'src/types/suite'; const router = (api: MiddlewareAPI) => (next: Dispatch) => (action: Action) => { const { router } = api.getState(); diff --git a/packages/suite/src/middlewares/suite/sentryMiddleware.ts b/packages/suite/src/middlewares/suite/sentryMiddleware.ts index a710dedf3f0..f3743dac582 100644 --- a/packages/suite/src/middlewares/suite/sentryMiddleware.ts +++ b/packages/suite/src/middlewares/suite/sentryMiddleware.ts @@ -1,41 +1,41 @@ import { MiddlewareAPI } from 'redux'; +import { analyticsActions } from '@suite-common/analytics'; +import { deviceAuthenticityActions } from '@suite-common/device-authenticity'; import { - discoveryActions, accountsActions, + authorizeDeviceThunk, blockchainActions, - selectSelectedDevice, deviceActions, - authorizeDeviceThunk, + discoveryActions, + selectSelectedDevice, } from '@suite-common/wallet-core'; +import { DEVICE, TRANSPORT } from '@trezor/connect'; import { getBootloaderVersion, getFirmwareVersion, hasBitcoinOnlyFirmware, } from '@trezor/device-utils'; -import { DEVICE, TRANSPORT } from '@trezor/connect'; -import { analyticsActions } from '@suite-common/analytics'; -import { deviceAuthenticityActions } from '@suite-common/device-authenticity'; import { WALLET_SETTINGS } from 'src/actions/settings/constants'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; import { - SUITE, - ROUTER, DESKTOP_UPDATE, METADATA, MODAL, PROTOCOL, + ROUTER, + SUITE, } from 'src/actions/suite/constants'; +import { Action, AppState, Dispatch } from 'src/types/suite'; import { getSuiteReadyPayload } from 'src/utils/suite/analytics'; import { addSentryBreadcrumb, + captureSentryMessage, setSentryContext, setSentryTag, withSentryScope, - captureSentryMessage, } from 'src/utils/suite/sentry'; -import { AppState, Action, Dispatch } from 'src/types/suite'; const deviceContextName = 'trezor-device'; diff --git a/packages/suite/src/middlewares/suite/suiteMiddleware.ts b/packages/suite/src/middlewares/suite/suiteMiddleware.ts index f3b0f34d7c7..403801c0876 100644 --- a/packages/suite/src/middlewares/suite/suiteMiddleware.ts +++ b/packages/suite/src/middlewares/suite/suiteMiddleware.ts @@ -1,6 +1,7 @@ -import { MiddlewareAPI } from 'redux'; import { AnyAction, isAnyOf } from '@reduxjs/toolkit'; +import { MiddlewareAPI } from 'redux'; +import { notificationsActions } from '@suite-common/toast-notifications'; import { authConfirm, authorizeDeviceThunk, @@ -13,13 +14,12 @@ import { restartDiscoveryThunk, selectDeviceThunk, } from '@suite-common/wallet-core'; -import { notificationsActions } from '@suite-common/toast-notifications'; import { DEVICE, DeviceModelInternal } from '@trezor/connect'; -import { SUITE, ROUTER, METADATA } from 'src/actions/suite/constants'; -import { AppState, Action, Dispatch } from 'src/types/suite'; +import { METADATA, ROUTER, SUITE } from 'src/actions/suite/constants'; import { handleProtocolRequest } from 'src/actions/suite/protocolActions'; import { appChanged, setFlag } from 'src/actions/suite/suiteActions'; +import { Action, AppState, Dispatch } from 'src/types/suite'; const isActionDeviceRelated = (action: AnyAction): boolean => { if ( diff --git a/packages/suite/src/middlewares/wallet/__fixtures__/coinjoinMiddleware.ts b/packages/suite/src/middlewares/wallet/__fixtures__/coinjoinMiddleware.ts index ef080726421..f27f0a8b184 100644 --- a/packages/suite/src/middlewares/wallet/__fixtures__/coinjoinMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/__fixtures__/coinjoinMiddleware.ts @@ -3,13 +3,13 @@ import { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { AnonymitySet } from '@trezor/blockchain-link'; import { DEVICE, StaticSessionId } from '@trezor/connect'; -import { SuiteState } from 'src/reducers/suite/suiteReducer'; import { ROUTER, SUITE } from 'src/actions/suite/constants'; import { COINJOIN } from 'src/actions/wallet/constants'; +import { RouterState } from 'src/reducers/suite/routerReducer'; +import { SuiteState } from 'src/reducers/suite/suiteReducer'; import { CoinjoinState } from 'src/reducers/wallet/coinjoinReducer'; -import { CoinjoinAccount, CoinjoinSession } from 'src/types/wallet/coinjoin'; import { Account } from 'src/types/wallet'; -import { RouterState } from 'src/reducers/suite/routerReducer'; +import { CoinjoinAccount, CoinjoinSession } from 'src/types/wallet/coinjoin'; const DEVICE_A = { available: true, diff --git a/packages/suite/src/middlewares/wallet/__fixtures__/walletMiddleware.ts b/packages/suite/src/middlewares/wallet/__fixtures__/walletMiddleware.ts index 34943b6bfe3..8a8a9af1766 100644 --- a/packages/suite/src/middlewares/wallet/__fixtures__/walletMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/__fixtures__/walletMiddleware.ts @@ -1,10 +1,10 @@ -import { PROTO } from '@trezor/connect'; -import { Account, FormState as SendFormState, Output } from '@suite-common/wallet-types'; import { accountsActions, - sendFormActions, convertSendFormDraftsBtcAmountUnitsThunk, + sendFormActions, } from '@suite-common/wallet-core'; +import { Account, Output, FormState as SendFormState } from '@suite-common/wallet-types'; +import { PROTO } from '@trezor/connect'; import { WALLET_SETTINGS } from 'src/actions/settings/constants'; import { RouterState } from 'src/reducers/suite/routerReducer'; diff --git a/packages/suite/src/middlewares/wallet/__tests__/coinjoinMiddleware.test.ts b/packages/suite/src/middlewares/wallet/__tests__/coinjoinMiddleware.test.ts index 6139dacb1d5..40f6d899b9f 100644 --- a/packages/suite/src/middlewares/wallet/__tests__/coinjoinMiddleware.test.ts +++ b/packages/suite/src/middlewares/wallet/__tests__/coinjoinMiddleware.test.ts @@ -1,17 +1,17 @@ import { combineReducers, createReducer } from '@reduxjs/toolkit'; -import { configureMockStore, testMocks } from '@suite-common/test-utils'; import { prepareMessageSystemReducer } from '@suite-common/message-system'; +import { configureMockStore, testMocks } from '@suite-common/test-utils'; -import { extraDependencies } from 'src/support/extraDependencies'; +import { fixtures } from 'src/middlewares/wallet/__fixtures__/coinjoinMiddleware'; +import { coinjoinMiddleware } from 'src/middlewares/wallet/coinjoinMiddleware'; import routerReducer from 'src/reducers/suite/routerReducer'; import suiteReducer from 'src/reducers/suite/suiteReducer'; -import { CoinjoinService } from 'src/services/coinjoin/coinjoinService'; -import { coinjoinMiddleware } from 'src/middlewares/wallet/coinjoinMiddleware'; -import { fixtures } from 'src/middlewares/wallet/__fixtures__/coinjoinMiddleware'; import { accountsReducer } from 'src/reducers/wallet'; import { coinjoinReducer } from 'src/reducers/wallet/coinjoinReducer'; import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; +import { CoinjoinService } from 'src/services/coinjoin/coinjoinService'; +import { extraDependencies } from 'src/support/extraDependencies'; jest.mock('src/services/coinjoin/coinjoinService', () => { const mock = jest.requireActual('../../../actions/wallet/__fixtures__/mockCoinjoinService'); diff --git a/packages/suite/src/middlewares/wallet/__tests__/tradingMiddleware.test.ts b/packages/suite/src/middlewares/wallet/__tests__/tradingMiddleware.test.ts index c38670d97e3..e839ba76ddc 100644 --- a/packages/suite/src/middlewares/wallet/__tests__/tradingMiddleware.test.ts +++ b/packages/suite/src/middlewares/wallet/__tests__/tradingMiddleware.test.ts @@ -1,17 +1,17 @@ -import { UI } from '@trezor/connect'; import { invityAPI } from '@suite-common/invity'; +import { UI } from '@trezor/connect'; -import { configureStore } from 'src/support/tests/configureStore'; -import { tradingReducer, initialState } from 'src/reducers/wallet/tradingReducer'; -import selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; -import { tradingMiddleware } from 'src/middlewares/wallet/tradingMiddleware'; -import { Action } from 'src/types/suite'; +import { MODAL, ROUTER } from 'src/actions/suite/constants'; import { TRADING_COMMON } from 'src/actions/wallet/constants'; +import { tradingMiddleware } from 'src/middlewares/wallet/tradingMiddleware'; +import modalReducer, { State as ModalState } from 'src/reducers/suite/modalReducer'; +import routerReducer, { RouterState } from 'src/reducers/suite/routerReducer'; import suiteReducer from 'src/reducers/suite/suiteReducer'; 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 selectedAccountReducer from 'src/reducers/wallet/selectedAccountReducer'; +import { initialState, tradingReducer } from 'src/reducers/wallet/tradingReducer'; +import { configureStore } from 'src/support/tests/configureStore'; +import { Action } from 'src/types/suite'; jest.mock('@suite-common/invity'); invityAPI.setInvityServersEnvironment = () => {}; diff --git a/packages/suite/src/middlewares/wallet/__tests__/walletMiddleware.test.ts b/packages/suite/src/middlewares/wallet/__tests__/walletMiddleware.test.ts index e95e72312d6..35456433d18 100644 --- a/packages/suite/src/middlewares/wallet/__tests__/walletMiddleware.test.ts +++ b/packages/suite/src/middlewares/wallet/__tests__/walletMiddleware.test.ts @@ -1,21 +1,21 @@ import { testMocks } from '@suite-common/test-utils'; import { + SendState, prepareBlockchainMiddleware, prepareSendFormReducer, - SendState, } from '@suite-common/wallet-core'; -import walletSettingsReducer from 'src/reducers/wallet/settingsReducer'; import walletMiddleware from 'src/middlewares/wallet/walletMiddleware'; +import { RouterState } from 'src/reducers/suite/routerReducer'; import { accountsReducer, blockchainReducer } from 'src/reducers/wallet'; -import { configureStore } from 'src/support/tests/configureStore'; +import formDraftReducer from 'src/reducers/wallet/formDraftReducer'; import selectedAccountReducer, { State as SelectedAccountState, } from 'src/reducers/wallet/selectedAccountReducer'; -import formDraftReducer from 'src/reducers/wallet/formDraftReducer'; -import { RouterState } from 'src/reducers/suite/routerReducer'; -import { Action } from 'src/types/suite'; +import walletSettingsReducer from 'src/reducers/wallet/settingsReducer'; import { extraDependencies } from 'src/support/extraDependencies'; +import { configureStore } from 'src/support/tests/configureStore'; +import { Action } from 'src/types/suite'; import * as fixtures from '../__fixtures__/walletMiddleware'; diff --git a/packages/suite/src/middlewares/wallet/coinjoinMiddleware.ts b/packages/suite/src/middlewares/wallet/coinjoinMiddleware.ts index 720874c94ab..c30d7a6e76e 100644 --- a/packages/suite/src/middlewares/wallet/coinjoinMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/coinjoinMiddleware.ts @@ -1,44 +1,44 @@ -import type { MiddlewareAPI } from 'redux'; import { isAnyOf } from '@reduxjs/toolkit'; +import type { MiddlewareAPI } from 'redux'; -import { - discoveryActions, - accountsActions, - blockchainActions, - selectAccountByKey, - transactionsActions, -} from '@suite-common/wallet-core'; import { Feature, + messageSystemActions, selectFeatureConfig, selectIsFeatureDisabled, - messageSystemActions, } from '@suite-common/message-system'; import { addToast } from '@suite-common/toast-notifications'; +import { + accountsActions, + blockchainActions, + discoveryActions, + selectAccountByKey, + transactionsActions, +} from '@suite-common/wallet-core'; import { RoundPhase, SessionPhase } from '@trezor/coinjoin'; -import { UI, DEVICE } from '@trezor/connect'; +import { DEVICE, UI } from '@trezor/connect'; import { arrayDistinct } from '@trezor/utils'; -import { SUITE, ROUTER } from 'src/actions/suite/constants'; +import { ROUTER, SUITE } from 'src/actions/suite/constants'; +import * as storageActions from 'src/actions/suite/storageActions'; +import * as coinjoinAccountActions from 'src/actions/wallet/coinjoinAccountActions'; +import * as coinjoinClientActions from 'src/actions/wallet/coinjoinClientActions'; +import { COINJOIN } from 'src/actions/wallet/constants'; import { SESSION_ROUND_CHANGED, - SET_DEBUG_SETTINGS, SESSION_TX_BROADCASTED, + SET_DEBUG_SETTINGS, } from 'src/actions/wallet/constants/coinjoinConstants'; -import { COINJOIN } from 'src/actions/wallet/constants'; -import * as coinjoinAccountActions from 'src/actions/wallet/coinjoinAccountActions'; -import * as coinjoinClientActions from 'src/actions/wallet/coinjoinClientActions'; -import * as storageActions from 'src/actions/suite/storageActions'; -import { CoinjoinService } from 'src/services/coinjoin'; -import type { AppState, Action, Dispatch } from 'src/types/suite'; -import { CoinjoinConfig } from 'src/types/wallet/coinjoin'; +import { selectIsDeviceOrUiLocked, selectTorState } from 'src/reducers/suite/suiteReducer'; import { selectCoinjoinAccountByKey, - selectIsAnySessionInCriticalPhase, - selectIsAccountWithSessionInCriticalPhaseByAccountKey, selectCoinjoinSessionBlockerByAccountKey, + selectIsAccountWithSessionInCriticalPhaseByAccountKey, + selectIsAnySessionInCriticalPhase, } from 'src/reducers/wallet/coinjoinReducer'; -import { selectIsDeviceOrUiLocked, selectTorState } from 'src/reducers/suite/suiteReducer'; +import { CoinjoinService } from 'src/services/coinjoin'; +import type { Action, AppState, Dispatch } from 'src/types/suite'; +import { CoinjoinConfig } from 'src/types/wallet/coinjoin'; import { isCoinjoinSupportedSymbol } from 'src/utils/wallet/coinjoinUtils'; export const coinjoinMiddleware = diff --git a/packages/suite/src/middlewares/wallet/discoveryMiddleware.ts b/packages/suite/src/middlewares/wallet/discoveryMiddleware.ts index d537d18ee5f..cd1ace96332 100644 --- a/packages/suite/src/middlewares/wallet/discoveryMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/discoveryMiddleware.ts @@ -1,26 +1,26 @@ -import { connectPopupCallThunk } from '@trezor/suite-desktop-connect-popup'; +import { createMiddlewareWithExtraDeps } from '@suite-common/redux-utils'; +import { isDeviceAcquired } from '@suite-common/suite-utils'; +import { DiscoveryStatus } from '@suite-common/wallet-constants'; import { + accountsActions, authorizeDeviceThunk, + createDiscoveryThunk, deviceActions, - selectSelectedDevice, - selectDeviceDiscovery, - accountsActions, disableAccountsThunk, - createDiscoveryThunk, + selectDeviceDiscovery, + selectSelectedDevice, startDiscoveryThunk, stopDiscoveryThunk, updateNetworkSettingsThunk, } from '@suite-common/wallet-core'; import * as discoveryActions from '@suite-common/wallet-core'; import { UI } from '@trezor/connect'; -import { isDeviceAcquired } from '@suite-common/suite-utils'; -import { DiscoveryStatus } from '@suite-common/wallet-constants'; -import { createMiddlewareWithExtraDeps } from '@suite-common/redux-utils'; +import { connectPopupCallThunk } from '@trezor/suite-desktop-connect-popup'; -import { SUITE, ROUTER, MODAL } from 'src/actions/suite/constants'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; -import { getApp } from 'src/utils/suite/router'; +import { MODAL, ROUTER, SUITE } from 'src/actions/suite/constants'; import { selectIsDeviceLocked } from 'src/reducers/suite/suiteReducer'; +import { getApp } from 'src/utils/suite/router'; export const prepareDiscoveryMiddleware = createMiddlewareWithExtraDeps( async (action, { dispatch, next, getState }) => { diff --git a/packages/suite/src/middlewares/wallet/graphMiddleware.ts b/packages/suite/src/middlewares/wallet/graphMiddleware.ts index cd11564ab43..7d09e48e11c 100644 --- a/packages/suite/src/middlewares/wallet/graphMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/graphMiddleware.ts @@ -1,15 +1,15 @@ import { MiddlewareAPI } from 'redux'; +import { DiscoveryStatus } from '@suite-common/wallet-constants'; import { - discoveryActions, accountsActions, - transactionsActions, + discoveryActions, selectDeviceDiscovery, + transactionsActions, } from '@suite-common/wallet-core'; -import { DiscoveryStatus } from '@suite-common/wallet-constants'; import * as graphActions from 'src/actions/wallet/graphActions'; -import { AppState, Action, Dispatch } from 'src/types/suite'; +import { Action, AppState, Dispatch } from 'src/types/suite'; const graphMiddleware = (api: MiddlewareAPI) => diff --git a/packages/suite/src/middlewares/wallet/storageMiddleware.ts b/packages/suite/src/middlewares/wallet/storageMiddleware.ts index 0c58e768bd6..3187a22c16c 100644 --- a/packages/suite/src/middlewares/wallet/storageMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/storageMiddleware.ts @@ -1,40 +1,40 @@ -import { MiddlewareAPI } from 'redux'; import { isAnyOf } from '@reduxjs/toolkit'; +import { MiddlewareAPI } from 'redux'; +import { analyticsActions } from '@suite-common/analytics'; +import { firmwareActions } from '@suite-common/firmware'; +import { messageSystemActions } from '@suite-common/message-system'; +import { isDeviceRemembered } from '@suite-common/suite-utils'; +import { TokenManagementAction } from '@suite-common/token-definitions'; +import { tokenDefinitionsActions } from '@suite-common/token-definitions/src/tokenDefinitionsActions'; import { - selectDevices, - selectSelectedDevice, - selectDiscoveryByDeviceState, - discoveryActions, accountsActions, blockchainActions, - transactionsActions, - selectAccountByKey, deviceActions, - selectHistoricFiatRates, - updateTxsFiatRatesThunk, + discoveryActions, + selectAccountByKey, selectDeviceByStaticSessionId, + selectDevices, + selectDiscoveryByDeviceState, + selectHistoricFiatRates, + selectSelectedDevice, sendFormActions, + transactionsActions, + updateTxsFiatRatesThunk, } from '@suite-common/wallet-core'; -import { firmwareActions } from '@suite-common/firmware'; -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'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; -import { GRAPH, TRADING_COMMON, FORM_DRAFT } from 'src/actions/wallet/constants'; -import * as COINJOIN from 'src/actions/wallet/constants/coinjoinConstants'; -import * as storageActions from 'src/actions/suite/storageActions'; -import { SUITE, METADATA, STORAGE } from 'src/actions/suite/constants'; +import { METADATA, STORAGE, SUITE } from 'src/actions/suite/constants'; 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 * as storageActions from 'src/actions/suite/storageActions'; +import { FORM_DRAFT, GRAPH, TRADING_COMMON } from 'src/actions/wallet/constants'; +import * as COINJOIN from 'src/actions/wallet/constants/coinjoinConstants'; +import { db } from 'src/storage'; +import type { AppState, Dispatch, Action as SuiteAction } from 'src/types/suite'; import type { WalletAction } from 'src/types/wallet'; +import { serializeDiscovery } from 'src/utils/suite/storage'; const storageMiddleware = (api: MiddlewareAPI) => { db.onBlocking = () => api.dispatch({ type: STORAGE.ERROR, payload: 'blocking' }); diff --git a/packages/suite/src/middlewares/wallet/tradingMiddleware.ts b/packages/suite/src/middlewares/wallet/tradingMiddleware.ts index b3e15a56978..bc41f464fb1 100644 --- a/packages/suite/src/middlewares/wallet/tradingMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/tradingMiddleware.ts @@ -1,18 +1,18 @@ import { MiddlewareAPI } from 'redux'; -import { UI } from '@trezor/connect'; -import { accountsActions } from '@suite-common/wallet-core'; import { invityAPI } from '@suite-common/invity'; +import { accountsActions } from '@suite-common/wallet-core'; +import { UI } from '@trezor/connect'; -import { AppState, Action, Dispatch } from 'src/types/suite'; +import { MODAL, ROUTER } from 'src/actions/suite/constants'; import { TRADING_COMMON, TRADING_EXCHANGE, TRADING_SELL } from 'src/actions/wallet/constants'; -import { INVITY_API_RELOAD_DATA_AFTER_MS } from 'src/constants/wallet/trading/metadata'; import * as tradingCommonActions from 'src/actions/wallet/trading/tradingCommonActions'; -import * as tradingInfoAction from 'src/actions/wallet/tradingInfoActions'; import * as tradingBuyActions from 'src/actions/wallet/tradingBuyActions'; import * as tradingExchangeActions from 'src/actions/wallet/tradingExchangeActions'; +import * as tradingInfoAction from 'src/actions/wallet/tradingInfoActions'; import * as tradingSellActions from 'src/actions/wallet/tradingSellActions'; -import { ROUTER, MODAL } from 'src/actions/suite/constants'; +import { INVITY_API_RELOAD_DATA_AFTER_MS } from 'src/constants/wallet/trading/metadata'; +import { Action, AppState, Dispatch } from 'src/types/suite'; import { getTradeTypeByRoute } from 'src/utils/wallet/trading/tradingUtils'; /** diff --git a/packages/suite/src/middlewares/wallet/walletMiddleware.ts b/packages/suite/src/middlewares/wallet/walletMiddleware.ts index 30f02e76f16..3708c61227b 100644 --- a/packages/suite/src/middlewares/wallet/walletMiddleware.ts +++ b/packages/suite/src/middlewares/wallet/walletMiddleware.ts @@ -1,29 +1,29 @@ -import type { MiddlewareAPI } from 'redux'; import { isAnyOf } from '@reduxjs/toolkit'; +import type { MiddlewareAPI } from 'redux'; +import { getTxsPerPage } from '@suite-common/suite-utils'; import { accountsActions, blockchainActions, + convertSendFormDraftsBtcAmountUnitsThunk, + deviceActions, + sendFormActions, setCustomBackendThunk, + stakeActions, subscribeBlockchainThunk, transactionsActions, unsubscribeBlockchainThunk, - deviceActions, - stakeActions, - sendFormActions, - convertSendFormDraftsBtcAmountUnitsThunk, } from '@suite-common/wallet-core'; -import { getTxsPerPage } from '@suite-common/suite-utils'; -import { ROUTER } from 'src/actions/suite/constants'; import { WALLET_SETTINGS } from 'src/actions/settings/constants'; -import * as selectedAccountActions from 'src/actions/wallet/selectedAccountActions'; -import * as receiveActions from 'src/actions/wallet/receiveActions'; +import { ROUTER } from 'src/actions/suite/constants'; import * as cardanoStakingActions from 'src/actions/wallet/cardanoStakingActions'; +import * as receiveActions from 'src/actions/wallet/receiveActions'; +import * as selectedAccountActions from 'src/actions/wallet/selectedAccountActions'; import * as tradingCommonActions from 'src/actions/wallet/trading/tradingCommonActions'; import * as tradingBuyActions from 'src/actions/wallet/tradingBuyActions'; -import type { AppState, Action, Dispatch } from 'src/types/suite'; import { selectSelectedAccountKey } from 'src/reducers/wallet/selectedAccountReducer'; +import type { Action, AppState, Dispatch } from 'src/types/suite'; const walletMiddleware = (api: MiddlewareAPI) => diff --git a/packages/suite/src/reducers/backup/backupReducer.ts b/packages/suite/src/reducers/backup/backupReducer.ts index 81df9c9d7ac..431d87a72d7 100644 --- a/packages/suite/src/reducers/backup/backupReducer.ts +++ b/packages/suite/src/reducers/backup/backupReducer.ts @@ -1,7 +1,7 @@ import produce from 'immer'; +import { BackupStatus, ConfirmKey } from 'src/actions/backup/backupActions'; import { BACKUP } from 'src/actions/backup/constants'; -import { ConfirmKey, BackupStatus } from 'src/actions/backup/backupActions'; import { Action } from 'src/types/suite'; export interface BackupRootState { diff --git a/packages/suite/src/reducers/onboarding/onboardingReducer.ts b/packages/suite/src/reducers/onboarding/onboardingReducer.ts index 1afdebcbc59..c833c38149e 100644 --- a/packages/suite/src/reducers/onboarding/onboardingReducer.ts +++ b/packages/suite/src/reducers/onboarding/onboardingReducer.ts @@ -5,8 +5,8 @@ import { OnboardingAnalytics } from '@trezor/suite-analytics'; import { ONBOARDING } from 'src/actions/onboarding/constants'; import * as STEP from 'src/constants/onboarding/steps'; +import type { AnyPath, AnyStepId } from 'src/types/onboarding'; import { Action, TrezorDevice } from 'src/types/suite'; -import type { AnyStepId, AnyPath } from 'src/types/onboarding'; export interface OnboardingRootState { onboarding: OnboardingState; diff --git a/packages/suite/src/reducers/recovery/recoveryReducer.ts b/packages/suite/src/reducers/recovery/recoveryReducer.ts index b8645a757b7..b29d152720c 100644 --- a/packages/suite/src/reducers/recovery/recoveryReducer.ts +++ b/packages/suite/src/reducers/recovery/recoveryReducer.ts @@ -1,9 +1,9 @@ import produce from 'immer'; import { RECOVERY } from 'src/actions/recovery/constants'; -import { Action } from 'src/types/suite'; -import { WordCount } from 'src/types/recovery'; import { SeedInputStatus } from 'src/actions/recovery/recoveryActions'; +import { WordCount } from 'src/types/recovery'; +import { Action } from 'src/types/suite'; export interface RecoveryState { advancedRecovery: boolean; diff --git a/packages/suite/src/reducers/suite/__tests__/deviceReducer.test.ts b/packages/suite/src/reducers/suite/__tests__/deviceReducer.test.ts index a9a52c4119b..25a01b09677 100644 --- a/packages/suite/src/reducers/suite/__tests__/deviceReducer.test.ts +++ b/packages/suite/src/reducers/suite/__tests__/deviceReducer.test.ts @@ -1,8 +1,8 @@ import { testMocks } from '@suite-common/test-utils'; import { isUnlocked, prepareDeviceReducer } from '@suite-common/wallet-core'; -import { Action } from 'src/types/suite'; import { extraDependencies } from 'src/support/extraDependencies'; +import { Action } from 'src/types/suite'; import fixtures from '../__fixtures__/deviceReducer'; diff --git a/packages/suite/src/reducers/suite/__tests__/modalReducer.test.ts b/packages/suite/src/reducers/suite/__tests__/modalReducer.test.ts index 2dddeed9bbd..ac49c2570f9 100644 --- a/packages/suite/src/reducers/suite/__tests__/modalReducer.test.ts +++ b/packages/suite/src/reducers/suite/__tests__/modalReducer.test.ts @@ -1,7 +1,7 @@ import { Action } from 'src/types/suite'; -import modalReducer, { State } from '../modalReducer'; import fixtures from '../__fixtures__/modalReducer'; +import modalReducer, { State } from '../modalReducer'; describe('modalReducer', () => { fixtures.forEach(f => { diff --git a/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts b/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts index eee215605db..09e96d41a9b 100644 --- a/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts +++ b/packages/suite/src/reducers/suite/__tests__/protocolReducer.test.ts @@ -1,7 +1,7 @@ import type { Action } from 'src/types/suite'; -import protocolReducer, { State } from '../protocolReducer'; import fixtures from '../__fixtures__/protocolReducer'; +import protocolReducer, { State } from '../protocolReducer'; 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 ccd6cea4712..eb465b0c20b 100644 --- a/packages/suite/src/reducers/suite/desktopUpdateReducer.ts +++ b/packages/suite/src/reducers/suite/desktopUpdateReducer.ts @@ -1,7 +1,7 @@ import produce from 'immer'; -import { UpdateInfo, UpdateProgress } from '@trezor/suite-desktop-api'; import { DesktopAppUpdateState as UpdateState } from '@suite-common/suite-constants'; +import { UpdateInfo, UpdateProgress } from '@trezor/suite-desktop-api'; import { DESKTOP_UPDATE, SUITE } from 'src/actions/suite/constants'; import { Action } from 'src/types/suite'; diff --git a/packages/suite/src/reducers/suite/guideReducer.ts b/packages/suite/src/reducers/suite/guideReducer.ts index d612d08544b..b3a4bf82d63 100644 --- a/packages/suite/src/reducers/suite/guideReducer.ts +++ b/packages/suite/src/reducers/suite/guideReducer.ts @@ -3,8 +3,8 @@ import produce from 'immer'; 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'; +import { Action } from 'src/types/suite'; export interface State { open: boolean; diff --git a/packages/suite/src/reducers/suite/index.ts b/packages/suite/src/reducers/suite/index.ts index f2c1a390067..4f1ecc88e00 100644 --- a/packages/suite/src/reducers/suite/index.ts +++ b/packages/suite/src/reducers/suite/index.ts @@ -1,21 +1,21 @@ import { Reducer } from '@reduxjs/toolkit'; import { prepareAnalyticsReducer } from '@suite-common/analytics'; +import { logsSlice } from '@suite-common/logger'; import { prepareMessageSystemReducer } from '@suite-common/message-system'; import { notificationsReducer } from '@suite-common/toast-notifications'; -import { logsSlice } from '@suite-common/logger'; import { prepareDeviceReducer } from '@suite-common/wallet-core'; import { extraDependencies } from 'src/support/extraDependencies'; -import router from './routerReducer'; -import suite from './suiteReducer'; -import modal from './modalReducer'; -import window from './windowReducer'; -import metadata from './metadataReducer'; import desktopUpdate from './desktopUpdateReducer'; import guide from './guideReducer'; +import metadata from './metadataReducer'; +import modal from './modalReducer'; import protocol from './protocolReducer'; +import router from './routerReducer'; +import suite from './suiteReducer'; +import window from './windowReducer'; const analytics = prepareAnalyticsReducer(extraDependencies); // Type annotation as workaround for type-check error "The inferred type of 'default' cannot be named..." diff --git a/packages/suite/src/reducers/suite/metadataReducer.ts b/packages/suite/src/reducers/suite/metadataReducer.ts index 95a3cb8afb4..27f74600cc8 100644 --- a/packages/suite/src/reducers/suite/metadataReducer.ts +++ b/packages/suite/src/reducers/suite/metadataReducer.ts @@ -2,35 +2,35 @@ import produce from 'immer'; import { AccountsRootState, - selectAccountByKey, DeviceRootState, - selectSelectedDevice, State, - selectDeviceByState, deviceActions, + selectAccountByKey, + selectDeviceByState, selectDeviceByStaticSessionId, + selectSelectedDevice, } from '@suite-common/wallet-core'; import { AccountKey } from '@suite-common/wallet-types'; import { DeviceState, StaticSessionId } from '@trezor/connect'; import { - STORAGE, METADATA, METADATA_LABELING, METADATA_PASSWORDS, + STORAGE, } from 'src/actions/suite/constants'; +import { + DEFAULT_ACCOUNT_METADATA, + DEFAULT_WALLET_METADATA, +} from 'src/actions/suite/constants/metadataLabelingConstants'; import { Action, TrezorDevice } from 'src/types/suite'; import { - MetadataState, - WalletLabels, AccountLabels, + MetadataState, PasswordManagerState, + WalletLabels, } from 'src/types/suite/metadata'; import { Account } from 'src/types/wallet'; -import { - DEFAULT_ACCOUNT_METADATA, - DEFAULT_WALLET_METADATA, -} from 'src/actions/suite/constants/metadataLabelingConstants'; import { SuiteRootState } from './suiteReducer'; diff --git a/packages/suite/src/reducers/suite/modalReducer.ts b/packages/suite/src/reducers/suite/modalReducer.ts index 0246fb6b209..f21ac4c69b8 100644 --- a/packages/suite/src/reducers/suite/modalReducer.ts +++ b/packages/suite/src/reducers/suite/modalReducer.ts @@ -1,5 +1,5 @@ -import { UI, DEVICE, Device, UiRequestButtonData } from '@trezor/connect'; import { UserContextPayload } from '@suite-common/suite-types'; +import { DEVICE, Device, UI, UiRequestButtonData } from '@trezor/connect'; import { MODAL } from 'src/actions/suite/constants'; import type { Action, TrezorDevice } from 'src/types/suite'; diff --git a/packages/suite/src/reducers/suite/routerReducer.ts b/packages/suite/src/reducers/suite/routerReducer.ts index 677bf6cba47..dba0e5e6f87 100644 --- a/packages/suite/src/reducers/suite/routerReducer.ts +++ b/packages/suite/src/reducers/suite/routerReducer.ts @@ -1,8 +1,8 @@ -import { RouterAppWithParams, SettingsBackRoute } from 'src/constants/suite/routes'; import { ROUTER } from 'src/actions/suite/constants'; -import { Action } from 'src/types/suite'; -import type { AnchorType } from 'src/constants/suite/anchors'; import { ACCOUNT_TABS } from 'src/components/wallet/WalletLayout/AccountTopPanel/AccountNavigation'; +import type { AnchorType } from 'src/constants/suite/anchors'; +import { RouterAppWithParams, SettingsBackRoute } from 'src/constants/suite/routes'; +import { Action } from 'src/types/suite'; export type RouterState = { loaded: boolean; diff --git a/packages/suite/src/reducers/suite/suiteReducer.ts b/packages/suite/src/reducers/suite/suiteReducer.ts index 27cdf6f6ea1..2454a8c3043 100644 --- a/packages/suite/src/reducers/suite/suiteReducer.ts +++ b/packages/suite/src/reducers/suite/suiteReducer.ts @@ -3,28 +3,28 @@ import produce from 'immer'; import type { InvityServerEnvironment } from '@suite-common/invity'; import { Feature, selectIsFeatureDisabled } from '@suite-common/message-system'; import { isDeviceAcquired } from '@suite-common/suite-utils'; -import { discoveryActions, DeviceRootState, selectSelectedDevice } from '@suite-common/wallet-core'; -import { versionUtils } from '@trezor/utils'; -import { isWeb } from '@trezor/env-utils'; -import { TRANSPORT, TransportInfo, ConnectSettings, InstallerInfo } from '@trezor/connect'; import { NetworkSymbol } from '@suite-common/wallet-config'; -import { SuiteThemeVariant } from '@trezor/suite-desktop-api'; +import { DeviceRootState, discoveryActions, selectSelectedDevice } from '@suite-common/wallet-core'; import { AddressDisplayOptions, WalletType } from '@suite-common/wallet-types'; +import { ConnectSettings, InstallerInfo, TRANSPORT, TransportInfo } from '@trezor/connect'; +import { isWeb } from '@trezor/env-utils'; +import { SuiteThemeVariant } from '@trezor/suite-desktop-api'; +import { versionUtils } from '@trezor/utils'; -import { getIsTorEnabled, getIsTorLoading } from 'src/utils/suite/tor'; -import type { OAuthServerEnvironment } from 'src/types/suite/metadata'; -import { ensureLocale } from 'src/utils/suite/l10n'; +import { STORAGE, SUITE } from 'src/actions/suite/constants'; import type { Locale } from 'src/config/suite/languages'; -import { SUITE, STORAGE } from 'src/actions/suite/constants'; import { ExperimentalFeature } from 'src/constants/suite/experimental'; -import { Action, AppState, TorBootstrap, TorStatus } from 'src/types/suite'; -import { getExcludedPrerequisites, getPrerequisiteName } from 'src/utils/suite/prerequisites'; -import { SIDEBAR_WIDTH_NUMERIC } from 'src/constants/suite/layout'; import { hashCheckErrorScenarios, isSkippedHashCheckError, revisionCheckErrorScenarios, } from 'src/constants/suite/firmware'; +import { SIDEBAR_WIDTH_NUMERIC } from 'src/constants/suite/layout'; +import { Action, AppState, TorBootstrap, TorStatus } from 'src/types/suite'; +import type { OAuthServerEnvironment } from 'src/types/suite/metadata'; +import { ensureLocale } from 'src/utils/suite/l10n'; +import { getExcludedPrerequisites, getPrerequisiteName } from 'src/utils/suite/prerequisites'; +import { getIsTorEnabled, getIsTorLoading } from 'src/utils/suite/tor'; import { RouterRootState, selectRouter } from './routerReducer'; diff --git a/packages/suite/src/reducers/wallet/__tests__/cardanoStakingReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/cardanoStakingReducer.test.ts index 90518c3b7de..3ea9d9e6fba 100644 --- a/packages/suite/src/reducers/wallet/__tests__/cardanoStakingReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/cardanoStakingReducer.test.ts @@ -1,5 +1,5 @@ -import reducer, { initialState } from 'src/reducers/wallet/cardanoStakingReducer'; import { CARDANO_STAKING } from 'src/actions/wallet/constants'; +import reducer, { initialState } from 'src/reducers/wallet/cardanoStakingReducer'; describe('cardanoStakingReducer reducer', () => { it('test initial state', () => { diff --git a/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts index 65db9af53f3..7cbd520261e 100644 --- a/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/coinjoinReducer.test.ts @@ -1,12 +1,12 @@ import type { Action } from 'src/types/suite'; +import { actionFixtures, selectorFixtures } from '../__fixtures__/coinjoinReducer'; import { - coinjoinReducer, - CoinjoinState, CoinjoinRootState, + CoinjoinState, + coinjoinReducer, selectRegisteredUtxosByAccountKey, } from '../coinjoinReducer'; -import { actionFixtures, selectorFixtures } from '../__fixtures__/coinjoinReducer'; describe('Coinjoin reducer actions', () => { actionFixtures.forEach(f => { diff --git a/packages/suite/src/reducers/wallet/__tests__/sendFormReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/sendFormReducer.test.ts index 0c950632401..b8c1e049c2a 100644 --- a/packages/suite/src/reducers/wallet/__tests__/sendFormReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/sendFormReducer.test.ts @@ -1,16 +1,16 @@ -import { FormState, PrecomposedTransactionFinal, Account } from '@suite-common/wallet-types'; import { SerializedTx, accountsActions, - prepareSendFormReducer, initialState, + prepareSendFormReducer, sendFormActions, } from '@suite-common/wallet-core'; +import { Account, FormState, PrecomposedTransactionFinal } from '@suite-common/wallet-types'; 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'; +import { PreloadStoreAction } from 'src/support/suite/preloadStore'; +import { Action } from 'src/types/suite'; // Since these mocked values are only used for assigning them and deleting from the state, // their shape is completely irrelevant for these test. So to make this test file diff --git a/packages/suite/src/reducers/wallet/__tests__/settingsReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/settingsReducer.test.ts index 6afe45f7a53..924e2e902d3 100644 --- a/packages/suite/src/reducers/wallet/__tests__/settingsReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/settingsReducer.test.ts @@ -1,7 +1,7 @@ -import reducer, { initialState } from 'src/reducers/wallet/settingsReducer'; -import { STORAGE } from 'src/actions/suite/constants'; import { WALLET_SETTINGS } from 'src/actions/settings/constants'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; +import { STORAGE } from 'src/actions/suite/constants'; +import reducer, { initialState } from 'src/reducers/wallet/settingsReducer'; describe('settings reducer', () => { it('test initial state', () => { diff --git a/packages/suite/src/reducers/wallet/__tests__/tradingReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/tradingReducer.test.ts index 3e0833f012e..bf913cde532 100644 --- a/packages/suite/src/reducers/wallet/__tests__/tradingReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/tradingReducer.test.ts @@ -6,8 +6,6 @@ import { SellFiatTradeQuoteRequest, } from 'invity-api'; -import { tradingReducer, initialState } from 'src/reducers/wallet/tradingReducer'; -import { TradeBuy, TradeExchange } from 'src/types/wallet/tradingCommonTypes'; import { STORAGE } from 'src/actions/suite/constants'; import { TRADING_BUY, @@ -24,6 +22,8 @@ import { sellQuotes, } from 'src/reducers/wallet/__fixtures__/tradingReducerFixtures'; import { accounts } from 'src/reducers/wallet/__fixtures__/transactionConstants'; +import { initialState, tradingReducer } from 'src/reducers/wallet/tradingReducer'; +import { TradeBuy, TradeExchange } from 'src/types/wallet/tradingCommonTypes'; describe('settings reducer', () => { it('test initial state', () => { diff --git a/packages/suite/src/reducers/wallet/__tests__/transactionReducer.test.ts b/packages/suite/src/reducers/wallet/__tests__/transactionReducer.test.ts index bebbba28963..d2e605174e9 100644 --- a/packages/suite/src/reducers/wallet/__tests__/transactionReducer.test.ts +++ b/packages/suite/src/reducers/wallet/__tests__/transactionReducer.test.ts @@ -1,13 +1,13 @@ import { - transactionsInitialState, - transactionsActions, - prepareTransactionsReducer, fetchTransactionsPageThunk, + prepareTransactionsReducer, + transactionsActions, + transactionsInitialState, } from '@suite-common/wallet-core'; import { extraDependencies } from 'src/support/extraDependencies'; -import { transactions, accounts } from '../__fixtures__/transactionConstants'; +import { accounts, transactions } from '../__fixtures__/transactionConstants'; const reducer = prepareTransactionsReducer(extraDependencies); diff --git a/packages/suite/src/reducers/wallet/coinjoinReducer.ts b/packages/suite/src/reducers/wallet/coinjoinReducer.ts index 9e5ec08a2bb..8afa0d8b581 100644 --- a/packages/suite/src/reducers/wallet/coinjoinReducer.ts +++ b/packages/suite/src/reducers/wallet/coinjoinReducer.ts @@ -1,63 +1,63 @@ import produce from 'immer'; -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'; -import { - accountsActions, - AccountsRootState, - selectAccountByKey, - DeviceRootState, - selectDeviceStatus, -} from '@suite-common/wallet-core'; import { Feature, MessageSystemRootState, - selectIsFeatureDisabled, selectFeatureConfig, + selectIsFeatureDisabled, } from '@suite-common/message-system'; import { createWeakMapSelector } from '@suite-common/redux-utils'; +import { + AccountsRootState, + DeviceRootState, + accountsActions, + selectAccountByKey, + selectDeviceStatus, +} from '@suite-common/wallet-core'; +import { Account, AccountKey } from '@suite-common/wallet-types'; +import { RoundPhase, getInputSize, getOutputSize } from '@trezor/coinjoin'; +import { PartialRecord } from '@trezor/type-utils'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { STORAGE } from 'src/actions/suite/constants'; -import { - CoinjoinAccount, - CoinjoinDebugSettings, - CoinjoinConfig, - CoinjoinClientInstance, -} from 'src/types/wallet/coinjoin'; import { COINJOIN } from 'src/actions/wallet/constants'; -import { Action } from 'src/types/suite'; import { + SuiteRootState, selectIsDeviceOrUiLocked, selectTorState, - SuiteRootState, } from 'src/reducers/suite/suiteReducer'; -import { - breakdownCoinjoinBalance, - calculateAnonymityProgress, - getMaxFeePerVbyte, - cleanAnonymityGains, - getRoundPhaseFromSessionPhase, - transformCoinjoinStatus, - calculateAverageAnonymityGainPerRound, - getMaxRounds, - getSkipRounds, -} from 'src/utils/wallet/coinjoinUtils'; import { CLIENT_STATUS_FALLBACK, + DEFAULT_TARGET_ANONYMITY, ESTIMATED_ANONYMITY_GAINED_PER_ROUND, - MIN_ANONYMITY_GAINED_PER_ROUND, - ESTIMATED_ROUNDS_FAIL_RATE_BUFFER, ESTIMATED_HOURS_PER_ROUND, - UNECONOMICAL_COINJOIN_THRESHOLD, - DEFAULT_TARGET_ANONYMITY, - SKIP_ROUNDS_BY_DEFAULT, + ESTIMATED_ROUNDS_FAIL_RATE_BUFFER, FEE_RATE_MEDIAN_FALLBACK, MAX_MINING_FEE_MODIFIER, - ZKSNACKS_LEGAL_DOCUMENTS_VERSION, + MIN_ANONYMITY_GAINED_PER_ROUND, + SKIP_ROUNDS_BY_DEFAULT, TREZOR_LEGAL_DOCUMENTS_VERSION, + UNECONOMICAL_COINJOIN_THRESHOLD, + ZKSNACKS_LEGAL_DOCUMENTS_VERSION, } from 'src/services/coinjoin'; +import { Action } from 'src/types/suite'; +import { + CoinjoinAccount, + CoinjoinClientInstance, + CoinjoinConfig, + CoinjoinDebugSettings, +} from 'src/types/wallet/coinjoin'; +import { + breakdownCoinjoinBalance, + calculateAnonymityProgress, + calculateAverageAnonymityGainPerRound, + cleanAnonymityGains, + getMaxFeePerVbyte, + getMaxRounds, + getRoundPhaseFromSessionPhase, + getSkipRounds, + transformCoinjoinStatus, +} from 'src/utils/wallet/coinjoinUtils'; import { SelectedAccountRootState, selectSelectedAccount } from './selectedAccountReducer'; diff --git a/packages/suite/src/reducers/wallet/formDraftReducer.ts b/packages/suite/src/reducers/wallet/formDraftReducer.ts index 51d636405a4..71cedc6d25c 100644 --- a/packages/suite/src/reducers/wallet/formDraftReducer.ts +++ b/packages/suite/src/reducers/wallet/formDraftReducer.ts @@ -2,9 +2,9 @@ import { FieldValues } from 'react-hook-form'; import produce from 'immer'; +import { STORAGE } from 'src/actions/suite/constants'; import { FORM_DRAFT } from 'src/actions/wallet/constants'; import { Action } from 'src/types/suite'; -import { STORAGE } from 'src/actions/suite/constants'; export interface FormDraftState { [key: string]: FieldValues; diff --git a/packages/suite/src/reducers/wallet/graphReducer.ts b/packages/suite/src/reducers/wallet/graphReducer.ts index bdc2a263e1a..f19115c529b 100644 --- a/packages/suite/src/reducers/wallet/graphReducer.ts +++ b/packages/suite/src/reducers/wallet/graphReducer.ts @@ -2,12 +2,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 { GRAPH } from 'src/actions/wallet/constants'; import { SETTINGS } from 'src/config/suite'; -import { GraphData, AccountIdentifier, GraphRange, GraphScale } from 'src/types/wallet/graph'; +import { Action as SuiteAction } from 'src/types/suite'; +import { Account, WalletAction } from 'src/types/wallet'; +import { AccountIdentifier, GraphData, GraphRange, GraphScale } from 'src/types/wallet/graph'; export interface State { data: GraphData[]; diff --git a/packages/suite/src/reducers/wallet/index.ts b/packages/suite/src/reducers/wallet/index.ts index 6a7b0b64ca2..310a90976be 100644 --- a/packages/suite/src/reducers/wallet/index.ts +++ b/packages/suite/src/reducers/wallet/index.ts @@ -1,27 +1,27 @@ import { combineReducers } from 'redux'; import { + feesReducer, prepareAccountsReducer, - prepareFiatRatesReducer, - prepareTransactionsReducer, prepareBlockchainReducer, prepareDiscoveryReducer, - prepareStakeReducer, + prepareFiatRatesReducer, prepareSendFormReducer, - feesReducer, + prepareStakeReducer, + prepareTransactionsReducer, } from '@suite-common/wallet-core'; import { extraDependencies } from 'src/support/extraDependencies'; -import settingsReducer from './settingsReducer'; -import graphReducer from './graphReducer'; -import selectedAccountReducer from './selectedAccountReducer'; -import receiveReducer from './receiveReducer'; -import { tradingReducer } from './tradingReducer'; import accountSearchReducer from './accountSearchReducer'; -import formDraftReducer from './formDraftReducer'; import cardanoStakingReducer from './cardanoStakingReducer'; import { coinjoinReducer } from './coinjoinReducer'; +import formDraftReducer from './formDraftReducer'; +import graphReducer from './graphReducer'; +import receiveReducer from './receiveReducer'; +import selectedAccountReducer from './selectedAccountReducer'; +import settingsReducer from './settingsReducer'; +import { tradingReducer } from './tradingReducer'; export const transactionsReducer = prepareTransactionsReducer(extraDependencies); export const accountsReducer = prepareAccountsReducer(extraDependencies); diff --git a/packages/suite/src/reducers/wallet/selectedAccountReducer.ts b/packages/suite/src/reducers/wallet/selectedAccountReducer.ts index 5ff59a2385f..72cc90176e0 100644 --- a/packages/suite/src/reducers/wallet/selectedAccountReducer.ts +++ b/packages/suite/src/reducers/wallet/selectedAccountReducer.ts @@ -1,8 +1,8 @@ import { accountsActions } from '@suite-common/wallet-core'; import type { SelectedAccountStatus } from '@suite-common/wallet-types'; -import type { Action } from 'src/types/suite'; import { State as TradingState } from 'src/reducers/wallet/tradingReducer'; +import type { Action } from 'src/types/suite'; export type State = SelectedAccountStatus; diff --git a/packages/suite/src/reducers/wallet/settingsReducer.ts b/packages/suite/src/reducers/wallet/settingsReducer.ts index 251879f18aa..6dc1e354df5 100644 --- a/packages/suite/src/reducers/wallet/settingsReducer.ts +++ b/packages/suite/src/reducers/wallet/settingsReducer.ts @@ -1,8 +1,8 @@ import produce from 'immer'; +import { networkSymbolCollection } from '@suite-common/wallet-config'; import type { WalletSettings } from '@suite-common/wallet-types'; import { PROTO } from '@trezor/connect'; -import { networkSymbolCollection } from '@suite-common/wallet-config'; import { WALLET_SETTINGS } from 'src/actions/settings/constants'; import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; diff --git a/packages/suite/src/reducers/wallet/tradingReducer.ts b/packages/suite/src/reducers/wallet/tradingReducer.ts index ea31819cafe..2b0e497649c 100644 --- a/packages/suite/src/reducers/wallet/tradingReducer.ts +++ b/packages/suite/src/reducers/wallet/tradingReducer.ts @@ -2,34 +2,34 @@ import produce from 'immer'; import type { BuyTrade, BuyTradeQuoteRequest, - ExchangeTradeQuoteRequest, - ExchangeTrade, - SellFiatTrade, - SellFiatTradeQuoteRequest, Coins, CryptoId, + ExchangeTrade, + ExchangeTradeQuoteRequest, Platforms, + SellFiatTrade, + SellFiatTradeQuoteRequest, } from 'invity-api'; +import type { TradingType } from '@suite-common/invity'; import type { PrecomposedTransactionFinal } from '@suite-common/wallet-types'; import type { FeeLevel } from '@trezor/connect'; -import type { TradingType } from '@suite-common/invity'; -import type { WalletAction, Account } from 'src/types/wallet'; -import type { BuyInfo } from 'src/actions/wallet/tradingBuyActions'; -import type { ExchangeInfo } from 'src/actions/wallet/tradingExchangeActions'; +import { STORAGE } from 'src/actions/suite/constants'; import { TRADING_BUY, - TRADING_EXCHANGE, TRADING_COMMON, - TRADING_SELL, + TRADING_EXCHANGE, TRADING_INFO, + TRADING_SELL, } from 'src/actions/wallet/constants'; -import { STORAGE } from 'src/actions/suite/constants'; -import type { AppState, Action as SuiteAction } from 'src/types/suite'; +import type { BuyInfo } from 'src/actions/wallet/tradingBuyActions'; +import type { ExchangeInfo } from 'src/actions/wallet/tradingExchangeActions'; import type { SellInfo } from 'src/actions/wallet/tradingSellActions'; -import type { Trade } from 'src/types/wallet/tradingCommonTypes'; +import type { AppState, Action as SuiteAction } from 'src/types/suite'; import { TradingPaymentMethodListProps } from 'src/types/trading/trading'; +import type { Account, WalletAction } from 'src/types/wallet'; +import type { Trade } from 'src/types/wallet/tradingCommonTypes'; export interface ComposedTransactionInfo { composed?: Pick< diff --git a/packages/suite/src/services/coinjoin/coinjoinService.ts b/packages/suite/src/services/coinjoin/coinjoinService.ts index 4a774d20841..11dcf9222f7 100644 --- a/packages/suite/src/services/coinjoin/coinjoinService.ts +++ b/packages/suite/src/services/coinjoin/coinjoinService.ts @@ -1,7 +1,7 @@ import { CoinjoinBackend, CoinjoinClient, CoinjoinPrisonInmate } from '@trezor/coinjoin'; +import { isDesktop } from '@trezor/env-utils'; import { createIpcProxy } from '@trezor/ipc-proxy'; import { PartialRecord } from '@trezor/type-utils'; -import { isDesktop } from '@trezor/env-utils'; import type { CoinjoinNetworksConfig, CoinjoinSymbol } from './config'; import { getCoinjoinConfig } from './config'; diff --git a/packages/suite/src/services/coinjoin/config.ts b/packages/suite/src/services/coinjoin/config.ts index 7dc5db216b4..4a5dfcda2cc 100644 --- a/packages/suite/src/services/coinjoin/config.ts +++ b/packages/suite/src/services/coinjoin/config.ts @@ -1,12 +1,12 @@ +import type { NetworkSymbol } from '@suite-common/wallet-config'; +import type { CoinjoinBackendSettings, CoinjoinClientSettings } from '@trezor/coinjoin'; import { - PLEBS_DONT_PAY_THRESHOLD_FALLBACK, COORDINATOR_FEE_RATE_FALLBACK, - MIN_ALLOWED_AMOUNT_FALLBACK, MAX_ALLOWED_AMOUNT_FALLBACK, + MIN_ALLOWED_AMOUNT_FALLBACK, + PLEBS_DONT_PAY_THRESHOLD_FALLBACK, } from '@trezor/coinjoin/src/constants'; -import type { CoinjoinBackendSettings, CoinjoinClientSettings } from '@trezor/coinjoin'; import type { PartialRecord } from '@trezor/type-utils'; -import type { NetworkSymbol } from '@suite-common/wallet-config'; import type { CoinjoinServerEnvironment } from 'src/types/wallet/coinjoin'; diff --git a/packages/suite/src/services/github.ts b/packages/suite/src/services/github.ts index 5f2380b7cd8..e11e16ca43f 100644 --- a/packages/suite/src/services/github.ts +++ b/packages/suite/src/services/github.ts @@ -1,3 +1,4 @@ +import type { TransportInfo } from '@trezor/connect'; import { getFirmwareVersion } from '@trezor/device-utils'; import { getCommitHash, @@ -7,7 +8,6 @@ import { getUserAgent, isDesktop, } from '@trezor/env-utils'; -import type { TransportInfo } from '@trezor/connect'; import { GITHUB_REPO_URL } from '@trezor/urls'; import type { TrezorDevice } from 'src/types/suite'; diff --git a/packages/suite/src/services/suite/metadata/GoogleProvider.ts b/packages/suite/src/services/suite/metadata/GoogleProvider.ts index 36749fbee71..3f993de21b6 100644 --- a/packages/suite/src/services/suite/metadata/GoogleProvider.ts +++ b/packages/suite/src/services/suite/metadata/GoogleProvider.ts @@ -1,5 +1,5 @@ -import { AbstractMetadataProvider, OAuthServerEnvironment, Tokens } from 'src/types/suite/metadata'; import GoogleClient from 'src/services/google'; +import { AbstractMetadataProvider, OAuthServerEnvironment, Tokens } from 'src/types/suite/metadata'; class GoogleProvider extends AbstractMetadataProvider { connected = false; diff --git a/packages/suite/src/storage/definitions.ts b/packages/suite/src/storage/definitions.ts index 3b17176e804..7ce6ae0719b 100644 --- a/packages/suite/src/storage/definitions.ts +++ b/packages/suite/src/storage/definitions.ts @@ -2,24 +2,24 @@ import { FieldValues } from 'react-hook-form'; import type { DBSchema } from 'idb'; +import { AnalyticsState } from '@suite-common/analytics'; +import type { MessageState } from '@suite-common/message-system'; +import type { DeviceWithEmptyPath, MessageSystem } from '@suite-common/suite-types'; +import { SimpleTokenStructure } from '@suite-common/token-definitions'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import type { + BackendSettings, FormState, RatesByTimestamps, - BackendSettings, WalletSettings, } from '@suite-common/wallet-types'; -import type { MessageState } from '@suite-common/message-system'; -import type { DeviceWithEmptyPath, MessageSystem } from '@suite-common/suite-types'; -import { NetworkSymbol } from '@suite-common/wallet-config'; import type { StorageUpdateMessage } from '@trezor/suite-storage'; -import { AnalyticsState } from '@suite-common/analytics'; -import { SimpleTokenStructure } from '@suite-common/token-definitions'; -import type { CoinjoinAccount, CoinjoinDebugSettings } from 'src/types/wallet/coinjoin'; +import type { SuiteState } from 'src/reducers/suite/suiteReducer'; +import type { MetadataState } from 'src/types/suite/metadata'; import type { Account, Discovery, WalletAccountTransaction } from 'src/types/wallet'; +import type { CoinjoinAccount, CoinjoinDebugSettings } from 'src/types/wallet/coinjoin'; import type { Trade } from 'src/types/wallet/tradingCommonTypes'; -import type { MetadataState } from 'src/types/suite/metadata'; -import type { SuiteState } from 'src/reducers/suite/suiteReducer'; import { GraphData } from '../types/wallet/graph'; diff --git a/packages/suite/src/storage/index.ts b/packages/suite/src/storage/index.ts index a16f675968f..79c1baefbc6 100644 --- a/packages/suite/src/storage/index.ts +++ b/packages/suite/src/storage/index.ts @@ -2,8 +2,8 @@ import SuiteDB, { OnUpgradeFunc } from '@trezor/suite-storage'; import { reloadApp } from 'src/utils/suite/reload'; -import { migrate } from './migrations'; import type { SuiteDBSchema } from './definitions'; +import { migrate } from './migrations'; const VERSION = 53; // 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 bd86abbbfec..e4c32fcf95f 100644 --- a/packages/suite/src/storage/migrations/index.ts +++ b/packages/suite/src/storage/migrations/index.ts @@ -1,28 +1,28 @@ import { toWei } from 'web3-utils'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { isDesktop } from '@trezor/env-utils'; import { + type NetworkSymbol, getNetwork, isNetworkSymbol, - type NetworkSymbol, networkSymbolCollection, } from '@suite-common/wallet-config'; import type { BackendSettings } from '@suite-common/wallet-types'; -import type { OnUpgradeFunc } from '@trezor/suite-storage'; import { + amountToSmallestUnit, formatNetworkAmount, networkAmountToSmallestUnit, - amountToSmallestUnit, } from '@suite-common/wallet-utils'; -import { DeviceModelInternal, FirmwareType } from '@trezor/connect'; import { parseAsset } from '@trezor/blockchain-link-utils/src/blockfrost'; +import { DeviceModelInternal, FirmwareType } from '@trezor/connect'; +import { isDesktop } from '@trezor/env-utils'; +import type { OnUpgradeFunc } from '@trezor/suite-storage'; import { PartialRecord } from '@trezor/type-utils'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import type { CustomBackend, BlockbookUrl } from 'src/types/wallet/backend'; import type { State } from 'src/reducers/wallet/settingsReducer'; import { migrationOfBnbNetwork } from 'src/storage/migrations/networks/bnb'; import { migrationCoinmarketToTrading } from 'src/storage/migrations/trading/migrationCoinmarketToTrading'; +import type { BlockbookUrl, CustomBackend } from 'src/types/wallet/backend'; import { updateAll } from './utils'; import type { DBWalletAccountTransaction, SuiteDBSchema } from '../definitions'; diff --git a/packages/suite/src/storage/migrations/networks/bnb.ts b/packages/suite/src/storage/migrations/networks/bnb.ts index 5977fbd5e7a..5592fd6393d 100644 --- a/packages/suite/src/storage/migrations/networks/bnb.ts +++ b/packages/suite/src/storage/migrations/networks/bnb.ts @@ -1,7 +1,7 @@ import type { OnUpgradeFunc } from '@trezor/suite-storage'; -import { updateAll } from '../utils'; import type { SuiteDBSchema } from '../../definitions'; +import { updateAll } from '../utils'; export const migrationOfBnbNetwork: OnUpgradeFunc = async ( _db, diff --git a/packages/suite/src/storage/migrations/utils.ts b/packages/suite/src/storage/migrations/utils.ts index 1a9b9805d50..c4c9b6dd2c5 100644 --- a/packages/suite/src/storage/migrations/utils.ts +++ b/packages/suite/src/storage/migrations/utils.ts @@ -1,4 +1,4 @@ -import type { StoreNames, StoreValue, IDBPTransaction } from 'idb'; +import type { IDBPTransaction, StoreNames, StoreValue } from 'idb'; import type { SuiteDBSchema } from '../definitions'; diff --git a/packages/suite/src/support/extraDependencies.ts b/packages/suite/src/support/extraDependencies.ts index 257598af77f..c08ae507d3d 100644 --- a/packages/suite/src/support/extraDependencies.ts +++ b/packages/suite/src/support/extraDependencies.ts @@ -1,44 +1,44 @@ -import { saveAs } from 'file-saver'; import { PayloadAction } from '@reduxjs/toolkit'; +import { saveAs } from 'file-saver'; -import { getAccountKey, buildHistoricRatesFromStorage } from '@suite-common/wallet-utils'; +import { ExtraDependencies } from '@suite-common/redux-utils'; +import { + TokenDefinitionsState, + buildTokenDefinitionsFromStorage, +} from '@suite-common/token-definitions'; +import { isNetworkSymbol } from '@suite-common/wallet-config'; import { - DeviceRootState, - selectIsPendingTransportEvent, - TransactionsState, BlockchainState, + DeviceRootState, DiscoveryRootState, - selectDiscoveryByDeviceState, - deviceActions, FiatRatesState, + TransactionsState, + deviceActions, + selectDiscoveryByDeviceState, + selectIsPendingTransportEvent, } from '@suite-common/wallet-core'; -import { isNetworkSymbol } from '@suite-common/wallet-config'; -import { ExtraDependencies } from '@suite-common/redux-utils'; +import { buildHistoricRatesFromStorage, getAccountKey } from '@suite-common/wallet-utils'; import { PROTO, StaticSessionId } from '@trezor/connect'; -import { - TokenDefinitionsState, - buildTokenDefinitionsFromStorage, -} from '@suite-common/token-definitions'; import { isDesktop } from '@trezor/env-utils'; +import * as walletSettingsActions from 'src/actions/settings/walletSettingsActions'; +import * as metadataActions from 'src/actions/suite/metadataActions'; +import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; +import * as modalActions from 'src/actions/suite/modalActions'; +import { StorageLoadAction } from 'src/actions/suite/storageActions'; +import { addWalletThunk, openSwitchDeviceDialog } from 'src/actions/wallet/addWalletThunk'; +import * as cardanoStakingActions from 'src/actions/wallet/cardanoStakingActions'; 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'; -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 { selectIsWindowVisible } from 'src/reducers/suite/windowReducer'; +import { fixLoadedCoinjoinAccount } from 'src/utils/wallet/coinjoinUtils'; -import * as suiteActions from '../actions/suite/suiteActions'; -import { AppState, ButtonRequest, TrezorDevice } from '../types/suite'; import { METADATA, STORAGE } from '../actions/suite/constants'; +import * as suiteActions from '../actions/suite/suiteActions'; import { selectSuiteSettings } from '../reducers/suite/suiteReducer'; +import { AppState, ButtonRequest, TrezorDevice } from '../types/suite'; const connectSrc = '../'; // 'https://localhost:8088/'; diff --git a/packages/suite/src/support/suite/Autodetect.tsx b/packages/suite/src/support/suite/Autodetect.tsx index f1f2b4c77cc..d2f6b11038f 100644 --- a/packages/suite/src/support/suite/Autodetect.tsx +++ b/packages/suite/src/support/suite/Autodetect.tsx @@ -1,10 +1,10 @@ import { useEffect } from 'react'; +import * as languageActions from 'src/actions/settings/languageActions'; +import { setTheme as setThemeAction } from 'src/actions/suite/suiteActions'; +import { useActions, useSelector } from 'src/hooks/suite'; import { getOsTheme, watchOsTheme } from 'src/utils/suite/env'; import { getOsLocale, watchOsLocale } from 'src/utils/suite/l10n'; -import { useActions, useSelector } from 'src/hooks/suite'; -import { setTheme as setThemeAction } from 'src/actions/suite/suiteActions'; -import * as languageActions from 'src/actions/settings/languageActions'; const Autodetect = () => { const autodetectTheme = useSelector(state => state.suite.settings.autodetect.theme); diff --git a/packages/suite/src/support/suite/ConnectedIntlProvider.tsx b/packages/suite/src/support/suite/ConnectedIntlProvider.tsx index 192d5450c66..77feda3634d 100644 --- a/packages/suite/src/support/suite/ConnectedIntlProvider.tsx +++ b/packages/suite/src/support/suite/ConnectedIntlProvider.tsx @@ -1,11 +1,11 @@ -import { useState, useEffect, ReactNode } from 'react'; +import { ReactNode, useEffect, useState } from 'react'; import { IntlProvider } from 'react-intl'; -import enMessages from '@trezor/suite-data/files/translations/en.json'; import { isDevEnv } from '@suite-common/suite-utils'; +import enMessages from '@trezor/suite-data/files/translations/en.json'; -import { useSelector } from 'src/hooks/suite/useSelector'; import type { Locale } from 'src/config/suite/languages'; +import { useSelector } from 'src/hooks/suite/useSelector'; const useFetchMessages = (locale: Locale) => { const [messages, setMessages] = useState<{ [key: string]: any }>({}); diff --git a/packages/suite/src/support/suite/ErrorBoundary.tsx b/packages/suite/src/support/suite/ErrorBoundary.tsx index 64ca69565f3..03d4656d5f3 100644 --- a/packages/suite/src/support/suite/ErrorBoundary.tsx +++ b/packages/suite/src/support/suite/ErrorBoundary.tsx @@ -1,7 +1,7 @@ import { Component, ErrorInfo } from 'react'; -import { connect, ConnectedComponent } from 'react-redux'; +import { ConnectedComponent, connect } from 'react-redux'; -import { bindActionCreators, Dispatch } from 'redux'; +import { Dispatch, bindActionCreators } from 'redux'; import { Error } from 'src/components/suite/Error'; import { reportToSentry } from 'src/utils/suite/sentry'; diff --git a/packages/suite/src/support/suite/ModalContext.tsx b/packages/suite/src/support/suite/ModalContext.tsx index e6b533a3f17..7c66b51d4df 100644 --- a/packages/suite/src/support/suite/ModalContext.tsx +++ b/packages/suite/src/support/suite/ModalContext.tsx @@ -1,10 +1,10 @@ import { - useContext, - useRef, - createContext, - RefObject, ReactNode, + RefObject, + createContext, + useContext, useEffect, + useRef, useState, } from 'react'; diff --git a/packages/suite/src/support/suite/OnlineStatus.tsx b/packages/suite/src/support/suite/OnlineStatus.tsx index c45ea7b9efc..a8559785702 100644 --- a/packages/suite/src/support/suite/OnlineStatus.tsx +++ b/packages/suite/src/support/suite/OnlineStatus.tsx @@ -1,7 +1,7 @@ import { useEffect } from 'react'; -import { useDispatch } from 'src/hooks/suite'; import { updateOnlineStatus } from 'src/actions/suite/suiteActions'; +import { useDispatch } from 'src/hooks/suite'; /** * Navigator online/offline handler diff --git a/packages/suite/src/support/suite/Protocol.tsx b/packages/suite/src/support/suite/Protocol.tsx index 7522ac8ef38..f17d66456c4 100644 --- a/packages/suite/src/support/suite/Protocol.tsx +++ b/packages/suite/src/support/suite/Protocol.tsx @@ -1,11 +1,11 @@ import { useEffect } from 'react'; import { useLocation } from 'react-router-dom'; +import { isDesktop, isWeb } from '@trezor/env-utils'; 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'; +import { useActions } from 'src/hooks/suite'; const Protocol = () => { const { handleProtocolRequest } = useActions({ diff --git a/packages/suite/src/support/suite/Resize.tsx b/packages/suite/src/support/suite/Resize.tsx index 8dd36a8a55e..e7a8fbca466 100644 --- a/packages/suite/src/support/suite/Resize.tsx +++ b/packages/suite/src/support/suite/Resize.tsx @@ -2,8 +2,8 @@ import { useEffect, useState } from 'react'; import useDebounce from 'react-use/lib/useDebounce'; -import { useDispatch } from 'src/hooks/suite'; import { updateWindowSize } from 'src/actions/suite/windowActions'; +import { useDispatch } from 'src/hooks/suite'; /** * Window resize handler diff --git a/packages/suite/src/support/suite/Router.tsx b/packages/suite/src/support/suite/Router.tsx index d102ee952d2..55cf33ebfea 100644 --- a/packages/suite/src/support/suite/Router.tsx +++ b/packages/suite/src/support/suite/Router.tsx @@ -3,8 +3,8 @@ 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 { useDispatch, useSelector } from 'src/hooks/suite'; import history from 'src/support/history'; const RouterComponent = () => { diff --git a/packages/suite/src/support/suite/ThemeProvider.tsx b/packages/suite/src/support/suite/ThemeProvider.tsx index e3a6eafb1fe..e342fd31e96 100644 --- a/packages/suite/src/support/suite/ThemeProvider.tsx +++ b/packages/suite/src/support/suite/ThemeProvider.tsx @@ -2,8 +2,8 @@ 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 { getThemeColors } from 'src/utils/suite/theme'; import GlobalStyle from './styles/GlobalStyle'; diff --git a/packages/suite/src/support/suite/preloadStore.ts b/packages/suite/src/support/suite/preloadStore.ts index dfc1cdf0a37..bd4800b49c9 100644 --- a/packages/suite/src/support/suite/preloadStore.ts +++ b/packages/suite/src/support/suite/preloadStore.ts @@ -1,5 +1,5 @@ -import { db } from 'src/storage'; import * as STORAGE from 'src/actions/suite/constants/storageConstants'; +import { db } from 'src/storage'; // This function should be called before first render // PreloadedState will be used in redux store creation diff --git a/packages/suite/src/support/suite/styles/GlobalStyle.tsx b/packages/suite/src/support/suite/styles/GlobalStyle.tsx index a26242740f6..c704f7d537b 100644 --- a/packages/suite/src/support/suite/styles/GlobalStyle.tsx +++ b/packages/suite/src/support/suite/styles/GlobalStyle.tsx @@ -1,4 +1,4 @@ -import { createGlobalStyle, DefaultTheme } from 'styled-components'; +import { DefaultTheme, createGlobalStyle } from 'styled-components'; import { typography } from '@trezor/theme'; diff --git a/packages/suite/src/support/suite/useTor.tsx b/packages/suite/src/support/suite/useTor.tsx index 3e92b348cc0..8e523c0a38c 100644 --- a/packages/suite/src/support/suite/useTor.tsx +++ b/packages/suite/src/support/suite/useTor.tsx @@ -1,18 +1,18 @@ 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 { getLocationHostname, isDesktop, isWeb } from '@trezor/env-utils'; +import { BootstrapTorEvent, TorStatusEvent, desktopApi } from '@trezor/suite-desktop-api'; -import { TorStatus } from 'src/types/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { getIsTorDomain } from 'src/utils/suite/tor'; import { setTorBootstrap, setTorBootstrapSlow, updateTorStatus, } from 'src/actions/suite/suiteActions'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectTorState } from 'src/reducers/suite/suiteReducer'; +import { TorStatus } from 'src/types/suite'; +import { getIsTorDomain } from 'src/utils/suite/tor'; 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 c8c63f8cefd..31f65844026 100644 --- a/packages/suite/src/support/tests/IntlHelper.tsx +++ b/packages/suite/src/support/tests/IntlHelper.tsx @@ -1,7 +1,7 @@ import { ReactChild } from 'react'; -import renderer from 'react-test-renderer'; import { IntlProvider } from 'react-intl'; import { Provider } from 'react-redux'; +import renderer from 'react-test-renderer'; import { configureStore } from 'src/support/tests/configureStore'; diff --git a/packages/suite/src/support/tests/configureStore.tsx b/packages/suite/src/support/tests/configureStore.tsx index 1f8b1e8d19b..b79b014ac91 100644 --- a/packages/suite/src/support/tests/configureStore.tsx +++ b/packages/suite/src/support/tests/configureStore.tsx @@ -1,4 +1,4 @@ -import { AnyAction, isFulfilled, isPending, Middleware } from '@reduxjs/toolkit'; +import { AnyAction, Middleware, isFulfilled, isPending } from '@reduxjs/toolkit'; import reduxMockStore, { MockStoreCreator } from 'redux-mock-store'; import thunk from 'redux-thunk'; diff --git a/packages/suite/src/support/tests/hooksHelper.tsx b/packages/suite/src/support/tests/hooksHelper.tsx index 2be6e0a554f..1df363952f7 100644 --- a/packages/suite/src/support/tests/hooksHelper.tsx +++ b/packages/suite/src/support/tests/hooksHelper.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react'; -import { Provider } from 'react-redux'; import { IntlProvider } from 'react-intl'; +import { Provider } from 'react-redux'; import { act, render, screen, waitForElementToBeRemoved } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; diff --git a/packages/suite/src/types/suite/index.ts b/packages/suite/src/types/suite/index.ts index d5739278aec..77d812f985b 100644 --- a/packages/suite/src/types/suite/index.ts +++ b/packages/suite/src/types/suite/index.ts @@ -1,30 +1,30 @@ -import type { ThunkDispatch, ThunkAction as TAction } from 'redux-thunk'; import type { Store as ReduxStore } from 'redux'; +import type { ThunkAction as TAction, ThunkDispatch } from 'redux-thunk'; -import { deviceActions, discoveryActions, transactionsActions } from '@suite-common/wallet-core'; -import { firmwareActions } from '@suite-common/firmware'; import { analyticsActions } from '@suite-common/analytics'; -import type { UiEvent, TransportEvent, BlockchainEvent } from '@trezor/connect'; -import { notificationsActions } from '@suite-common/toast-notifications'; -import { messageSystemActions } from '@suite-common/message-system'; import { deviceAuthenticityActions } from '@suite-common/device-authenticity'; +import { firmwareActions } from '@suite-common/firmware'; +import { messageSystemActions } from '@suite-common/message-system'; import type { Route } from '@suite-common/suite-types'; +import { notificationsActions } from '@suite-common/toast-notifications'; +import { deviceActions, discoveryActions, transactionsActions } from '@suite-common/wallet-core'; +import type { BlockchainEvent, TransportEvent, UiEvent } from '@trezor/connect'; +import type { BackupAction } from 'src/actions/backup/backupActions'; +import type { OnboardingAction } from 'src/actions/onboarding/onboardingActions'; +import type { RecoveryAction } from 'src/actions/recovery/recoveryActions'; +import type { WalletSettingsAction } from 'src/actions/settings/walletSettingsActions'; +import type { DesktopUpdateAction } from 'src/actions/suite/desktopUpdateActions'; +import type { GuideAction } from 'src/actions/suite/guideActions'; +import type { MetadataAction } from 'src/actions/suite/metadataActions'; +import type { ModalAction } from 'src/actions/suite/modalActions'; +import type { ProtocolAction } from 'src/actions/suite/protocolActions'; import type { RouterAction } from 'src/actions/suite/routerActions'; -import type { AppState } from 'src/reducers/store'; import type { StorageAction } from 'src/actions/suite/storageActions'; import type { SuiteAction } from 'src/actions/suite/suiteActions'; import type { WindowAction } from 'src/actions/suite/windowActions'; -import type { ModalAction } from 'src/actions/suite/modalActions'; -import type { MetadataAction } from 'src/actions/suite/metadataActions'; -import type { ProtocolAction } from 'src/actions/suite/protocolActions'; -import type { DesktopUpdateAction } from 'src/actions/suite/desktopUpdateActions'; -import type { OnboardingAction } from 'src/actions/onboarding/onboardingActions'; -import type { WalletSettingsAction } from 'src/actions/settings/walletSettingsActions'; +import type { AppState } from 'src/reducers/store'; import type { WalletAction } from 'src/types/wallet'; -import type { BackupAction } from 'src/actions/backup/backupActions'; -import type { RecoveryAction } from 'src/actions/recovery/recoveryActions'; -import type { GuideAction } from 'src/actions/suite/guideActions'; // reexport export type { ExtendedMessageDescriptor } from 'src/components/suite/Translation'; diff --git a/packages/suite/src/types/trading/trading.ts b/packages/suite/src/types/trading/trading.ts index 612626c4395..30d14f226dd 100644 --- a/packages/suite/src/types/trading/trading.ts +++ b/packages/suite/src/types/trading/trading.ts @@ -14,14 +14,6 @@ import { } from 'invity-api'; import { AnyAction, Dispatch } from 'redux'; -import { Account, SelectedAccountLoaded } from '@suite-common/wallet-types'; -import { AccountType, NetworkSymbolExtended } from '@suite-common/wallet-config'; -import { Timer } from '@trezor/react-utils'; -import { AccountsState } from '@suite-common/wallet-core'; -import { TokenDefinitionsState } from '@suite-common/token-definitions'; -import { AssetLogoProps } from '@trezor/components'; -import { StaticSessionId } from '@trezor/connect'; -import { AssetOptionBaseProps } from '@trezor/product-components'; import type { TradingBuyType, TradingExchangeType, @@ -29,7 +21,18 @@ import type { TradingSellType, TradingType, } from '@suite-common/invity'; +import { TokenDefinitionsState } from '@suite-common/token-definitions'; +import { AccountType, NetworkSymbolExtended } from '@suite-common/wallet-config'; +import { AccountsState } from '@suite-common/wallet-core'; +import { Account, SelectedAccountLoaded } from '@suite-common/wallet-types'; +import { AssetLogoProps } from '@trezor/components'; +import { StaticSessionId } from '@trezor/connect'; +import { AssetOptionBaseProps } from '@trezor/product-components'; +import { Timer } from '@trezor/react-utils'; +import type { BuyInfo } from 'src/actions/wallet/tradingBuyActions'; +import type { ExchangeInfo } from 'src/actions/wallet/tradingExchangeActions'; +import type { SellInfo } from 'src/actions/wallet/tradingSellActions'; import { GetDefaultAccountLabelParams } from 'src/hooks/suite/useDefaultAccountLabel'; import { State } from 'src/reducers/wallet/tradingReducer'; import { ExtendedMessageDescriptor, TrezorDevice } from 'src/types/suite'; @@ -41,9 +44,6 @@ import type { TradeSell, TradeType, } from 'src/types/wallet/tradingCommonTypes'; -import type { SellInfo } from 'src/actions/wallet/tradingSellActions'; -import type { ExchangeInfo } from 'src/actions/wallet/tradingExchangeActions'; -import type { BuyInfo } from 'src/actions/wallet/tradingBuyActions'; type TradingPageType = 'form' | 'offers' | 'confirm'; diff --git a/packages/suite/src/types/trading/tradingDetail.ts b/packages/suite/src/types/trading/tradingDetail.ts index 4737c1e55d5..3c785fe064f 100644 --- a/packages/suite/src/types/trading/tradingDetail.ts +++ b/packages/suite/src/types/trading/tradingDetail.ts @@ -1,10 +1,10 @@ -import type { SelectedAccountLoaded } from '@suite-common/wallet-types'; import type { TradingType } from '@suite-common/invity'; +import type { SelectedAccountLoaded } from '@suite-common/wallet-types'; import type { TradingTradeCommonProps } from 'src/reducers/wallet/tradingReducer'; +import { TradingTradeInfoMapProps, TradingTradeMapProps } from 'src/types/trading/trading'; import type { Account } from 'src/types/wallet'; import type { TradeType } from 'src/types/wallet/tradingCommonTypes'; -import { TradingTradeInfoMapProps, TradingTradeMapProps } from 'src/types/trading/trading'; export interface TradingDetailContextValues extends TradingTradeCommonProps { account: Account; diff --git a/packages/suite/src/types/trading/tradingForm.ts b/packages/suite/src/types/trading/tradingForm.ts index f5d0c17b525..cb18b47a6d3 100644 --- a/packages/suite/src/types/trading/tradingForm.ts +++ b/packages/suite/src/types/trading/tradingForm.ts @@ -1,5 +1,5 @@ -import type { FieldValues, UseFormReturn, FieldPath } from 'react-hook-form'; import React from 'react'; +import type { FieldPath, FieldValues, UseFormReturn } from 'react-hook-form'; import type { BankAccount, @@ -11,16 +11,6 @@ import type { 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 type { TradingBuyType, TradingExchangeType, @@ -29,25 +19,21 @@ import type { TradingTradeType, TradingType, } from '@suite-common/invity'; - +import { Network } from '@suite-common/wallet-config'; +import { AccountsState } from '@suite-common/wallet-core'; import { - TradingAccountOptionsGroupOptionProps, - TradingCryptoSelectItemProps, - TradingGetCryptoQuoteAmountProps, - TradingGetProvidersInfoProps, - TradingPaymentMethodListProps, - TradingPaymentMethodProps, - TradingTradeDetailMapProps, - TradingTradeSellExchangeType, -} from 'src/types/trading/trading'; -import type { Account } from 'src/types/wallet'; + FeeInfo, + FormState, + PrecomposedLevels, + PrecomposedLevelsCardano, +} from '@suite-common/wallet-types'; +import { FeeLevel } from '@trezor/connect'; +import { Timer } from '@trezor/react-utils'; + import type { BuyInfo } from 'src/actions/wallet/tradingBuyActions'; -import { AppState } from 'src/reducers/store'; -import { Dispatch, GetState } from 'src/types/suite'; -import { Option, TradeBuy, TradeExchange, TradeSell } from 'src/types/wallet/tradingCommonTypes'; -import { SendContextValues } from 'src/types/wallet/sendForm'; -import { SellInfo } from 'src/actions/wallet/tradingSellActions'; import { ExchangeInfo } from 'src/actions/wallet/tradingExchangeActions'; +import { SellInfo } from 'src/actions/wallet/tradingSellActions'; +import type { TranslationKey } from 'src/components/suite/Translation'; import { EXCHANGE_COMPARATOR_KYC_FILTER, EXCHANGE_COMPARATOR_KYC_FILTER_ALL, @@ -64,7 +50,21 @@ import { FORM_RATE_FLOATING, FORM_RATE_TYPE, } from 'src/constants/wallet/trading/form'; -import type { TranslationKey } from 'src/components/suite/Translation'; +import { AppState } from 'src/reducers/store'; +import { Dispatch, GetState } from 'src/types/suite'; +import { + TradingAccountOptionsGroupOptionProps, + TradingCryptoSelectItemProps, + TradingGetCryptoQuoteAmountProps, + TradingGetProvidersInfoProps, + TradingPaymentMethodListProps, + TradingPaymentMethodProps, + TradingTradeDetailMapProps, + TradingTradeSellExchangeType, +} from 'src/types/trading/trading'; +import type { Account } from 'src/types/wallet'; +import { SendContextValues } from 'src/types/wallet/sendForm'; +import { Option, TradeBuy, TradeExchange, TradeSell } from 'src/types/wallet/tradingCommonTypes'; import { AmountLimitProps, CryptoAmountLimitProps } from 'src/utils/suite/validation'; export interface TradingBuyFormProps { diff --git a/packages/suite/src/types/trading/tradingVerify.ts b/packages/suite/src/types/trading/tradingVerify.ts index 8c9a641d3be..519e3ea13f6 100644 --- a/packages/suite/src/types/trading/tradingVerify.ts +++ b/packages/suite/src/types/trading/tradingVerify.ts @@ -5,8 +5,8 @@ import { CryptoId } from 'invity-api'; import { AccountAddress } from '@trezor/connect'; -import type { Account } from 'src/types/wallet'; import { ExtendedMessageDescriptor } from 'src/types/suite'; +import type { Account } from 'src/types/wallet'; export interface TradingVerifyFormProps { address?: string; diff --git a/packages/suite/src/types/wallet/coinjoin.ts b/packages/suite/src/types/wallet/coinjoin.ts index e5e82515c1e..faada99707b 100644 --- a/packages/suite/src/types/wallet/coinjoin.ts +++ b/packages/suite/src/types/wallet/coinjoin.ts @@ -1,19 +1,19 @@ -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 { - RegisterAccountParams, + CoinjoinClientVersion, CoinjoinPrisonInmate, CoinjoinStatusEvent, - CoinjoinClientVersion, + RegisterAccountParams, } from '@trezor/coinjoin'; import { + EndRoundState, RoundPhase, SessionPhase, - EndRoundState, WabiSabiProtocolErrorCode, } from '@trezor/coinjoin/src/enums'; +import { PartialRecord } from '@trezor/type-utils'; import type { CoinjoinNetworksConfig } from 'src/services/coinjoin'; diff --git a/packages/suite/src/types/wallet/index.ts b/packages/suite/src/types/wallet/index.ts index 78b53c40804..3ce731db856 100644 --- a/packages/suite/src/types/wallet/index.ts +++ b/packages/suite/src/types/wallet/index.ts @@ -1,25 +1,25 @@ +import { tokenDefinitionsActions } from '@suite-common/token-definitions/src/tokenDefinitionsActions'; import { - discoveryActions, accountsActions, blockchainActions, - stakeActions, + discoveryActions, sendFormActions, + stakeActions, } 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 { TradingBuyAction } from 'src/actions/wallet/tradingBuyActions'; -import { TradingExchangeAction } from 'src/actions/wallet/tradingExchangeActions'; -import { TradingSellAction } from 'src/actions/wallet/tradingSellActions'; -import { TradingCommonAction } from 'src/actions/wallet/trading/tradingCommonActions'; -import { GraphAction } from 'src/actions/wallet/graphActions'; import { AccountSearchAction } from 'src/actions/wallet/accountSearchActions'; -import { FormDraftAction } from 'src/actions/wallet/formDraftActions'; import { CardanoStakingAction } from 'src/actions/wallet/cardanoStakingActions'; import { CoinjoinAccountAction } from 'src/actions/wallet/coinjoinAccountActions'; import { CoinjoinClientAction } from 'src/actions/wallet/coinjoinClientActions'; +import { FormDraftAction } from 'src/actions/wallet/formDraftActions'; +import { GraphAction } from 'src/actions/wallet/graphActions'; +import { ReceiveAction } from 'src/actions/wallet/receiveActions'; +import { SignVerifyAction } from 'src/actions/wallet/signVerifyActions'; +import { TradingCommonAction } from 'src/actions/wallet/trading/tradingCommonActions'; +import { TradingBuyAction } from 'src/actions/wallet/tradingBuyActions'; +import { TradingExchangeAction } from 'src/actions/wallet/tradingExchangeActions'; import { TradingInfoAction } from 'src/actions/wallet/tradingInfoActions'; +import { TradingSellAction } from 'src/actions/wallet/tradingSellActions'; // 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 d78be699b04..dbe3e399df6 100644 --- a/packages/suite/src/types/wallet/sendForm.ts +++ b/packages/suite/src/types/wallet/sendForm.ts @@ -1,8 +1,8 @@ import { Dispatch, SetStateAction } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; import { Network } from '@suite-common/wallet-config'; -import { AccountUtxo, FeeLevel, PROTO } from '@trezor/connect'; import { Account, AccountKey, @@ -17,13 +17,13 @@ import { UtxoSorting, WalletAccountTransaction, } from '@suite-common/wallet-types'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { AccountUtxo, FeeLevel, PROTO } from '@trezor/connect'; -import { GetCurrentRateParams } from 'src/hooks/wallet/useSendFormFields'; import { HandleAmountChangeParams, HandleFiatChangeParams, } from 'src/hooks/wallet/useSendFormChangeHandlers'; +import { GetCurrentRateParams } from 'src/hooks/wallet/useSendFormFields'; export type ExportFileType = 'csv' | 'pdf' | 'json'; diff --git a/packages/suite/src/types/wallet/tradingCommonTypes.ts b/packages/suite/src/types/wallet/tradingCommonTypes.ts index 51f135706a6..a75a6dd83d2 100644 --- a/packages/suite/src/types/wallet/tradingCommonTypes.ts +++ b/packages/suite/src/types/wallet/tradingCommonTypes.ts @@ -1,4 +1,4 @@ -import type { BuyTrade, SellFiatTrade, ExchangeTrade, FiatCurrencyCode } from 'invity-api'; +import type { BuyTrade, ExchangeTrade, FiatCurrencyCode, SellFiatTrade } from 'invity-api'; import type { FlagProps } from '@trezor/components'; diff --git a/packages/suite/src/utils/firmware/index.ts b/packages/suite/src/utils/firmware/index.ts index ec425ed1730..22715314a17 100644 --- a/packages/suite/src/utils/firmware/index.ts +++ b/packages/suite/src/utils/firmware/index.ts @@ -1,9 +1,9 @@ -import { valid, satisfies } from 'semver'; +import { satisfies, valid } from 'semver'; -import { getFirmwareVersion } from '@trezor/device-utils'; import { DeviceModelInternal, FirmwareType } from '@trezor/connect'; +import { getFirmwareVersion } from '@trezor/device-utils'; -import { type TrezorDevice, type ExtendedMessageDescriptor } from 'src/types/suite'; +import { type ExtendedMessageDescriptor, type TrezorDevice } from 'src/types/suite'; export const getFormattedFingerprint = (fingerprint: string) => [ diff --git a/packages/suite/src/utils/onboarding/steps.ts b/packages/suite/src/utils/onboarding/steps.ts index 898021d638f..cae4d6de57e 100644 --- a/packages/suite/src/utils/onboarding/steps.ts +++ b/packages/suite/src/utils/onboarding/steps.ts @@ -2,9 +2,9 @@ import { selectSelectedDevice } from '@suite-common/wallet-core'; import { getFirmwareVersion } from '@trezor/device-utils'; import { versionUtils } from '@trezor/utils'; -import { AnyStepId, AnyPath, Step } from 'src/types/onboarding'; -import { GetState } from 'src/types/suite'; import { ID_AUTHENTICATE_DEVICE_STEP } from 'src/constants/onboarding/steps'; +import { AnyPath, AnyStepId, Step } from 'src/types/onboarding'; +import { GetState } from 'src/types/suite'; export const isStepUsed = (step: Step, getState: GetState): boolean => { const state = getState(); diff --git a/packages/suite/src/utils/suite/__fixtures__/guide.ts b/packages/suite/src/utils/suite/__fixtures__/guide.ts index a9915f49337..77ef364fa4d 100644 --- a/packages/suite/src/utils/suite/__fixtures__/guide.ts +++ b/packages/suite/src/utils/suite/__fixtures__/guide.ts @@ -1,5 +1,5 @@ -import { testMocks } from '@suite-common/test-utils'; import { GuideArticle, GuideCategory } from '@suite-common/suite-types'; +import { testMocks } from '@suite-common/test-utils'; const { getGuideNode } = testMocks; diff --git a/packages/suite/src/utils/suite/__tests__/anchor.test.ts b/packages/suite/src/utils/suite/__tests__/anchor.test.ts index ef8c0044c92..fe19f33d943 100644 --- a/packages/suite/src/utils/suite/__tests__/anchor.test.ts +++ b/packages/suite/src/utils/suite/__tests__/anchor.test.ts @@ -1,5 +1,5 @@ -import * as anchorUtils from '../anchor'; import * as fixtures from '../__fixtures__/anchor'; +import * as anchorUtils from '../anchor'; describe('anchor utils', () => { test('getDefaultBackendType', () => { diff --git a/packages/suite/src/utils/suite/__tests__/ethereumStaking.test.ts b/packages/suite/src/utils/suite/__tests__/ethereumStaking.test.ts index c83600cb302..89e7ded0cec 100644 --- a/packages/suite/src/utils/suite/__tests__/ethereumStaking.test.ts +++ b/packages/suite/src/utils/suite/__tests__/ethereumStaking.test.ts @@ -1,3 +1,5 @@ +import { ValidatorsQueue } from '@suite-common/wallet-core'; +import { WalletAccountTransaction } from '@suite-common/wallet-types'; import TrezorConnect, { AccountInfo, InternalTransfer, @@ -9,49 +11,47 @@ 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 { - transformTx, - stake, - unstake, - claimWithdrawRequest, - getStakeFormsDefaultValues, - StakeTxBaseArgs, + claimFailedFixture, + claimFixture, + getAdjustedGasLimitConsumptionFixture, + getChangedInternalTxFixture, + getDaysToAddToPoolFixture, + getDaysToAddToPoolInitialFixture, + getDaysToUnstakeFixture, + getEthNetworkForWalletSdkFixture, + getInstantStakeTypeFixture, + getStakeFormsDefaultValuesFixture, + getStakeTxGasLimitFixture, + getUnstakingPeriodInDaysFixture, + simulateUnstakeFixture, + stakeFailedFixture, + stakeFixture, + transformTxFixtures, + unstakeFailedFixture, + unstakeFixture, +} from '../__fixtures__/ethereumStaking'; +import { GetStakeFormsDefaultValuesParams, GetStakeTxGasLimitParams, - getStakeTxGasLimit, - getUnstakingPeriodInDays, + StakeTxBaseArgs, + claimWithdrawRequest, + getAdjustedGasLimitConsumption, + getChangedInternalTx, getDaysToAddToPool, - getDaysToUnstake, getDaysToAddToPoolInitial, - getAdjustedGasLimitConsumption, + getDaysToUnstake, getEthNetworkForWalletSdk, getInstantStakeType, - getChangedInternalTx, + getStakeFormsDefaultValues, + getStakeTxGasLimit, + getUnstakingPeriodInDays, simulateUnstake, + stake, + transformTx, + unstake, } from '../ethereumStaking'; -import { - transformTxFixtures, - stakeFixture, - stakeFailedFixture, - unstakeFixture, - unstakeFailedFixture, - claimFixture, - claimFailedFixture, - getStakeFormsDefaultValuesFixture, - getStakeTxGasLimitFixture, - getUnstakingPeriodInDaysFixture, - getDaysToAddToPoolFixture, - getDaysToUnstakeFixture, - getDaysToAddToPoolInitialFixture, - getAdjustedGasLimitConsumptionFixture, - getEthNetworkForWalletSdkFixture, - getInstantStakeTypeFixture, - getChangedInternalTxFixture, - simulateUnstakeFixture, -} from '../__fixtures__/ethereumStaking'; describe('transformTx', () => { transformTxFixtures.forEach(test => { diff --git a/packages/suite/src/utils/suite/__tests__/flags.test.ts b/packages/suite/src/utils/suite/__tests__/flags.test.ts index f19825c105a..d37eade6e23 100644 --- a/packages/suite/src/utils/suite/__tests__/flags.test.ts +++ b/packages/suite/src/utils/suite/__tests__/flags.test.ts @@ -1,4 +1,4 @@ -import { isFlagPresent, addToFlags, HAS_EMAIL_FLAG, HAS_BOOKMARK_FLAG } from '../flags'; +import { HAS_BOOKMARK_FLAG, HAS_EMAIL_FLAG, addToFlags, isFlagPresent } from '../flags'; describe('flags utils', () => { it('should return bool indicating if flag is present for given number', () => { diff --git a/packages/suite/src/utils/suite/__tests__/guide.test.ts b/packages/suite/src/utils/suite/__tests__/guide.test.ts index 4dd58d8ea0e..4cc262db798 100644 --- a/packages/suite/src/utils/suite/__tests__/guide.test.ts +++ b/packages/suite/src/utils/suite/__tests__/guide.test.ts @@ -1,5 +1,5 @@ -import * as guideUtils from '../guide'; import * as fixtures from '../__fixtures__/guide'; +import * as guideUtils from '../guide'; describe('getNodeTitle', () => { fixtures.getNodeTitle.forEach(f => { diff --git a/packages/suite/src/utils/suite/__tests__/logsUtils.test.ts b/packages/suite/src/utils/suite/__tests__/logsUtils.test.ts index c47c5ed650f..2314cc4cf42 100644 --- a/packages/suite/src/utils/suite/__tests__/logsUtils.test.ts +++ b/packages/suite/src/utils/suite/__tests__/logsUtils.test.ts @@ -1,14 +1,14 @@ import { testMocks } from '@suite-common/test-utils'; -import { discoveryActions } from '@suite-common/wallet-core'; import { DiscoveryStatus } from '@suite-common/wallet-constants'; +import { discoveryActions } from '@suite-common/wallet-core'; import { StaticSessionId } from '@trezor/connect'; import { + REDACTED_REPLACEMENT, redactAccount, redactAction, redactDevice, redactDiscovery, - REDACTED_REPLACEMENT, } from 'src/utils/suite/logsUtils'; describe('logsUtils', () => { diff --git a/packages/suite/src/utils/suite/__tests__/metadata.test.ts b/packages/suite/src/utils/suite/__tests__/metadata.test.ts index 50d9d639bab..af8b38cba9b 100644 --- a/packages/suite/src/utils/suite/__tests__/metadata.test.ts +++ b/packages/suite/src/utils/suite/__tests__/metadata.test.ts @@ -1,12 +1,12 @@ import fs from 'fs'; import { - encrypt, + arrayBufferToBuffer, decrypt, - deriveMetadataKey, deriveAesKey, deriveFilename, - arrayBufferToBuffer, + deriveMetadataKey, + encrypt, urlSearchParams, } from '../metadata'; diff --git a/packages/suite/src/utils/suite/__tests__/parseUri.test.ts b/packages/suite/src/utils/suite/__tests__/parseUri.test.ts index 215dc886b37..ca172760373 100644 --- a/packages/suite/src/utils/suite/__tests__/parseUri.test.ts +++ b/packages/suite/src/utils/suite/__tests__/parseUri.test.ts @@ -1,4 +1,4 @@ -import { parseUri, parseQuery } from 'src/utils/suite/parseUri'; +import { parseQuery, parseUri } from 'src/utils/suite/parseUri'; import * as fixtures from '../__fixtures__/parseUri'; diff --git a/packages/suite/src/utils/suite/__tests__/router.test.ts b/packages/suite/src/utils/suite/__tests__/router.test.ts index 8f807908180..0316fb42863 100644 --- a/packages/suite/src/utils/suite/__tests__/router.test.ts +++ b/packages/suite/src/utils/suite/__tests__/router.test.ts @@ -1,11 +1,11 @@ import { + findRouteByName, getApp, getAppWithParams, - findRouteByName, - getRoute, getPrefixedURL, - stripPrefixedPathname, + getRoute, getTopLevelRoute, + stripPrefixedPathname, } from '../router'; const OLD_ENV = { ...process.env }; diff --git a/packages/suite/src/utils/suite/__tests__/tor.test.ts b/packages/suite/src/utils/suite/__tests__/tor.test.ts index 339bb5906a4..1c5dfbf5ed7 100644 --- a/packages/suite/src/utils/suite/__tests__/tor.test.ts +++ b/packages/suite/src/utils/suite/__tests__/tor.test.ts @@ -1,6 +1,6 @@ import { TOR_URLS } from '@trezor/urls'; -import { getTorUrlIfAvailable, getIsTorDomain, isOnionUrl } from 'src/utils/suite/tor'; +import { getIsTorDomain, getTorUrlIfAvailable, isOnionUrl } from 'src/utils/suite/tor'; describe('tor', () => { beforeAll(() => { diff --git a/packages/suite/src/utils/suite/analytics.ts b/packages/suite/src/utils/suite/analytics.ts index e6447ad44b9..4c5827eb30a 100644 --- a/packages/suite/src/utils/suite/analytics.ts +++ b/packages/suite/src/utils/suite/analytics.ts @@ -1,24 +1,24 @@ -import { AppUpdateEvent, SuiteAnalyticsEventSuiteReady } from '@trezor/suite-analytics'; +import { UNIT_ABBREVIATIONS } from '@suite-common/suite-constants'; +import { + selectRememberedHiddenWalletsCount, + selectRememberedStandardWalletsCount, +} from '@suite-common/wallet-core'; +import { getCustomBackends } from '@suite-common/wallet-utils'; import { - getScreenWidth, - getScreenHeight, getBrowserName, getBrowserVersion, getOsName, getOsVersion, - getWindowWidth, - getWindowHeight, getPlatformLanguages, + getScreenHeight, + getScreenWidth, + getWindowHeight, + getWindowWidth, isDesktop, } from '@trezor/env-utils'; -import { getCustomBackends } from '@suite-common/wallet-utils'; -import { UNIT_ABBREVIATIONS } from '@suite-common/suite-constants'; -import { desktopApi, UpdateInfo } from '@trezor/suite-desktop-api'; +import { AppUpdateEvent, SuiteAnalyticsEventSuiteReady } from '@trezor/suite-analytics'; +import { UpdateInfo, desktopApi } from '@trezor/suite-desktop-api'; import { GetSystemInformationResponse } from '@trezor/suite-desktop-api/src/messages'; -import { - selectRememberedStandardWalletsCount, - selectRememberedHiddenWalletsCount, -} from '@suite-common/wallet-core'; import { AccountTransactionBaseAnchor } from 'src/constants/suite/anchors'; import { AppState } from 'src/types/suite'; diff --git a/packages/suite/src/utils/suite/env.ts b/packages/suite/src/utils/suite/env.ts index 08567a6181b..52195e68b95 100644 --- a/packages/suite/src/utils/suite/env.ts +++ b/packages/suite/src/utils/suite/env.ts @@ -1,5 +1,5 @@ import { isDesktop } from '@trezor/env-utils'; -import { desktopApi, SuiteThemeVariant } from '@trezor/suite-desktop-api'; +import { SuiteThemeVariant, desktopApi } from '@trezor/suite-desktop-api'; export const submitRequestForm = async ( formMethod: 'GET' | 'POST' | 'IFRAME', diff --git a/packages/suite/src/utils/suite/ethereumStaking.ts b/packages/suite/src/utils/suite/ethereumStaking.ts index e4c3235fa50..c9a38e1bdef 100644 --- a/packages/suite/src/utils/suite/ethereumStaking.ts +++ b/packages/suite/src/utils/suite/ethereumStaking.ts @@ -1,32 +1,32 @@ -import { Ethereum, ETH_NETWORK_ADDRESSES, EthNetworkAddresses } from '@everstake/wallet-sdk'; +import { ETH_NETWORK_ADDRESSES, EthNetworkAddresses, Ethereum } from '@everstake/wallet-sdk'; import { fromWei, numberToHex, toWei } from 'web3-utils'; -import { - PrecomposedLevels, - StakeFormState, - StakeType, - WalletAccountTransaction, -} from '@suite-common/wallet-types'; +import type { NetworkSymbol } from '@suite-common/wallet-config'; import { DEFAULT_PAYMENT, - STAKE_GAS_LIMIT_RESERVE, MIN_ETH_AMOUNT_FOR_STAKING, + STAKE_GAS_LIMIT_RESERVE, UNSTAKE_INTERCHANGES, - WALLET_SDK_SOURCE, UNSTAKING_ETH_PERIOD, + WALLET_SDK_SOURCE, } from '@suite-common/wallet-constants'; -import type { NetworkSymbol } from '@suite-common/wallet-config'; +import { ValidatorsQueue } from '@suite-common/wallet-core'; +import { + PrecomposedLevels, + StakeFormState, + StakeType, + WalletAccountTransaction, +} from '@suite-common/wallet-types'; import { getEthereumEstimateFeeParams, isPending, isSupportedEthStakingNetworkSymbol, 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 TrezorConnect, { EthereumTransaction, InternalTransfer, Success } from '@trezor/connect'; import { BlockchainEstimatedFee } from '@trezor/connect/src/types/api/blockchainEstimateFee'; import { PartialRecord } from '@trezor/type-utils'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; const secondsToDays = (seconds: number) => Math.round(seconds / 60 / 60 / 24); diff --git a/packages/suite/src/utils/suite/logsUtils.ts b/packages/suite/src/utils/suite/logsUtils.ts index 167d81cd99e..52fddc75710 100644 --- a/packages/suite/src/utils/suite/logsUtils.ts +++ b/packages/suite/src/utils/suite/logsUtils.ts @@ -1,15 +1,26 @@ +import { LogEntry } from '@suite-common/logger'; +import { getPhysicalDeviceUniqueIds } from '@suite-common/suite-utils'; import { + accountsActions, + authorizeDeviceThunk, deviceActions, discoveryActions, - accountsActions, selectDevices, - authorizeDeviceThunk, } from '@suite-common/wallet-core'; +import { Discovery } from '@suite-common/wallet-types'; +import { getCustomBackends } from '@suite-common/wallet-utils'; +import { DEVICE } from '@trezor/connect'; +import { + getBootloaderHash, + getBootloaderVersion, + getFirmwareRevision, + getFirmwareVersion, +} from '@trezor/device-utils'; import { - getEnvironment, getBrowserName, getBrowserVersion, getCommitHash, + getEnvironment, getOsName, getOsVersion, getPlatformLanguages, @@ -20,24 +31,13 @@ import { getWindowWidth, isCodesignBuild, } from '@trezor/env-utils'; -import { LogEntry } from '@suite-common/logger'; -import { DEVICE } from '@trezor/connect'; -import { getCustomBackends } from '@suite-common/wallet-utils'; -import { - getBootloaderHash, - getBootloaderVersion, - getFirmwareRevision, - getFirmwareVersion, -} from '@trezor/device-utils'; import { DeepPartial } from '@trezor/type-utils'; -import { Discovery } from '@suite-common/wallet-types'; -import { getPhysicalDeviceUniqueIds } from '@suite-common/suite-utils'; -import { getIsTorEnabled } from 'src/utils/suite/tor'; -import { AppState, TrezorDevice } from 'src/types/suite'; import { METADATA_LABELING } from 'src/actions/suite/constants'; -import { Account } from 'src/types/wallet'; import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer'; +import { AppState, TrezorDevice } from 'src/types/suite'; +import { Account } from 'src/types/wallet'; +import { getIsTorEnabled } from 'src/utils/suite/tor'; export const REDACTED_REPLACEMENT = '[redacted]'; diff --git a/packages/suite/src/utils/suite/metadata.ts b/packages/suite/src/utils/suite/metadata.ts index b4d7e88cb1a..b41c72c4909 100644 --- a/packages/suite/src/utils/suite/metadata.ts +++ b/packages/suite/src/utils/suite/metadata.ts @@ -1,5 +1,5 @@ -import * as crypto from 'crypto'; import base58check from 'bs58check'; +import * as crypto from 'crypto'; import { DataType, MetadataProvider } from '@suite-common/metadata-types'; import { StaticSessionId } from '@trezor/connect'; diff --git a/packages/suite/src/utils/suite/notification.ts b/packages/suite/src/utils/suite/notification.ts index c80db2caac5..ac8f97be66d 100644 --- a/packages/suite/src/utils/suite/notification.ts +++ b/packages/suite/src/utils/suite/notification.ts @@ -1,8 +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 { AppState, ToastNotificationVariant } from 'src/types/suite'; 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 dbe7dbc8a31..04ae750a62c 100644 --- a/packages/suite/src/utils/suite/oauth.ts +++ b/packages/suite/src/utils/suite/oauth.ts @@ -1,9 +1,9 @@ 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 { urlHashParams, urlSearchParams } from 'src/utils/suite/metadata'; +import { getPrefixedURL } from 'src/utils/suite/router'; /** * For web, use oauth_receiver.html hosted on the same origin (localhost/sldev/trezor.io) diff --git a/packages/suite/src/utils/suite/prerequisites.ts b/packages/suite/src/utils/suite/prerequisites.ts index abb5f6f1302..418fbd5695d 100644 --- a/packages/suite/src/utils/suite/prerequisites.ts +++ b/packages/suite/src/utils/suite/prerequisites.ts @@ -2,7 +2,7 @@ import { DefinedUnionMember } from '@trezor/type-utils'; import { RouterState } from 'src/reducers/suite/routerReducer'; import type { TransportState } from 'src/reducers/suite/suiteReducer'; -import type { TrezorDevice, AppState } from 'src/types/suite'; +import type { AppState, TrezorDevice } from 'src/types/suite'; import { isAdditionalShamirBackupInProgress, diff --git a/packages/suite/src/utils/suite/protocol.ts b/packages/suite/src/utils/suite/protocol.ts index 9547bbda122..337fdd7fe23 100644 --- a/packages/suite/src/utils/suite/protocol.ts +++ b/packages/suite/src/utils/suite/protocol.ts @@ -1,6 +1,6 @@ import { Protocol } from '@suite-common/suite-constants'; import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; -import { analytics, EventType } from '@trezor/suite-analytics'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { parseQuery, parseUri } from './parseUri'; diff --git a/packages/suite/src/utils/suite/router.ts b/packages/suite/src/utils/suite/router.ts index e159b8d3718..9f9336e12c5 100644 --- a/packages/suite/src/utils/suite/router.ts +++ b/packages/suite/src/utils/suite/router.ts @@ -1,5 +1,5 @@ import { Route } from '@suite-common/suite-types'; -import { isAccountOfNetwork, getNetworkOptional } from '@suite-common/wallet-config'; +import { getNetworkOptional, isAccountOfNetwork } from '@suite-common/wallet-config'; import { WalletParams as CommonWalletParams } from '@suite-common/wallet-types'; import routes, { RouterAppWithParams } from 'src/constants/suite/routes'; diff --git a/packages/suite/src/utils/suite/sentry.ts b/packages/suite/src/utils/suite/sentry.ts index 3e6d1936492..be395b535a7 100644 --- a/packages/suite/src/utils/suite/sentry.ts +++ b/packages/suite/src/utils/suite/sentry.ts @@ -4,7 +4,7 @@ import { allowReportTag } from '@suite-common/sentry'; import { selectSelectedDevice } from '@suite-common/wallet-core'; import { Dispatch, GetState } from 'src/types/suite'; -import { redactDevice, redactDiscovery, getApplicationLog } from 'src/utils/suite/logsUtils'; +import { getApplicationLog, redactDevice, redactDiscovery } from 'src/utils/suite/logsUtils'; export const setSentryContext = Sentry.setContext; diff --git a/packages/suite/src/utils/suite/solanaStaking.ts b/packages/suite/src/utils/suite/solanaStaking.ts index ac1b8a6a715..8768a91a799 100644 --- a/packages/suite/src/utils/suite/solanaStaking.ts +++ b/packages/suite/src/utils/suite/solanaStaking.ts @@ -1,13 +1,13 @@ -import { VersionedTransaction, PublicKey } from '@solana/web3.js-version1'; +import { PublicKey, VersionedTransaction } from '@solana/web3.js-version1'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { WALLET_SDK_SOURCE } from '@suite-common/wallet-constants'; +import { Blockchain } from '@suite-common/wallet-types'; import { networkAmountToSmallestUnit, selectSolanaWalletSdkNetwork, } from '@suite-common/wallet-utils'; import type { SolanaSignTransaction } from '@trezor/connect'; -import { Blockchain } from '@suite-common/wallet-types'; type SolanaTx = SolanaSignTransaction & { versionedTx: VersionedTransaction; diff --git a/packages/suite/src/utils/suite/storage.ts b/packages/suite/src/utils/suite/storage.ts index 3b27a8d655f..bfb2417683a 100644 --- a/packages/suite/src/utils/suite/storage.ts +++ b/packages/suite/src/utils/suite/storage.ts @@ -1,6 +1,6 @@ -import { Discovery } from '@suite-common/wallet-types'; import { connectInitThunk } from '@suite-common/connect-init'; import { DeviceWithEmptyPath } from '@suite-common/suite-types'; +import { Discovery } from '@suite-common/wallet-types'; import { AcquiredDevice } from 'src/types/suite'; import { CoinjoinAccount } from 'src/types/wallet/coinjoin'; diff --git a/packages/suite/src/utils/suite/tor.ts b/packages/suite/src/utils/suite/tor.ts index f5d7f210f55..6cadd42fbb1 100644 --- a/packages/suite/src/utils/suite/tor.ts +++ b/packages/suite/src/utils/suite/tor.ts @@ -1,5 +1,5 @@ -import { parseHostname, urlToOnion } from '@trezor/utils'; import { TOR_URLS } from '@trezor/urls'; +import { parseHostname, urlToOnion } from '@trezor/utils'; import { TorStatus } from 'src/types/suite'; diff --git a/packages/suite/src/utils/wallet/__tests__/coinjoinUtils.test.ts b/packages/suite/src/utils/wallet/__tests__/coinjoinUtils.test.ts index b6ee64293f4..181c70958ad 100644 --- a/packages/suite/src/utils/wallet/__tests__/coinjoinUtils.test.ts +++ b/packages/suite/src/utils/wallet/__tests__/coinjoinUtils.test.ts @@ -1,5 +1,5 @@ -import * as coinjoinUtils from '../coinjoinUtils'; import * as fixtures from '../__fixtures__/coinjoinUtils'; +import * as coinjoinUtils from '../coinjoinUtils'; describe('breakdownCoinjoinBalance', () => { it('works without session', () => { diff --git a/packages/suite/src/utils/wallet/__tests__/filterAndCategorizeUtxosUtils.test.ts b/packages/suite/src/utils/wallet/__tests__/filterAndCategorizeUtxosUtils.test.ts index d39c0e597e4..317968be961 100644 --- a/packages/suite/src/utils/wallet/__tests__/filterAndCategorizeUtxosUtils.test.ts +++ b/packages/suite/src/utils/wallet/__tests__/filterAndCategorizeUtxosUtils.test.ts @@ -1,5 +1,5 @@ -import * as filterAndCategorizeUtxos from '../filterAndCategorizeUtxosUtils'; import * as fixtures from '../__fixtures__/filterAndCategorizeUtxosFixture'; +import * as filterAndCategorizeUtxos from '../filterAndCategorizeUtxosUtils'; describe('filterAndCategorizeUtxos', () => { it('filter and categorizes correctly while searching by address', () => { diff --git a/packages/suite/src/utils/wallet/coinjoinUtils.ts b/packages/suite/src/utils/wallet/coinjoinUtils.ts index 00abe42d43d..4b1cb73c53c 100644 --- a/packages/suite/src/utils/wallet/coinjoinUtils.ts +++ b/packages/suite/src/utils/wallet/coinjoinUtils.ts @@ -1,26 +1,26 @@ 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 { BITCOIN_ONLY_SYMBOLS } from '@suite-common/suite-constants'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { Account, SelectedAccountStatus } from '@suite-common/wallet-types'; +import { getBip43Type, getUtxoOutpoint } from '@suite-common/wallet-utils'; import { AnonymitySet } from '@trezor/blockchain-link'; import { CoinjoinStatusEvent, - RegisterAccountParams, CoinjoinTransactionData, - SessionPhase, + RegisterAccountParams, RoundPhase, + SessionPhase, } from '@trezor/coinjoin'; -import { NetworkSymbol } from '@suite-common/wallet-config'; import { isArrayMember } from '@trezor/utils'; -import { BITCOIN_ONLY_SYMBOLS } from '@suite-common/suite-constants'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { ANONYMITY_GAINS_HINDSIGHT_COUNT, ANONYMITY_GAINS_HINDSIGHT_DAYS, - MAX_ROUNDS_ALLOWED, ESTIMATED_MIN_ROUNDS_NEEDED, + MAX_ROUNDS_ALLOWED, SKIP_ROUNDS_VALUE_WHEN_ENABLED, } from 'src/services/coinjoin/config'; import type { CoinjoinSymbol } from 'src/services/coinjoin/config'; diff --git a/packages/suite/src/utils/wallet/exportTransactionsUtils.ts b/packages/suite/src/utils/wallet/exportTransactionsUtils.ts index 3e0a716b826..214900e88e7 100644 --- a/packages/suite/src/utils/wallet/exportTransactionsUtils.ts +++ b/packages/suite/src/utils/wallet/exportTransactionsUtils.ts @@ -5,7 +5,7 @@ import { fromWei } from 'web3-utils'; import { FiatCurrencyCode } from '@suite-common/suite-config'; import { trezorLogo } from '@suite-common/suite-constants'; import { TokenDefinitions, getIsPhishingTransaction } from '@suite-common/token-definitions'; -import { getNetworkDisplaySymbol, NetworkSymbol } from '@suite-common/wallet-config'; +import { NetworkSymbol, getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { ExportFileType, RatesByTimestamps, @@ -13,8 +13,6 @@ import { TokenAddress, WalletAccountTransaction, } from '@suite-common/wallet-types'; -import { TransactionTarget } from '@trezor/connect'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; import { formatAmount, formatNetworkAmount, @@ -24,6 +22,8 @@ import { localizeNumber, roundTimestampToNearestPastHour, } from '@suite-common/wallet-utils'; +import { TransactionTarget } from '@trezor/connect'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; type AccountTransactionForExports = Omit & { targets: (TransactionTarget & { metadataLabel?: string })[]; diff --git a/packages/suite/src/utils/wallet/graph/utils.ts b/packages/suite/src/utils/wallet/graph/utils.ts index fc56d5cf351..9b9283062f6 100644 --- a/packages/suite/src/utils/wallet/graph/utils.ts +++ b/packages/suite/src/utils/wallet/graph/utils.ts @@ -1,13 +1,13 @@ import { differenceInMonths } from 'date-fns'; import { getFiatRatesForTimestamps } from '@suite-common/fiat-services'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; import { resetTime } from '@suite-common/suite-utils'; -import { getNetwork, type NetworkSymbol } from '@suite-common/wallet-config'; +import { type NetworkSymbol, getNetwork } 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 type { BlockchainAccountBalanceHistory, StaticSessionId } from '@trezor/connect'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { CommonAggregatedHistory, GraphData, GraphRange, GraphScale } from 'src/types/wallet/graph'; diff --git a/packages/suite/src/utils/wallet/graph/utilsWorker.ts b/packages/suite/src/utils/wallet/graph/utilsWorker.ts index de731ad8238..bd746b7ccda 100644 --- a/packages/suite/src/utils/wallet/graph/utilsWorker.ts +++ b/packages/suite/src/utils/wallet/graph/utilsWorker.ts @@ -1,8 +1,8 @@ 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 type { FiatRatesBySymbol } from '@trezor/connect'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { AggregatedAccountHistory, diff --git a/packages/suite/src/utils/wallet/tokenUtils.ts b/packages/suite/src/utils/wallet/tokenUtils.ts index 3e39ba0e360..251b00fa975 100644 --- a/packages/suite/src/utils/wallet/tokenUtils.ts +++ b/packages/suite/src/utils/wallet/tokenUtils.ts @@ -1,19 +1,19 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Account, Rate, TokenAddress, RatesByKey } from '@suite-common/wallet-types'; -import { TokenInfo } from '@trezor/connect'; -import { - getFiatRateKey, - isNftMatchesSearch, - isNftToken, - isTokenMatchesSearch, -} from '@suite-common/wallet-utils'; -import { NetworkSymbol, getNetworkFeatures } from '@suite-common/wallet-config'; import { FiatCurrencyCode } from '@suite-common/suite-config'; import { EnhancedTokenInfo, TokenDefinition, isTokenDefinitionKnown, } from '@suite-common/token-definitions'; +import { NetworkSymbol, getNetworkFeatures } from '@suite-common/wallet-config'; +import { Account, Rate, RatesByKey, TokenAddress } from '@suite-common/wallet-types'; +import { + getFiatRateKey, + isNftMatchesSearch, + isNftToken, + isTokenMatchesSearch, +} from '@suite-common/wallet-utils'; +import { TokenInfo } from '@trezor/connect'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; export interface TokensWithRates extends TokenInfo { fiatValue: BigNumber; diff --git a/packages/suite/src/utils/wallet/trading/__tests__/buyUtils.test.ts b/packages/suite/src/utils/wallet/trading/__tests__/buyUtils.test.ts index 28f49ae0dc4..f4744051f65 100644 --- a/packages/suite/src/utils/wallet/trading/__tests__/buyUtils.test.ts +++ b/packages/suite/src/utils/wallet/trading/__tests__/buyUtils.test.ts @@ -1,10 +1,10 @@ import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import * as fixtures from 'src/utils/wallet/trading/__fixtures__/buyUtils'; import { - getAmountLimits, createQuoteLink, - getStatusMessage, createTxLink, + getAmountLimits, + getStatusMessage, } from 'src/utils/wallet/trading/buyUtils'; const { diff --git a/packages/suite/src/utils/wallet/trading/__tests__/exchangeUtils.test.ts b/packages/suite/src/utils/wallet/trading/__tests__/exchangeUtils.test.ts index f6870936c47..256cfbcd67f 100644 --- a/packages/suite/src/utils/wallet/trading/__tests__/exchangeUtils.test.ts +++ b/packages/suite/src/utils/wallet/trading/__tests__/exchangeUtils.test.ts @@ -3,11 +3,11 @@ import { CryptoId } from 'invity-api'; import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import * as fixtures from 'src/utils/wallet/trading/__fixtures__/exchangeUtils'; import { - tradingGetExchangeReceiveCryptoId, getAmountLimits, getStatusMessage, getSuccessQuotesOrdered, isQuoteError, + tradingGetExchangeReceiveCryptoId, } from 'src/utils/wallet/trading/exchangeUtils'; jest.mock('src/hooks/wallet/trading/useTradingInfo', () => ({ diff --git a/packages/suite/src/utils/wallet/trading/__tests__/sellUtils.test.ts b/packages/suite/src/utils/wallet/trading/__tests__/sellUtils.test.ts index 1722dc2a7c3..d287efce592 100644 --- a/packages/suite/src/utils/wallet/trading/__tests__/sellUtils.test.ts +++ b/packages/suite/src/utils/wallet/trading/__tests__/sellUtils.test.ts @@ -1,13 +1,13 @@ +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { ComposedTransactionInfo } from 'src/reducers/wallet/tradingReducer'; +import { Account } from 'src/types/wallet'; +import * as fixtures from 'src/utils/wallet/trading/__fixtures__/sellUtils'; import { - getStatusMessage, + createQuoteLink, formatIban, getAmountLimits, - createQuoteLink, + getStatusMessage, } from 'src/utils/wallet/trading/sellUtils'; -import { Account } from 'src/types/wallet'; -import { ComposedTransactionInfo } from 'src/reducers/wallet/tradingReducer'; -import * as fixtures from 'src/utils/wallet/trading/__fixtures__/sellUtils'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; const { QUOTE_REQUEST_FIAT, diff --git a/packages/suite/src/utils/wallet/trading/__tests__/tradingUtils.test.ts b/packages/suite/src/utils/wallet/trading/__tests__/tradingUtils.test.ts index 68ee5f44c49..2ad3a754ff5 100644 --- a/packages/suite/src/utils/wallet/trading/__tests__/tradingUtils.test.ts +++ b/packages/suite/src/utils/wallet/trading/__tests__/tradingUtils.test.ts @@ -1,25 +1,10 @@ import { CryptoId } from 'invity-api'; +import { useDefaultAccountLabel } from 'src/hooks/suite/useDefaultAccountLabel'; import { Account } from 'src/types/wallet'; -import { - buildFiatOption, - getUnusedAddressFromAccount, - getCountryLabelParts, - mapTestnetSymbol, - getTagAndInfoNote, - getBestRatedQuote, - addIdsToQuotes, - filterQuotesAccordingTags, - tradingGetSortedAccounts, - tradingBuildAccountOptions, - tradingGetRoundedFiatAmount, - tradingGetAmountLabels, - tradingGetAccountLabel, - testnetToProdCryptoId, - getAddressAndTokenFromAccountOptionsGroupProps, - isCryptoIdForNativeToken, - getTradeTypeByRoute, -} from 'src/utils/wallet/trading/tradingUtils'; +import * as BUY_FIXTURE from 'src/utils/wallet/trading/__fixtures__/buyUtils'; +import * as EXCHANGE_FIXTURE from 'src/utils/wallet/trading/__fixtures__/exchangeUtils'; +import * as SELL_FIXTURE from 'src/utils/wallet/trading/__fixtures__/sellUtils'; import { FIXTURE_ACCOUNTS, FIXTURE_ACCOUNT_OPTIONS, @@ -27,10 +12,25 @@ import { accountEth, coinDefinitions, } from 'src/utils/wallet/trading/__fixtures__/tradingUtils'; -import * as BUY_FIXTURE from 'src/utils/wallet/trading/__fixtures__/buyUtils'; -import * as SELL_FIXTURE from 'src/utils/wallet/trading/__fixtures__/sellUtils'; -import * as EXCHANGE_FIXTURE from 'src/utils/wallet/trading/__fixtures__/exchangeUtils'; -import { useDefaultAccountLabel } from 'src/hooks/suite/useDefaultAccountLabel'; +import { + addIdsToQuotes, + buildFiatOption, + filterQuotesAccordingTags, + getAddressAndTokenFromAccountOptionsGroupProps, + getBestRatedQuote, + getCountryLabelParts, + getTagAndInfoNote, + getTradeTypeByRoute, + getUnusedAddressFromAccount, + isCryptoIdForNativeToken, + mapTestnetSymbol, + testnetToProdCryptoId, + tradingBuildAccountOptions, + tradingGetAccountLabel, + tradingGetAmountLabels, + tradingGetRoundedFiatAmount, + tradingGetSortedAccounts, +} from 'src/utils/wallet/trading/tradingUtils'; jest.mock('src/hooks/suite/useDefaultAccountLabel', () => ({ ...jest.requireActual('src/hooks/suite/useDefaultAccountLabel'), diff --git a/packages/suite/src/utils/wallet/trading/buyUtils.ts b/packages/suite/src/utils/wallet/trading/buyUtils.ts index 225b122fff6..6e49681588d 100644 --- a/packages/suite/src/utils/wallet/trading/buyUtils.ts +++ b/packages/suite/src/utils/wallet/trading/buyUtils.ts @@ -1,7 +1,7 @@ import { BuyTrade, BuyTradeQuoteRequest, BuyTradeStatus } from 'invity-api'; +import { getLocationOrigin, isDesktop } from '@trezor/env-utils'; import { desktopApi } from '@trezor/suite-desktop-api'; -import { isDesktop, getLocationOrigin } from '@trezor/env-utils'; import { Account } from 'src/types/wallet'; import { AmountLimitProps } from 'src/utils/suite/validation'; diff --git a/packages/suite/src/utils/wallet/trading/exchangeUtils.ts b/packages/suite/src/utils/wallet/trading/exchangeUtils.ts index cf1572c5dae..0844caa7001 100644 --- a/packages/suite/src/utils/wallet/trading/exchangeUtils.ts +++ b/packages/suite/src/utils/wallet/trading/exchangeUtils.ts @@ -9,15 +9,15 @@ import { getLocationOrigin, isDesktop } from '@trezor/env-utils'; import { desktopApi } from '@trezor/suite-desktop-api'; import { ExchangeInfo } from 'src/actions/wallet/tradingExchangeActions'; -import { RateType } from 'src/types/trading/tradingForm'; import { FORM_DEFAULT_CRYPTO_CURRENCY, FORM_DEFAULT_CRYPTO_SECONDARY_CURRENCY, FORM_RATE_FIXED, FORM_RATE_FLOATING, } from 'src/constants/wallet/trading/form'; -import { Account } from 'src/types/wallet'; import { ComposedTransactionInfo } from 'src/reducers/wallet/tradingReducer'; +import { RateType } from 'src/types/trading/tradingForm'; +import { Account } from 'src/types/wallet'; import { CryptoAmountLimitProps } from 'src/utils/suite/validation'; type GetAmountLimitsProps = { diff --git a/packages/suite/src/utils/wallet/trading/sellUtils.ts b/packages/suite/src/utils/wallet/trading/sellUtils.ts index c1d893d6794..6ba9077132a 100644 --- a/packages/suite/src/utils/wallet/trading/sellUtils.ts +++ b/packages/suite/src/utils/wallet/trading/sellUtils.ts @@ -1,10 +1,10 @@ import { SellFiatTrade, SellFiatTradeQuoteRequest, SellTradeStatus } from 'invity-api'; +import { getLocationOrigin, isDesktop } from '@trezor/env-utils'; import { desktopApi } from '@trezor/suite-desktop-api'; -import { isDesktop, getLocationOrigin } from '@trezor/env-utils'; -import { Account } from 'src/types/wallet'; import { ComposedTransactionInfo } from 'src/reducers/wallet/tradingReducer'; +import { Account } from 'src/types/wallet'; import type { AmountLimitProps } from 'src/utils/suite/validation'; type GetAmountLimitsProps = { diff --git a/packages/suite/src/utils/wallet/trading/tradingTypingUtils.ts b/packages/suite/src/utils/wallet/trading/tradingTypingUtils.ts index fd45b2b8673..0cd01aa6a9f 100644 --- a/packages/suite/src/utils/wallet/trading/tradingTypingUtils.ts +++ b/packages/suite/src/utils/wallet/trading/tradingTypingUtils.ts @@ -1,6 +1,5 @@ import { BuyTrade, ExchangeTrade, SellFiatTrade } from 'invity-api'; -import { CurrencyOption } from '@suite-common/wallet-types'; import type { TradingBuyType, TradingExchangeType, @@ -8,6 +7,7 @@ import type { TradingTradeType, TradingType, } from '@suite-common/invity'; +import { CurrencyOption } from '@suite-common/wallet-types'; import { FORM_FIAT_CURRENCY_SELECT, FORM_OUTPUT_CURRENCY } from 'src/constants/wallet/trading/form'; import { diff --git a/packages/suite/src/utils/wallet/trading/tradingUtils.ts b/packages/suite/src/utils/wallet/trading/tradingUtils.ts index cc7047d3df0..7b67a6b78b3 100644 --- a/packages/suite/src/utils/wallet/trading/tradingUtils.ts +++ b/packages/suite/src/utils/wallet/trading/tradingUtils.ts @@ -1,6 +1,8 @@ -import { BuyTrade, SellFiatTrade, CryptoId, ExchangeTrade } from 'invity-api'; +import { BuyTrade, CryptoId, ExchangeTrade, SellFiatTrade } from 'invity-api'; import { v4 as uuidv4 } from 'uuid'; +import { type TradingTradeType, type TradingType, regional } from '@suite-common/invity'; +import { DefinitionType, isTokenDefinitionKnown } from '@suite-common/token-definitions'; import { Network, NetworkSymbol, @@ -13,17 +15,14 @@ import { getNetworkFeatures, getNetworkType, } from '@suite-common/wallet-config'; -import TrezorConnect from '@trezor/connect'; -import { DefinitionType, isTokenDefinitionKnown } from '@suite-common/token-definitions'; import { getContractAddressForNetworkSymbol, - substituteBip43Path, sortByCoin, + substituteBip43Path, } from '@suite-common/wallet-utils'; +import TrezorConnect from '@trezor/connect'; import { BigNumber } from '@trezor/utils'; -import { regional, type TradingTradeType, type TradingType } from '@suite-common/invity'; -import { Account } from 'src/types/wallet'; import { ExtendedMessageDescriptor, Route, TrezorDevice } from 'src/types/suite'; import { TradingAccountOptionsGroupOptionProps, @@ -36,6 +35,7 @@ import { TradingTradeBuySellType, TradingTradeDetailMapProps, } from 'src/types/trading/trading'; +import { Account } from 'src/types/wallet'; export const cryptoPlatformSeparator = '--'; /** diff --git a/packages/suite/src/views/backup/Backup.tsx b/packages/suite/src/views/backup/Backup.tsx index 72fb72cc126..76b5ae60282 100644 --- a/packages/suite/src/views/backup/Backup.tsx +++ b/packages/suite/src/views/backup/Backup.tsx @@ -1,12 +1,12 @@ import { ReactNode } from 'react'; -import { Image, Column, NewModal, Text } from '@trezor/components'; -import { HELP_CENTER_RECOVERY_ISSUES_URL } from '@trezor/urls'; import { isDeviceAcquired } from '@suite-common/suite-utils'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { Column, Image, NewModal, Text } from '@trezor/components'; +import { HELP_CENTER_RECOVERY_ISSUES_URL } from '@trezor/urls'; -import { useSelector } from 'src/hooks/suite'; import { Translation, TrezorLink } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; import type { ForegroundAppProps } from 'src/types/suite'; import { BackupStep1Initial } from './BackupStep1Initial'; diff --git a/packages/suite/src/views/backup/BackupStep1Initial.tsx b/packages/suite/src/views/backup/BackupStep1Initial.tsx index 9d1b4d6702b..34c5edb97e5 100644 --- a/packages/suite/src/views/backup/BackupStep1Initial.tsx +++ b/packages/suite/src/views/backup/BackupStep1Initial.tsx @@ -1,15 +1,15 @@ -import { Paragraph, NewModal } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { NewModal, Paragraph } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { backupDevice, ConfirmKey } from 'src/actions/backup/backupActions'; -import { Translation } from 'src/components/suite'; +import { ConfirmKey, backupDevice } from 'src/actions/backup/backupActions'; import { PreBackupCheckboxes } from 'src/components/backup'; +import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsDeviceLocked } from 'src/reducers/suite/suiteReducer'; -import { BackupState } from '../../reducers/backup/backupReducer'; import { BackupStepDescription } from './BackupStepDescription'; +import { BackupState } from '../../reducers/backup/backupReducer'; const canStart = (userConfirmed: ConfirmKey[], isDeviceLocked: boolean) => (['has-enough-time', 'is-in-private', 'understands-what-seed-is'] as const).every(e => diff --git a/packages/suite/src/views/backup/BackupStep3Finished.tsx b/packages/suite/src/views/backup/BackupStep3Finished.tsx index 3164210cef8..41c7a12549b 100644 --- a/packages/suite/src/views/backup/BackupStep3Finished.tsx +++ b/packages/suite/src/views/backup/BackupStep3Finished.tsx @@ -1,4 +1,4 @@ -import { Paragraph, NewModal } from '@trezor/components'; +import { NewModal, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/backup/BackupStepError.tsx b/packages/suite/src/views/backup/BackupStepError.tsx index 0bd283b9e44..c15c5a9efe0 100644 --- a/packages/suite/src/views/backup/BackupStepError.tsx +++ b/packages/suite/src/views/backup/BackupStepError.tsx @@ -1,4 +1,4 @@ -import { Paragraph, NewModal } from '@trezor/components'; +import { NewModal, Paragraph } from '@trezor/components'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx index 816840e584e..59787a007bf 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCard.tsx @@ -3,26 +3,27 @@ import { useDispatch } from 'react-redux'; import styled, { useTheme } from 'styled-components'; +import { AssetFiatBalance } from '@suite-common/assets'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { selectCoinDefinitions } from '@suite-common/token-definitions'; import { Network } from '@suite-common/wallet-config'; -import { spacings, spacingsPx, typography } from '@trezor/theme'; +import { selectDebugFilteredAssetAccountsThatStaked } from '@suite-common/wallet-core'; +import { Account, RatesByKey } from '@suite-common/wallet-types'; +import { isTestnet } from '@suite-common/wallet-utils'; import { Card, Column, H2, Icon, + InfoItem, Row, SkeletonRectangle, variables, - InfoItem, } from '@trezor/components'; -import { AssetFiatBalance } from '@suite-common/assets'; import { TokenInfo } from '@trezor/connect'; -import { Account, RatesByKey } from '@suite-common/wallet-types'; -import { isTestnet } from '@suite-common/wallet-utils'; -import { selectDebugFilteredAssetAccountsThatStaked } from '@suite-common/wallet-core'; -import { selectCoinDefinitions } from '@suite-common/token-definitions'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { spacings, spacingsPx, typography } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; import { AmountUnitSwitchWrapper, CoinBalance, @@ -30,9 +31,8 @@ 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 { useAccountSearch, useLoadingSkeleton, useSelector } from 'src/hooks/suite'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; import { TradingBuyButton } from '../TradingBuyButton'; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardInfo.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardInfo.tsx index 6f1070c936a..b7f639f0cac 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardInfo.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardInfo.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { Network } from '@suite-common/wallet-config'; import { AssetFiatBalance } from '@suite-common/assets'; +import { Network } from '@suite-common/wallet-config'; import { Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardTokensAndStakingInfo.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardTokensAndStakingInfo.tsx index 5df0de18ae5..79de1b554d1 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardTokensAndStakingInfo.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCard/AssetCardTokensAndStakingInfo.tsx @@ -1,7 +1,7 @@ -import { Row, Column, Icon, Divider, Text } from '@trezor/components'; import type { NetworkSymbol } from '@suite-common/wallet-config'; -import { spacings } from '@trezor/theme'; import { Account } from '@suite-common/wallet-types'; +import { Column, Divider, Icon, Row, Text } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { CoinBalance, FiatValue, HiddenPlaceholder, Translation } from 'src/components/suite'; import { TokenIconSetWrapper } from 'src/components/wallet/TokenIconSetWrapper'; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetCoinLogo.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetCoinLogo.tsx index 855843257e8..0e43a88afe4 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCoinLogo.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCoinLogo.tsx @@ -3,13 +3,13 @@ import { AssetFiatBalanceWithPercentage, calculateAssetsPercentage, } from '@suite-common/assets'; -import { Row, SkeletonCircle, Tooltip } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { localizePercentage } from '@suite-common/wallet-utils'; +import { Row, SkeletonCircle, Tooltip } from '@trezor/components'; import { AssetShareIndicator } from '@trezor/product-components'; -import { selectLanguage } from 'src/reducers/suite/suiteReducer'; import { useSelector } from 'src/hooks/suite'; +import { selectLanguage } from 'src/reducers/suite/suiteReducer'; 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 01fff534632..a1847a7b76d 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetCoinName.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetCoinName.tsx @@ -1,6 +1,6 @@ import { Network } from '@suite-common/wallet-config'; import { selectVisibleNonEmptyDeviceAccountsByNetworkSymbol } from '@suite-common/wallet-core'; -import { SkeletonRectangle, Note, Column } from '@trezor/components'; +import { Column, Note, SkeletonRectangle } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRow.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRow.tsx index 72bfd1d9e7f..3d46efaba54 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRow.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRow.tsx @@ -2,17 +2,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 { AssetFiatBalance } from '@suite-common/assets'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; import { selectCoinDefinitions } from '@suite-common/token-definitions'; +import { Network } from '@suite-common/wallet-config'; import { selectDebugFilteredAssetAccountsThatStaked } 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 { isTestnet } from '@suite-common/wallet-utils'; +import { TokenInfo } from '@trezor/blockchain-link-types'; +import { Column, Icon, IconButton, Row, Table, Text } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; import { AmountUnitSwitchWrapper, CoinBalance, @@ -21,17 +22,16 @@ import { Translation, TrendTicker, } from 'src/components/suite'; -import { goto } from 'src/actions/suite/routerActions'; -import { useAccountSearch, useDispatch, useSelector } from 'src/hooks/suite'; import { TokenIconSetWrapper } from 'src/components/wallet/TokenIconSetWrapper'; +import { useAccountSearch, useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; import { AssetCoinLogo } from '../AssetCoinLogo'; import { AssetCoinName } from '../AssetCoinName'; import { TradingBuyButton } from '../TradingBuyButton'; -import { AssetTokenRow } from './AssetTokenRow'; import { AssetStakingRow } from './AssetStakingRow'; import { AssetTableExtraRowsSection as Section } from './AssetTableExtraRowsSection'; +import { AssetTokenRow } from './AssetTokenRow'; 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 4dc79e0d93b..ee399bab810 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRowSkeleton.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetRowSkeleton.tsx @@ -1,4 +1,4 @@ -import { Row, Table, SkeletonRectangle } from '@trezor/components'; +import { Row, SkeletonRectangle, Table } from '@trezor/components'; import { useLoadingSkeleton } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetStakingRow.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetStakingRow.tsx index ef8cfffd3ab..65a623bf0de 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetStakingRow.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetStakingRow.tsx @@ -1,8 +1,8 @@ +import { NetworkSymbol } from '@suite-common/wallet-config'; import { Column, Icon, Table, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import { CoinBalance, HiddenPlaceholder, Translation, FiatValue } from 'src/components/suite'; +import { CoinBalance, FiatValue, HiddenPlaceholder, Translation } from 'src/components/suite'; import { AssetTableExtraRowsSection as Section } from './AssetTableExtraRowsSection'; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTable.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTable.tsx index 3113f172e0b..dd740bfa57e 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTable.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTable.tsx @@ -1,14 +1,14 @@ -import { Table } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { AssetFiatBalance } from '@suite-common/assets'; -import { RatesByKey } from '@suite-common/wallet-types'; import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { RatesByKey } from '@suite-common/wallet-types'; +import { Table } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { AssetData } from '../AssetsView'; -import { AssetRowSkeleton } from './AssetRowSkeleton'; import { AssetRow } from './AssetRow'; +import { AssetRowSkeleton } from './AssetRowSkeleton'; interface AssetTableProps { discoveryInProgress?: boolean; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTokenRow.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTokenRow.tsx index 3b38bd7b533..5e608cc45df 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTokenRow.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTokenRow.tsx @@ -1,6 +1,6 @@ +import { Network } from '@suite-common/wallet-config'; import { Table } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Network } from '@suite-common/wallet-config'; import { FiatValue, Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx b/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx index d96564ab727..63dc5bbc611 100644 --- a/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx @@ -1,36 +1,36 @@ import styled, { useTheme } from 'styled-components'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Icon, Button, LoadingContent, Card, Row } from '@trezor/components'; -import { selectCurrentFiatRates } from '@suite-common/wallet-core'; -import { TokenInfo } from '@trezor/blockchain-link-types'; import { AssetFiatBalance } from '@suite-common/assets'; -import { spacings, spacingsPx, typography } from '@trezor/theme'; -import { - getFiatRateKey, - toFiatCurrency, - isSupportedEthStakingNetworkSymbol, - isSupportedSolStakingNetworkSymbol, -} from '@suite-common/wallet-utils'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; import { + type Network, type NetworkSymbol, getNetwork, - type Network, isNetworkSymbol, } from '@suite-common/wallet-config'; +import { selectCurrentFiatRates } from '@suite-common/wallet-core'; import { RatesByKey } from '@suite-common/wallet-types'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { + getFiatRateKey, + isSupportedEthStakingNetworkSymbol, + isSupportedSolStakingNetworkSymbol, + toFiatCurrency, +} from '@suite-common/wallet-utils'; +import { TokenInfo } from '@trezor/blockchain-link-types'; +import { Button, Card, Icon, LoadingContent, Row } from '@trezor/components'; +import { spacings, spacingsPx, typography } from '@trezor/theme'; import { PartialRecord } from '@trezor/type-utils'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { goto } from 'src/actions/suite/routerActions'; +import { setFlag } from 'src/actions/suite/suiteActions'; import { DashboardSection } from 'src/components/dashboard'; -import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; +import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; 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 { Account } from 'src/types/wallet'; import { AssetCard, AssetCardSkeleton } from './AssetCard/AssetCard'; import { AssetTable } from './AssetTable/AssetTable'; diff --git a/packages/suite/src/views/dashboard/AssetsView/TradingBuyButton.tsx b/packages/suite/src/views/dashboard/AssetsView/TradingBuyButton.tsx index d7cb2b12cee..18cd830785f 100644 --- a/packages/suite/src/views/dashboard/AssetsView/TradingBuyButton.tsx +++ b/packages/suite/src/views/dashboard/AssetsView/TradingBuyButton.tsx @@ -1,12 +1,12 @@ import { MouseEvent } from 'react'; -import { Button } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; +import { Button } from '@trezor/components'; 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 { useAccountSearch, useDispatch } from 'src/hooks/suite'; type TradingBuyButtonProps = { symbol: NetworkSymbol; diff --git a/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts b/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts index 77e97b9b22b..85aea26f75d 100644 --- a/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts +++ b/packages/suite/src/views/dashboard/AssetsView/assetsViewUtils.ts @@ -2,9 +2,9 @@ import { FiatCurrencyCode } from '@suite-common/suite-config'; import { TokenDefinition } from '@suite-common/token-definitions'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { Account, RatesByKey } from '@suite-common/wallet-types'; +import { getAccountTotalStakingBalance } from '@suite-common/wallet-utils'; import { TokenInfo } from '@trezor/connect'; import { BigNumber } from '@trezor/utils'; -import { getAccountTotalStakingBalance } from '@suite-common/wallet-utils'; import { enhanceTokensWithRates, diff --git a/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx b/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx index 74d4cfe3913..7f8bf28c91a 100644 --- a/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx +++ b/packages/suite/src/views/dashboard/DashboardPassphraseBanner.tsx @@ -4,8 +4,8 @@ import { AnimatePresence, motion } from 'framer-motion'; import styled from 'styled-components'; import { selectSelectedDevice } from '@suite-common/wallet-core'; -import { Banner, Text, Button, IconButton, Row, Column } from '@trezor/components'; import { WalletType } from '@suite-common/wallet-types'; +import { Banner, Button, Column, IconButton, Row, Text } from '@trezor/components'; import { goto } from 'src/actions/suite/routerActions'; import { setFlag } from 'src/actions/suite/suiteActions'; diff --git a/packages/suite/src/views/dashboard/PortfolioCard/DashboardGraph.tsx b/packages/suite/src/views/dashboard/PortfolioCard/DashboardGraph.tsx index 49b22414d12..8f993ea37fe 100644 --- a/packages/suite/src/views/dashboard/PortfolioCard/DashboardGraph.tsx +++ b/packages/suite/src/views/dashboard/PortfolioCard/DashboardGraph.tsx @@ -1,20 +1,20 @@ -import { memo, useState, useEffect, useCallback } from 'react'; +import { memo, useCallback, useEffect, useState } from 'react'; import { getUnixTime } from 'date-fns'; import styled from 'styled-components'; -import { variables, Button } from '@trezor/components'; import { calcTicks, calcTicksFromData } from '@suite-common/suite-utils'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { Button, variables } from '@trezor/components'; -import GraphWorker from 'src/support/workers/graph'; import { getGraphDataForInterval, updateGraphData } from 'src/actions/wallet/graphActions'; +import { HiddenPlaceholder, TransactionsGraph, Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import GraphWorker from 'src/support/workers/graph'; import { Account } from 'src/types/wallet'; -import { TransactionsGraph, Translation, HiddenPlaceholder } from 'src/components/suite'; import { AggregatedDashboardHistory } from 'src/types/wallet/graph'; import { getMinMaxValueFromData } from 'src/utils/wallet/graph'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/dashboard/PortfolioCard/EmptyWallet.tsx b/packages/suite/src/views/dashboard/PortfolioCard/EmptyWallet.tsx index 6e970065409..fbb97aa87f2 100644 --- a/packages/suite/src/views/dashboard/PortfolioCard/EmptyWallet.tsx +++ b/packages/suite/src/views/dashboard/PortfolioCard/EmptyWallet.tsx @@ -1,12 +1,12 @@ -import { H3, Row, Paragraph, Button, Column, IconCircle } from '@trezor/components'; +import { selectIsDeviceUsingPassphrase } from '@suite-common/wallet-core'; +import { Button, Column, H3, IconCircle, Paragraph, Row } 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 { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite'; import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; export const EmptyWallet = () => { diff --git a/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCard.tsx b/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCard.tsx index 0147201d7a7..991bfc05cd1 100644 --- a/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCard.tsx +++ b/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCard.tsx @@ -2,24 +2,24 @@ import { memo, useMemo } from 'react'; import styled from 'styled-components'; -import { Dropdown, Card, Tooltip, Column } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { selectCurrentFiatRates } from '@suite-common/wallet-core'; +import { Card, Column, Dropdown, Tooltip } from '@trezor/components'; import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; +import { spacings } from '@trezor/theme'; -import { GraphScaleDropdownItem, GraphSkeleton, Translation } from 'src/components/suite'; +import { goto } from 'src/actions/suite/routerActions'; +import { setFlag } from 'src/actions/suite/suiteActions'; import { DashboardSection } from 'src/components/dashboard'; +import { GraphScaleDropdownItem, GraphSkeleton, Translation } from 'src/components/suite'; 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 { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { useTotalFiatBalance } from 'src/hooks/wallet/useTotalFiatBalance'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { PortfolioCardHeader } from './PortfolioCardHeader'; -import { PortfolioCardException } from './PortfolioCardException'; -import { EmptyWallet } from './EmptyWallet'; import { DashboardGraph } from './DashboardGraph'; +import { EmptyWallet } from './EmptyWallet'; +import { PortfolioCardException } from './PortfolioCardException'; +import { PortfolioCardHeader } from './PortfolioCardHeader'; // eslint-disable-next-line local-rules/no-override-ds-component const StyledDropdown = styled(Dropdown)` diff --git a/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardException.tsx b/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardException.tsx index 6d92a8532dd..a6fc10e6e09 100644 --- a/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardException.tsx +++ b/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardException.tsx @@ -1,21 +1,21 @@ import { ComponentProps } from 'react'; +import { NetworkType, getNetwork } from '@suite-common/wallet-config'; import { authConfirm, authorizeDeviceThunk, restartDiscoveryThunk as restartDiscovery, } from '@suite-common/wallet-core'; -import { getNetwork, NetworkType } from '@suite-common/wallet-config'; -import { Button, H3, IconName, Column, Row, IconCircle, Text } from '@trezor/components'; import { Discovery } from '@suite-common/wallet-types'; +import { Button, Column, H3, IconCircle, IconName, Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Translation } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { goto } from 'src/actions/suite/routerActions'; -import { DiscoveryStatusType } from 'src/types/wallet'; +import { Translation } from 'src/components/suite'; import { TranslationKey } from 'src/components/suite/Translation'; +import { useDevice, useDispatch } from 'src/hooks/suite'; +import { DiscoveryStatusType } from 'src/types/wallet'; interface CTA { label?: TranslationKey; diff --git a/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardHeader.tsx b/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardHeader.tsx index 571348b48d5..fb283098af1 100644 --- a/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardHeader.tsx +++ b/packages/suite/src/views/dashboard/PortfolioCard/PortfolioCardHeader.tsx @@ -5,11 +5,11 @@ 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 { GraphRangeSelector, Translation } from 'src/components/suite'; +import { FiatHeader } from 'src/components/wallet/FiatHeader'; import { useFastAccounts } from 'src/hooks/wallet'; import { GraphRange } from 'src/types/wallet/graph'; -import { FiatHeader } from 'src/components/wallet/FiatHeader'; 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 4793700c643..66cf772a07a 100644 --- a/packages/suite/src/views/dashboard/PromoBanner.tsx +++ b/packages/suite/src/views/dashboard/PromoBanner.tsx @@ -2,16 +2,16 @@ 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, Row, Column } from '@trezor/components'; +import { Button, Column, Icon, Image, Row, Tooltip, variables } from '@trezor/components'; import { isWeb } from '@trezor/env-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { spacings } from '@trezor/theme'; +import { SUITE_MOBILE_APP_STORE, SUITE_MOBILE_PLAY_STORE, SUITE_URL } from '@trezor/urls'; -import { Translation, QrCode, TrezorLink } from 'src/components/suite'; -import { useLayoutSize } from 'src/hooks/suite/useLayoutSize'; +import { QrCode, Translation, TrezorLink } from 'src/components/suite'; import { HORIZONTAL_LAYOUT_PADDINGS, MAX_CONTENT_WIDTH_NUMERIC } from 'src/constants/suite/layout'; import { useSelector } from 'src/hooks/suite'; +import { useLayoutSize } from 'src/hooks/suite/useLayoutSize'; import { useResponsiveContext } from '../../support/suite/ResponsiveContext'; diff --git a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCard.tsx b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCard.tsx index fa8c861b273..5d52dffe568 100644 --- a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCard.tsx +++ b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCard.tsx @@ -1,29 +1,29 @@ import { useEffect, useMemo, useState } from 'react'; +import { MIN_ETH_BALANCE_FOR_STAKING } from '@suite-common/wallet-constants'; +import { selectPoolStatsApyData } from '@suite-common/wallet-core'; import { - variables, - Divider, - H3, Card, Column, - Tooltip, + Divider, Grid, - useMediaQuery, - Paragraph, + H3, IconName, + Paragraph, + Tooltip, + useMediaQuery, + variables, } from '@trezor/components'; -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 { spacings } from '@trezor/theme'; +import { setFlag } from 'src/actions/suite/suiteActions'; +import { DashboardSection } from 'src/components/dashboard'; +import { StakingFeature, Translation } from 'src/components/suite'; import { useDevice, useDiscovery, useDispatch, useSelector } from 'src/hooks/suite'; import { useAccounts } from 'src/hooks/wallet'; -import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; -import { setFlag } from 'src/actions/suite/suiteActions'; -import { Translation, StakingFeature } from 'src/components/suite'; -import { DashboardSection } from 'src/components/dashboard'; +import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; import { StakeEthCardFooter } from './StakeEthCardFooter/StakeEthCardFooter'; diff --git a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/NetworkBadge.tsx b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/NetworkBadge.tsx index c977ac71aa0..23a345ce918 100644 --- a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/NetworkBadge.tsx +++ b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/NetworkBadge.tsx @@ -1,9 +1,9 @@ import { ReactNode } from 'react'; +import { NetworkSymbol } from '@suite-common/wallet-config'; import { Paragraph, Row } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { CoinLogo } from '@trezor/product-components'; -import { NetworkSymbol } from '@suite-common/wallet-config'; +import { spacings } from '@trezor/theme'; type NetworkBadgeProps = { symbol: NetworkSymbol; diff --git a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/StakeEthCardFooter.tsx b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/StakeEthCardFooter.tsx index bf0f0a2a568..7b5f9bab218 100644 --- a/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/StakeEthCardFooter.tsx +++ b/packages/suite/src/views/dashboard/StakeEthCard/StakeEthCardFooter/StakeEthCardFooter.tsx @@ -1,10 +1,10 @@ +import { getNetwork } from '@suite-common/wallet-config'; import { Button, Paragraph, Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { getNetwork } from '@suite-common/wallet-config'; +import { goto } from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite'; import { useAccountSearch, useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { NetworkBadge } from './NetworkBadge'; diff --git a/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx b/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx index 2bbdc9bdc1d..75ede3440ce 100644 --- a/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx +++ b/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoBanner.tsx @@ -1,19 +1,19 @@ import React, { useState } from 'react'; -import styled from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; import { rgba } from 'polished'; +import styled from 'styled-components'; -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 { Button, IconButton, Image, SVG_IMAGES, SVG_PATH, variables } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { colorVariants } from '@trezor/theme'; +import { TREZOR_SAFE_5_URL } from '@trezor/urls'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { selectIsDashboardT3T1PromoBannerShown } from 'src/reducers/suite/suiteReducer'; import { setFlag } from 'src/actions/suite/suiteActions'; import { Translation, TrezorLink } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { selectIsDashboardT3T1PromoBannerShown } from 'src/reducers/suite/suiteReducer'; 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 8a49f49d63a..3068cb2a63e 100644 --- a/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoLogo.tsx +++ b/packages/suite/src/views/dashboard/T3T1PromoBanner/T3T1PromoLogo.tsx @@ -2,8 +2,8 @@ import React from 'react'; import styled from 'styled-components'; -import { borders, colorVariants, typography } from '@trezor/theme'; import { variables } from '@trezor/components'; +import { borders, colorVariants, typography } from '@trezor/theme'; const LogoContainer = styled.div` display: flex; diff --git a/packages/suite/src/views/dashboard/index.tsx b/packages/suite/src/views/dashboard/index.tsx index 0314a8a9a50..875f9c31f6e 100644 --- a/packages/suite/src/views/dashboard/index.tsx +++ b/packages/suite/src/views/dashboard/index.tsx @@ -1,15 +1,15 @@ import { Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { useLayout } from 'src/hooks/suite'; import { PageHeader } from 'src/components/suite/layouts/SuiteLayout'; +import { useLayout } from 'src/hooks/suite'; import { AssetsView } from './AssetsView/AssetsView'; +import { DashboardPassphraseBanner } from './DashboardPassphraseBanner'; import { PortfolioCard } from './PortfolioCard/PortfolioCard'; import { PromoBanner } from './PromoBanner'; -import { T3T1PromoBanner } from './T3T1PromoBanner/T3T1PromoBanner'; import { StakeEthCard } from './StakeEthCard/StakeEthCard'; -import { DashboardPassphraseBanner } from './DashboardPassphraseBanner'; +import { T3T1PromoBanner } from './T3T1PromoBanner/T3T1PromoBanner'; export const Dashboard = () => { useLayout('Home', ); diff --git a/packages/suite/src/views/firmware/FirmwareCustom.tsx b/packages/suite/src/views/firmware/FirmwareCustom.tsx index fa2d198d1ac..44989ef7354 100644 --- a/packages/suite/src/views/firmware/FirmwareCustom.tsx +++ b/packages/suite/src/views/firmware/FirmwareCustom.tsx @@ -2,8 +2,8 @@ import { useState } from 'react'; import { useFirmwareInstallation } from '@suite-common/firmware'; -import { useDevice } from 'src/hooks/suite'; import { SelectCustomFirmware } from 'src/components/firmware'; +import { useDevice } from 'src/hooks/suite'; import { FirmwareModal } from './FirmwareModal'; diff --git a/packages/suite/src/views/firmware/FirmwareModal.tsx b/packages/suite/src/views/firmware/FirmwareModal.tsx index e03a9ddde0d..7bca8f0658b 100644 --- a/packages/suite/src/views/firmware/FirmwareModal.tsx +++ b/packages/suite/src/views/firmware/FirmwareModal.tsx @@ -3,12 +3,12 @@ import { useIntl } from 'react-intl'; import styled from 'styled-components'; +import { useFirmwareInstallation } from '@suite-common/firmware'; import { TranslationKey } from '@suite-common/intl-types'; import { acquireDevice, selectSelectedDevice } from '@suite-common/wallet-core'; import { variables } from '@trezor/components'; import TrezorConnect from '@trezor/connect'; import { ConfirmOnDevice } from '@trezor/product-components'; -import { useFirmwareInstallation } from '@suite-common/firmware'; import { closeModalApp } from 'src/actions/suite/routerActions'; import { @@ -17,8 +17,8 @@ import { FirmwareInstallation, FirmwareUpdateHashCheckError, } from 'src/components/firmware'; -import { Translation, Modal, PrerequisitesGuide } from 'src/components/suite'; import { OnboardingStepBox } from 'src/components/onboarding'; +import { Modal, PrerequisitesGuide, Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import messages from 'src/support/messages'; diff --git a/packages/suite/src/views/firmware/FirmwareUpdate.tsx b/packages/suite/src/views/firmware/FirmwareUpdate.tsx index aaff620a515..2506bf9b618 100644 --- a/packages/suite/src/views/firmware/FirmwareUpdate.tsx +++ b/packages/suite/src/views/firmware/FirmwareUpdate.tsx @@ -1,7 +1,7 @@ import { useFirmwareInstallation } from '@suite-common/firmware'; -import { FirmwareInitial } from 'src/components/firmware'; import { closeModalApp } from 'src/actions/suite/routerActions'; +import { FirmwareInitial } from 'src/components/firmware'; import { useDispatch } from 'src/hooks/suite'; import { FirmwareModal } from './FirmwareModal'; diff --git a/packages/suite/src/views/onboarding/UnexpectedState/index.tsx b/packages/suite/src/views/onboarding/UnexpectedState/index.tsx index 55af7c03eaf..e3f5cc18a60 100644 --- a/packages/suite/src/views/onboarding/UnexpectedState/index.tsx +++ b/packages/suite/src/views/onboarding/UnexpectedState/index.tsx @@ -4,10 +4,10 @@ import styled from 'styled-components'; import { selectSelectedDevice } from '@suite-common/wallet-core'; -import { PinMatrix, PrerequisitesGuide, Translation } from 'src/components/suite'; -import { useOnboarding, useSelector } from 'src/hooks/suite'; import { OnboardingStepBox } from 'src/components/onboarding'; +import { PinMatrix, PrerequisitesGuide, Translation } from 'src/components/suite'; import steps from 'src/config/onboarding/steps'; +import { useOnboarding, useSelector } from 'src/hooks/suite'; import { selectPrerequisite } from 'src/reducers/suite/suiteReducer'; import IsSameDevice from './components/IsSameDevice'; diff --git a/packages/suite/src/views/onboarding/index.tsx b/packages/suite/src/views/onboarding/index.tsx index 154218292fc..967cc351271 100644 --- a/packages/suite/src/views/onboarding/index.tsx +++ b/packages/suite/src/views/onboarding/index.tsx @@ -1,23 +1,23 @@ import { useMemo } from 'react'; +import { MODAL } from 'src/actions/suite/constants'; import { OnboardingLayout } from 'src/components/onboarding'; import { ReduxModal } from 'src/components/suite/modals/ReduxModal/ReduxModal'; +import * as STEP from 'src/constants/onboarding/steps'; +import { useFilteredModal, useOnboarding } from 'src/hooks/suite'; +import UnexpectedState from 'src/views/onboarding/UnexpectedState'; +import { BackupStep } from 'src/views/onboarding/steps/Backup'; +import BasicSettingsStep from 'src/views/onboarding/steps/BasicSettings'; import CreateOrRecover from 'src/views/onboarding/steps/CreateOrRecover'; +import { FinalStep } from 'src/views/onboarding/steps/Final'; import { FirmwareStep } from 'src/views/onboarding/steps/FirmwareStep'; -import { ResetDeviceStep } from 'src/views/onboarding/steps/ResetDevice'; +import SetPinStep from 'src/views/onboarding/steps/Pin'; import { RecoveryStep } from 'src/views/onboarding/steps/Recovery'; -import { BackupStep } from 'src/views/onboarding/steps/Backup'; +import { ResetDeviceStep } from 'src/views/onboarding/steps/ResetDevice'; import SecurityStep from 'src/views/onboarding/steps/Security'; -import SetPinStep from 'src/views/onboarding/steps/Pin'; -import BasicSettingsStep from 'src/views/onboarding/steps/BasicSettings'; -import { FinalStep } from 'src/views/onboarding/steps/Final'; -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'; +import { DeviceAuthenticity } from './steps/SecurityCheck/DeviceAuthenticity'; export const Onboarding = () => { const { activeStepId, goToNextStep } = useOnboarding(); diff --git a/packages/suite/src/views/onboarding/steps/Backup.tsx b/packages/suite/src/views/onboarding/steps/Backup.tsx index 610498a1a7b..3d2ede18d9c 100644 --- a/packages/suite/src/views/onboarding/steps/Backup.tsx +++ b/packages/suite/src/views/onboarding/steps/Backup.tsx @@ -2,26 +2,26 @@ import { useState } from 'react'; import styled from 'styled-components'; -import { Image } from '@trezor/components'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { Image } from '@trezor/components'; +import { backupDevice } from 'src/actions/backup/backupActions'; +import { goToNextStep, updateAnalytics } from 'src/actions/onboarding/onboardingActions'; +import * as onboardingActions from 'src/actions/onboarding/onboardingActions'; +import { goto } from 'src/actions/suite/routerActions'; +import { BackupSeedCards } from 'src/components/backup'; import { OnboardingButtonCta, OnboardingButtonSkip, - OptionsWrapper, OnboardingStepBox, + OptionsWrapper, SkipStepConfirmation, } from 'src/components/onboarding'; import { Translation } from 'src/components/suite'; -import { BackupSeedCards } from 'src/components/backup'; -import { canContinue } from 'src/utils/backup'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { goToNextStep, updateAnalytics } from 'src/actions/onboarding/onboardingActions'; -import { backupDevice } from 'src/actions/backup/backupActions'; -import { goto } from 'src/actions/suite/routerActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsActionAbortable, selectIsDeviceLocked } from 'src/reducers/suite/suiteReducer'; -import * as onboardingActions from 'src/actions/onboarding/onboardingActions'; +import { canContinue } from 'src/utils/backup'; // eslint-disable-next-line local-rules/no-override-ds-component const StyledImage = styled(Image)` diff --git a/packages/suite/src/views/onboarding/steps/BasicSettings/AdvancedSetup.tsx b/packages/suite/src/views/onboarding/steps/BasicSettings/AdvancedSetup.tsx index 0bff4856c9a..41373f1d6e2 100644 --- a/packages/suite/src/views/onboarding/steps/BasicSettings/AdvancedSetup.tsx +++ b/packages/suite/src/views/onboarding/steps/BasicSettings/AdvancedSetup.tsx @@ -1,14 +1,14 @@ -import { useState, ReactNode } from 'react'; +import { ReactNode, useState } from 'react'; import styled, { useTheme } from 'styled-components'; import { Icon } from '@trezor/components'; import { isDesktop, isWeb } from '@trezor/env-utils'; -import { useSelector } from 'src/hooks/suite'; +import { CollapsibleOnboardingCard } from 'src/components/onboarding/CollapsibleOnboardingCard'; import { Translation } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; import { getIsTorEnabled } from 'src/utils/suite/tor'; -import { CollapsibleOnboardingCard } from 'src/components/onboarding/CollapsibleOnboardingCard'; import { TorSection } from './TorSection'; diff --git a/packages/suite/src/views/onboarding/steps/BasicSettings/BasicSettingsStepBox.tsx b/packages/suite/src/views/onboarding/steps/BasicSettings/BasicSettingsStepBox.tsx index bc77e29bc66..1aa97b5ffc6 100644 --- a/packages/suite/src/views/onboarding/steps/BasicSettings/BasicSettingsStepBox.tsx +++ b/packages/suite/src/views/onboarding/steps/BasicSettings/BasicSettingsStepBox.tsx @@ -5,11 +5,11 @@ import styled from 'styled-components'; import { CollapsibleBox } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { changeCoinVisibility } from 'src/actions/settings/walletSettingsActions'; 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'; const Separator = styled.hr` diff --git a/packages/suite/src/views/onboarding/steps/BasicSettings/TorSection.tsx b/packages/suite/src/views/onboarding/steps/BasicSettings/TorSection.tsx index be5c3f4e5e3..ca38f9d2115 100644 --- a/packages/suite/src/views/onboarding/steps/BasicSettings/TorSection.tsx +++ b/packages/suite/src/views/onboarding/steps/BasicSettings/TorSection.tsx @@ -1,12 +1,12 @@ import styled from 'styled-components'; -import { variables, Switch } from '@trezor/components'; +import { Switch, variables } from '@trezor/components'; +import { toggleTor } from 'src/actions/suite/suiteActions'; import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; -import { toggleTor } from 'src/actions/suite/suiteActions'; -import { getIsTorEnabled, getIsTorLoading } from 'src/utils/suite/tor'; import { TorStatus } from 'src/types/suite'; +import { getIsTorEnabled, getIsTorLoading } from 'src/utils/suite/tor'; const TorWrapper = styled.div` width: 100%; diff --git a/packages/suite/src/views/onboarding/steps/BasicSettings/index.tsx b/packages/suite/src/views/onboarding/steps/BasicSettings/index.tsx index d4014e45198..bf73429ed00 100644 --- a/packages/suite/src/views/onboarding/steps/BasicSettings/index.tsx +++ b/packages/suite/src/views/onboarding/steps/BasicSettings/index.tsx @@ -1,10 +1,10 @@ import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; -import { Translation } from 'src/components/suite'; import { OnboardingButtonCta } from 'src/components/onboarding'; +import { Translation } from 'src/components/suite'; import { useDevice, useOnboarding, useSelector } from 'src/hooks/suite'; -import { getIsTorLoading } from 'src/utils/suite/tor'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; +import { getIsTorLoading } from 'src/utils/suite/tor'; import { AdvancedSetup } from './AdvancedSetup'; import { BasicSettingsStepBox } from './BasicSettingsStepBox'; diff --git a/packages/suite/src/views/onboarding/steps/CreateOrRecover.tsx b/packages/suite/src/views/onboarding/steps/CreateOrRecover.tsx index e75fe20afc0..3093af2d889 100644 --- a/packages/suite/src/views/onboarding/steps/CreateOrRecover.tsx +++ b/packages/suite/src/views/onboarding/steps/CreateOrRecover.tsx @@ -1,12 +1,12 @@ -import { Translation } from 'src/components/suite'; -import { useOnboarding } from 'src/hooks/suite'; -import * as STEP from 'src/constants/onboarding/steps'; import { OnboardingOption, - OptionsWrapper, - OptionsDivider, OnboardingStepBox, + OptionsDivider, + OptionsWrapper, } from 'src/components/onboarding'; +import { Translation } from 'src/components/suite'; +import * as STEP from 'src/constants/onboarding/steps'; +import { useOnboarding } from 'src/hooks/suite'; const CreateOrRecoverStep = () => { const { goToNextStep, addPath, updateAnalytics } = useOnboarding(); diff --git a/packages/suite/src/views/onboarding/steps/DeviceTutorial.tsx b/packages/suite/src/views/onboarding/steps/DeviceTutorial.tsx index 8376fed4210..b9f8d1314fe 100644 --- a/packages/suite/src/views/onboarding/steps/DeviceTutorial.tsx +++ b/packages/suite/src/views/onboarding/steps/DeviceTutorial.tsx @@ -4,8 +4,8 @@ import { useIntl } from 'react-intl'; import styled from 'styled-components'; import { selectSelectedDevice } from '@suite-common/wallet-core'; -import TrezorConnect from '@trezor/connect'; import { Button } from '@trezor/components'; +import TrezorConnect from '@trezor/connect'; import { spacingsPx } from '@trezor/theme'; import { @@ -16,8 +16,8 @@ import { import { OnboardingStepBox } from 'src/components/onboarding'; import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; import { selectOnboardingTutorialStatus } from 'src/reducers/onboarding/onboardingReducer'; +import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; import messages from 'src/support/messages'; const StyledOnboardingStepBox = styled(OnboardingStepBox)` diff --git a/packages/suite/src/views/onboarding/steps/Final.tsx b/packages/suite/src/views/onboarding/steps/Final.tsx index c464634cf79..8e80f545d83 100644 --- a/packages/suite/src/views/onboarding/steps/Final.tsx +++ b/packages/suite/src/views/onboarding/steps/Final.tsx @@ -1,25 +1,25 @@ import { useRef, useState } from 'react'; -import styled, { css } from 'styled-components'; import useMeasure from 'react-use/lib/useMeasure'; +import styled, { css } from 'styled-components'; -import { analytics, EventType } from '@trezor/suite-analytics'; import { Button, - variables, + DeviceAnimation, Dropdown, DropdownRef, Tooltip, - DeviceAnimation, + variables, } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { spacingsPx, typography } from '@trezor/theme'; -import { Translation, HomescreenGallery } from 'src/components/suite'; import { OnboardingStepBox } from 'src/components/onboarding'; +import { HomescreenGallery, Translation } from 'src/components/suite'; +import { ChangeDeviceLabel } from 'src/components/suite/ChangeDeviceLabel'; 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 { isHomescreenSupportedOnDevice } from 'src/utils/suite/homescreen'; const Content = styled.div` flex-direction: column; diff --git a/packages/suite/src/views/onboarding/steps/FirmwareStep.tsx b/packages/suite/src/views/onboarding/steps/FirmwareStep.tsx index 62a4e4cf4dd..8e0455e9389 100644 --- a/packages/suite/src/views/onboarding/steps/FirmwareStep.tsx +++ b/packages/suite/src/views/onboarding/steps/FirmwareStep.tsx @@ -1,19 +1,19 @@ -import { getFirmwareVersion } from '@trezor/device-utils'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; import { useFirmwareInstallation } from '@suite-common/firmware'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { getFirmwareVersion } from '@trezor/device-utils'; import { MODAL } from 'src/actions/suite/constants'; -import { OnboardingButtonBack, OnboardingStepBox } from 'src/components/onboarding'; -import { PrerequisitesGuide, Translation } from 'src/components/suite'; import { + Fingerprint, FirmwareContinueButton, - FirmwareRetryButton, - FirmwareInstallation, FirmwareInitial, + FirmwareInstallation, + FirmwareRetryButton, FirmwareUpdateHashCheckError, - Fingerprint, } from 'src/components/firmware'; -import { useSelector, useOnboarding } from 'src/hooks/suite'; +import { OnboardingButtonBack, OnboardingStepBox } from 'src/components/onboarding'; +import { PrerequisitesGuide, Translation } from 'src/components/suite'; +import { useOnboarding, useSelector } from 'src/hooks/suite'; import { getSuiteFirmwareTypeString } from 'src/utils/firmware'; export const FirmwareStep = () => { diff --git a/packages/suite/src/views/onboarding/steps/Pin.tsx b/packages/suite/src/views/onboarding/steps/Pin.tsx index 4201a87dc04..524e28859a1 100644 --- a/packages/suite/src/views/onboarding/steps/Pin.tsx +++ b/packages/suite/src/views/onboarding/steps/Pin.tsx @@ -2,15 +2,15 @@ import { useEffect, useState } from 'react'; import { selectSelectedDevice } from '@suite-common/wallet-core'; -import { PinMatrix, Translation } from 'src/components/suite'; +import { changePin } from 'src/actions/settings/deviceSettingsActions'; import { OnboardingButtonCta, OnboardingButtonSkip, OnboardingStepBox, SkipStepConfirmation, } from 'src/components/onboarding'; -import { changePin } from 'src/actions/settings/deviceSettingsActions'; -import { useDispatch, useSelector, useOnboarding } from 'src/hooks/suite'; +import { PinMatrix, Translation } from 'src/components/suite'; +import { useDispatch, useOnboarding, useSelector } from 'src/hooks/suite'; import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; const SetPinStep = () => { diff --git a/packages/suite/src/views/onboarding/steps/Recovery/RecoveryStepBox.tsx b/packages/suite/src/views/onboarding/steps/Recovery/RecoveryStepBox.tsx index ff19931af81..8474adfcc6e 100644 --- a/packages/suite/src/views/onboarding/steps/Recovery/RecoveryStepBox.tsx +++ b/packages/suite/src/views/onboarding/steps/Recovery/RecoveryStepBox.tsx @@ -1,12 +1,12 @@ import { DeviceModelInternal } from '@trezor/connect'; +import { goToPreviousStep } from 'src/actions/onboarding/onboardingActions'; +import { setStatus } from 'src/actions/recovery/recoveryActions'; import { OnboardingButtonBack, OnboardingStepBox, OnboardingStepBoxProps, } from 'src/components/onboarding'; -import { goToPreviousStep } from 'src/actions/onboarding/onboardingActions'; -import { setStatus } from 'src/actions/recovery/recoveryActions'; import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; const RecoveryStepBox = (props: OnboardingStepBoxProps) => { diff --git a/packages/suite/src/views/onboarding/steps/Recovery/index.tsx b/packages/suite/src/views/onboarding/steps/Recovery/index.tsx index f805ed1f608..cc0d19522b5 100644 --- a/packages/suite/src/views/onboarding/steps/Recovery/index.tsx +++ b/packages/suite/src/views/onboarding/steps/Recovery/index.tsx @@ -1,14 +1,14 @@ import styled from 'styled-components'; -import { pickByDeviceModel } from '@trezor/device-utils'; -import { DeviceModelInternal } from '@trezor/connect'; import { isDeviceWithButtons } from '@suite-common/suite-utils'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { DeviceModelInternal } from '@trezor/connect'; +import { pickByDeviceModel } from '@trezor/device-utils'; +import { goToNextStep, updateAnalytics } from 'src/actions/onboarding/onboardingActions'; import { OnboardingButtonCta } from 'src/components/onboarding'; -import { SelectWordCount, SelectRecoveryType, SelectRecoveryWord } from 'src/components/recovery'; +import { SelectRecoveryType, SelectRecoveryWord, SelectWordCount } from 'src/components/recovery'; import { Translation } from 'src/components/suite'; -import { goToNextStep, updateAnalytics } from 'src/actions/onboarding/onboardingActions'; import { useDispatch, useRecovery, useSelector } from 'src/hooks/suite'; import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; diff --git a/packages/suite/src/views/onboarding/steps/ResetDevice.tsx b/packages/suite/src/views/onboarding/steps/ResetDevice.tsx index fd69722e549..a83367c675a 100644 --- a/packages/suite/src/views/onboarding/steps/ResetDevice.tsx +++ b/packages/suite/src/views/onboarding/steps/ResetDevice.tsx @@ -6,11 +6,11 @@ import { selectSelectedDevice } 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 { OnboardingButtonBack, OnboardingStepBox, OptionsWrapper } from 'src/components/onboarding'; +import { Translation } from 'src/components/suite'; +import * as STEP from 'src/constants/onboarding/steps'; +import { useDevice, useDispatch, useOnboarding, useSelector } from 'src/hooks/suite'; import { selectIsActionAbortable } from 'src/reducers/suite/suiteReducer'; import { diff --git a/packages/suite/src/views/onboarding/steps/Security.tsx b/packages/suite/src/views/onboarding/steps/Security.tsx index 223cafe6b3b..df9dc2ec704 100644 --- a/packages/suite/src/views/onboarding/steps/Security.tsx +++ b/packages/suite/src/views/onboarding/steps/Security.tsx @@ -1,12 +1,12 @@ import { useState } from 'react'; -import { Translation } from 'src/components/suite'; import { OnboardingButtonCta, OnboardingButtonSkip, OnboardingStepBox, SkipStepConfirmation, } from 'src/components/onboarding'; +import { Translation } from 'src/components/suite'; import { useOnboarding } from 'src/hooks/suite'; const SecurityStep = () => { diff --git a/packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx b/packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx index c3eb7f6009f..0694890862d 100644 --- a/packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx +++ b/packages/suite/src/views/onboarding/steps/SecurityCheck/DeviceAuthenticity.tsx @@ -11,9 +11,9 @@ import { TREZOR_SUPPORT_DEVICE_AUTHENTICATION_FAILED_URL } from '@trezor/urls'; import { OnboardingButtonCta, OnboardingStepBox } from 'src/components/onboarding'; import { CollapsibleOnboardingCard } from 'src/components/onboarding/CollapsibleOnboardingCard'; import { DeviceAuthenticationExplainer, Translation } from 'src/components/suite'; +import { SecurityCheckFail } from 'src/components/suite/SecurityCheck/SecurityCheckFail'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; -import { SecurityCheckFail } from 'src/components/suite/SecurityCheck/SecurityCheckFail'; const StyledCard = styled(CollapsibleOnboardingCard)` padding: ${spacingsPx.md}; diff --git a/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityCheck.tsx b/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityCheck.tsx index 2d6ccd23d5f..ef45b8af51f 100644 --- a/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityCheck.tsx +++ b/packages/suite/src/views/onboarding/steps/SecurityCheck/SecurityCheck.tsx @@ -2,10 +2,11 @@ import { useEffect, useState } from 'react'; import styled, { useTheme } from 'styled-components'; -import { getConnectedDeviceStatus } from '@suite-common/suite-utils'; +import { SUPPORTS_DEVICE_AUTHENTICITY_CHECK } from '@suite-common/suite-constants'; import { AcquiredDevice } from '@suite-common/suite-types'; -import { deviceActions, selectSelectedDevice, selectDevices } from '@suite-common/wallet-core'; -import { Button, Column, Icon, H2, Text, Tooltip, Divider } from '@trezor/components'; +import { getConnectedDeviceStatus } from '@suite-common/suite-utils'; +import { deviceActions, selectDevices, selectSelectedDevice } from '@suite-common/wallet-core'; +import { Button, Column, Divider, H2, Icon, Text, Tooltip } from '@trezor/components'; import { spacings, spacingsPx, typography } from '@trezor/theme'; import { TREZOR_RESELLERS_URL, @@ -13,20 +14,19 @@ import { TREZOR_SUPPORT_IS_MY_DEVICE_SAFE, TREZOR_URL, } from '@trezor/urls'; -import { SUPPORTS_DEVICE_AUTHENTICITY_CHECK } from '@suite-common/suite-constants'; import { goto } from 'src/actions/suite/routerActions'; -import { useDispatch, useLayoutSize, useOnboarding, useSelector } from 'src/hooks/suite'; -import { Translation, TrezorLink } from 'src/components/suite'; import { Hologram, OnboardingButtonSkip } from 'src/components/onboarding'; import { CollapsibleOnboardingCard } from 'src/components/onboarding/CollapsibleOnboardingCard'; -import { SecurityCheckLayout } from 'src/components/suite/SecurityCheck/SecurityCheckLayout'; +import { Translation, TrezorLink } from 'src/components/suite'; import { SecurityCheckFail } from 'src/components/suite/SecurityCheck/SecurityCheckFail'; +import { SecurityCheckLayout } from 'src/components/suite/SecurityCheck/SecurityCheckLayout'; +import { useDispatch, useLayoutSize, useOnboarding, useSelector } from 'src/hooks/suite'; import { selectIsOnboardingActive } from 'src/reducers/onboarding/onboardingReducer'; import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; -import { SecurityChecklist } from './SecurityChecklist'; import { DeviceAuthenticity } from './DeviceAuthenticity'; +import { SecurityChecklist } from './SecurityChecklist'; const StyledCard = styled(CollapsibleOnboardingCard)` max-width: 840px; diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/FloatingSelections.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/FloatingSelections.tsx index eb524c2402a..ebf9dda9ada 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/FloatingSelections.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/FloatingSelections.tsx @@ -3,13 +3,13 @@ import { CSSProperties, forwardRef, useRef } from 'react'; import styled from 'styled-components'; import { - useElevation, - Divider, + Banner, CollapsibleBox, Column, - Banner, - variables, + Divider, Text, + useElevation, + variables, } from '@trezor/components'; import { Elevation, @@ -25,8 +25,8 @@ import { Translation, TrezorLink } from 'src/components/suite'; import { LegacyOptions } from './LegacyOptions'; import { isShamirBackupType } from './SelectBackupType'; -import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; import { ShamirOptions } from './ShamirOptions'; +import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; const OptionGroupHeading = styled.div` display: flex; diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/LegacyOptions.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/LegacyOptions.tsx index 89dde3c1b6d..3155fa03315 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/LegacyOptions.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/LegacyOptions.tsx @@ -2,9 +2,9 @@ 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'; +import { OptionWithContent } from './OptionWithContent'; +import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; type LegacyOptionsProps = { selected: BackupType; diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/OptionWithContent.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/OptionWithContent.tsx index ff3f212e43a..382105ecd47 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/OptionWithContent.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/OptionWithContent.tsx @@ -2,20 +2,20 @@ import { ReactNode, forwardRef } from 'react'; import styled, { css } from 'styled-components'; -import { Radio, Row, variables, Text, Icon, useElevation, Tooltip } from '@trezor/components'; +import { Icon, Radio, Row, Text, Tooltip, useElevation, variables } from '@trezor/components'; import { - spacingsPx, - borders, Elevation, + borders, mapElevationToBackground, mapElevationToBorder, + spacingsPx, } from '@trezor/theme'; -import { useLayoutSize } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; +import { useLayoutSize } from 'src/hooks/suite'; -import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; import { typesToLabelMap } from './typesToLabelMap'; +import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; export const OptionText = styled.div` display: flex; diff --git a/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx b/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx index 5a4c5041729..af857505221 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/SelectBackupType.tsx @@ -1,20 +1,23 @@ import { useState } from 'react'; -import styled from 'styled-components'; import { FloatingFocusManager, + FloatingPortal, autoUpdate, - useFloating, + offset, + size, useClick, useDismiss, - useRole, + useFloating, useInteractions, - FloatingPortal, - size, - offset, + useRole, } from '@floating-ui/react'; +import styled from 'styled-components'; -import { ElevationUp, Text, Banner, useElevation } from '@trezor/components'; +import { TranslationKey } from '@suite-common/intl-types'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { Banner, ElevationUp, Text, useElevation } from '@trezor/components'; +import { DeviceModelInternal } from '@trezor/connect'; import { Elevation, borders, @@ -22,16 +25,13 @@ import { mapElevationToBorder, spacingsPx, } from '@trezor/theme'; -import { selectSelectedDevice } 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 { OptionText, SelectedOption } from './OptionWithContent'; import { typesToLabelMap } from './typesToLabelMap'; +import { Translation } from '../../../../components/suite'; +import { useLayoutSize, useSelector } from '../../../../hooks/suite'; +import { BackupType } from '../../../../reducers/onboarding/onboardingReducer'; 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 95acd69a9ae..dc188b8d764 100644 --- a/packages/suite/src/views/onboarding/steps/SelectBackupType/ShamirOptions.tsx +++ b/packages/suite/src/views/onboarding/steps/SelectBackupType/ShamirOptions.tsx @@ -1,15 +1,15 @@ import { satisfies } from 'semver'; -import { Badge, Tooltip } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { Badge, Tooltip } from '@trezor/components'; import { getFirmwareVersion } from '@trezor/device-utils'; +import { spacings } from '@trezor/theme'; +import { DefaultTag } from './DefaultTag'; +import { OptionWithContent } from './OptionWithContent'; 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'; const UpgradableToMultiTag = () => { const { isMobileLayout } = useLayoutSize(); diff --git a/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx b/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx index f9ddf577d08..673c3e680a8 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/EntryForm.tsx @@ -3,16 +3,16 @@ 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 { selectSelectedDevice } from '@suite-common/wallet-core'; -import { isUrl } from '@trezor/utils'; +import { Button, Checkbox, Input } from '@trezor/components'; +import TrezorConnect from '@trezor/connect'; import { spacingsPx } from '@trezor/theme'; +import { isUrl } from '@trezor/utils'; +import { PATH } from 'src/actions/suite/constants/metadataPasswordsConstants'; import { usePasswords, useSelector } from 'src/hooks/suite'; 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` diff --git a/packages/suite/src/views/password-manager/PasswordManager/PasswordEntry.tsx b/packages/suite/src/views/password-manager/PasswordManager/PasswordEntry.tsx index 692bf051338..361771ef281 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/PasswordEntry.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/PasswordEntry.tsx @@ -2,16 +2,16 @@ import React, { useState } from 'react'; import styled from 'styled-components'; -import TrezorConnect, { DeviceUniquePath } from '@trezor/connect'; import { Button } from '@trezor/components'; +import TrezorConnect, { DeviceUniquePath } from '@trezor/connect'; import { spacingsPx } from '@trezor/theme'; +import { PATH } from 'src/actions/suite/constants/metadataPasswordsConstants'; import { DialogModal } from 'src/components/suite/modals/Modal/DialogRenderer'; -import * as metadataUtils from 'src/utils/suite/metadata'; +import { usePasswords } from 'src/hooks/suite'; import type { PasswordEntry as PasswordEntryType } from 'src/types/suite/metadata'; -import { PATH } from 'src/actions/suite/constants/metadataPasswordsConstants'; +import * as metadataUtils from 'src/utils/suite/metadata'; import { getDisplayKey } from 'src/utils/suite/passwords'; -import { usePasswords } from 'src/hooks/suite'; import { EntryForm } from './EntryForm'; diff --git a/packages/suite/src/views/password-manager/PasswordManager/PasswordManager.tsx b/packages/suite/src/views/password-manager/PasswordManager/PasswordManager.tsx index 8ef40e76102..5590353e525 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/PasswordManager.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/PasswordManager.tsx @@ -4,7 +4,7 @@ import styled from 'styled-components'; import { Button } from '@trezor/components'; -import { TextColumn, ActionColumn } from 'src/components/suite'; +import { ActionColumn, TextColumn } from 'src/components/suite'; import { useDevice, usePasswords } from 'src/hooks/suite'; import { getNextId } from 'src/utils/suite/passwords'; diff --git a/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx b/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx index 47b366e789e..731fcd092f4 100644 --- a/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx +++ b/packages/suite/src/views/password-manager/PasswordManager/PasswordsList.tsx @@ -2,17 +2,17 @@ import styled from 'styled-components'; import { selectSelectedDevice } 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 { useSelector } from 'src/hooks/suite'; +import type { PasswordEntry as PasswordEntryType } from 'src/types/suite/metadata'; import { AddEntryButton } from './AddEntryButton'; +import { EntryForm } from './EntryForm'; import { - PasswordEntry as PasswordEntryComponent, PasswordEntryCol, + PasswordEntry as PasswordEntryComponent, PasswordEntryRow, } from './PasswordEntry'; -import { EntryForm } from './EntryForm'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/password-manager/index.tsx b/packages/suite/src/views/password-manager/index.tsx index 77fc4f041c0..91720b0730c 100644 --- a/packages/suite/src/views/password-manager/index.tsx +++ b/packages/suite/src/views/password-manager/index.tsx @@ -1,6 +1,6 @@ -import { useLayout } from 'src/hooks/suite'; import { PageHeader } from 'src/components/suite/layouts/SuiteLayout'; import { BasicName } from 'src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/BasicName'; +import { useLayout } from 'src/hooks/suite'; import { PasswordManager } from './PasswordManager/PasswordManager'; diff --git a/packages/suite/src/views/recovery/index.tsx b/packages/suite/src/views/recovery/index.tsx index e8c0ac80d7c..b60a4274917 100644 --- a/packages/suite/src/views/recovery/index.tsx +++ b/packages/suite/src/views/recovery/index.tsx @@ -7,28 +7,28 @@ import { isDeviceAcquired, isDeviceWithButtons, } from '@suite-common/suite-utils'; -import { Card, H2, H3, Image, BulletList, NewModal, Paragraph } from '@trezor/components'; -import { pickByDeviceModel } from '@trezor/device-utils'; +import { BulletList, Card, H2, H3, Image, NewModal, Paragraph } from '@trezor/components'; import TrezorConnect, { DeviceModelInternal } from '@trezor/connect'; +import { pickByDeviceModel } from '@trezor/device-utils'; import { spacings } from '@trezor/theme'; -import { SelectRecoveryType, SelectWordCount } from 'src/components/recovery'; -import { CheckItem, Loading, Translation } from 'src/components/suite'; import { checkSeed, setAdvancedRecovery, setStatus, setWordsCount, } from 'src/actions/recovery/recoveryActions'; +import { MODAL } from 'src/actions/suite/constants'; +import { SelectRecoveryType, SelectWordCount } from 'src/components/recovery'; +import { CheckItem, Loading, Translation } from 'src/components/suite'; +import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; -import type { ForegroundAppProps } from 'src/types/suite'; -import type { WordCount } from 'src/types/recovery'; import messages from 'src/support/messages'; -import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; -import { MODAL } from 'src/actions/suite/constants'; +import type { WordCount } from 'src/types/recovery'; +import type { ForegroundAppProps } from 'src/types/suite'; -import { T1B1InputStep } from './steps/T1B1InputStep'; import { EnterOnDeviceStep } from './steps/EnterOnDeviceStep'; +import { T1B1InputStep } from './steps/T1B1InputStep'; export const Recovery = ({ onCancel }: ForegroundAppProps) => { const recovery = useSelector(state => state.recovery); diff --git a/packages/suite/src/views/recovery/steps/T1B1InputStep.tsx b/packages/suite/src/views/recovery/steps/T1B1InputStep.tsx index d3583502bd8..031ae574c3c 100644 --- a/packages/suite/src/views/recovery/steps/T1B1InputStep.tsx +++ b/packages/suite/src/views/recovery/steps/T1B1InputStep.tsx @@ -1,7 +1,8 @@ import { Paragraph } from '@trezor/components'; -import { HELP_CENTER_ADVANCED_RECOVERY_URL } from '@trezor/urls'; import { UI } from '@trezor/connect'; +import { HELP_CENTER_ADVANCED_RECOVERY_URL } from '@trezor/urls'; +import { MODAL } from 'src/actions/suite/constants'; import { PinMatrix, Translation, @@ -10,7 +11,6 @@ import { WordInputAdvanced, } from 'src/components/suite'; import { useDevice, useSelector } from 'src/hooks/suite'; -import { MODAL } from 'src/actions/suite/constants'; const RequestConfirmationStep = () => ( diff --git a/packages/suite/src/views/settings/SettingsCoins/FirmwareTypeSuggestion.tsx b/packages/suite/src/views/settings/SettingsCoins/FirmwareTypeSuggestion.tsx index 574850e75ab..340cd235a7e 100644 --- a/packages/suite/src/views/settings/SettingsCoins/FirmwareTypeSuggestion.tsx +++ b/packages/suite/src/views/settings/SettingsCoins/FirmwareTypeSuggestion.tsx @@ -1,11 +1,11 @@ import styled from 'styled-components'; -import { Button, Banner } from '@trezor/components'; +import { Banner, Button } 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 { setFlag } from 'src/actions/suite/suiteActions'; import { Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useDevice, useDispatch } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/settings/SettingsCoins/SettingsCoins.tsx b/packages/suite/src/views/settings/SettingsCoins/SettingsCoins.tsx index 649e7889e68..8703773a89f 100644 --- a/packages/suite/src/views/settings/SettingsCoins/SettingsCoins.tsx +++ b/packages/suite/src/views/settings/SettingsCoins/SettingsCoins.tsx @@ -1,8 +1,8 @@ -import styled from 'styled-components'; import { AnimatePresence, MotionProps, motion } from 'framer-motion'; +import styled from 'styled-components'; -import { startDiscoveryThunk, selectDeviceSupportedNetworks } from '@suite-common/wallet-core'; -import { Button, motionEasing, Tooltip } from '@trezor/components'; +import { selectDeviceSupportedNetworks, startDiscoveryThunk } from '@suite-common/wallet-core'; +import { Button, Tooltip, motionEasing } from '@trezor/components'; import { hasBitcoinOnlyFirmware, isBitcoinOnlyDevice } from '@trezor/device-utils'; import { spacingsPx } from '@trezor/theme'; @@ -13,14 +13,14 @@ import { SettingsSectionItem, } from 'src/components/settings'; import { CoinGroup, Translation } from 'src/components/suite'; -import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useNetworkSupport } from 'src/hooks/settings/useNetworkSupport'; import { useDevice, - useRediscoveryNeeded, + useDiscovery, useDispatch, + useRediscoveryNeeded, useSelector, - useDiscovery, } from 'src/hooks/suite'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; import { isCoinjoinSupportedSymbol } from 'src/utils/wallet/coinjoinUtils'; diff --git a/packages/suite/src/views/settings/SettingsDebug/Backends.tsx b/packages/suite/src/views/settings/SettingsDebug/Backends.tsx index b7ceb721a14..63afec5d42e 100644 --- a/packages/suite/src/views/settings/SettingsDebug/Backends.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/Backends.tsx @@ -1,16 +1,16 @@ import styled from 'styled-components'; -import { getNetwork, NetworkSymbol } from '@suite-common/wallet-config'; +import { NetworkSymbol, getNetwork } from '@suite-common/wallet-config'; import { selectNetworkBlockchainInfo } from '@suite-common/wallet-core'; import { ConnectionStatus } from '@suite-common/wallet-types'; import { Button } from '@trezor/components'; import { CoinLogo } from '@trezor/product-components'; import { typography } from '@trezor/theme'; +import { openModal } from 'src/actions/suite/modalActions'; import { SectionItem, StatusLight, Translation } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { useBackendReconnection } from 'src/hooks/settings/backends'; -import { openModal } from 'src/actions/suite/modalActions'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; const CoinSection = styled.div` diff --git a/packages/suite/src/views/settings/SettingsDebug/CheckFirmwareAuthenticity.tsx b/packages/suite/src/views/settings/SettingsDebug/CheckFirmwareAuthenticity.tsx index fbfef61573f..13cb33b9d0c 100644 --- a/packages/suite/src/views/settings/SettingsDebug/CheckFirmwareAuthenticity.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/CheckFirmwareAuthenticity.tsx @@ -1,8 +1,8 @@ import { Switch } from '@trezor/components'; +import { SUITE } from 'src/actions/suite/constants'; import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { SUITE } from 'src/actions/suite/constants'; export const CheckFirmwareAuthenticity = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/views/settings/SettingsDebug/CoinjoinApi.tsx b/packages/suite/src/views/settings/SettingsDebug/CoinjoinApi.tsx index f5c6e8b1388..affc61302df 100644 --- a/packages/suite/src/views/settings/SettingsDebug/CoinjoinApi.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/CoinjoinApi.tsx @@ -1,15 +1,15 @@ import styled from 'styled-components'; +import { BITCOIN_ONLY_SYMBOLS } from '@suite-common/suite-constants'; import { NetworkSymbol, getNetwork } from '@suite-common/wallet-config'; import { Button } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { BITCOIN_ONLY_SYMBOLS } from '@suite-common/suite-constants'; -import { ActionColumn, ActionSelect, SectionItem, TextColumn } from 'src/components/suite'; -import { COINJOIN_NETWORKS, CoinjoinSymbol } from 'src/services/coinjoin'; import { setDebugSettings } from 'src/actions/wallet/coinjoinClientActions'; +import { ActionColumn, ActionSelect, SectionItem, TextColumn } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { CoinjoinServerEnvironment, CoinjoinClientInstance } from 'src/types/wallet/coinjoin'; +import { COINJOIN_NETWORKS, CoinjoinSymbol } from 'src/services/coinjoin'; +import { CoinjoinClientInstance, CoinjoinServerEnvironment } from 'src/types/wallet/coinjoin'; import { reloadApp } from 'src/utils/suite/reload'; import { isCoinjoinSupportedSymbol } from 'src/utils/wallet/coinjoinUtils'; diff --git a/packages/suite/src/views/settings/SettingsDebug/DeviceAuthenticity.tsx b/packages/suite/src/views/settings/SettingsDebug/DeviceAuthenticity.tsx index c4da500a03e..985caeba1ac 100644 --- a/packages/suite/src/views/settings/SettingsDebug/DeviceAuthenticity.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/DeviceAuthenticity.tsx @@ -1,8 +1,8 @@ import { Switch } from '@trezor/components'; -import { useSelector, useDispatch } from 'src/hooks/suite'; -import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; import { setDebugMode } from 'src/actions/suite/suiteActions'; +import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; export const DeviceAuthenticity = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/views/settings/SettingsDebug/Devkit.tsx b/packages/suite/src/views/settings/SettingsDebug/Devkit.tsx index 02936d8ce37..8fff70b5605 100644 --- a/packages/suite/src/views/settings/SettingsDebug/Devkit.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/Devkit.tsx @@ -1,8 +1,8 @@ -import { Switch } from '@trezor/components'; import { firmwareActions, selectUseDevkit } from '@suite-common/firmware'; +import { Switch } from '@trezor/components'; import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; -import { useSelector, useDispatch } from 'src/hooks/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; export const Devkit = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/views/settings/SettingsDebug/GithubIssue.tsx b/packages/suite/src/views/settings/SettingsDebug/GithubIssue.tsx index 37cc9a67f91..edf13c5eb7a 100644 --- a/packages/suite/src/views/settings/SettingsDebug/GithubIssue.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/GithubIssue.tsx @@ -1,9 +1,9 @@ -import { SettingsAnchor } from 'src/constants/suite/anchors'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn } from 'src/components/suite'; +import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useDevice, useSelector } from 'src/hooks/suite'; -import { openGithubIssue } from 'src/services/github'; import { selectActiveTransports } from 'src/reducers/suite/suiteReducer'; +import { openGithubIssue } from 'src/services/github'; export const GithubIssue = () => { const transports = useSelector(selectActiveTransports); diff --git a/packages/suite/src/views/settings/SettingsDebug/InvityApi.tsx b/packages/suite/src/views/settings/SettingsDebug/InvityApi.tsx index f7cb0a54418..790e2dfabfb 100644 --- a/packages/suite/src/views/settings/SettingsDebug/InvityApi.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/InvityApi.tsx @@ -3,11 +3,11 @@ import styled from 'styled-components'; import type { InvityServerEnvironment } from '@suite-common/invity'; import { invityAPI } from '@suite-common/invity'; +import { setDebugMode } from 'src/actions/suite/suiteActions'; 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 { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { reloadApp } from 'src/utils/suite/reload'; const StyledActionSelect = styled(ActionSelect)` diff --git a/packages/suite/src/views/settings/SettingsDebug/MessageSystemDebugInfo.tsx b/packages/suite/src/views/settings/SettingsDebug/MessageSystemDebugInfo.tsx index 58dda40e1e5..321d8064e4a 100644 --- a/packages/suite/src/views/settings/SettingsDebug/MessageSystemDebugInfo.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/MessageSystemDebugInfo.tsx @@ -1,9 +1,9 @@ import { useState } from 'react'; -import { Box, Button, ButtonGroup, Column, NewModal, Paragraph, Row } from '@trezor/components'; import { selectAllValidMessages, selectMessageSystemConfig } from '@suite-common/message-system'; -import { copyToClipboard } from '@trezor/dom-utils'; import { Message } from '@suite-common/suite-types'; +import { Box, Button, ButtonGroup, Column, NewModal, Paragraph, Row } from '@trezor/components'; +import { copyToClipboard } from '@trezor/dom-utils'; import { spacings } from '@trezor/theme'; import { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/settings/SettingsDebug/Metadata.tsx b/packages/suite/src/views/settings/SettingsDebug/Metadata.tsx index 5c54842cef8..a57f90ee5dd 100644 --- a/packages/suite/src/views/settings/SettingsDebug/Metadata.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/Metadata.tsx @@ -2,9 +2,9 @@ import { useState } from 'react'; import { Button } from '@trezor/components'; +import { exportMetadataToLocalFile } from 'src/actions/suite/metadataActions'; import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; -import { exportMetadataToLocalFile } from 'src/actions/suite/metadataActions'; export const Metadata = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/views/settings/SettingsDebug/OAuthApi.tsx b/packages/suite/src/views/settings/SettingsDebug/OAuthApi.tsx index e3b818ac048..33144ddeb9b 100644 --- a/packages/suite/src/views/settings/SettingsDebug/OAuthApi.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/OAuthApi.tsx @@ -1,12 +1,12 @@ import styled from 'styled-components'; +import { setDebugMode } from 'src/actions/suite/suiteActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, ActionSelect, TextColumn } from 'src/components/suite'; -import GoogleClient from 'src/services/google'; -import { setDebugMode } from 'src/actions/suite/suiteActions'; +import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useDispatch, useSelector } from 'src/hooks/suite'; +import GoogleClient from 'src/services/google'; import type { OAuthServerEnvironment } from 'src/types/suite/metadata'; -import { SettingsAnchor } from 'src/constants/suite/anchors'; const StyledActionSelect = styled(ActionSelect)` min-width: 256px; diff --git a/packages/suite/src/views/settings/SettingsDebug/SettingsDebug.tsx b/packages/suite/src/views/settings/SettingsDebug/SettingsDebug.tsx index 1a442aed188..741f48bf693 100644 --- a/packages/suite/src/views/settings/SettingsDebug/SettingsDebug.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/SettingsDebug.tsx @@ -1,28 +1,28 @@ import { isDesktop, isWeb } from '@trezor/env-utils'; -import { SettingsSection, SettingsLayout } from 'src/components/settings'; -import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; +import { SettingsLayout, SettingsSection } from 'src/components/settings'; import { useSelector } from 'src/hooks/suite'; +import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; -import { TranslationMode } from './TranslationMode'; -import { GithubIssue } from './GithubIssue'; -import { WipeData } from './WipeData'; -import { ThrowTestingError } from './ThrowTestingError'; -import { InvityApi } from './InvityApi'; -import { CoinjoinApi } from './CoinjoinApi'; -import { OAuthApi } from './OAuthApi'; +import { Backends } from './Backends'; import { CheckFirmwareAuthenticity } from './CheckFirmwareAuthenticity'; +import { CoinjoinApi } from './CoinjoinApi'; import { DeviceAuthenticity } from './DeviceAuthenticity'; import { Devkit } from './Devkit'; +import { GithubIssue } from './GithubIssue'; +import { InvityApi } from './InvityApi'; +import { MessageSystemDebugInfo } from './MessageSystemDebugInfo'; +import { Metadata } from './Metadata'; +import { OAuthApi } from './OAuthApi'; +import { PreField } from './PreField'; +import { ThrowTestingError } from './ThrowTestingError'; +import { Tor } from './Tor'; +import { TranslationMode } from './TranslationMode'; import { Transport } from './Transport'; import { TransportBackends } from './TransportBackends'; -import { ViewOnlySettings } from './ViewOnlySettings'; import { TriggerHighlight } from './TriggerHighlight'; -import { Backends } from './Backends'; -import { PreField } from './PreField'; -import { Tor } from './Tor'; -import { Metadata } from './Metadata'; -import { MessageSystemDebugInfo } from './MessageSystemDebugInfo'; +import { ViewOnlySettings } from './ViewOnlySettings'; +import { WipeData } from './WipeData'; export const SettingsDebug = () => { const flags = useSelector(selectSuiteFlags); diff --git a/packages/suite/src/views/settings/SettingsDebug/Tor.tsx b/packages/suite/src/views/settings/SettingsDebug/Tor.tsx index 01725610875..1cac5d079b8 100644 --- a/packages/suite/src/views/settings/SettingsDebug/Tor.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/Tor.tsx @@ -1,6 +1,6 @@ -import { useDispatch } from 'src/hooks/suite'; -import { ActionColumn, ActionButton, SectionItem, TextColumn } from 'src/components/suite'; import { toggleTor } from 'src/actions/suite/suiteActions'; +import { ActionButton, ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; +import { useDispatch } from 'src/hooks/suite'; export const Tor = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/views/settings/SettingsDebug/TranslationMode.tsx b/packages/suite/src/views/settings/SettingsDebug/TranslationMode.tsx index 3a09c2ae502..98d345ae059 100644 --- a/packages/suite/src/views/settings/SettingsDebug/TranslationMode.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/TranslationMode.tsx @@ -2,8 +2,8 @@ import { Switch } from '@trezor/components'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn } from 'src/components/suite'; -import { isTranslationMode, setTranslationMode } from 'src/utils/suite/l10n'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { isTranslationMode, setTranslationMode } from 'src/utils/suite/l10n'; export const TranslationMode = () => ( diff --git a/packages/suite/src/views/settings/SettingsDebug/Transport.tsx b/packages/suite/src/views/settings/SettingsDebug/Transport.tsx index 1edd7b175f6..7e5d87b5470 100644 --- a/packages/suite/src/views/settings/SettingsDebug/Transport.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/Transport.tsx @@ -1,14 +1,14 @@ import { useMemo } from 'react'; -import TrezorConnect from '@trezor/connect'; import { Checkbox } from '@trezor/components'; +import TrezorConnect from '@trezor/connect'; import { isDesktop } from '@trezor/env-utils'; import { ArrayElement } from '@trezor/type-utils'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { setDebugMode } from 'src/actions/suite/suiteActions'; -import { DebugModeOptions, selectActiveTransports } from 'src/reducers/suite/suiteReducer'; import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { DebugModeOptions, selectActiveTransports } from 'src/reducers/suite/suiteReducer'; type TransportMenuItem = { name: ArrayElement>; diff --git a/packages/suite/src/views/settings/SettingsDebug/TransportBackends.tsx b/packages/suite/src/views/settings/SettingsDebug/TransportBackends.tsx index b42f99bb84c..f4bfede1748 100644 --- a/packages/suite/src/views/settings/SettingsDebug/TransportBackends.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/TransportBackends.tsx @@ -1,6 +1,6 @@ +import { isDevEnv } from '@suite-common/suite-utils'; 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 { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/settings/SettingsDebug/ViewOnlySettings.tsx b/packages/suite/src/views/settings/SettingsDebug/ViewOnlySettings.tsx index c2ef2153943..3bd12ab9257 100644 --- a/packages/suite/src/views/settings/SettingsDebug/ViewOnlySettings.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/ViewOnlySettings.tsx @@ -1,8 +1,8 @@ import { Checkbox } from '@trezor/components'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { setFlag } from 'src/actions/suite/suiteActions'; import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; export const ViewOnlySettings = () => { diff --git a/packages/suite/src/views/settings/SettingsDebug/WipeData.tsx b/packages/suite/src/views/settings/SettingsDebug/WipeData.tsx index 3e6ad4c0a3f..647004297de 100644 --- a/packages/suite/src/views/settings/SettingsDebug/WipeData.tsx +++ b/packages/suite/src/views/settings/SettingsDebug/WipeData.tsx @@ -1,12 +1,12 @@ import styled from 'styled-components'; -import { desktopApi } from '@trezor/suite-desktop-api'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { desktopApi } from '@trezor/suite-desktop-api'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch, useSelector } from 'src/hooks/suite'; const UserDataLink = styled.span` cursor: pointer; diff --git a/packages/suite/src/views/settings/SettingsDevice/AutoLock.tsx b/packages/suite/src/views/settings/SettingsDevice/AutoLock.tsx index 7f4267f3e08..e9d930b9962 100644 --- a/packages/suite/src/views/settings/SettingsDevice/AutoLock.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/AutoLock.tsx @@ -1,11 +1,11 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; import { formatDurationStrict } from '@suite-common/suite-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { applySettings } from 'src/actions/settings/deviceSettingsActions'; 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 { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDevice, useDispatch, useLocales } from 'src/hooks/suite'; // auto lock times in seconds; allowed lock times by device: <1 minute, 6 days> const AUTO_LOCK_TIMES = { diff --git a/packages/suite/src/views/settings/SettingsDevice/BackupRecoverySeed.tsx b/packages/suite/src/views/settings/SettingsDevice/BackupRecoverySeed.tsx index 7313c19cb84..f7d74cdec80 100644 --- a/packages/suite/src/views/settings/SettingsDevice/BackupRecoverySeed.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/BackupRecoverySeed.tsx @@ -1,10 +1,10 @@ import { HELP_CENTER_RECOVERY_SEED_URL } from '@trezor/urls'; +import { goto } from 'src/actions/suite/routerActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDevice, useDispatch } from 'src/hooks/suite'; interface BackupRecoverySeedProps { isDeviceLocked: boolean; diff --git a/packages/suite/src/views/settings/SettingsDevice/Brightness.tsx b/packages/suite/src/views/settings/SettingsDevice/Brightness.tsx index 8753d672576..d5994cca4e6 100644 --- a/packages/suite/src/views/settings/SettingsDevice/Brightness.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/Brightness.tsx @@ -1,10 +1,10 @@ import TrezorConnect from '@trezor/connect'; -import { analytics, EventType } from '@trezor/suite-analytics'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { - SectionItem, ActionButton, ActionColumn, + SectionItem, TextColumn, Translation, } from 'src/components/suite'; diff --git a/packages/suite/src/views/settings/SettingsDevice/ChangeLanguage.tsx b/packages/suite/src/views/settings/SettingsDevice/ChangeLanguage.tsx index 0a5dd471550..f39abfcbe9d 100644 --- a/packages/suite/src/views/settings/SettingsDevice/ChangeLanguage.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/ChangeLanguage.tsx @@ -1,11 +1,11 @@ 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'; import { LANGUAGES } from '../../../config/suite'; import { Locale } from '../../../config/suite/languages'; +import { SettingsAnchor } from '../../../constants/suite/anchors'; +import { useDevice, useDispatch } from '../../../hooks/suite'; const BASE_TRANSLATIONS = [{ value: 'en-US', label: LANGUAGES['en'].name }]; diff --git a/packages/suite/src/views/settings/SettingsDevice/ChangePin.tsx b/packages/suite/src/views/settings/SettingsDevice/ChangePin.tsx index c8ed0bfc9f7..07b1472d598 100644 --- a/packages/suite/src/views/settings/SettingsDevice/ChangePin.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/ChangePin.tsx @@ -1,10 +1,10 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { changePin } from 'src/actions/settings/deviceSettingsActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDispatch } from 'src/hooks/suite'; -import { changePin } from 'src/actions/settings/deviceSettingsActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch } from 'src/hooks/suite'; interface ChangePinProps { isDeviceLocked: boolean; diff --git a/packages/suite/src/views/settings/SettingsDevice/CheckRecoverySeed.tsx b/packages/suite/src/views/settings/SettingsDevice/CheckRecoverySeed.tsx index de67654f690..520d893f746 100644 --- a/packages/suite/src/views/settings/SettingsDevice/CheckRecoverySeed.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/CheckRecoverySeed.tsx @@ -1,10 +1,10 @@ import { getCheckBackupUrl } from '@suite-common/suite-utils'; +import { goto } from 'src/actions/suite/routerActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDevice, useDispatch } from 'src/hooks/suite'; interface CheckRecoverySeedProps { isDeviceLocked: boolean; diff --git a/packages/suite/src/views/settings/SettingsDevice/CustomFirmware.tsx b/packages/suite/src/views/settings/SettingsDevice/CustomFirmware.tsx index 872e3fef39c..8d759b43132 100644 --- a/packages/suite/src/views/settings/SettingsDevice/CustomFirmware.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/CustomFirmware.tsx @@ -1,10 +1,10 @@ import { getFirmwareDowngradeUrl } from '@suite-common/suite-utils'; +import { goto } from 'src/actions/suite/routerActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDevice, useDispatch } from 'src/hooks/suite'; export const CustomFirmware = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/views/settings/SettingsDevice/DefaultWalletLoading.tsx b/packages/suite/src/views/settings/SettingsDevice/DefaultWalletLoading.tsx index ade89eb6214..8d8a8de3beb 100644 --- a/packages/suite/src/views/settings/SettingsDevice/DefaultWalletLoading.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/DefaultWalletLoading.tsx @@ -1,14 +1,14 @@ +import { deviceActions, selectSelectedDevice } from '@suite-common/wallet-core'; import { WalletType as DefaultWalletLoadingOptions } from '@suite-common/wallet-types'; import { SelectBar } from '@trezor/components'; import { EventType, analytics } from '@trezor/suite-analytics'; -import { deviceActions, selectSelectedDevice } from '@suite-common/wallet-core'; -import { Translation } from 'src/components/suite/Translation'; -import { SettingsAnchor } from 'src/constants/suite/anchors'; -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 { Translation } from 'src/components/suite/Translation'; +import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch, useSelector } from 'src/hooks/suite'; const options = [ { diff --git a/packages/suite/src/views/settings/SettingsDevice/DeviceAuthenticityOptOut.tsx b/packages/suite/src/views/settings/SettingsDevice/DeviceAuthenticityOptOut.tsx index 206ccd1732a..418a7b67fbe 100644 --- a/packages/suite/src/views/settings/SettingsDevice/DeviceAuthenticityOptOut.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/DeviceAuthenticityOptOut.tsx @@ -1,5 +1,7 @@ import { HELP_CENTER_DEVICE_AUTHENTICATION } from '@trezor/urls'; +import { openModal } from 'src/actions/suite/modalActions'; +import { deviceAuthenticityOptOut } from 'src/actions/suite/suiteActions'; import { ActionButton, ActionColumn, @@ -8,8 +10,6 @@ import { Translation, } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { openModal } from 'src/actions/suite/modalActions'; -import { deviceAuthenticityOptOut } from 'src/actions/suite/suiteActions'; export const DeviceAuthenticityOptOut = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/views/settings/SettingsDevice/DeviceLabel.tsx b/packages/suite/src/views/settings/SettingsDevice/DeviceLabel.tsx index d775fab30c0..b3696fe4021 100644 --- a/packages/suite/src/views/settings/SettingsDevice/DeviceLabel.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/DeviceLabel.tsx @@ -1,8 +1,8 @@ import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { MAX_LABEL_LENGTH } from 'src/constants/suite/device'; -import { SettingsAnchor } from 'src/constants/suite/anchors'; import { ChangeDeviceLabel } from 'src/components/suite/ChangeDeviceLabel'; +import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { MAX_LABEL_LENGTH } from 'src/constants/suite/device'; interface DeviceLabelProps { isDeviceLocked: boolean; diff --git a/packages/suite/src/views/settings/SettingsDevice/DisplayRotation.tsx b/packages/suite/src/views/settings/SettingsDevice/DisplayRotation.tsx index 343b8ffaeb2..f20ba395df8 100644 --- a/packages/suite/src/views/settings/SettingsDevice/DisplayRotation.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/DisplayRotation.tsx @@ -1,16 +1,16 @@ +import { Icon, SelectBar, Tooltip } from '@trezor/components'; import { DeviceModelInternal, type DisplayRotation as DisplayRotationType, PROTO, } from '@trezor/connect'; -import { analytics, EventType } from '@trezor/suite-analytics'; -import { Icon, SelectBar, Tooltip } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; -import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDevice, useDispatch } from 'src/hooks/suite'; type Rotation = { label: JSX.Element; value: DisplayRotationType }; diff --git a/packages/suite/src/views/settings/SettingsDevice/FirmwareRevisionCheck.tsx b/packages/suite/src/views/settings/SettingsDevice/FirmwareRevisionCheck.tsx index 162aadc0cbb..2b5b69cc805 100644 --- a/packages/suite/src/views/settings/SettingsDevice/FirmwareRevisionCheck.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/FirmwareRevisionCheck.tsx @@ -1,5 +1,7 @@ import { HELP_CENTER_FIRMWARE_REVISION_CHECK } from '@trezor/urls'; +import { openModal } from 'src/actions/suite/modalActions'; +import { toggleCheckFirmwareAuthenticity } from 'src/actions/suite/suiteActions'; import { ActionButton, ActionColumn, @@ -8,8 +10,6 @@ import { Translation, } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { openModal } from 'src/actions/suite/modalActions'; -import { toggleCheckFirmwareAuthenticity } from 'src/actions/suite/suiteActions'; 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 ec218a1cc4e..142c3799a1e 100644 --- a/packages/suite/src/views/settings/SettingsDevice/FirmwareTypeChange.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/FirmwareTypeChange.tsx @@ -8,6 +8,7 @@ import { } from '@trezor/device-utils'; import { HELP_FIRMWARE_TYPE } from '@trezor/urls'; +import { goto } from 'src/actions/suite/routerActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, @@ -16,9 +17,8 @@ import { Translation, TrezorLink, } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDevice, useDispatch } from 'src/hooks/suite'; import { getSuiteFirmwareTypeString } from 'src/utils/firmware'; const Version = styled.div` diff --git a/packages/suite/src/views/settings/SettingsDevice/FirmwareVersion.tsx b/packages/suite/src/views/settings/SettingsDevice/FirmwareVersion.tsx index bf97f53405b..6ae4dc2bbe4 100644 --- a/packages/suite/src/views/settings/SettingsDevice/FirmwareVersion.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/FirmwareVersion.tsx @@ -1,9 +1,10 @@ import styled from 'styled-components'; import { getChangelogUrl, getFwUpdateVersion } from '@suite-common/suite-utils'; -import { getFirmwareVersion } from '@trezor/device-utils'; import { Button, Tooltip } from '@trezor/components'; +import { getFirmwareVersion } from '@trezor/device-utils'; +import { goto } from 'src/actions/suite/routerActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, @@ -12,10 +13,9 @@ import { Translation, TrezorLink, } from 'src/components/suite'; +import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useDevice, useDispatch } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; import { AcquiredDevice } from 'src/types/suite'; -import { SettingsAnchor } from 'src/constants/suite/anchors'; const Version = styled.div` span { diff --git a/packages/suite/src/views/settings/SettingsDevice/HapticFeedback.tsx b/packages/suite/src/views/settings/SettingsDevice/HapticFeedback.tsx index 872d6067ec3..d7bb9922deb 100644 --- a/packages/suite/src/views/settings/SettingsDevice/HapticFeedback.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/HapticFeedback.tsx @@ -1,10 +1,10 @@ import { Switch } from '@trezor/components'; -import { analytics, EventType } from '@trezor/suite-analytics'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { useDevice, useDispatch } from '../../../hooks/suite'; diff --git a/packages/suite/src/views/settings/SettingsDevice/Homescreen.tsx b/packages/suite/src/views/settings/SettingsDevice/Homescreen.tsx index 2a7ff58efbb..852a264226a 100644 --- a/packages/suite/src/views/settings/SettingsDevice/Homescreen.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/Homescreen.tsx @@ -2,10 +2,12 @@ import { useRef, useState } from 'react'; import styled from 'styled-components'; +import { Button, ButtonGroup, Tooltip, variables } from '@trezor/components'; import { DeviceModelInternal } from '@trezor/connect'; import { HOMESCREEN_EDITOR_URL } from '@trezor/urls'; -import { Button, ButtonGroup, Tooltip, variables } from '@trezor/components'; +import { applySettings } from 'src/actions/settings/deviceSettingsActions'; +import { openModal } from 'src/actions/suite/modalActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, @@ -14,19 +16,17 @@ import { TextColumn, Translation, } from 'src/components/suite'; +import { SettingsAnchor } from 'src/constants/suite/anchors'; import { HAS_MONOCHROME_SCREEN } from 'src/constants/suite/device'; import { useDevice, useDispatch } from 'src/hooks/suite'; -import { openModal } from 'src/actions/suite/modalActions'; -import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { + ImageValidationError, deviceModelInformation, - imagePathToHex, fileToDataUrl, - ImageValidationError, - validateImage, + imagePathToHex, isHomescreenSupportedOnDevice, + validateImage, } from 'src/utils/suite/homescreen'; -import { SettingsAnchor } from 'src/constants/suite/anchors'; const HiddenInput = styled.input` display: none; diff --git a/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx b/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx index 3dcbe796acf..72502f40bf1 100644 --- a/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/MultiShareBackup.tsx @@ -1,7 +1,7 @@ -import { HELP_CENTER_MULTI_SHARE_BACKUP_URL } from '@trezor/urls'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; import { TrezorDevice } from '@suite-common/suite-types'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; import { EventType, analytics } from '@trezor/suite-analytics'; +import { HELP_CENTER_MULTI_SHARE_BACKUP_URL } from '@trezor/urls'; import { ActionButton, diff --git a/packages/suite/src/views/settings/SettingsDevice/Passphrase.tsx b/packages/suite/src/views/settings/SettingsDevice/Passphrase.tsx index 020d177d28e..01964f3931d 100644 --- a/packages/suite/src/views/settings/SettingsDevice/Passphrase.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/Passphrase.tsx @@ -1,12 +1,12 @@ -import { HELP_CENTER_PASSPHRASE_URL } from '@trezor/urls'; -import { analytics, EventType } from '@trezor/suite-analytics'; import { Switch } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { HELP_CENTER_PASSPHRASE_URL } from '@trezor/urls'; +import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; -import { applySettings } from 'src/actions/settings/deviceSettingsActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDevice, useDispatch } from 'src/hooks/suite'; interface PassphraseProps { isDeviceLocked: boolean; diff --git a/packages/suite/src/views/settings/SettingsDevice/PinProtection.tsx b/packages/suite/src/views/settings/SettingsDevice/PinProtection.tsx index 8b2580aa625..e36bcb9f491 100644 --- a/packages/suite/src/views/settings/SettingsDevice/PinProtection.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/PinProtection.tsx @@ -1,11 +1,11 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; import { Switch } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; -import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; import { changePin } from 'src/actions/settings/deviceSettingsActions'; -import { SettingsAnchor } from 'src/constants/suite/anchors'; 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 'src/hooks/suite'; interface PinProtectionProps { isDeviceLocked: boolean; diff --git a/packages/suite/src/views/settings/SettingsDevice/SafetyChecks.tsx b/packages/suite/src/views/settings/SettingsDevice/SafetyChecks.tsx index 0c34b6056cc..cb5bb365c28 100644 --- a/packages/suite/src/views/settings/SettingsDevice/SafetyChecks.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/SafetyChecks.tsx @@ -1,8 +1,8 @@ +import { openModal } from 'src/actions/suite/modalActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDispatch } from 'src/hooks/suite'; -import { openModal } from 'src/actions/suite/modalActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch } from 'src/hooks/suite'; interface SafetyChecksProps { isDeviceLocked: boolean; diff --git a/packages/suite/src/views/settings/SettingsDevice/SettingsDevice.tsx b/packages/suite/src/views/settings/SettingsDevice/SettingsDevice.tsx index 68bd2a011ef..24f00f34a41 100644 --- a/packages/suite/src/views/settings/SettingsDevice/SettingsDevice.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/SettingsDevice.tsx @@ -1,26 +1,31 @@ +import { SUPPORTS_DEVICE_AUTHENTICITY_CHECK } from '@suite-common/suite-constants'; import { isDeviceRemembered, isDeviceWithButtons } from '@suite-common/suite-utils'; import { isBitcoinOnlyDevice } from '@trezor/device-utils'; -import { SUPPORTS_DEVICE_AUTHENTICITY_CHECK } from '@suite-common/suite-constants'; import { DeviceBanner, SettingsLayout, SettingsSection } from 'src/components/settings'; import { Translation } from 'src/components/suite'; import { useDevice, useSelector } from 'src/hooks/suite'; +import { selectHasActiveTransport } from 'src/reducers/suite/suiteReducer'; import type { TrezorDevice } from 'src/types/suite'; import { isRecoveryInProgress } from 'src/utils/device/isRecoveryInProgress'; -import { selectHasActiveTransport } from 'src/reducers/suite/suiteReducer'; import { AuthenticateDevice } from './AuthenticateDevice'; import { AutoLock } from './AutoLock'; import { BackupFailed } from './BackupFailed'; import { BackupRecoverySeed } from './BackupRecoverySeed'; +import { Brightness } from './Brightness'; +import { ChangeLanguage } from './ChangeLanguage'; import { ChangePin } from './ChangePin'; import { CheckRecoverySeed } from './CheckRecoverySeed'; import { CustomFirmware } from './CustomFirmware'; +import { DefaultWalletLoading } from './DefaultWalletLoading'; import { DeviceAuthenticityOptOut } from './DeviceAuthenticityOptOut'; import { DeviceLabel } from './DeviceLabel'; import { DisplayRotation } from './DisplayRotation'; +import { FirmwareRevisionCheck } from './FirmwareRevisionCheck'; import { FirmwareTypeChange } from './FirmwareTypeChange'; import { FirmwareVersion } from './FirmwareVersion'; +import { HapticFeedback } from './HapticFeedback'; import { Homescreen } from './Homescreen'; import { MultiShareBackup } from './MultiShareBackup'; import { Passphrase } from './Passphrase'; @@ -28,11 +33,6 @@ import { PinProtection } from './PinProtection'; import { SafetyChecks } from './SafetyChecks'; import { WipeCode } from './WipeCode'; import { WipeDevice } from './WipeDevice'; -import { ChangeLanguage } from './ChangeLanguage'; -import { HapticFeedback } from './HapticFeedback'; -import { Brightness } from './Brightness'; -import { DefaultWalletLoading } from './DefaultWalletLoading'; -import { FirmwareRevisionCheck } from './FirmwareRevisionCheck'; const deviceSettingsUnavailable = (device?: TrezorDevice) => { const wrongDeviceType = device?.type && ['unacquired', 'unreadable'].includes(device.type); diff --git a/packages/suite/src/views/settings/SettingsDevice/WipeCode.tsx b/packages/suite/src/views/settings/SettingsDevice/WipeCode.tsx index 85d5656773b..dd185da0503 100644 --- a/packages/suite/src/views/settings/SettingsDevice/WipeCode.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/WipeCode.tsx @@ -1,8 +1,8 @@ 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 { EventType, analytics } from '@trezor/suite-analytics'; +import { HELP_CENTER_WIPE_CODE_URL } from '@trezor/urls'; import { changeWipeCode } from 'src/actions/settings/deviceSettingsActions'; import { SettingsSectionItem } from 'src/components/settings'; diff --git a/packages/suite/src/views/settings/SettingsDevice/WipeDevice.tsx b/packages/suite/src/views/settings/SettingsDevice/WipeDevice.tsx index 98817e2d5a6..f0efa7b4e3d 100644 --- a/packages/suite/src/views/settings/SettingsDevice/WipeDevice.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/WipeDevice.tsx @@ -1,10 +1,10 @@ import { isDeviceInBootloaderMode } from '@trezor/device-utils'; +import { openModal } from 'src/actions/suite/modalActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; -import { openModal } from 'src/actions/suite/modalActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDevice, useDispatch } from 'src/hooks/suite'; interface WipeDeviceProps { isDeviceLocked: boolean; diff --git a/packages/suite/src/views/settings/SettingsGeneral/AddressDisplay.tsx b/packages/suite/src/views/settings/SettingsGeneral/AddressDisplay.tsx index 3d6656d905e..a55e0f14575 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/AddressDisplay.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/AddressDisplay.tsx @@ -2,12 +2,12 @@ import { AddressDisplayOptions } from '@suite-common/wallet-types'; import { SelectBar } from '@trezor/components'; import { EventType, analytics } from '@trezor/suite-analytics'; -import { Translation } from 'src/components/suite/Translation'; -import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { setAddressDisplayType } from 'src/actions/suite/suiteActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn } from 'src/components/suite'; +import { Translation } from 'src/components/suite/Translation'; +import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch, useSelector } from 'src/hooks/suite'; const options = [ { diff --git a/packages/suite/src/views/settings/SettingsGeneral/BitcoinAmountUnit.tsx b/packages/suite/src/views/settings/SettingsGeneral/BitcoinAmountUnit.tsx index 1425646eb0f..92c8077ab62 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/BitcoinAmountUnit.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/BitcoinAmountUnit.tsx @@ -1,5 +1,5 @@ -import { PROTO } from '@trezor/connect'; import { UNIT_LABELS, UNIT_OPTIONS } from '@suite-common/suite-constants'; +import { PROTO } from '@trezor/connect'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, ActionSelect, TextColumn, Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/settings/SettingsGeneral/ClearStorage.tsx b/packages/suite/src/views/settings/SettingsGeneral/ClearStorage.tsx index 6e376368314..a6149407b58 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/ClearStorage.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/ClearStorage.tsx @@ -1,11 +1,11 @@ import { desktopApi } from '@trezor/suite-desktop-api'; +import { goto } from 'src/actions/suite/routerActions'; +import { removeDatabase } from 'src/actions/suite/storageActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { removeDatabase } from 'src/actions/suite/storageActions'; -import { goto } from 'src/actions/suite/routerActions'; -import { useDispatch } from 'src/hooks/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch } from 'src/hooks/suite'; import { reloadApp } from 'src/utils/suite/reload'; export const ClearStorage = () => { diff --git a/packages/suite/src/views/settings/SettingsGeneral/ConnectLabelingProvider.tsx b/packages/suite/src/views/settings/SettingsGeneral/ConnectLabelingProvider.tsx index fa4103ca56b..6485daead56 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/ConnectLabelingProvider.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/ConnectLabelingProvider.tsx @@ -1,10 +1,10 @@ import { Tooltip } from '@trezor/components'; +import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; -import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDevice, useDispatch } from 'src/hooks/suite'; export const ConnectLabelingProvider = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/views/settings/SettingsGeneral/DesktopSuiteBanner.tsx b/packages/suite/src/views/settings/SettingsGeneral/DesktopSuiteBanner.tsx index e587ac51ce3..76215c80e9c 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/DesktopSuiteBanner.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/DesktopSuiteBanner.tsx @@ -1,9 +1,10 @@ import { useState } from 'react'; -import styled from 'styled-components'; import { AnimatePresence, HTMLMotionProps, motion } from 'framer-motion'; +import styled from 'styled-components'; import { + Box, Button, H2, Icon, @@ -11,15 +12,14 @@ import { Image, Paragraph, motionEasing, - Box, } 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 { EventType, analytics } from '@trezor/suite-analytics'; +import { SUITE_URL } from '@trezor/urls'; -import { useDispatch } from 'src/hooks/suite/useDispatch'; import { setFlag } from 'src/actions/suite/suiteActions'; import { Translation } from 'src/components/suite'; +import { useDispatch } from 'src/hooks/suite/useDispatch'; import { useExternalLink } from '../../../hooks/suite'; diff --git a/packages/suite/src/views/settings/SettingsGeneral/DisconnectLabelingProvider.tsx b/packages/suite/src/views/settings/SettingsGeneral/DisconnectLabelingProvider.tsx index fff004401e8..f52763a49e7 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/DisconnectLabelingProvider.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/DisconnectLabelingProvider.tsx @@ -1,10 +1,10 @@ import { capitalizeFirstLetter } from '@trezor/utils'; +import { disconnectProvider } from 'src/actions/suite/metadataProviderActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useSelector, useDispatch } from 'src/hooks/suite'; -import { disconnectProvider } from 'src/actions/suite/metadataProviderActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectSelectedProviderForLabels } from 'src/reducers/suite/metadataReducer'; export const DisconnectLabelingProvider = () => { diff --git a/packages/suite/src/views/settings/SettingsGeneral/EarlyAccess.tsx b/packages/suite/src/views/settings/SettingsGeneral/EarlyAccess.tsx index 548acddb27d..b92f7718e3a 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/EarlyAccess.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/EarlyAccess.tsx @@ -2,11 +2,11 @@ import styled from 'styled-components'; import { desktopApi } from '@trezor/suite-desktop-api'; +import { openEarlyAccessSetup } from 'src/actions/suite/desktopUpdateActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { openEarlyAccessSetup } from 'src/actions/suite/desktopUpdateActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch, useSelector } from 'src/hooks/suite'; const Version = styled.div` span { diff --git a/packages/suite/src/views/settings/SettingsGeneral/Experimental.tsx b/packages/suite/src/views/settings/SettingsGeneral/Experimental.tsx index e523d6f0a99..2e775c93af5 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Experimental.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Experimental.tsx @@ -1,16 +1,16 @@ -import styled from 'styled-components'; import { AnimatePresence, motion } from 'framer-motion'; +import styled from 'styled-components'; -import { Checkbox, Switch, Banner, Button } from '@trezor/components'; +import { Banner, Button, Checkbox, Switch } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; import { EXPERIMENTAL_FEATURES_KB_URL } from '@trezor/urls'; import { SUITE } from 'src/actions/suite/constants'; +import { goto } from 'src/actions/suite/routerActions'; import { ActionColumn, SectionItem, TextColumn, Translation } from 'src/components/suite'; import { EXPERIMENTAL_FEATURES, ExperimentalFeature } from 'src/constants/suite/experimental'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; -import { goto } from 'src/actions/suite/routerActions'; const FeatureLineWrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/settings/SettingsGeneral/Fiat.tsx b/packages/suite/src/views/settings/SettingsGeneral/Fiat.tsx index 6f712578f49..d2806da60ce 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Fiat.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Fiat.tsx @@ -1,11 +1,11 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; import { FiatCurrencyCode, fiatCurrencies } from '@suite-common/suite-config'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { setLocalCurrency } from 'src/actions/settings/walletSettingsActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, ActionSelect, TextColumn, Translation } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { setLocalCurrency } from 'src/actions/settings/walletSettingsActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; const buildCurrencyOption = (currency: string) => ({ diff --git a/packages/suite/src/views/settings/SettingsGeneral/Labeling.tsx b/packages/suite/src/views/settings/SettingsGeneral/Labeling.tsx index bf01419758b..07634623519 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Labeling.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Labeling.tsx @@ -1,13 +1,13 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; import { LoadingContent, Switch, Tooltip } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { HELP_CENTER_LABELING } from '@trezor/urls'; -import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useSelector, useDispatch, useDevice, useDiscovery } from 'src/hooks/suite'; import * as metadataActions from 'src/actions/suite/metadataActions'; import * as metadataLabelingActions from 'src/actions/suite/metadataLabelingActions'; -import { SettingsAnchor } from 'src/constants/suite/anchors'; import { SettingsSectionItem } from 'src/components/settings'; +import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; +import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDevice, useDiscovery, useDispatch, useSelector } from 'src/hooks/suite'; export const Labeling = () => { const metadata = useSelector(state => state.metadata); diff --git a/packages/suite/src/views/settings/SettingsGeneral/Language.tsx b/packages/suite/src/views/settings/SettingsGeneral/Language.tsx index dae86d90c0f..3704d2c2796 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Language.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Language.tsx @@ -1,18 +1,18 @@ import { useMemo } from 'react'; -import { analytics, EventType } from '@trezor/suite-analytics'; import { getPlatformLanguages } from '@trezor/env-utils'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { CROWDIN_URL } from '@trezor/urls'; +import { setLanguage } from 'src/actions/settings/languageActions'; +import { setAutodetect } from 'src/actions/suite/suiteActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, ActionSelect, TextColumn, Translation } from 'src/components/suite'; -import { isTranslationMode, getOsLocale } from 'src/utils/suite/l10n'; -import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; 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 { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { getOsLocale, isTranslationMode } from 'src/utils/suite/l10n'; const onlyOfficial = (locale: [string, LocaleInfo]): locale is [Locale, LocaleInfo] => locale[1].type === 'official'; diff --git a/packages/suite/src/views/settings/SettingsGeneral/SettingsGeneral.tsx b/packages/suite/src/views/settings/SettingsGeneral/SettingsGeneral.tsx index 5dbf0ec39d3..d85579a32dc 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/SettingsGeneral.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/SettingsGeneral.tsx @@ -1,39 +1,39 @@ -import { isDesktop, isWeb } from '@trezor/env-utils'; import { getNetwork } from '@suite-common/wallet-config'; +import { isDesktop, isWeb } from '@trezor/env-utils'; import { SettingsLayout, SettingsSection } from 'src/components/settings'; import { Translation } from 'src/components/suite'; import { useLayoutSize, useSelector } from 'src/hooks/suite'; +import { selectSelectedProviderForLabels } from 'src/reducers/suite/metadataReducer'; import { + selectHasExperimentalFeature, selectIsSettingsDesktopAppPromoBannerShown, selectTorState, - selectHasExperimentalFeature, } from 'src/reducers/suite/suiteReducer'; import { selectEnabledNetworks } from 'src/reducers/wallet/settingsReducer'; -import { selectSelectedProviderForLabels } from 'src/reducers/suite/metadataReducer'; -import { Language } from './Language'; -import { Fiat } from './Fiat'; -import { Labeling } from './Labeling'; -import { DisconnectLabelingProvider } from './DisconnectLabelingProvider'; -import { ConnectLabelingProvider } from './ConnectLabelingProvider'; -import { Tor } from './Tor'; -import { TorOnionLinks } from './TorOnionLinks'; -import { Theme } from './Theme'; +import { AddressDisplay } from './AddressDisplay'; import { Analytics } from './Analytics'; -import { ShowApplicationLog } from './ShowApplicationLog'; -import { ClearStorage } from './ClearStorage'; -import { VersionWithUpdate } from './VersionWithUpdate'; -import { EarlyAccess } from './EarlyAccess'; +import { AutoStart } from './AutoStart'; +import { AutomaticUpdate } from './AutomaticUpdate'; import { BitcoinAmountUnit } from './BitcoinAmountUnit'; +import { ClearStorage } from './ClearStorage'; +import { ConnectLabelingProvider } from './ConnectLabelingProvider'; import { DesktopSuiteBanner } from './DesktopSuiteBanner'; -import { AddressDisplay } from './AddressDisplay'; +import { DisconnectLabelingProvider } from './DisconnectLabelingProvider'; +import { EarlyAccess } from './EarlyAccess'; import { EnableViewOnly } from './EnableViewOnly'; import { Experimental } from './Experimental'; -import { AutomaticUpdate } from './AutomaticUpdate'; -import { AutoStart } from './AutoStart'; +import { Fiat } from './Fiat'; +import { Labeling } from './Labeling'; +import { Language } from './Language'; +import { ShowApplicationLog } from './ShowApplicationLog'; import { ShowOnTray } from './ShowOnTray'; +import { Theme } from './Theme'; +import { Tor } from './Tor'; import { TorExternal } from './TorExternal'; +import { TorOnionLinks } from './TorOnionLinks'; +import { VersionWithUpdate } from './VersionWithUpdate'; export const SettingsGeneral = () => { const shouldShowSettingsDesktopAppPromoBanner = useSelector( diff --git a/packages/suite/src/views/settings/SettingsGeneral/ShowApplicationLog.tsx b/packages/suite/src/views/settings/SettingsGeneral/ShowApplicationLog.tsx index 5643d0067ca..04528d2705c 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/ShowApplicationLog.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/ShowApplicationLog.tsx @@ -1,8 +1,8 @@ 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'; +import { useDispatch } from 'src/hooks/suite'; export const ShowApplicationLog = () => { const dispatch = useDispatch(); diff --git a/packages/suite/src/views/settings/SettingsGeneral/Theme.tsx b/packages/suite/src/views/settings/SettingsGeneral/Theme.tsx index 7f6e49e294b..dc35b848e3b 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Theme.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Theme.tsx @@ -1,14 +1,14 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; -import { desktopApi, SuiteThemeVariant } from '@trezor/suite-desktop-api'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { SuiteThemeVariant, desktopApi } 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 { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; +import { getOsTheme } from 'src/utils/suite/env'; 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 8768b00b050..ee196a25bb0 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/Tor.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/Tor.tsx @@ -3,15 +3,15 @@ import { useEffect, useState } from 'react'; import { LoadingContent, Switch } from '@trezor/components'; import { HELP_CENTER_TOR_URL } from '@trezor/urls'; -import { useDispatch, useSelector } from 'src/hooks/suite'; +import { openDeferredModal } from 'src/actions/suite/modalActions'; import { toggleTor } from 'src/actions/suite/suiteActions'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; -import { getIsTorEnabled, getIsTorLoading } from 'src/utils/suite/tor'; -import { TorStatus } from 'src/types/suite'; -import { openDeferredModal } from 'src/actions/suite/modalActions'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectCoinjoinAccounts } from 'src/reducers/wallet/coinjoinReducer'; +import { TorStatus } from 'src/types/suite'; +import { getIsTorEnabled, getIsTorLoading } from 'src/utils/suite/tor'; export const Tor = () => { const [hasTorError, setHasTorError] = useState(false); diff --git a/packages/suite/src/views/settings/SettingsGeneral/TorExternal.tsx b/packages/suite/src/views/settings/SettingsGeneral/TorExternal.tsx index 0588a1a0c20..b7a9b85eeb6 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/TorExternal.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/TorExternal.tsx @@ -1,13 +1,13 @@ import { useEffect, useState } from 'react'; -import { TorSettings } from '@trezor/suite-desktop-api/src/messages'; import { desktopApi } from '@trezor/suite-desktop-api'; +import { TorSettings } from '@trezor/suite-desktop-api/src/messages'; -import { ActionColumn, ActionSelect, TextColumn, Translation } from 'src/components/suite'; -import { selectTorState } from 'src/reducers/suite/suiteReducer'; -import { useSelector } from 'src/hooks/suite'; import { SettingsSectionItem } from 'src/components/settings'; +import { ActionColumn, ActionSelect, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useSelector } from 'src/hooks/suite'; +import { selectTorState } from 'src/reducers/suite/suiteReducer'; const options = [ { diff --git a/packages/suite/src/views/settings/SettingsGeneral/TorOnionLinks.tsx b/packages/suite/src/views/settings/SettingsGeneral/TorOnionLinks.tsx index b8540de554b..8ec98542a11 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/TorOnionLinks.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/TorOnionLinks.tsx @@ -1,11 +1,11 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; import { Switch } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { setOnionLinks } from 'src/actions/suite/suiteActions'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { SettingsSectionItem } from 'src/components/settings'; import { ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { SettingsAnchor } from 'src/constants/suite/anchors'; +import { useDispatch, useSelector } from 'src/hooks/suite'; /* keep torOnionLinks value as it is but hide this section when tor is off. when tor is off this value has no effect anyway (handled by ExternalLink hook) */ diff --git a/packages/suite/src/views/settings/SettingsGeneral/VersionWithUpdate.tsx b/packages/suite/src/views/settings/SettingsGeneral/VersionWithUpdate.tsx index 19d6d609a74..4190cb34294 100644 --- a/packages/suite/src/views/settings/SettingsGeneral/VersionWithUpdate.tsx +++ b/packages/suite/src/views/settings/SettingsGeneral/VersionWithUpdate.tsx @@ -11,9 +11,9 @@ import { Translation, TrezorLink, } from 'src/components/suite'; +import { SettingsAnchor } from 'src/constants/suite/anchors'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { DesktopUpdateState, UpdateState } from 'src/reducers/suite/desktopUpdateReducer'; -import { SettingsAnchor } from 'src/constants/suite/anchors'; import { getReleaseUrl } from 'src/services/github'; const getUpdateStateMessage = (state: UpdateState) => { diff --git a/packages/suite/src/views/settings/SettingsLoader.tsx b/packages/suite/src/views/settings/SettingsLoader.tsx index d1fbf0226bc..90a008b1943 100644 --- a/packages/suite/src/views/settings/SettingsLoader.tsx +++ b/packages/suite/src/views/settings/SettingsLoader.tsx @@ -1,7 +1,7 @@ import React from 'react'; +import { AnimatePresence, motion } from 'framer-motion'; import styled from 'styled-components'; -import { motion, AnimatePresence } from 'framer-motion'; import { H3, Spinner, motionEasing } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; diff --git a/packages/suite/src/views/start/StartContent.tsx b/packages/suite/src/views/start/StartContent.tsx index a867f5bfd99..04c790e16f4 100644 --- a/packages/suite/src/views/start/StartContent.tsx +++ b/packages/suite/src/views/start/StartContent.tsx @@ -2,11 +2,11 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; +import { selectIsAnalyticsConfirmed } from '@suite-common/analytics'; 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 { DATA_TOS_URL, DOCS_ANALYTICS_URL } from '@trezor/urls'; import { rerun } from 'src/actions/recovery/recoveryActions'; import { PrerequisitesGuide, TrezorLink } from 'src/components/suite'; diff --git a/packages/suite/src/views/suite/ErrorPage.tsx b/packages/suite/src/views/suite/ErrorPage.tsx index e9148ed4f01..e52725299c4 100644 --- a/packages/suite/src/views/suite/ErrorPage.tsx +++ b/packages/suite/src/views/suite/ErrorPage.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { Paragraph, H2, Button, Link, Image } from '@trezor/components'; +import { Button, H2, Image, Link, Paragraph } from '@trezor/components'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/suite/SwitchDevice/CardWithDevice.tsx b/packages/suite/src/views/suite/SwitchDevice/CardWithDevice.tsx index 38b24190313..2d5da347d45 100644 --- a/packages/suite/src/views/suite/SwitchDevice/CardWithDevice.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/CardWithDevice.tsx @@ -3,11 +3,11 @@ 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 { Card, IconName, motionAnimation, useElevation } from '@trezor/components'; import { Elevation, mapElevationToBorder, spacingsPx } from '@trezor/theme'; -import type { TrezorDevice, ForegroundAppProps } from 'src/types/suite'; +import type { ForegroundAppProps, TrezorDevice } from 'src/types/suite'; 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 b8cbbe68077..6da9736e344 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/AddWalletButton.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/AddWalletButton.tsx @@ -1,12 +1,12 @@ +import { WalletType } from '@suite-common/wallet-types'; import { Button, Column, HotkeyBadge, Row, Tooltip } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { WalletType } from '@suite-common/wallet-types'; +import { addWalletThunk } from 'src/actions/wallet/addWalletThunk'; import { Translation } from 'src/components/suite'; -import { TrezorDevice, AcquiredDevice, ForegroundAppProps } from 'src/types/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { addWalletThunk } from 'src/actions/wallet/addWalletThunk'; import { selectIsDeviceOrUiLocked } from 'src/reducers/suite/suiteReducer'; +import { AcquiredDevice, ForegroundAppProps, TrezorDevice } from 'src/types/suite'; interface AddWalletButtonProps { device: TrezorDevice; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceDetail.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceDetail.tsx index b3c20a721fd..43df06154f4 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceDetail.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceDetail.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react'; -import { TruncateWithTooltip, Column } from '@trezor/components'; +import { Column, TruncateWithTooltip } from '@trezor/components'; export const DeviceDetail = ({ label, children }: { label: string; children: ReactNode }) => ( diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceHeader.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceHeader.tsx index 77de6683fd9..8e5f7eb2ad7 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceHeader.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceHeader.tsx @@ -1,16 +1,16 @@ -import styled from 'styled-components'; import { motion } from 'framer-motion'; +import styled from 'styled-components'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; import { IconButton, IconName, Row, TOOLTIP_DELAY_LONG, Tooltip } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; -import { DeviceStatus } from 'src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceStatus'; import { Translation, WebUsbButton } from 'src/components/suite'; -import { useSelector } from 'src/hooks/suite'; -import { ForegroundAppProps, TrezorDevice } from 'src/types/suite'; import { WebUsbIconButton } from 'src/components/suite/WebUsbButton'; +import { DeviceStatus } from 'src/components/suite/layouts/SuiteLayout/DeviceSelector/DeviceStatus'; +import { useSelector } from 'src/hooks/suite'; import { selectHasTransportOfType } from 'src/reducers/suite/suiteReducer'; +import { ForegroundAppProps, TrezorDevice } from 'src/types/suite'; const Container = styled.div<{ $isFullHeaderVisible: boolean }>` display: flex; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx index ffb8b92c360..52868364bbe 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceItem.tsx @@ -1,16 +1,16 @@ import styled from 'styled-components'; -import { variables, Column } from '@trezor/components'; import * as deviceUtils from '@suite-common/suite-utils'; -import { selectSelectedDevice, selectDeviceThunk, acquireDevice } from '@suite-common/wallet-core'; +import { acquireDevice, selectDeviceThunk, selectSelectedDevice } from '@suite-common/wallet-core'; +import { Column, variables } from '@trezor/components'; 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 { useDispatch, useSelector } from 'src/hooks/suite'; +import type { AcquiredDevice, ForegroundAppProps, TrezorDevice } from 'src/types/suite'; -import { WalletInstance } from './WalletInstance'; import { AddWalletButton } from './AddWalletButton'; +import { WalletInstance } from './WalletInstance'; import { CardWithDevice } from '../CardWithDevice'; import { DeviceWarning } from './DeviceWarning'; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx index c27a6a8b51d..182bd141b68 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceStatusText.tsx @@ -1,13 +1,13 @@ import React, { MouseEventHandler } from 'react'; +import { TrezorDevice } from '@suite-common/suite-types'; import * as deviceUtils from '@suite-common/suite-utils'; import { TOOLTIP_DELAY_LONG, TruncateWithTooltip } from '@trezor/components'; -import { TrezorDevice } from '@suite-common/suite-types'; import { Translation } from 'src/components/suite'; -import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer'; -import { useSelector } from 'src/hooks/suite'; import { useWalletLabeling } from 'src/components/suite/labeling/WalletLabeling'; +import { useSelector } from 'src/hooks/suite'; +import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer'; import { DeviceConnectionText } from './DeviceConnectionText'; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceWarning.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceWarning.tsx index 4f5cf768ea2..d345b9847d5 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceWarning.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/DeviceWarning.tsx @@ -2,8 +2,8 @@ import * as deviceUtils from '@suite-common/suite-utils'; import { Banner } from '@trezor/components'; import { Translation } from 'src/components/suite'; -import { TrezorDevice } from 'src/types/suite'; import { useDevice } from 'src/hooks/suite'; +import { TrezorDevice } from 'src/types/suite'; interface DeviceWarningProps { needsAttention: boolean; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectButton.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectButton.tsx index 78dd7d0d3b4..af788cdf9d9 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectButton.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectButton.tsx @@ -1,6 +1,6 @@ import { useTheme } from 'styled-components'; -import { Tooltip, Icon } from '@trezor/components'; +import { Icon, Tooltip } from '@trezor/components'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectConfirmation.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectConfirmation.tsx index 649033bd492..a1e6b1f2ca9 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectConfirmation.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/EjectConfirmation.tsx @@ -2,10 +2,10 @@ import { MouseEventHandler, ReactNode } from 'react'; import styled from 'styled-components'; -import { H4, Button, Paragraph, Row } from '@trezor/components'; -import { deviceActions } from '@suite-common/wallet-core'; -import { analytics, EventType } from '@trezor/suite-analytics'; import { AcquiredDevice } from '@suite-common/suite-types'; +import { deviceActions } from '@suite-common/wallet-core'; +import { Button, H4, Paragraph, Row } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx index 6a6bdd581ea..8e917c469c0 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnly.tsx @@ -1,9 +1,9 @@ import styled from 'styled-components'; -import { CollapsibleBox, Text, Row } from '@trezor/components'; -import { spacings, spacingsPx } from '@trezor/theme'; -import { toggleRememberDevice } from '@suite-common/wallet-core'; import { AcquiredDevice } from '@suite-common/suite-types'; +import { toggleRememberDevice } from '@suite-common/wallet-core'; +import { CollapsibleBox, Row, Text } from '@trezor/components'; +import { spacings, spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnlyRadios.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnlyRadios.tsx index cd2704fc0d8..8c9d307ba48 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnlyRadios.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/ViewOnlyRadios.tsx @@ -1,8 +1,8 @@ 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 { Column, Icon, Paragraph, Radio, Row, Text, useElevation } from '@trezor/components'; +import { Elevation, borders, mapElevationToBorder, spacings, spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx index 8e1746bce3c..e55bb1b30b5 100644 --- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx @@ -1,31 +1,31 @@ import { useState } from 'react'; import { - selectDiscoveryByDeviceState, + createDiscoveryThunk, selectCurrentFiatRates, selectDeviceThunk, + selectDiscoveryByDeviceState, selectSelectedDevice, - createDiscoveryThunk, } from '@suite-common/wallet-core'; -import { Card, Icon, Tooltip, Row, Column, Text, Divider, Box } from '@trezor/components'; import { getAllAccounts } from '@suite-common/wallet-utils'; -import { spacings, negativeSpacings } from '@trezor/theme'; +import { Box, Card, Column, Divider, Icon, Row, Text, Tooltip } from '@trezor/components'; +import { negativeSpacings, spacings } from '@trezor/theme'; -import { WalletLabeling, Translation, MetadataLabeling } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { AcquiredDevice, ForegroundAppProps } from 'src/types/suite'; -import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer'; import { METADATA_LABELING } from 'src/actions/suite/constants'; -import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; -import { FiatHeader } from 'src/components/wallet/FiatHeader'; import { redirectAfterWalletSelectedThunk } from 'src/actions/wallet/addWalletThunk'; +import { MetadataLabeling, Translation, WalletLabeling } from 'src/components/suite'; +import { FiatHeader } from 'src/components/wallet/FiatHeader'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { useTotalFiatBalance } from 'src/hooks/wallet/useTotalFiatBalance'; +import { selectLabelingDataForWallet } from 'src/reducers/suite/metadataReducer'; +import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { AcquiredDevice, ForegroundAppProps } from 'src/types/suite'; -import { useWalletLabeling } from '../../../../components/suite/labeling/WalletLabeling'; import { EjectConfirmation, EjectConfirmationDisableViewOnly } from './EjectConfirmation'; +import { useWalletLabeling } from '../../../../components/suite/labeling/WalletLabeling'; import { ContentType } from '../types'; -import { ViewOnly } from './ViewOnly'; import { EjectButton } from './EjectButton'; +import { ViewOnly } from './ViewOnly'; interface WalletInstanceProps { instance: AcquiredDevice; diff --git a/packages/suite/src/views/suite/SwitchDevice/SwitchDevice.tsx b/packages/suite/src/views/suite/SwitchDevice/SwitchDevice.tsx index 0daa11115c8..59d9a9b5e3c 100644 --- a/packages/suite/src/views/suite/SwitchDevice/SwitchDevice.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/SwitchDevice.tsx @@ -1,10 +1,10 @@ import * as deviceUtils from '@suite-common/suite-utils'; -import { selectSelectedDevice, selectDevices } from '@suite-common/wallet-core'; +import { selectDevices, selectSelectedDevice } 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 { ForegroundAppProps } from 'src/types/suite'; import { DeviceItem } from './DeviceItem/DeviceItem'; import { SwitchDeviceModal } from './SwitchDeviceModal'; diff --git a/packages/suite/src/views/suite/SwitchDevice/SwitchDeviceModal.tsx b/packages/suite/src/views/suite/SwitchDevice/SwitchDeviceModal.tsx index 6b8617b454a..1f87c542dd0 100644 --- a/packages/suite/src/views/suite/SwitchDevice/SwitchDeviceModal.tsx +++ b/packages/suite/src/views/suite/SwitchDevice/SwitchDeviceModal.tsx @@ -1,10 +1,10 @@ import { useEvent } from 'react-use'; -import styled from 'styled-components'; import { motion } from 'framer-motion'; +import styled from 'styled-components'; +import { Column, NewModal } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { NewModal, Column } from '@trezor/components'; import { TrafficLightOffset } from '../../../components/suite/TrafficLightOffset'; diff --git a/packages/suite/src/views/suite/bridge-requested/index.tsx b/packages/suite/src/views/suite/bridge-requested/index.tsx index d9497a2f5aa..e4a9ceff5e0 100644 --- a/packages/suite/src/views/suite/bridge-requested/index.tsx +++ b/packages/suite/src/views/suite/bridge-requested/index.tsx @@ -3,12 +3,12 @@ import { useState } from 'react'; import styled from 'styled-components'; import { Button, Card, Image, Text } from '@trezor/components'; -import { desktopApi } from '@trezor/suite-desktop-api'; import { isDesktop } from '@trezor/env-utils'; +import { desktopApi } from '@trezor/suite-desktop-api'; import { spacings } from '@trezor/theme'; -import { Translation, Modal, Metadata } from 'src/components/suite'; import { goto } from 'src/actions/suite/routerActions'; +import { Metadata, Modal, Translation } from 'src/components/suite'; import { useDispatch, useLayout } from 'src/hooks/suite'; import { AutoStart } from 'src/views/settings/SettingsGeneral/AutoStart'; diff --git a/packages/suite/src/views/suite/bridge/index.tsx b/packages/suite/src/views/suite/bridge/index.tsx index 89af96eb251..cbff9e86e0d 100644 --- a/packages/suite/src/views/suite/bridge/index.tsx +++ b/packages/suite/src/views/suite/bridge/index.tsx @@ -3,8 +3,8 @@ import styled from 'styled-components'; 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 { Metadata, Modal, Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { useOpenSuiteDesktop } from 'src/hooks/suite/useOpenSuiteDesktop'; import { diff --git a/packages/suite/src/views/suite/notifications/index.tsx b/packages/suite/src/views/suite/notifications/index.tsx index 1ea507330d1..851c9ff0791 100644 --- a/packages/suite/src/views/suite/notifications/index.tsx +++ b/packages/suite/src/views/suite/notifications/index.tsx @@ -1,7 +1,7 @@ import { Card } from '@trezor/components'; -import { Notifications, Translation } from 'src/components/suite'; import { DashboardSection } from 'src/components/dashboard'; +import { Notifications, Translation } from 'src/components/suite'; import { useLayout } from 'src/hooks/suite'; const NotificationsView = () => { diff --git a/packages/suite/src/views/suite/version/index.tsx b/packages/suite/src/views/suite/version/index.tsx index 59f70ceb3f1..d5e00c0954d 100644 --- a/packages/suite/src/views/suite/version/index.tsx +++ b/packages/suite/src/views/suite/version/index.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { Link, H2, Paragraph } from '@trezor/components'; +import { H2, Link, Paragraph } from '@trezor/components'; import { getCommitHash, getSuiteVersion } from '@trezor/env-utils'; import { Modal } from 'src/components/suite'; diff --git a/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx b/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx index 6111c589ec0..4a77fd67721 100644 --- a/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx +++ b/packages/suite/src/views/view-only/ViewOnlyPromoContent.tsx @@ -2,6 +2,8 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; +import { DEFAULT_FLAGSHIP_MODEL } from '@suite-common/suite-constants'; +import { selectSelectedDevice, toggleRememberDevice } from '@suite-common/wallet-core'; import { Button, Card, @@ -13,22 +15,20 @@ import { useElevation, variables, } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { Elevation, borders, mapElevationToBackground, spacings, spacingsPx } from '@trezor/theme'; -import { selectSelectedDevice, 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 { DeviceConnectionText } from '../suite/SwitchDevice/DeviceItem/DeviceConnectionText'; -import { DeviceDetail } from '../suite/SwitchDevice/DeviceItem/DeviceDetail'; import { MacWindow } from './MacWindow'; -import { useDispatch, useSelector } from '../../hooks/suite'; -import { setFlag } from '../../actions/suite/suiteActions'; import { IllustrativeExample } from './images/IllustrativeExample'; import { IllustrativeExampleArrow } from './images/IllustrativeExampleArrow'; +import { PriceChartLine } from './images/PriceChartLine'; +import { setFlag } from '../../actions/suite/suiteActions'; +import { FormattedCryptoAmount, Translation } from '../../components/suite'; +import { useDispatch, useSelector } from '../../hooks/suite'; +import { DeviceConnectionText } from '../suite/SwitchDevice/DeviceItem/DeviceConnectionText'; +import { DeviceDetail } from '../suite/SwitchDevice/DeviceItem/DeviceDetail'; 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 164ccba25ff..01d013a51f7 100644 --- a/packages/suite/src/views/view-only/ViewOnlyTooltip.tsx +++ b/packages/suite/src/views/view-only/ViewOnlyTooltip.tsx @@ -3,10 +3,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 { setFlag } from 'src/actions/suite/suiteActions'; import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { selectSuiteFlags } from 'src/reducers/suite/suiteReducer'; type ViewOnlyTooltipProps = { children: React.ReactNode; diff --git a/packages/suite/src/views/wallet/anonymize/components/CoinjoinConfirmation.tsx b/packages/suite/src/views/wallet/anonymize/components/CoinjoinConfirmation.tsx index b02c7bf5979..11790c3c119 100644 --- a/packages/suite/src/views/wallet/anonymize/components/CoinjoinConfirmation.tsx +++ b/packages/suite/src/views/wallet/anonymize/components/CoinjoinConfirmation.tsx @@ -17,15 +17,15 @@ import { import { spacingsPx, typography } from '@trezor/theme'; import { DATA_TOS_URL, ZKSNACKS_TERMS_URL } from '@trezor/urls'; -import { Error } from 'src/components/suite/Error'; +import { startCoinjoinSession } from 'src/actions/wallet/coinjoinAccountActions'; import { Translation, TrezorLink } from 'src/components/suite'; +import { Error } from 'src/components/suite/Error'; +import { useCoinjoinSessionBlockers } from 'src/hooks/coinjoin/useCoinjoinSessionBlockers'; 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'; diff --git a/packages/suite/src/views/wallet/anonymize/index.tsx b/packages/suite/src/views/wallet/anonymize/index.tsx index f578a1a959e..dccaf854d92 100644 --- a/packages/suite/src/views/wallet/anonymize/index.tsx +++ b/packages/suite/src/views/wallet/anonymize/index.tsx @@ -1,8 +1,8 @@ import { Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { useSelector } from 'src/hooks/suite'; import { WalletLayout, WalletSubpageHeading } from 'src/components/wallet'; +import { useSelector } from 'src/hooks/suite'; import { CoinjoinConfirmation } from 'src/views/wallet/anonymize/components/CoinjoinConfirmation'; const Anonymize = () => { diff --git a/packages/suite/src/views/wallet/details/CoinjoinLogs.tsx b/packages/suite/src/views/wallet/details/CoinjoinLogs.tsx index 3c0e2f5f74c..6f7fe84c4b9 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinLogs.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinLogs.tsx @@ -1,14 +1,14 @@ import styled from 'styled-components'; -import { desktopApi } from '@trezor/suite-desktop-api'; import { Card } from '@trezor/components'; +import { desktopApi } from '@trezor/suite-desktop-api'; 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'; -import { anchorOutlineStyles } from 'src/utils/suite/anchor'; +import { useAnchor } from 'src/hooks/suite/useAnchor'; +import { useSelector } from 'src/hooks/suite/useSelector'; import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; +import { anchorOutlineStyles } from 'src/utils/suite/anchor'; // eslint-disable-next-line local-rules/no-override-ds-component const SetupCard = styled(Card)<{ $shouldHighlight?: boolean }>` diff --git a/packages/suite/src/views/wallet/details/CoinjoinSetup/AnonymityLevelSetup.tsx b/packages/suite/src/views/wallet/details/CoinjoinSetup/AnonymityLevelSetup.tsx index 0617a76cc91..13373c0e8ea 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/AnonymityLevelSetup.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/AnonymityLevelSetup.tsx @@ -3,12 +3,12 @@ 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 { Banner, Icon, motionEasing } from '@trezor/components'; +import { coinjoinAccountUpdateAnonymity } from 'src/actions/wallet/coinjoinAccountActions'; import { Translation } from 'src/components/suite'; import { AnonymityStatus } from 'src/constants/suite/coinjoin'; import { useAnonymityStatus, useDispatch } from 'src/hooks/suite'; -import { coinjoinAccountUpdateAnonymity } from 'src/actions/wallet/coinjoinAccountActions'; import { SetupSlider } from './SetupSlider/SetupSlider'; diff --git a/packages/suite/src/views/wallet/details/CoinjoinSetup/CoinjoinSetup.tsx b/packages/suite/src/views/wallet/details/CoinjoinSetup/CoinjoinSetup.tsx index 03cb88f1354..d90709de760 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/CoinjoinSetup.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/CoinjoinSetup.tsx @@ -3,11 +3,11 @@ 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 { Banner, Card, Radio, motionAnimation, motionEasing } from '@trezor/components'; +import { coinjoinAccountUpdateSetupOption } from 'src/actions/wallet/coinjoinAccountActions'; import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; -import { coinjoinAccountUpdateSetupOption } from 'src/actions/wallet/coinjoinAccountActions'; import { selectCoinjoinAccountByKey } from 'src/reducers/wallet/coinjoinReducer'; import { AnonymityLevelSetup } from './AnonymityLevelSetup'; diff --git a/packages/suite/src/views/wallet/details/CoinjoinSetup/MaxMiningFeeSetup.tsx b/packages/suite/src/views/wallet/details/CoinjoinSetup/MaxMiningFeeSetup.tsx index 1c1c55f8e68..dd67cd5eb8a 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/MaxMiningFeeSetup.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/MaxMiningFeeSetup.tsx @@ -1,8 +1,8 @@ import { useTheme } from 'styled-components'; +import { coinjoinAccountUpdateMaxMiningFee } from 'src/actions/wallet/coinjoinAccountActions'; import { Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { coinjoinAccountUpdateMaxMiningFee } from 'src/actions/wallet/coinjoinAccountActions'; import { selectDefaultMaxMiningFeeByAccountKey, selectFeeRateMedianByAccountKey, 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 b627b5ab0bd..9ae03b8ea72 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SetupSlider.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SetupSlider.tsx @@ -1,4 +1,4 @@ -import { useRef, ReactNode, KeyboardEventHandler, ChangeEventHandler } from 'react'; +import { ChangeEventHandler, KeyboardEventHandler, ReactNode, useRef } from 'react'; import styled from 'styled-components'; 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 61d83f36f80..479b25ce627 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SliderInput.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/SetupSlider/SliderInput.tsx @@ -1,11 +1,11 @@ import { + ChangeEvent, + KeyboardEvent, forwardRef, useEffect, useImperativeHandle, useRef, useState, - KeyboardEvent, - ChangeEvent, } from 'react'; import styled from 'styled-components'; diff --git a/packages/suite/src/views/wallet/details/CoinjoinSetup/SkipRoundsSetup.tsx b/packages/suite/src/views/wallet/details/CoinjoinSetup/SkipRoundsSetup.tsx index 2108dd286a3..855e6b99338 100644 --- a/packages/suite/src/views/wallet/details/CoinjoinSetup/SkipRoundsSetup.tsx +++ b/packages/suite/src/views/wallet/details/CoinjoinSetup/SkipRoundsSetup.tsx @@ -4,9 +4,9 @@ import styled from 'styled-components'; import { Switch, variables } from '@trezor/components'; +import { coinjoinAccountToggleSkipRounds } from 'src/actions/wallet/coinjoinAccountActions'; import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite/useSelector'; -import { coinjoinAccountToggleSkipRounds } from 'src/actions/wallet/coinjoinAccountActions'; import { selectCurrentCoinjoinSession } from 'src/reducers/wallet/coinjoinReducer'; const Row = styled.div` diff --git a/packages/suite/src/views/wallet/details/RescanAccount.tsx b/packages/suite/src/views/wallet/details/RescanAccount.tsx index 774d8e755f2..934535df86c 100644 --- a/packages/suite/src/views/wallet/details/RescanAccount.tsx +++ b/packages/suite/src/views/wallet/details/RescanAccount.tsx @@ -1,8 +1,8 @@ import { Row } from '@trezor/components'; +import { rescanCoinjoinAccount } from 'src/actions/wallet/coinjoinAccountActions'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite/useDispatch'; -import { rescanCoinjoinAccount } from 'src/actions/wallet/coinjoinAccountActions'; import type { Account } from 'src/types/wallet'; type RescanAccountProps = { diff --git a/packages/suite/src/views/wallet/details/index.tsx b/packages/suite/src/views/wallet/details/index.tsx index 47710a4bac9..368ea180808 100644 --- a/packages/suite/src/views/wallet/details/index.tsx +++ b/packages/suite/src/views/wallet/details/index.tsx @@ -3,18 +3,18 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; import { getAccountTypeTech } from '@suite-common/wallet-utils'; -import { Paragraph, variables, Card, Column, Row, InfoItem, Button } from '@trezor/components'; -import { HELP_CENTER_BIP32_URL, HELP_CENTER_XPUB_URL, Url } from '@trezor/urls'; +import { Button, Card, Column, InfoItem, Paragraph, Row, variables } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { HELP_CENTER_BIP32_URL, HELP_CENTER_XPUB_URL, Url } from '@trezor/urls'; -import { Translation } from 'src/components/suite'; 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 { Translation } from 'src/components/suite'; import { AccountTypeBadge } from 'src/components/suite/AccountTypeBadge'; import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; import { TranslationKey } from 'src/components/suite/Translation'; +import { AccountTypeDescription } from 'src/components/suite/modals/ReduxModal/UserContextModal/AddAccountModal/AccountTypeSelect/AccountTypeDescription'; +import { WalletLayout } from 'src/components/wallet'; +import { useDevice, useDispatch, useSelector } from 'src/hooks/suite'; import { CoinjoinLogs } from './CoinjoinLogs'; import { CoinjoinSetup } from './CoinjoinSetup/CoinjoinSetup'; diff --git a/packages/suite/src/views/wallet/nfts/NftsTable/NftsRow.tsx b/packages/suite/src/views/wallet/nfts/NftsTable/NftsRow.tsx index ee2829c4ca4..e026dc728f7 100644 --- a/packages/suite/src/views/wallet/nfts/NftsTable/NftsRow.tsx +++ b/packages/suite/src/views/wallet/nfts/NftsTable/NftsRow.tsx @@ -1,17 +1,19 @@ import { useState } from 'react'; -import { Network } from '@suite-common/wallet-config'; import { DefinitionType, - tokenDefinitionsActions, - TokenManagementAction, EnhancedTokenInfo, + TokenManagementAction, + tokenDefinitionsActions, } from '@suite-common/token-definitions'; -import { Badge, Button, Dropdown, Icon, Row, Table, Text, IconCircle } from '@trezor/components'; +import { Network } from '@suite-common/wallet-config'; import { SelectedAccountStatus } from '@suite-common/wallet-types'; -import { getNftExplorerUrl, getNftContractExplorerUrl } from '@suite-common/wallet-utils'; +import { getNftContractExplorerUrl, getNftExplorerUrl } from '@suite-common/wallet-utils'; +import { Badge, Button, Dropdown, Icon, IconCircle, Row, Table, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { SUITE } from 'src/actions/suite/constants'; +import { copyAddressToClipboard, showCopyAddressModal } from 'src/actions/suite/copyAddressActions'; import { goto } from 'src/actions/suite/routerActions'; import { HiddenPlaceholder, @@ -20,12 +22,10 @@ import { TrezorLink, } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { SUITE } from 'src/actions/suite/constants'; import { selectIsCopyAddressModalShown } from 'src/reducers/suite/suiteReducer'; -import { copyAddressToClipboard, showCopyAddressModal } from 'src/actions/suite/copyAddressActions'; -import { BlurUrls } from '../../tokens/common/BlurUrls'; import { DropdownRow } from '../../tokens/DropdownRow'; +import { BlurUrls } from '../../tokens/common/BlurUrls'; type NftsRowProps = { nft: EnhancedTokenInfo; diff --git a/packages/suite/src/views/wallet/nfts/NftsTable/NftsTable.tsx b/packages/suite/src/views/wallet/nfts/NftsTable/NftsTable.tsx index 5bb74a163dc..d672d58ed74 100644 --- a/packages/suite/src/views/wallet/nfts/NftsTable/NftsTable.tsx +++ b/packages/suite/src/views/wallet/nfts/NftsTable/NftsTable.tsx @@ -1,12 +1,12 @@ import { useState } from 'react'; +import { getNetwork } from '@suite-common/wallet-config'; import { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { Card, Column, Table } from '@trezor/components'; -import { getNetwork } from '@suite-common/wallet-config'; import { spacings } from '@trezor/theme'; -import { GetTokensOutputType } from 'src/utils/wallet/tokenUtils'; import { Translation } from 'src/components/suite/Translation'; +import { GetTokensOutputType } from 'src/utils/wallet/tokenUtils'; import NftsRow from './NftsRow'; import { DropdownRow } from '../../tokens/DropdownRow'; diff --git a/packages/suite/src/views/wallet/nfts/NftsTablesSection.tsx b/packages/suite/src/views/wallet/nfts/NftsTablesSection.tsx index 344eb14c719..21620361623 100644 --- a/packages/suite/src/views/wallet/nfts/NftsTablesSection.tsx +++ b/packages/suite/src/views/wallet/nfts/NftsTablesSection.tsx @@ -1,14 +1,14 @@ -import { Banner, H3, Column } from '@trezor/components'; -import { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { selectNftDefinitions } from '@suite-common/token-definitions'; +import { SelectedAccountLoaded } from '@suite-common/wallet-types'; +import { Banner, Column, H3 } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { getTokens } from 'src/utils/wallet/tokenUtils'; -import { NoTokens } from '../tokens/common/NoTokens'; import NftsTable from './NftsTable/NftsTable'; +import { NoTokens } from '../tokens/common/NoTokens'; import { NoSearchResultsWrapped } from '../tokens/common/TokensTable/TokensTable'; type EvmNftsTablesProps = { diff --git a/packages/suite/src/views/wallet/nfts/index.tsx b/packages/suite/src/views/wallet/nfts/index.tsx index cdb23a7cd59..c2c21600a3a 100644 --- a/packages/suite/src/views/wallet/nfts/index.tsx +++ b/packages/suite/src/views/wallet/nfts/index.tsx @@ -1,15 +1,15 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; import { Route, Switch } from 'react-router-dom'; import { Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; import { WalletLayout } from 'src/components/wallet'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; -import { TokensNavigation } from '../tokens/TokensNavigation'; import { NftsTablesSection } from './NftsTablesSection'; +import { TokensNavigation } from '../tokens/TokensNavigation'; export const Nfts = () => { const [searchQuery, setSearchQuery] = useState(''); diff --git a/packages/suite/src/views/wallet/receive/Receive.tsx b/packages/suite/src/views/wallet/receive/Receive.tsx index 12542fa59ce..d76d6cf276c 100644 --- a/packages/suite/src/views/wallet/receive/Receive.tsx +++ b/packages/suite/src/views/wallet/receive/Receive.tsx @@ -1,15 +1,15 @@ -import { selectSelectedDevice, selectPendingAccountAddresses } from '@suite-common/wallet-core'; +import { selectPendingAccountAddresses, selectSelectedDevice } from '@suite-common/wallet-core'; import { Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { ConfirmEvmExplanationModal } from 'src/components/suite/modals'; 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 { ConnectDeviceReceivePromo } from './components/ConnectDevicePromo'; +import { FreshAddress } from './components/FreshAddress'; +import { UsedAddresses } from './components/UsedAddresses'; 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 f188ba1decc..ede9f4b2a1b 100644 --- a/packages/suite/src/views/wallet/receive/components/CoinjoinReceiveWarning.tsx +++ b/packages/suite/src/views/wallet/receive/components/CoinjoinReceiveWarning.tsx @@ -1,8 +1,8 @@ -import { Banner, H4, Column } from '@trezor/components'; +import { Banner, Column, H4 } from '@trezor/components'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { Translation } from 'src/components/suite'; import { hideCoinjoinReceiveWarning } from 'src/actions/suite/suiteActions'; +import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; export const CoinjoinReceiveWarning = () => { diff --git a/packages/suite/src/views/wallet/receive/components/ConnectDevicePromo.tsx b/packages/suite/src/views/wallet/receive/components/ConnectDevicePromo.tsx index e7707f5dda6..ae5b7031538 100644 --- a/packages/suite/src/views/wallet/receive/components/ConnectDevicePromo.tsx +++ b/packages/suite/src/views/wallet/receive/components/ConnectDevicePromo.tsx @@ -1,6 +1,6 @@ -import { H4, Paragraph, Banner } from '@trezor/components'; -import { selectSelectedDevice } from '@suite-common/wallet-core'; import { DEFAULT_FLAGSHIP_MODEL } from '@suite-common/suite-constants'; +import { selectSelectedDevice } from '@suite-common/wallet-core'; +import { Banner, H4, Paragraph } from '@trezor/components'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/wallet/receive/components/FreshAddress.tsx b/packages/suite/src/views/wallet/receive/components/FreshAddress.tsx index fc48a4faa14..1a67dab4146 100644 --- a/packages/suite/src/views/wallet/receive/components/FreshAddress.tsx +++ b/packages/suite/src/views/wallet/receive/components/FreshAddress.tsx @@ -2,28 +2,28 @@ import { useMemo } from 'react'; import styled from 'styled-components'; +import { getNetwork } from '@suite-common/wallet-config'; +import { AccountsRootState, selectIsAccountUtxoBased } from '@suite-common/wallet-core'; +import { getFirstFreshAddress } from '@suite-common/wallet-utils'; import { + Banner, Button, Card, - Text, - Tooltip, GradientOverlay, - Row, - InfoItem, H4, - Banner, + InfoItem, Paragraph, + Row, + Text, + Tooltip, } from '@trezor/components'; -import { getFirstFreshAddress } from '@suite-common/wallet-utils'; -import { AccountsRootState, selectIsAccountUtxoBased } from '@suite-common/wallet-core'; import { spacings } from '@trezor/theme'; -import { getNetwork } from '@suite-common/wallet-config'; -import { Translation, ReadMoreLink } from 'src/components/suite'; -import { AppState } from 'src/types/suite'; import { showAddress } from 'src/actions/wallet/receiveActions'; +import { ReadMoreLink, Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite/'; import { selectIsFirmwareAuthenticityCheckEnabledAndHardFailed } from 'src/reducers/suite/suiteReducer'; +import { AppState } from 'src/types/suite'; const FreshAddressWrapper = styled.div` position: relative; diff --git a/packages/suite/src/views/wallet/receive/components/Header.tsx b/packages/suite/src/views/wallet/receive/components/Header.tsx index a14877fd941..7f735ca2cf3 100644 --- a/packages/suite/src/views/wallet/receive/components/Header.tsx +++ b/packages/suite/src/views/wallet/receive/components/Header.tsx @@ -1,10 +1,10 @@ import styled from 'styled-components'; -import { H2, Paragraph } from '@trezor/components'; import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { H2, Paragraph } from '@trezor/components'; -import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; +import { Account } from 'src/types/wallet'; const Content = styled.div` margin: 0 0 24px; diff --git a/packages/suite/src/views/wallet/receive/components/UsedAddresses.tsx b/packages/suite/src/views/wallet/receive/components/UsedAddresses.tsx index 56b66694736..e6fff06298e 100644 --- a/packages/suite/src/views/wallet/receive/components/UsedAddresses.tsx +++ b/packages/suite/src/views/wallet/receive/components/UsedAddresses.tsx @@ -2,28 +2,28 @@ import { useState } from 'react'; import styled from 'styled-components'; -import { AccountAddress } from '@trezor/connect'; +import { NetworkSymbol } from '@suite-common/wallet-config'; +import { formatNetworkAmount } from '@suite-common/wallet-utils'; import { - Card, Button, + Card, Column, - Row, GradientOverlay, - Tooltip, + Row, Table, Text, + Tooltip, } from '@trezor/components'; +import { AccountAddress } from '@trezor/connect'; import { spacings } from '@trezor/theme'; -import { NetworkSymbol } from '@suite-common/wallet-config'; -import { formatNetworkAmount } from '@suite-common/wallet-utils'; -import { Translation, MetadataLabeling, FormattedCryptoAmount } from 'src/components/suite'; -import { AppState } from 'src/types/suite'; -import { MetadataAddPayload } from 'src/types/suite/metadata'; import { showAddress } from 'src/actions/wallet/receiveActions'; +import { FormattedCryptoAmount, MetadataLabeling, Translation } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite/'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; import { selectIsFirmwareAuthenticityCheckEnabledAndHardFailed } from 'src/reducers/suite/suiteReducer'; +import { AppState } from 'src/types/suite'; +import { MetadataAddPayload } from 'src/types/suite/metadata'; const AddressActions = styled.div<{ $isVisible?: boolean }>` opacity: ${({ $isVisible }) => ($isVisible ? '1' : '0')}; 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 782bf347286..7b122632e0b 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/BitcoinOptions.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/BitcoinOptions.tsx @@ -2,18 +2,18 @@ import { useWatch } from 'react-hook-form'; import styled from 'styled-components'; +import { selectNetworkBlockchainInfo } from '@suite-common/wallet-core'; 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 { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; +import { useSendFormContext } from 'src/hooks/wallet'; -import { Locktime } from './Locktime/Locktime'; -import { CoinControl } from './CoinControl/CoinControl'; import { OnOffSwitcher } from '../OnOffSwitcher'; +import { CoinControl } from './CoinControl/CoinControl'; +import { Locktime } from './Locktime/Locktime'; 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 fc3512276d3..fc293601525 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 @@ -2,25 +2,25 @@ import { useEffect, useState } from 'react'; import styled, { useTheme } from 'styled-components'; +import { getTxsPerPage } from '@suite-common/suite-utils'; 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, Column, Icon, Row, Switch, Text } from '@trezor/components'; import { spacings, spacingsPx } from '@trezor/theme'; import { FormattedCryptoAmount, Translation } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { Pagination } from 'src/components/wallet'; +import { useDispatch, useSelector } from 'src/hooks/suite'; 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 { selectCurrentTargetAnonymity } from 'src/reducers/wallet/coinjoinReducer'; import { filterAndCategorizeUtxos } from 'src/utils/wallet/filterAndCategorizeUtxosUtils'; -import { UtxoSortingSelect } from './UtxoSortingSelect'; -import { UtxoSelectionList } from './UtxoSelectionList/UtxoSelectionList'; import { UtxoSearch } from './UtxoSearch'; +import { UtxoSelectionList } from './UtxoSelectionList/UtxoSelectionList'; +import { UtxoSortingSelect } from './UtxoSortingSelect'; const Header = styled.header` border-bottom: 1px solid ${({ theme }) => theme.borderElevation1}; 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 4f611a280ed..f3c55cb102f 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,8 +1,8 @@ -import { useCallback, useRef, Dispatch, SetStateAction, ChangeEvent, KeyboardEvent } from 'react'; +import { ChangeEvent, Dispatch, KeyboardEvent, SetStateAction, useCallback, useRef } from 'react'; import styled, { useTheme } from 'styled-components'; -import { Input, Icon, KEYBOARD_CODE } from '@trezor/components'; +import { Icon, Input, KEYBOARD_CODE } from '@trezor/components'; import { useTranslation } from 'src/hooks/suite/useTranslation'; diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoSelection.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoSelection.tsx index dd3304cc40e..195d7010144 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoSelection.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoSelection.tsx @@ -4,9 +4,9 @@ import styled, { css, useTheme } from 'styled-components'; import { formatNetworkAmount, isSameUtxo } from '@suite-common/wallet-utils'; import { Checkbox, Row, Spinner, TextButton, Tooltip } from '@trezor/components'; +import { CheckContainer } from '@trezor/components/src/components/form/Checkbox/Checkbox'; import { AccountUtxo } from '@trezor/connect'; import { borders, spacings, spacingsPx, typography } from '@trezor/theme'; -import { CheckContainer } from '@trezor/components/src/components/form/Checkbox/Checkbox'; import { openModal } from 'src/actions/suite/modalActions'; import { @@ -15,15 +15,15 @@ import { MetadataLabeling, Translation, } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; import { TransactionTimestamp, UtxoAnonymity } from 'src/components/wallet'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { useSendFormContext } from 'src/hooks/wallet'; import { useCoinjoinUnavailableUtxos } from 'src/hooks/wallet/form/useCoinjoinUnavailableUtxos'; -import { WalletAccountTransaction } from 'src/types/wallet'; import { selectIsLabelingInitPossible, selectLabelingDataForSelectedAccount, } from 'src/reducers/suite/metadataReducer'; +import { WalletAccountTransaction } from 'src/types/wallet'; import { UtxoTag } from './UtxoTag'; diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoTag.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoTag.tsx index 364ba5c30d4..d967cdb2536 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoTag.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoTag.tsx @@ -1,6 +1,6 @@ import { ReactNode } from 'react'; -import { Icon, Tooltip, IconName } from '@trezor/components'; +import { Icon, IconName, Tooltip } from '@trezor/components'; import { CSSColor } from '@trezor/theme'; interface UtxoTagProps { diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelectionList.tsx b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelectionList.tsx index 33dfc3b9c7c..eb481515e04 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelectionList.tsx +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelectionList.tsx @@ -1,10 +1,10 @@ import { ReactNode } from 'react'; -import styled from 'styled-components'; import { transparentize } from 'polished'; +import styled from 'styled-components'; import { selectAccountTransactions } from '@suite-common/wallet-core'; -import { Icon, variables, IconName } from '@trezor/components'; +import { Icon, IconName, variables } from '@trezor/components'; import type { AccountUtxo } from '@trezor/connect'; 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 44638dcbc35..e8398e6ae6b 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 @@ -2,16 +2,16 @@ import { useEffect } from 'react'; import styled from 'styled-components'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Card, Icon, IconButton } from '@trezor/components'; -import { getInputState, isInteger } from '@suite-common/wallet-utils'; -import { spacingsPx } from '@trezor/theme'; import { selectNetworkBlockchainInfo } from '@suite-common/wallet-core'; +import { getInputState, isInteger } from '@suite-common/wallet-utils'; +import { Card, Icon, IconButton } from '@trezor/components'; import { NumberInput } from '@trezor/product-components'; +import { spacingsPx } from '@trezor/theme'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { Translation } from 'src/components/suite'; import { useSelector, useTranslation } from 'src/hooks/suite'; import { useSendFormContext } from 'src/hooks/wallet'; -import { Translation } from 'src/components/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; import { canLocktimeTxBeBroadcast } from './canLocktimeTxBeBroadcast'; diff --git a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/test/canLocktimeTxBeBroadcast.test.ts b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/test/canLocktimeTxBeBroadcast.test.ts index 3025f805f92..e1f87fb33c6 100644 --- a/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/test/canLocktimeTxBeBroadcast.test.ts +++ b/packages/suite/src/views/wallet/send/Options/BitcoinOptions/Locktime/test/canLocktimeTxBeBroadcast.test.ts @@ -1,6 +1,6 @@ import { - canLocktimeTxBeBroadcast, CanLocktimeTxBeBroadcastParams, + canLocktimeTxBeBroadcast, } from '../canLocktimeTxBeBroadcast'; const data: Array<{ it: string; input: CanLocktimeTxBeBroadcastParams; result: boolean }> = [ 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 4f04e402479..415ae2544da 100644 --- a/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumData.tsx +++ b/packages/suite/src/views/wallet/send/Options/EthereumOptions/EthereumData.tsx @@ -2,14 +2,14 @@ import { useEffect } from 'react'; import styled from 'styled-components'; -import { Textarea, Icon } from '@trezor/components'; -import { getInputState, isHexValid } from '@suite-common/wallet-utils'; import { formInputsMaxLength } from '@suite-common/validators'; +import { getInputState, isHexValid } from '@suite-common/wallet-utils'; +import { Icon, Textarea } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; -import { useSendFormContext } from 'src/hooks/wallet'; import { useTranslation } from 'src/hooks/suite'; +import { useSendFormContext } from 'src/hooks/wallet'; const inputAsciiName = 'ethereumDataAscii'; const inputHexName = 'ethereumDataHex'; diff --git a/packages/suite/src/views/wallet/send/Options/Options.tsx b/packages/suite/src/views/wallet/send/Options/Options.tsx index e1beaef1bde..8699720ab29 100644 --- a/packages/suite/src/views/wallet/send/Options/Options.tsx +++ b/packages/suite/src/views/wallet/send/Options/Options.tsx @@ -1,9 +1,9 @@ import { useSendFormContext } from 'src/hooks/wallet'; import { BitcoinOptions } from './BitcoinOptions/BitcoinOptions'; +import { CardanoOptions } from './CardanoOptions'; import { EthereumOptions } from './EthereumOptions/EthereumOptions'; import { RippleOptions } from './RippleOptions/RippleOptions'; -import { CardanoOptions } from './CardanoOptions'; export const Options = () => { const { 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 78da6f8d26e..656bbfbdb48 100644 --- a/packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx +++ b/packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx @@ -1,13 +1,13 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Input, Switch, Note, Column, Banner } from '@trezor/components'; -import { getInputState, isInteger } from '@suite-common/wallet-utils'; -import { U_INT_32 } from '@suite-common/wallet-constants'; import { formInputsMaxLength } from '@suite-common/validators'; +import { U_INT_32 } from '@suite-common/wallet-constants'; +import { getInputState, isInteger } from '@suite-common/wallet-utils'; +import { Banner, Column, Input, Note, Switch } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Translation } from 'src/components/suite'; -import { useSendFormContext } from 'src/hooks/wallet'; import { useTranslation } from 'src/hooks/suite'; +import { useSendFormContext } from 'src/hooks/wallet'; export const DestinationTag = () => { const { 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 7938314734a..379f0899d9b 100644 --- a/packages/suite/src/views/wallet/send/Options/RippleOptions/RippleOptions.tsx +++ b/packages/suite/src/views/wallet/send/Options/RippleOptions/RippleOptions.tsx @@ -2,8 +2,8 @@ import styled from 'styled-components'; import { Button, Tooltip } from '@trezor/components'; -import { useSendFormContext } from 'src/hooks/wallet'; import { Translation } from 'src/components/suite'; +import { useSendFormContext } from 'src/hooks/wallet'; 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 813608a622e..22e01b8a6e5 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Address.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Address.tsx @@ -1,38 +1,38 @@ import { useCallback, useEffect, useRef, useState } from 'react'; -import { checkAddressCheckSum, toChecksumAddress } from 'web3-utils'; import styled from 'styled-components'; +import { checkAddressCheckSum, toChecksumAddress } from 'web3-utils'; -import { Input, Button, IconButton, Icon, Link, Row } from '@trezor/components'; -import { capitalizeFirstLetter } from '@trezor/utils'; -import * as URLS from '@trezor/urls'; +import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; 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 { - isAddressValid, + checkIsAddressNotUsedNotChecksummed, + getInputState, isAddressDeprecated, - isTaprootAddress, + isAddressValid, isBech32AddressUppercase, - getInputState, - checkIsAddressNotUsedNotChecksummed, + isTaprootAddress, } from '@suite-common/wallet-utils'; -import { getNetworkSymbolForProtocol } from '@suite-common/suite-utils'; -import { spacings } from '@trezor/theme'; +import { Button, Icon, IconButton, Input, Link, Row } from '@trezor/components'; +import TrezorConnect from '@trezor/connect'; import { CoinLogo } from '@trezor/product-components'; +import { spacings } from '@trezor/theme'; +import * as URLS from '@trezor/urls'; import { HELP_CENTER_EVM_ADDRESS_CHECKSUM, HELP_CENTER_EVM_SEND_TO_CONTRACT_URL, } from '@trezor/urls'; +import { capitalizeFirstLetter } from '@trezor/utils'; import { scanOrRequestSendFormThunk } from 'src/actions/wallet/send/sendFormThunks'; -import { useSendFormContext } from 'src/hooks/wallet'; -import { getProtocolInfo } from 'src/utils/suite/protocol'; +import { AddressLabeling, MetadataLabeling } from 'src/components/suite'; import { InputError } from 'src/components/wallet'; import { InputErrorProps } from 'src/components/wallet/InputError'; -import { AddressLabeling, MetadataLabeling } from 'src/components/suite'; -import { useSelector, useDevice, useDispatch, useTranslation } from 'src/hooks/suite'; +import { useDevice, useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; +import { useSendFormContext } from 'src/hooks/wallet'; +import { getProtocolInfo } from 'src/utils/suite/protocol'; import { captureSentryMessage } from 'src/utils/suite/sentry'; import { Translation } from '../../../../components/suite/Translation'; 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 e871a103650..fe028490e5d 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Amount/Amount.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Amount/Amount.tsx @@ -1,24 +1,24 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Icon, Banner, Flex, Row, Text, variables, useMediaQuery } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { FiatCurrencyCode } from '@suite-common/suite-config'; import { formInputsMaxLength } from '@suite-common/validators'; +import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { Output, TokenAddress } from '@suite-common/wallet-types'; import { amountToSmallestUnit, + findToken, formatNetworkAmount, + getInputState, hasNetworkFeatures, isLowAnonymityWarning, - getInputState, - findToken, } from '@suite-common/wallet-utils'; -import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { Banner, Flex, Icon, Row, Text, useMediaQuery, variables } from '@trezor/components'; import { NumberInput } from '@trezor/product-components'; +import { spacings } from '@trezor/theme'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { FiatValue, Translation } from 'src/components/suite'; +import { useSelector, useTranslation } from 'src/hooks/suite'; import { useSendFormContext } from 'src/hooks/wallet'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; -import { useSelector, useTranslation } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; import { validateDecimals, 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 ba75bb7314b..c862d8885c5 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Amount/FiatInput.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Amount/FiatInput.tsx @@ -1,32 +1,32 @@ import { Controller } from 'react-hook-form'; import { useDispatch, useSelector } from 'react-redux'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { formInputsMaxLength } from '@suite-common/validators'; +import { updateFiatRatesThunk } from '@suite-common/wallet-core'; import { - Timestamp, - TokenAddress, - FiatRatesResult, CurrencyOption, + FiatRatesResult, Output, + Timestamp, + TokenAddress, } from '@suite-common/wallet-types'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Select } from '@trezor/components'; import { - getInputState, + buildCurrencyOptions, findToken, - isLowAnonymityWarning, formatAmount, - buildCurrencyOptions, + getInputState, + isLowAnonymityWarning, } from '@suite-common/wallet-utils'; -import { formInputsMaxLength } from '@suite-common/validators'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; -import { updateFiatRatesThunk } from '@suite-common/wallet-core'; +import { Select } from '@trezor/components'; import { NumberInput } from '@trezor/product-components'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { useTranslation } from 'src/hooks/suite'; import { useSendFormContext } from 'src/hooks/wallet'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; -import { useTranslation } from 'src/hooks/suite'; -import { validateDecimals } from 'src/utils/suite/validation'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { validateDecimals } from 'src/utils/suite/validation'; type FiatInputProps = { output: Partial; diff --git a/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx b/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx index 2f2b3a98b57..999e38a3066 100644 --- a/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/OpReturn.tsx @@ -1,14 +1,14 @@ import styled from 'styled-components'; -import { Textarea, IconButton, Row, Tooltip, variables } from '@trezor/components'; -import { getInputState, isHexValid } from '@suite-common/wallet-utils'; import { formInputsMaxLength } from '@suite-common/validators'; +import { getInputState, isHexValid } from '@suite-common/wallet-utils'; +import { IconButton, Row, Textarea, Tooltip, variables } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; -import { useSendFormContext } from 'src/hooks/wallet'; -import { Translation } from 'src/components/suite'; import { OpenGuideFromTooltip } from 'src/components/guide'; +import { Translation } from 'src/components/suite'; import { useTranslation } from 'src/hooks/suite'; +import { useSendFormContext } from 'src/hooks/wallet'; const Inputs = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/send/Outputs/Outputs.tsx b/packages/suite/src/views/wallet/send/Outputs/Outputs.tsx index bde2ac316bd..0c0e4c326f3 100644 --- a/packages/suite/src/views/wallet/send/Outputs/Outputs.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/Outputs.tsx @@ -1,12 +1,12 @@ import { useEffect, useRef, useState } from 'react'; -import styled from 'styled-components'; import { motion } from 'framer-motion'; +import styled from 'styled-components'; -import { Card, motionEasing, Column } from '@trezor/components'; +import { getNetworkFeatures } from '@suite-common/wallet-config'; +import { Card, Column, motionEasing } from '@trezor/components'; import { motionEasingStrings } from '@trezor/components/src/config/motion'; import { spacings } from '@trezor/theme'; -import { getNetworkFeatures } from '@suite-common/wallet-config'; import { useSendFormContext } from 'src/hooks/wallet'; diff --git a/packages/suite/src/views/wallet/send/Outputs/TokenSelect/TokenSelect.tsx b/packages/suite/src/views/wallet/send/Outputs/TokenSelect/TokenSelect.tsx index 5f6bbe8201b..e875349a012 100644 --- a/packages/suite/src/views/wallet/send/Outputs/TokenSelect/TokenSelect.tsx +++ b/packages/suite/src/views/wallet/send/Outputs/TokenSelect/TokenSelect.tsx @@ -1,59 +1,59 @@ -import { useMemo, useEffect, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { AssetLogo, Column, Row, Text, Card, IconButton } from '@trezor/components'; -import { selectCurrentFiatRates, updateFiatRatesThunk } from '@suite-common/wallet-core'; -import { Account, Timestamp, TokenAddress } from '@suite-common/wallet-types'; -import { - CoinLogo, - SearchAsset, - SelectAssetModal, - TokenTabs, - TokenTab, - AssetProps, - ITEM_HEIGHT, - AssetOptionBaseProps, -} from '@trezor/product-components'; -import { - getContractAddressForNetworkSymbol, - getTokenExplorerUrl, - hasNetworkFeatures, - isNftToken, -} from '@suite-common/wallet-utils'; -import { spacings } from '@trezor/theme'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; import { + TokenDefinitions, selectCoinDefinitions, selectIsSpecificCoinDefinitionKnown, - TokenDefinitions, } from '@suite-common/token-definitions'; import { + type NetworkSymbol, getCoingeckoId, getNetwork, getNetworkDisplaySymbolName, - type NetworkSymbol, } from '@suite-common/wallet-config'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { selectCurrentFiatRates, updateFiatRatesThunk } from '@suite-common/wallet-core'; +import { Account, Timestamp, TokenAddress } from '@suite-common/wallet-types'; +import { + getContractAddressForNetworkSymbol, + getTokenExplorerUrl, + hasNetworkFeatures, + isNftToken, +} from '@suite-common/wallet-utils'; import { TokenInfo } from '@trezor/blockchain-link-types'; +import { AssetLogo, Card, Column, IconButton, Row, Text } from '@trezor/components'; +import { + AssetOptionBaseProps, + AssetProps, + CoinLogo, + ITEM_HEIGHT, + SearchAsset, + SelectAssetModal, + TokenTab, + TokenTabs, +} from '@trezor/product-components'; +import { spacings } from '@trezor/theme'; -import { selectIsCopyAddressModalShown } from 'src/reducers/suite/suiteReducer'; +import { SUITE } from 'src/actions/suite/constants'; +import { copyAddressToClipboard, showCopyAddressModal } from 'src/actions/suite/copyAddressActions'; import { FiatValue, FormattedCryptoAmount, HiddenPlaceholder, Translation, } from 'src/components/suite'; -import { SUITE } from 'src/actions/suite/constants'; +import { TokenAddressRow } from 'src/components/suite/copy/TokenAddressRow'; +import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; +import { useSendFormContext } from 'src/hooks/wallet'; +import { selectIsCopyAddressModalShown } from 'src/reducers/suite/suiteReducer'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { enhanceTokensWithRates, getTokens, sortTokensWithRates, } from 'src/utils/wallet/tokenUtils'; -import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; -import { useSendFormContext } from 'src/hooks/wallet'; -import { TokenAddressRow } from 'src/components/suite/copy/TokenAddressRow'; -import { copyAddressToClipboard, showCopyAddressModal } from 'src/actions/suite/copyAddressActions'; export const IconCursorWrapper = styled.div` cursor: pointer; diff --git a/packages/suite/src/views/wallet/send/SendHeader.tsx b/packages/suite/src/views/wallet/send/SendHeader.tsx index e291940e9b9..9c6b9edbed6 100644 --- a/packages/suite/src/views/wallet/send/SendHeader.tsx +++ b/packages/suite/src/views/wallet/send/SendHeader.tsx @@ -1,13 +1,13 @@ import styled from 'styled-components'; -import { Button, Dropdown, DropdownMenuItemProps } from '@trezor/components'; import { sendFormActions } from '@suite-common/wallet-core'; +import { Button, Dropdown, DropdownMenuItemProps } from '@trezor/components'; import { FADE_IN } from '@trezor/components/src/config/animations'; import { Translation } from 'src/components/suite'; +import { WalletSubpageHeading } from 'src/components/wallet'; import { useDevice, useDispatch } from 'src/hooks/suite'; import { useSendFormContext } from 'src/hooks/wallet'; -import { WalletSubpageHeading } from 'src/components/wallet'; 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 16ba0a3be44..9774323e780 100644 --- a/packages/suite/src/views/wallet/send/SendRaw.tsx +++ b/packages/suite/src/views/wallet/send/SendRaw.tsx @@ -1,15 +1,15 @@ 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 { pushSendFormRawTransactionThunk, sendFormActions } from '@suite-common/wallet-core'; +import { getInputState, isHexValid, tryGetAccountIdentity } from '@suite-common/wallet-utils'; +import { Button, Card, H3, IconButton, Row, Textarea, Tooltip } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; import { spacings } from '@trezor/theme'; +import { OpenGuideFromTooltip } from 'src/components/guide'; import { Translation } from 'src/components/suite'; import { useDispatch, useTranslation } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; -import { OpenGuideFromTooltip } from 'src/components/guide'; 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 67e948d44d7..572c910d46b 100644 --- a/packages/suite/src/views/wallet/send/TotalSent/ReviewButton.tsx +++ b/packages/suite/src/views/wallet/send/TotalSent/ReviewButton.tsx @@ -2,13 +2,13 @@ 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 { Banner, Button, Checkbox, Tooltip, variables } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; +import { Translation } from 'src/components/suite/Translation'; 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; diff --git a/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx b/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx index 9acb7ad8218..36de2f1b01c 100644 --- a/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx +++ b/packages/suite/src/views/wallet/send/TotalSent/TotalSent.tsx @@ -1,11 +1,11 @@ import styled from 'styled-components'; +import { formatAmount, formatNetworkAmount } from '@suite-common/wallet-utils'; import { Card, Column, InfoItem } from '@trezor/components'; -import { formatNetworkAmount, formatAmount } from '@suite-common/wallet-utils'; import { spacings } from '@trezor/theme'; +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { useSendFormContext } from 'src/hooks/wallet'; -import { Translation, FiatValue, FormattedCryptoAmount } from 'src/components/suite'; import { ReviewButton } from './ReviewButton'; diff --git a/packages/suite/src/views/wallet/send/index.tsx b/packages/suite/src/views/wallet/send/index.tsx index 865c494dd68..d1479e3a612 100644 --- a/packages/suite/src/views/wallet/send/index.tsx +++ b/packages/suite/src/views/wallet/send/index.tsx @@ -4,24 +4,24 @@ import styled from 'styled-components'; import { Banner, Column } from '@trezor/components'; import { breakpointMediaQueries } from '@trezor/styles'; -import { spacingsPx, spacings } from '@trezor/theme'; +import { spacings, spacingsPx } from '@trezor/theme'; -import { useSelector } from 'src/hooks/suite'; +import { Translation } from 'src/components/suite'; +import { ConfirmEvmExplanationModal } from 'src/components/suite/modals'; import { WalletLayout } from 'src/components/wallet'; -import { useSendForm, SendContext, UseSendFormProps } from 'src/hooks/wallet/useSendForm'; +import { useSelector } from 'src/hooks/suite'; +import { SendContext, UseSendFormProps, useSendForm } from 'src/hooks/wallet/useSendForm'; import { - selectTargetAnonymityByAccountKey, selectRegisteredUtxosByAccountKey, + selectTargetAnonymityByAccountKey, } 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'; +import { Outputs } from './Outputs/Outputs'; import { SendFees } from './SendFees'; -import { TotalSent } from './TotalSent/TotalSent'; +import { SendHeader } from './SendHeader'; import { SendRaw } from './SendRaw'; +import { TotalSent } from './TotalSent/TotalSent'; const FormGrid = styled.div` gap: ${spacingsPx.md}; 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 82390fbdae1..a41700e3d8b 100644 --- a/packages/suite/src/views/wallet/sign-verify/components/SignAddressInput.tsx +++ b/packages/suite/src/views/wallet/sign-verify/components/SignAddressInput.tsx @@ -4,12 +4,12 @@ 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, + useSignAddressOptions, } from 'src/hooks/wallet/sign-verify/useSignAddressOptions'; +import type { State as RevealedAddresses } from 'src/reducers/wallet/receiveReducer'; +import type { Account } from 'src/types/wallet'; 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 eb526581fe8..51a9e8852ba 100644 --- a/packages/suite/src/views/wallet/sign-verify/components/VerifyAddressButton.tsx +++ b/packages/suite/src/views/wallet/sign-verify/components/VerifyAddressButton.tsx @@ -6,8 +6,8 @@ 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 { useDispatch } from 'src/hooks/suite'; 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 da6e7507c2b..f163e71132c 100644 --- a/packages/suite/src/views/wallet/sign-verify/index.tsx +++ b/packages/suite/src/views/wallet/sign-verify/index.tsx @@ -3,36 +3,36 @@ import { FieldError } from 'react-hook-form'; import styled from 'styled-components'; +import { getInputState } from '@suite-common/wallet-utils'; import { - Input, Button, - Textarea, Card, - Switch, - variables, + Input, SelectBar, + Switch, + Textarea, Tooltip, + variables, } 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'; -import { useDevice, useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; -import { sign, verify } from 'src/actions/wallet/signVerifyActions'; import { goto } from 'src/actions/suite/routerActions'; +import { sign, verify } from 'src/actions/wallet/signVerifyActions'; +import { Translation } from 'src/components/suite'; import { TranslationKey } from 'src/components/suite/Translation'; +import { WalletLayout, WalletSubpageHeading } from 'src/components/wallet'; +import { useDevice, useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; import { useCopySignedMessage } from 'src/hooks/wallet/sign-verify/useCopySignedMessage'; import { - useSignVerifyForm, - SignVerifyFields, MAX_LENGTH_MESSAGE, MAX_LENGTH_SIGNATURE, + SignVerifyFields, + useSignVerifyForm, } from 'src/hooks/wallet/sign-verify/useSignVerifyForm'; -import { Navigation, NavPages } from './components/Navigation'; -import { SignAddressInput } from './components/SignAddressInput'; import { ButtonRow, Row } from './components/ButtonRow'; +import { NavPages, Navigation } from './components/Navigation'; +import { SignAddressInput } from './components/SignAddressInput'; const SwitchWrapper = styled.label` display: flex; diff --git a/packages/suite/src/views/wallet/staking/components/CardanoRedelegate.tsx b/packages/suite/src/views/wallet/staking/components/CardanoRedelegate.tsx index 345b8b632bf..0345a4f4a7e 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoRedelegate.tsx +++ b/packages/suite/src/views/wallet/staking/components/CardanoRedelegate.tsx @@ -4,10 +4,10 @@ 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 { getReasonForDisabledAction, useCardanoStaking } from 'src/hooks/wallet/useCardanoStaking'; -import { Actions, Title, Heading, Text } from './CardanoPrimitives'; +import { Actions, Heading, Text, Title } from './CardanoPrimitives'; import { DeviceButton } from './DeviceButton'; interface CardanoRedelegateProps { diff --git a/packages/suite/src/views/wallet/staking/components/CardanoRewards.tsx b/packages/suite/src/views/wallet/staking/components/CardanoRewards.tsx index 834ed4e8cae..2239e271963 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoRewards.tsx +++ b/packages/suite/src/views/wallet/staking/components/CardanoRewards.tsx @@ -1,31 +1,31 @@ import { useEffect } from 'react'; +import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; 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 { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { openModal } from 'src/actions/suite/modalActions'; +import { HiddenPlaceholder } from 'src/components/suite/HiddenPlaceholder'; +import { Translation } from 'src/components/suite/Translation'; import { useDispatch } from 'src/hooks/suite'; import { getReasonForDisabledAction, useCardanoStaking } from 'src/hooks/wallet/useCardanoStaking'; -import { Translation } from 'src/components/suite/Translation'; import { Account } from 'src/types/wallet'; -import { HiddenPlaceholder } from 'src/components/suite/HiddenPlaceholder'; -import { openModal } from 'src/actions/suite/modalActions'; -import { DeviceButton } from './DeviceButton'; +import { CardanoActionPending } from './CardanoActionPending'; import { - StyledH2, Actions, + Column as CardanoColumn, + Content, Heading, Row, + StyledH2, Text, - Value, Title, - Content, - Column as CardanoColumn, + Value, } from './CardanoPrimitives'; -import { CardanoActionPending } from './CardanoActionPending'; +import { DeviceButton } from './DeviceButton'; 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 584974eb3a1..375b1cb86ae 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoStake.tsx +++ b/packages/suite/src/views/wallet/staking/components/CardanoStake.tsx @@ -1,29 +1,29 @@ import { useEffect } from 'react'; +import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; -import { Card, Column, Icon, Banner } from '@trezor/components'; +import { Banner, Card, Column, Icon } from '@trezor/components'; import { DeviceModelInternal } from '@trezor/connect'; import { spacings } from '@trezor/theme'; -import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; -import { Translation } from 'src/components/suite/Translation'; import { HiddenPlaceholder } from 'src/components/suite/HiddenPlaceholder'; -import { useCardanoStaking, getReasonForDisabledAction } from 'src/hooks/wallet/useCardanoStaking'; +import { Translation } from 'src/components/suite/Translation'; +import { getReasonForDisabledAction, useCardanoStaking } from 'src/hooks/wallet/useCardanoStaking'; import { Account } from 'src/types/wallet'; import { CardanoActionPending } from './CardanoActionPending'; -import { DeviceButton } from './DeviceButton'; import { - Title, - Row, - Column as CardanoColumn, Actions, - Heading, - Value, - Text, + Column as CardanoColumn, Content, + Heading, + Row, StyledH2, + Text, + Title, + Value, } from './CardanoPrimitives'; +import { DeviceButton } from './DeviceButton'; 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 ee22d27d8f9..6a5b5725a0f 100644 --- a/packages/suite/src/views/wallet/staking/components/CardanoStakingDashboard.tsx +++ b/packages/suite/src/views/wallet/staking/components/CardanoStakingDashboard.tsx @@ -2,12 +2,12 @@ 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 { useCardanoStaking } from 'src/hooks/wallet/useCardanoStaking'; +import { CardanoRedelegate } from './CardanoRedelegate'; import { CardanoRewards } from './CardanoRewards'; import { CardanoStake } from './CardanoStake'; -import { CardanoRedelegate } from './CardanoRedelegate'; interface CardanoStakingDashboardProps { selectedAccount: SelectedAccountLoaded; diff --git a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EthStakingDashboard.tsx b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EthStakingDashboard.tsx index 512745c56dd..8fa9ee7e45d 100644 --- a/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EthStakingDashboard.tsx +++ b/packages/suite/src/views/wallet/staking/components/EthStakingDashboard/components/EthStakingDashboard.tsx @@ -1,7 +1,6 @@ import { useEffect, useMemo } from 'react'; -import { Column, Flex, Grid, useMediaQuery, variables } from '@trezor/components'; -import { spacings } from '@trezor/theme'; +import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { fetchAllTransactionsForAccountThunk, selectAccountStakeTransactions, @@ -10,22 +9,23 @@ import { selectPoolStatsNextRewardPayout, selectValidatorsQueue, } from '@suite-common/wallet-core'; -import { getStakingDataForNetwork } from '@suite-common/wallet-utils'; -import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { SelectedAccountLoaded } from '@suite-common/wallet-types'; +import { getStakingDataForNetwork } from '@suite-common/wallet-utils'; +import { Column, Flex, Grid, useMediaQuery, variables } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { Translation } from 'src/components/suite'; import { DashboardSection } from 'src/components/dashboard'; +import { Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { getDaysToAddToPool, getDaysToUnstake } from 'src/utils/suite/ethereumStaking'; -import { StakingCard } from '../../StakingDashboard/components/StakingCard'; -import { ClaimCard } from '../../StakingDashboard/components/ClaimCard'; +import { InstantStakeBanner } from './InstantStakeBanner'; import { StakingDashboard } from '../../StakingDashboard/StakingDashboard'; import { ApyCard } from '../../StakingDashboard/components/ApyCard'; +import { ClaimCard } from '../../StakingDashboard/components/ClaimCard'; import { PayoutCard } from '../../StakingDashboard/components/PayoutCard'; +import { StakingCard } from '../../StakingDashboard/components/StakingCard'; import { Transactions } from '../../StakingDashboard/components/Transactions'; -import { InstantStakeBanner } from './InstantStakeBanner'; interface EthStakingDashboardProps { selectedAccount: SelectedAccountLoaded; 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 5c2752f5858..140255e95b6 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 @@ -2,15 +2,15 @@ import { useEffect, useRef, useState } from 'react'; import { fromWei } from 'web3-utils'; -import { Banner, Column, H3, Paragraph } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { StakeType, WalletAccountTransaction } from '@suite-common/wallet-types'; +import { Banner, Column, H3, Paragraph } from '@trezor/components'; import { InternalTransfer } from '@trezor/connect'; +import { spacings } from '@trezor/theme'; -import { useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; -import { getChangedInternalTx, getInstantStakeType } from 'src/utils/suite/ethereumStaking'; +import { useSelector } from 'src/hooks/suite'; import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; +import { getChangedInternalTx, getInstantStakeType } from 'src/utils/suite/ethereumStaking'; const getSubheadingTranslationId = (stakeType: StakeType) => { if (stakeType === 'stake') return 'TR_STAKING_INSTANTLY_STAKED'; diff --git a/packages/suite/src/views/wallet/staking/components/SolStakingDashboard/SolStakingDashboard.tsx b/packages/suite/src/views/wallet/staking/components/SolStakingDashboard/SolStakingDashboard.tsx index b12f07f21b6..b3794d1ccfc 100644 --- a/packages/suite/src/views/wallet/staking/components/SolStakingDashboard/SolStakingDashboard.tsx +++ b/packages/suite/src/views/wallet/staking/components/SolStakingDashboard/SolStakingDashboard.tsx @@ -1,20 +1,20 @@ import { useSelector } from 'react-redux'; -import { Column, Flex, Grid, useMediaQuery, variables } from '@trezor/components'; -import { spacings } from '@trezor/theme'; -import { SelectedAccountLoaded } from '@suite-common/wallet-types'; -import { selectPoolStatsApyData, StakeRootState } from '@suite-common/wallet-core'; +import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { SOLANA_EPOCH_DAYS } from '@suite-common/wallet-constants'; +import { StakeRootState, selectPoolStatsApyData } from '@suite-common/wallet-core'; +import { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { getStakingDataForNetwork } from '@suite-common/wallet-utils'; -import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { Column, Flex, Grid, useMediaQuery, variables } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { DashboardSection } from 'src/components/dashboard'; import { Translation } from 'src/components/suite'; import { StakingDashboard } from '../StakingDashboard/StakingDashboard'; import { ApyCard } from '../StakingDashboard/components/ApyCard'; -import { PayoutCard } from '../StakingDashboard/components/PayoutCard'; import { ClaimCard } from '../StakingDashboard/components/ClaimCard'; +import { PayoutCard } from '../StakingDashboard/components/PayoutCard'; import { StakingCard } from '../StakingDashboard/components/StakingCard'; interface SolStakingDashboardProps { diff --git a/packages/suite/src/views/wallet/staking/components/StakingDashboard/StakingDashboard.tsx b/packages/suite/src/views/wallet/staking/components/StakingDashboard/StakingDashboard.tsx index 253196940a2..ba208324b50 100644 --- a/packages/suite/src/views/wallet/staking/components/StakingDashboard/StakingDashboard.tsx +++ b/packages/suite/src/views/wallet/staking/components/StakingDashboard/StakingDashboard.tsx @@ -1,6 +1,6 @@ +import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { selectEthAccountHasStaked, selectSolAccountHasStaked } from '@suite-common/wallet-core'; import { SelectedAccountStatus } from '@suite-common/wallet-types'; -import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; import { WalletLayout } from 'src/components/wallet'; import { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ClaimCard.tsx b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ClaimCard.tsx index c0be8a30d01..cb043cac6ee 100644 --- a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ClaimCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ClaimCard.tsx @@ -1,16 +1,16 @@ import { useEffect, useMemo, useRef } from 'react'; -import { Button, Paragraph, Tooltip, Card, Column, InfoItem } from '@trezor/components'; -import { spacings } from '@trezor/theme'; -import { getStakingDataForNetwork, isPending } from '@suite-common/wallet-utils'; -import { selectAccountClaimTransactions } from '@suite-common/wallet-core'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { selectAccountClaimTransactions } from '@suite-common/wallet-core'; +import { getStakingDataForNetwork, isPending } from '@suite-common/wallet-utils'; +import { Button, Card, Column, InfoItem, Paragraph, Tooltip } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; import { openModal } from 'src/actions/suite/modalActions'; +import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; export const ClaimCard = () => { const selectedAccount = useSelector(selectSelectedAccount); diff --git a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/EmptyStakingCard.tsx b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/EmptyStakingCard.tsx index d25e2964cda..ac48e4b079c 100644 --- a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/EmptyStakingCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/EmptyStakingCard.tsx @@ -1,28 +1,28 @@ import { useMemo } from 'react'; +import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { selectPoolStatsApyData } from '@suite-common/wallet-core'; import { Button, Card, Column, + Divider, + Grid, + IconName, Paragraph, Text, Tooltip, - variables, - Divider, - Grid, useMediaQuery, - IconName, + variables, } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { selectPoolStatsApyData } from '@suite-common/wallet-core'; -import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; -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 { StakingFeature, Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; export const EmptyStakingCard = () => { const isBelowLaptop = useMediaQuery(`(max-width: ${variables.SCREEN_SIZE.LG})`); diff --git a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/PayoutCard.tsx b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/PayoutCard.tsx index a41a203ea87..0714d15cf02 100644 --- a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/PayoutCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/PayoutCard.tsx @@ -1,14 +1,14 @@ import { useMemo } from 'react'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Card, Column, Icon, Paragraph } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { BACKUP_REWARD_PAYOUT_DAYS } from '@suite-common/wallet-constants'; import { getStakingDataForNetwork } from '@suite-common/wallet-utils'; +import { Card, Column, Icon, Paragraph } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { Translation } from 'src/components/suite'; -import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { useSelector } from 'src/hooks/suite'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; interface PayoutCardProps { nextRewardPayout?: number | null; diff --git a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ProgressLabels/ProgressLabel.tsx b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ProgressLabels/ProgressLabel.tsx index d6f47429e2d..a100e2cefdf 100644 --- a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ProgressLabels/ProgressLabel.tsx +++ b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ProgressLabels/ProgressLabel.tsx @@ -2,7 +2,7 @@ import { ReactNode, useEffect, useRef, useState } from 'react'; import styled, { DefaultTheme } from 'styled-components'; -import { IconCircle, Text, Row } from '@trezor/components'; +import { IconCircle, Row, Text } from '@trezor/components'; import { IconCirclePaddingType } from '@trezor/components/src/components/IconCircle/types'; import { borders, spacings, spacingsPx } from '@trezor/theme'; diff --git a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ProgressLabels/ProgressLabels.tsx b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ProgressLabels/ProgressLabels.tsx index 9f8a677a950..01f8b992d53 100644 --- a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ProgressLabels/ProgressLabels.tsx +++ b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/ProgressLabels/ProgressLabels.tsx @@ -1,8 +1,8 @@ -import { spacings } from '@trezor/theme'; import { Row } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { ProgressLabelData } from './types'; import { ProgressLabel } from './ProgressLabel'; +import { ProgressLabelData } from './types'; interface ProgressLabelsProps { labels: ProgressLabelData[]; diff --git a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/StakingCard.tsx b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/StakingCard.tsx index 3f3ff7d4a73..e6516cbaa3a 100644 --- a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/StakingCard.tsx +++ b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/StakingCard.tsx @@ -1,39 +1,39 @@ -import { BigNumber } from '@trezor/utils/src/bigNumber'; +import { type NetworkSymbol, getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { SOLANA_EPOCH_DAYS } from '@suite-common/wallet-constants'; +import { selectAccountStakeTransactions } from '@suite-common/wallet-core'; +import { + calculateSolanaStakingReward, + getStakingAccountCurrentStatus, + getStakingDataForNetwork, + isPending, +} from '@suite-common/wallet-utils'; import { Badge, Button, Card, - Icon, - Row, - Grid, Column, - Tooltip, + Grid, + Icon, + IconName, InfoItem, Paragraph, - IconName, + Row, + Tooltip, useMediaQuery, variables, } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { selectAccountStakeTransactions } from '@suite-common/wallet-core'; -import { - calculateSolanaStakingReward, - getStakingAccountCurrentStatus, - getStakingDataForNetwork, - isPending, -} from '@suite-common/wallet-utils'; -import { SOLANA_EPOCH_DAYS } from '@suite-common/wallet-constants'; -import { getNetworkDisplaySymbol, type NetworkSymbol } from '@suite-common/wallet-config'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { FiatValue, Translation, FormattedCryptoAmount } 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 { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { useMessageSystemStaking } from 'src/hooks/suite/useMessageSystemStaking'; +import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer'; import { ProgressLabels } from './ProgressLabels/ProgressLabels'; -import { useProgressLabelsData } from '../hooks/useProgressLabelsData'; import { useIsTxStatusShown } from '../hooks/useIsTxStatusShown'; +import { useProgressLabelsData } from '../hooks/useProgressLabelsData'; type ItemProps = { label: React.ReactNode; diff --git a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/Transactions.tsx b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/Transactions.tsx index 3223f454b5c..3ed2c8f6726 100644 --- a/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/Transactions.tsx +++ b/packages/suite/src/views/wallet/staking/components/StakingDashboard/components/Transactions.tsx @@ -4,8 +4,8 @@ import { selectIsLoadingAccountTransactions, } from '@suite-common/wallet-core'; -import { TransactionList } from 'src/views/wallet/transactions/TransactionList/TransactionList'; import { useSelector } from 'src/hooks/suite'; +import { TransactionList } from 'src/views/wallet/transactions/TransactionList/TransactionList'; export const Transactions = () => { const selectedAccount = useSelector(state => state.wallet.selectedAccount); diff --git a/packages/suite/src/views/wallet/staking/components/StakingDashboard/hooks/useProgressLabelsData.tsx b/packages/suite/src/views/wallet/staking/components/StakingDashboard/hooks/useProgressLabelsData.tsx index 51bf8e40972..74e6e708125 100644 --- a/packages/suite/src/views/wallet/staking/components/StakingDashboard/hooks/useProgressLabelsData.tsx +++ b/packages/suite/src/views/wallet/staking/components/StakingDashboard/hooks/useProgressLabelsData.tsx @@ -1,8 +1,8 @@ import { useMemo } from 'react'; -import { Paragraph, Column } from '@trezor/components'; -import { Account } from '@suite-common/wallet-types'; import { SOLANA_EPOCH_DAYS } from '@suite-common/wallet-constants'; +import { Account } from '@suite-common/wallet-types'; +import { Column, Paragraph } from '@trezor/components'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/wallet/tokens/DropdownRow.tsx b/packages/suite/src/views/wallet/tokens/DropdownRow.tsx index a7312c07e38..e0b61cfd175 100644 --- a/packages/suite/src/views/wallet/tokens/DropdownRow.tsx +++ b/packages/suite/src/views/wallet/tokens/DropdownRow.tsx @@ -2,8 +2,8 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; -import { Row, Icon, Text, TextVariant, Badge } from '@trezor/components'; -import { spacings, TypographyStyle } from '@trezor/theme'; +import { Badge, Icon, Row, Text, TextVariant } from '@trezor/components'; +import { TypographyStyle, spacings } from '@trezor/theme'; import { HiddenPlaceholder, Translation } from 'src/components/suite'; import { TranslationKey } from 'src/components/suite/Translation'; diff --git a/packages/suite/src/views/wallet/tokens/TokensNavigation.tsx b/packages/suite/src/views/wallet/tokens/TokensNavigation.tsx index b68e2ba87e0..7b9f6470627 100644 --- a/packages/suite/src/views/wallet/tokens/TokensNavigation.tsx +++ b/packages/suite/src/views/wallet/tokens/TokensNavigation.tsx @@ -1,19 +1,19 @@ import { Dispatch, SetStateAction, useEffect, useState } from 'react'; -import { SelectedAccountLoaded } from '@suite-common/wallet-types'; +import { Route } from '@suite-common/suite-types'; import { selectCoinDefinitions, selectNftDefinitions } from '@suite-common/token-definitions'; +import { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { IconButton, IconName, Row, SubTabs } from '@trezor/components'; import { EventType, analytics } from '@trezor/suite-analytics'; -import { Route } from '@suite-common/suite-types'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { getTokens, GetTokensOutputType } from 'src/utils/wallet/tokenUtils'; -import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; -import { selectRouteName } from 'src/reducers/suite/routerReducer'; -import { SearchAction } from 'src/components/wallet/SearchAction'; import { openModal } from 'src/actions/suite/modalActions'; -import { Translation } from 'src/components/suite'; import { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite'; +import { SearchAction } from 'src/components/wallet/SearchAction'; +import { useDispatch, useSelector } from 'src/hooks/suite'; +import { selectRouteName } from 'src/reducers/suite/routerReducer'; +import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer'; +import { GetTokensOutputType, getTokens } from 'src/utils/wallet/tokenUtils'; import { TranslationKey } from '../../../components/suite/Translation'; diff --git a/packages/suite/src/views/wallet/tokens/coins/CoinsTable.tsx b/packages/suite/src/views/wallet/tokens/coins/CoinsTable.tsx index 560b77042c8..1c265c63b8e 100644 --- a/packages/suite/src/views/wallet/tokens/coins/CoinsTable.tsx +++ b/packages/suite/src/views/wallet/tokens/coins/CoinsTable.tsx @@ -1,16 +1,16 @@ +import { TokenManagementAction, selectCoinDefinitions } from '@suite-common/token-definitions'; import { selectCurrentFiatRates } from '@suite-common/wallet-core'; import { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { isTestnet } from '@suite-common/wallet-utils'; -import { TokenManagementAction, selectCoinDefinitions } from '@suite-common/token-definitions'; +import { Translation } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; import { enhanceTokensWithRates, getTokens, 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'; diff --git a/packages/suite/src/views/wallet/tokens/common/BlurUrls.tsx b/packages/suite/src/views/wallet/tokens/common/BlurUrls.tsx index 3b797e7b3d8..723e1361f8b 100644 --- a/packages/suite/src/views/wallet/tokens/common/BlurUrls.tsx +++ b/packages/suite/src/views/wallet/tokens/common/BlurUrls.tsx @@ -5,8 +5,8 @@ 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 { BlurWrapper } from 'src/components/wallet/TransactionItem/TransactionItemBlurWrapper'; // 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 b8b5ec89311..b8fa4951d76 100644 --- a/packages/suite/src/views/wallet/tokens/common/TokensTable/TokenRow.tsx +++ b/packages/suite/src/views/wallet/tokens/common/TokensTable/TokenRow.tsx @@ -1,8 +1,5 @@ import styled from 'styled-components'; -import { selectSelectedDevice, sendFormActions } from '@suite-common/wallet-core'; -import { Account, TokenAddress } from '@suite-common/wallet-types'; -import { Network, getCoingeckoId } from '@suite-common/wallet-config'; import { DefinitionType, EnhancedTokenInfo, @@ -10,26 +7,35 @@ import { selectIsSpecificCoinDefinitionKnown, tokenDefinitionsActions, } from '@suite-common/token-definitions'; +import { Network, getCoingeckoId } from '@suite-common/wallet-config'; +import { selectSelectedDevice, sendFormActions } from '@suite-common/wallet-core'; +import { Account, TokenAddress } from '@suite-common/wallet-types'; import { - Dropdown, - IconButton, - ButtonGroup, + getContractAddressForNetworkSymbol, + getTokenExplorerUrl, +} from '@suite-common/wallet-utils'; +import { + AssetLogo, Button, - Icon, - Table, + ButtonGroup, + Column, + Dropdown, GroupedMenuItems, - AssetLogo, + Icon, + IconButton, Row, - Column, + Table, Text, } from '@trezor/components'; -import { spacings, spacingsPx } from '@trezor/theme'; import { EventType, analytics } from '@trezor/suite-analytics'; -import { - getContractAddressForNetworkSymbol, - getTokenExplorerUrl, -} from '@suite-common/wallet-utils'; +import { spacings, spacingsPx } from '@trezor/theme'; +import { SUITE } from 'src/actions/suite/constants'; +import { copyAddressToClipboard, showCopyAddressModal } from 'src/actions/suite/copyAddressActions'; +import { openModal } from 'src/actions/suite/modalActions'; +import { goto } from 'src/actions/suite/routerActions'; +import { showAddress } from 'src/actions/wallet/receiveActions'; +import { setTradingPrefilledFromCryptoId } from 'src/actions/wallet/trading/tradingCommonActions'; import { FiatValue, FormattedCryptoAmount, @@ -45,21 +51,15 @@ import { useSelector, useTranslation, } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; -import { showAddress } from 'src/actions/wallet/receiveActions'; -import { - getUnusedAddressFromAccount, - toTokenCryptoId, -} from 'src/utils/wallet/trading/tradingUtils'; -import { openModal } from 'src/actions/suite/modalActions'; -import { formatTokenSymbol } from 'src/utils/wallet/tokenUtils'; import { selectIsCopyAddressModalShown, selectIsUnhideTokenModalShown, } from 'src/reducers/suite/suiteReducer'; -import { SUITE } from 'src/actions/suite/constants'; -import { copyAddressToClipboard, showCopyAddressModal } from 'src/actions/suite/copyAddressActions'; -import { setTradingPrefilledFromCryptoId } from 'src/actions/wallet/trading/tradingCommonActions'; +import { formatTokenSymbol } from 'src/utils/wallet/tokenUtils'; +import { + getUnusedAddressFromAccount, + toTokenCryptoId, +} from 'src/utils/wallet/trading/tradingUtils'; import { BlurUrls } from '../BlurUrls'; 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 4fdddb82616..97ebc8643f6 100644 --- a/packages/suite/src/views/wallet/tokens/common/TokensTable/TokensTable.tsx +++ b/packages/suite/src/views/wallet/tokens/common/TokensTable/TokensTable.tsx @@ -1,10 +1,10 @@ import { useState } from 'react'; -import { Account } from '@suite-common/wallet-types'; -import { Network } from '@suite-common/wallet-config'; import { EnhancedTokenInfo, TokenManagementAction } from '@suite-common/token-definitions'; +import { Network } from '@suite-common/wallet-config'; +import { Account } from '@suite-common/wallet-types'; +import { Card, Paragraph, Table } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { Table, Paragraph, Card } from '@trezor/components'; import { Translation } from 'src/components/suite'; import { useTradingLoadData } from 'src/hooks/wallet/trading/useTradingLoadData'; 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 f641519df0d..4abc71348fb 100644 --- a/packages/suite/src/views/wallet/tokens/hidden-tokens/HiddenTokensTable.tsx +++ b/packages/suite/src/views/wallet/tokens/hidden-tokens/HiddenTokensTable.tsx @@ -1,12 +1,12 @@ -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 { SelectedAccountLoaded } from '@suite-common/wallet-types'; import { isTestnet } from '@suite-common/wallet-utils'; +import { Banner, Column, H3 } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { getTokens } from 'src/utils/wallet/tokenUtils'; -import { useSelector } from 'src/hooks/suite'; import { Translation } from 'src/components/suite'; +import { useSelector } from 'src/hooks/suite'; +import { getTokens } from 'src/utils/wallet/tokenUtils'; import { NoTokens } from '../common/NoTokens'; import { NoSearchResultsWrapped, TokensTable } from '../common/TokensTable/TokensTable'; diff --git a/packages/suite/src/views/wallet/tokens/index.tsx b/packages/suite/src/views/wallet/tokens/index.tsx index 84f0e80a875..f20a762cb45 100644 --- a/packages/suite/src/views/wallet/tokens/index.tsx +++ b/packages/suite/src/views/wallet/tokens/index.tsx @@ -1,15 +1,15 @@ -import { useState, useEffect } from 'react'; +import { useEffect, useState } from 'react'; import { Route, Switch } from 'react-router-dom'; import { Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; 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 { TokensNavigation } from './TokensNavigation'; +import { CoinsTable } from './coins/CoinsTable'; import { HiddenTokensTable } from './hidden-tokens/HiddenTokensTable'; export const Tokens = () => { diff --git a/packages/suite/src/views/wallet/trading/DCA/TradingDCALanding.tsx b/packages/suite/src/views/wallet/trading/DCA/TradingDCALanding.tsx index 13d58b6ae09..877ae92c431 100644 --- a/packages/suite/src/views/wallet/trading/DCA/TradingDCALanding.tsx +++ b/packages/suite/src/views/wallet/trading/DCA/TradingDCALanding.tsx @@ -14,14 +14,14 @@ import { Row, Text, } from '@trezor/components'; +import { variables } from '@trezor/components/src/config'; import { borders, palette, spacings, spacingsPx } from '@trezor/theme'; import { TRADING_DOWNLOAD_INVITY_APP_URL } from '@trezor/urls'; -import { variables } from '@trezor/components/src/config'; import { Translation, TrezorLink } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; -import { TradingLayout } from 'src/views/wallet/trading/common/TradingLayout/TradingLayout'; import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; +import { TradingLayout } from 'src/views/wallet/trading/common/TradingLayout/TradingLayout'; const IconWrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/buy/TradingBuyConfirm.tsx b/packages/suite/src/views/wallet/trading/buy/TradingBuyConfirm.tsx index 9d336d0d53e..3641c1608d1 100644 --- a/packages/suite/src/views/wallet/trading/buy/TradingBuyConfirm.tsx +++ b/packages/suite/src/views/wallet/trading/buy/TradingBuyConfirm.tsx @@ -1,8 +1,8 @@ -import { UseTradingProps } from 'src/types/trading/trading'; import { useTradingBuyForm } from 'src/hooks/wallet/trading/form/useTradingBuyForm'; import { TradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { TradingSelectedOffer } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOffer'; +import { UseTradingProps } from 'src/types/trading/trading'; import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; +import { TradingSelectedOffer } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOffer'; const TradingBuyConfirmComponent = ({ selectedAccount }: UseTradingProps) => { const tradingBuyContextValues = useTradingBuyForm({ diff --git a/packages/suite/src/views/wallet/trading/buy/TradingBuyForm.tsx b/packages/suite/src/views/wallet/trading/buy/TradingBuyForm.tsx index 7fcaaed72a7..1a02f26a76c 100644 --- a/packages/suite/src/views/wallet/trading/buy/TradingBuyForm.tsx +++ b/packages/suite/src/views/wallet/trading/buy/TradingBuyForm.tsx @@ -1,9 +1,9 @@ -import { UseTradingProps } from 'src/types/trading/trading'; import { useTradingBuyForm } from 'src/hooks/wallet/trading/form/useTradingBuyForm'; import { TradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { UseTradingProps } from 'src/types/trading/trading'; +import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; import { TradingFormLayout } from 'src/views/wallet/trading/common/TradingForm/TradingFormLayout'; import { TradingLayout } from 'src/views/wallet/trading/common/TradingLayout/TradingLayout'; -import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; const TradingBuyComponent = ({ selectedAccount }: UseTradingProps) => { const tradingBuyContextValues = useTradingBuyForm({ selectedAccount }); diff --git a/packages/suite/src/views/wallet/trading/common/TradingAddressOptions.tsx b/packages/suite/src/views/wallet/trading/common/TradingAddressOptions.tsx index 0a195fbef5e..cc178ad1eba 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingAddressOptions.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingAddressOptions.tsx @@ -1,25 +1,25 @@ -import { useEffect, ReactElement, ReactNode } from 'react'; -import { UseFormReturn, Control, Controller } from 'react-hook-form'; +import { ReactElement, ReactNode, useEffect } from 'react'; +import { Control, Controller, UseFormReturn } from 'react-hook-form'; import type { MenuPlacement } from 'react-select'; import { CryptoId } from 'invity-api'; -import type { AccountAddress } from '@trezor/connect'; -import { Select, InfoSegments, Column } from '@trezor/components'; -import { formatAmount } from '@suite-common/wallet-utils'; import { getDisplaySymbol, getNetwork } from '@suite-common/wallet-config'; +import { formatAmount } from '@suite-common/wallet-utils'; +import { Column, InfoSegments, Select } from '@trezor/components'; +import type { AccountAddress } from '@trezor/connect'; 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 { FORM_SEND_CRYPTO_CURRENCY_SELECT } from 'src/constants/wallet/trading/form'; import { useSelector } from 'src/hooks/suite'; -import { TradingBalance } from 'src/views/wallet/trading/common/TradingBalance'; -import { getTradingNetworkDecimals } from 'src/utils/wallet/trading/tradingUtils'; +import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { useAccountAddressDictionary } from 'src/hooks/wallet/useAccounts'; +import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; +import type { Account } from 'src/types/wallet'; import { isTradingExchangeContext } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { FORM_SEND_CRYPTO_CURRENCY_SELECT } from 'src/constants/wallet/trading/form'; +import { getTradingNetworkDecimals } from 'src/utils/wallet/trading/tradingUtils'; +import { TradingBalance } from 'src/views/wallet/trading/common/TradingBalance'; const buildOptions = (addresses: Account['addresses']) => { if (!addresses) return undefined; diff --git a/packages/suite/src/views/wallet/trading/common/TradingBalance.tsx b/packages/suite/src/views/wallet/trading/common/TradingBalance.tsx index 9747d757522..6358eb1abe8 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingBalance.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingBalance.tsx @@ -1,4 +1,4 @@ -import { getNetwork, NetworkSymbol } from '@suite-common/wallet-config'; +import { NetworkSymbol, getNetwork } from '@suite-common/wallet-config'; import { TokenAddress } from '@suite-common/wallet-types'; import { amountToSmallestUnit } from '@suite-common/wallet-utils'; import { Text } from '@trezor/components'; @@ -8,8 +8,8 @@ import { useFiatFromCryptoValue } from 'src/hooks/suite/useFiatFromCryptoValue'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; import { TradingAccountOptionsGroupOptionProps } from 'src/types/trading/trading'; import { - tradingGetAccountLabel, getTradingNetworkDecimals, + tradingGetAccountLabel, } from 'src/utils/wallet/trading/tradingUtils'; interface TradingBalanceProps { diff --git a/packages/suite/src/views/wallet/trading/common/TradingCryptoAmount.tsx b/packages/suite/src/views/wallet/trading/common/TradingCryptoAmount.tsx index 4dfd3952e9b..e2e2b9cd039 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingCryptoAmount.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingCryptoAmount.tsx @@ -1,14 +1,14 @@ -import styled from 'styled-components'; import { CryptoId } from 'invity-api'; +import styled from 'styled-components'; -import { spacings } from '@trezor/theme'; -import { Row } from '@trezor/components'; import { getDisplaySymbol } from '@suite-common/wallet-config'; +import { Row } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { FormattedCryptoAmount } from 'src/components/suite'; -import { TradingCoinLogo } from 'src/views/wallet/trading/common/TradingCoinLogo'; import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { TradingTestWrapper } from 'src/views/wallet/trading'; +import { TradingCoinLogo } from 'src/views/wallet/trading/common/TradingCoinLogo'; const LogoWrapper = styled.div` line-height: 0; diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuy.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuy.tsx index 1f9778cc198..9153a80f14b 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuy.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuy.tsx @@ -1,17 +1,17 @@ import styled from 'styled-components'; -import { Card } from '@trezor/components'; import type { TradingBuyType } from '@suite-common/invity'; +import { Card } from '@trezor/components'; import { goto } from 'src/actions/suite/routerActions'; import { useDispatch } from 'src/hooks/suite'; import { useTradingDetailContext } from 'src/hooks/wallet/trading/useTradingDetail'; import { TradingGetCryptoQuoteAmountProps } from 'src/types/trading/trading'; -import { TradingSelectedOfferInfo } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo'; -import { TradingDetailBuyPaymentPaymentSuccessful } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentSuccessful'; import { TradingDetailBuyPaymentFailed } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentFailed'; import { TradingDetailBuyPaymentProcessing } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentProcessing'; +import { TradingDetailBuyPaymentPaymentSuccessful } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentSuccessful'; import { TradingDetailBuyPaymentWaitingForUser } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentWaitingForUser'; +import { TradingSelectedOfferInfo } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo'; import { TradingWrapper } from 'src/views/wallet/trading/common/TradingWrapper'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentFailed.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentFailed.tsx index 79f75923cdc..9292b3b92a2 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentFailed.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentFailed.tsx @@ -3,10 +3,10 @@ import styled from 'styled-components'; import { Button, H4, Image } from '@trezor/components'; import { spacings, typography } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite/Translation'; 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'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentProcessing.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentProcessing.tsx index 3967af0333b..53f5e42c970 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentProcessing.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentProcessing.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { Spinner, Button, H4 } from '@trezor/components'; +import { Button, H4, Spinner } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite/Translation'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentSuccessful.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentSuccessful.tsx index 2e54c25b85d..3ec410f8b78 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentSuccessful.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentSuccessful.tsx @@ -1,11 +1,11 @@ import styled from 'styled-components'; -import { Button, variables, Image } from '@trezor/components'; +import { Button, Image, variables } from '@trezor/components'; +import { goto } from 'src/actions/suite/routerActions'; 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'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentWaitingForUser.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentWaitingForUser.tsx index 4664deaa7d1..5bac4e9ce82 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentWaitingForUser.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailBuy/TradingDetailBuyPaymentWaitingForUser.tsx @@ -1,17 +1,17 @@ import { useState } from 'react'; -import styled from 'styled-components'; import { BuyTrade, BuyTradeStatus } from 'invity-api'; +import styled from 'styled-components'; -import { Button, variables, Image } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { invityAPI } from '@suite-common/invity'; +import { Button, Image, variables } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { submitRequestForm } from 'src/actions/wallet/trading/tradingCommonActions'; import { Translation } from 'src/components/suite/Translation'; +import { useDispatch } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; import { createTxLink } from 'src/utils/wallet/trading/buyUtils'; -import { submitRequestForm } from 'src/actions/wallet/trading/tradingCommonActions'; -import { useDispatch } from 'src/hooks/suite'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchange.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchange.tsx index 67768903215..5135fab4dfc 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchange.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchange.tsx @@ -1,19 +1,19 @@ import styled from 'styled-components'; -import { Card } from '@trezor/components'; import type { TradingExchangeType } from '@suite-common/invity'; +import { Card } from '@trezor/components'; import { goto } from 'src/actions/suite/routerActions'; import { useDispatch } from 'src/hooks/suite'; import { useTradingDetailContext } from 'src/hooks/wallet/trading/useTradingDetail'; import { tradeFinalStatuses } from 'src/hooks/wallet/trading/useTradingWatchTrade'; import { TradingGetCryptoQuoteAmountProps } from 'src/types/trading/trading'; -import { TradingSelectedOfferInfo } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo'; -import { TradingDetailExchangePaymentSuccessful } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSuccessful'; -import { TradingDetailExchangePaymentKYC } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentKYC'; -import { TradingDetailExchangePaymentFailed } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentFailed'; import { TradingDetailExchangePaymentConverting } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentConverting'; +import { TradingDetailExchangePaymentFailed } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentFailed'; +import { TradingDetailExchangePaymentKYC } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentKYC'; import { TradingDetailExchangePaymentSending } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSending'; +import { TradingDetailExchangePaymentSuccessful } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSuccessful'; +import { TradingSelectedOfferInfo } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo'; import { TradingWrapper } from 'src/views/wallet/trading/common/TradingWrapper'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentConverting.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentConverting.tsx index ff45c99dbc5..58ba0669e6e 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentConverting.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentConverting.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { Spinner, Button, H4 } from '@trezor/components'; +import { Button, H4, Spinner } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite/Translation'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentFailed.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentFailed.tsx index 228eb8da4a9..fa475759ce8 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentFailed.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentFailed.tsx @@ -3,10 +3,10 @@ import styled from 'styled-components'; import { Button, H4, Image } from '@trezor/components'; import { spacings, typography } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite/Translation'; 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 { TradingTransactionId } from 'src/views/wallet/trading/common/TradingTransactionId'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentKYC.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentKYC.tsx index a61f54c4ca8..86d8fd65be5 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentKYC.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentKYC.tsx @@ -1,13 +1,13 @@ -import styled from 'styled-components'; import { ExchangeProviderInfo } from 'invity-api'; +import styled from 'styled-components'; -import { Button, Image, H4 } from '@trezor/components'; +import { Button, H4, Image } from '@trezor/components'; import { spacings, typography } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite/Translation'; 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 { TradingTransactionId } from 'src/views/wallet/trading/common/TradingTransactionId'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSending.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSending.tsx index 90c9b0638f7..22a5d4a88b1 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSending.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSending.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { Spinner, Button, H4 } from '@trezor/components'; +import { Button, H4, Spinner } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite/Translation'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSuccessful.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSuccessful.tsx index d2dd84e4753..2effafef23c 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSuccessful.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailExchange/TradingDetailExchangePaymentSuccessful.tsx @@ -1,11 +1,11 @@ import styled from 'styled-components'; -import { Button, variables, Image } from '@trezor/components'; +import { Button, Image, variables } from '@trezor/components'; +import { goto } from 'src/actions/suite/routerActions'; 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'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSell.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSell.tsx index a0aeb86b985..201cd5c53ff 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSell.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSell.tsx @@ -1,17 +1,17 @@ import styled from 'styled-components'; -import { Card } from '@trezor/components'; import type { TradingSellType } from '@suite-common/invity'; +import { Card } from '@trezor/components'; import { goto } from 'src/actions/suite/routerActions'; import { useDispatch } from 'src/hooks/suite'; import { useTradingDetailContext } from 'src/hooks/wallet/trading/useTradingDetail'; import { tradeFinalStatuses } from 'src/hooks/wallet/trading/useTradingWatchTrade'; import { TradingGetCryptoQuoteAmountProps } from 'src/types/trading/trading'; -import { TradingSelectedOfferInfo } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo'; -import { TradingDetailSellPaymentSuccessful } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentSuccessful'; import { TradingDetailSellPaymentFailed } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentFailed'; import { TradingDetailSellPaymentPending } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentPending'; +import { TradingDetailSellPaymentSuccessful } from 'src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentSuccessful'; +import { TradingSelectedOfferInfo } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo'; import { TradingWrapper } from 'src/views/wallet/trading/common/TradingWrapper'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentFailed.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentFailed.tsx index ce109b722a9..692b390ab7d 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentFailed.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentFailed.tsx @@ -1,12 +1,12 @@ import styled from 'styled-components'; -import { Button, Image, H4 } from '@trezor/components'; +import { Button, H4, Image } from '@trezor/components'; import { spacings, typography } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; +import { Translation } from 'src/components/suite/Translation'; 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 { TradingTransactionId } from 'src/views/wallet/trading/common/TradingTransactionId'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentPending.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentPending.tsx index de71699d4c4..c3ea9f0208f 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentPending.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentPending.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { Spinner, Button, H4 } from '@trezor/components'; +import { Button, H4, Spinner } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite/Translation'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentSuccessful.tsx b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentSuccessful.tsx index 1c6a576da44..ecdf85ea2f1 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentSuccessful.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingDetail/TradingDetailSell/TradingDetailSellPaymentSuccessful.tsx @@ -1,12 +1,12 @@ import styled from 'styled-components'; -import { Button, variables, Image } from '@trezor/components'; +import { Button, Image, variables } from '@trezor/components'; import { borders } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; 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'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffers.tsx b/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffers.tsx index 586806b82ca..447a5f6806a 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffers.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffers.tsx @@ -1,8 +1,8 @@ import { Column } from '@trezor/components'; -import { getBestRatedQuote } from 'src/utils/wallet/trading/tradingUtils'; import { WalletSubpageHeading } from 'src/components/wallet'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { getBestRatedQuote } from 'src/utils/wallet/trading/tradingUtils'; import { TradingFeaturedOffersItem } from 'src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersItem'; export const TradingFeaturedOffers = () => { diff --git a/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersAmounts.tsx b/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersAmounts.tsx index a2e90500a9f..b1495fc11b2 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersAmounts.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersAmounts.tsx @@ -1,20 +1,20 @@ import React from 'react'; -import styled, { useTheme } from 'styled-components'; import { CryptoId } from 'invity-api'; +import styled, { useTheme } from 'styled-components'; -import { spacingsPx } from '@trezor/theme'; -import { Icon } from '@trezor/components'; import type { TradingTradeType } from '@suite-common/invity'; +import { Icon } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; +import { FormattedCryptoAmount } from 'src/components/suite'; +import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { getCryptoQuoteAmountProps, isTradingBuyContext, isTradingSellContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { FormattedCryptoAmount } from 'src/components/suite'; -import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { TradingFiatAmount } from 'src/views/wallet/trading/common/TradingFiatAmount'; const Arrow = styled.div` diff --git a/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersItem.tsx b/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersItem.tsx index cdf05683840..175c750cb57 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersItem.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersItem.tsx @@ -1,12 +1,14 @@ -import styled, { useTheme } from 'styled-components'; import { SellFiatTrade } from 'invity-api'; +import styled, { useTheme } from 'styled-components'; +import type { TradingTradeType, TradingType } from '@suite-common/invity'; import { Badge, Button, Card, Text } from '@trezor/components'; -import { spacings, spacingsPx } from '@trezor/theme'; import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; -import type { TradingTradeType, TradingType } from '@suite-common/invity'; +import { spacings, spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; +import { TradingTradeDetailBuySellType } from 'src/types/trading/trading'; +import { TradingFormContextValues } from 'src/types/trading/tradingForm'; import { getCryptoQuoteAmountProps, getProvidersInfoProps, @@ -16,11 +18,9 @@ import { isTradingSellContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; import { getTagAndInfoNote } from 'src/utils/wallet/trading/tradingUtils'; -import { TradingFormContextValues } from 'src/types/trading/tradingForm'; -import { TradingTradeDetailBuySellType } from 'src/types/trading/trading'; import { TradingFeaturedOffersAmounts } from 'src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersAmounts'; -import { TradingUtilsProvider } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider'; import { TradingFeaturedOffersPaymentInfo } from 'src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersPaymentInfo'; +import { TradingUtilsProvider } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider'; const Offer = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersPaymentInfo.tsx b/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersPaymentInfo.tsx index 539c1cd37da..2a9e261591a 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersPaymentInfo.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffersPaymentInfo.tsx @@ -1,10 +1,10 @@ import styled from 'styled-components'; -import { spacingsPx } from '@trezor/theme'; import type { TradingType } from '@suite-common/invity'; +import { spacingsPx } from '@trezor/theme'; -import { TradingTradeBuySellType, TradingTradeDetailBuySellType } from 'src/types/trading/trading'; import { Translation } from 'src/components/suite'; +import { TradingTradeBuySellType, TradingTradeDetailBuySellType } from 'src/types/trading/trading'; import { TradingPaymentPlainType } from 'src/views/wallet/trading/common/TradingPaymentPlainType'; const PaymentInfoWrapper = styled.div` diff --git a/packages/suite/src/views/wallet/trading/common/TradingFooter/TradingFooter.tsx b/packages/suite/src/views/wallet/trading/common/TradingFooter/TradingFooter.tsx index 66b07a6f66c..c9dabcf4645 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingFooter/TradingFooter.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingFooter/TradingFooter.tsx @@ -1,11 +1,11 @@ -import { useState, useRef } from 'react'; +import { useRef, useState } from 'react'; import styled, { css } from 'styled-components'; -import { Icon, Link, Image, Row } from '@trezor/components'; +import { Icon, Image, Link, Row } from '@trezor/components'; import { useOnClickOutside } from '@trezor/react-utils'; -import { DATA_TOS_INVITY_URL, INVITY_URL } from '@trezor/urls'; import { borders, spacingsPx, typography, zIndices } from '@trezor/theme'; +import { DATA_TOS_INVITY_URL, INVITY_URL } from '@trezor/urls'; import { Translation } from 'src/components/suite'; import { TradingFooterLogoWrapper } from 'src/views/wallet/trading'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingFooter/TradingProvidedByInvity.tsx b/packages/suite/src/views/wallet/trading/common/TradingFooter/TradingProvidedByInvity.tsx index 48f1f2538ca..15720e36a4e 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingFooter/TradingProvidedByInvity.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingFooter/TradingProvidedByInvity.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components'; +import { Image, Link, variables } from '@trezor/components'; import { INVITY_URL } from '@trezor/urls'; -import { variables, Link, Image } from '@trezor/components'; import { Translation } from 'src/components/suite'; import { TradingFooterLogoWrapper } from 'src/views/wallet/trading'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccount.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccount.tsx index e48e5d94fc8..e612167ff7d 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccount.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccount.tsx @@ -6,6 +6,10 @@ import { FiatCurrencyCode } from 'invity-api'; import { Row, Select, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; +import { AccountTypeBadge } from 'src/components/suite/AccountTypeBadge'; +import { useTradingBuildAccountGroups } from 'src/hooks/wallet/trading/form/common/useTradingBuildAccountGroups'; +import { useTradingFiatValues } from 'src/hooks/wallet/trading/form/common/useTradingFiatValues'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { TradingAccountOptionsGroupOptionProps, @@ -17,12 +21,8 @@ import { TradingFormInputAccountProps, TradingSellFormProps, } from 'src/types/trading/tradingForm'; -import { TradingFormInputAccountOption } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccountOption'; -import { useTradingFiatValues } from 'src/hooks/wallet/trading/form/common/useTradingFiatValues'; import { TradingBalance } from 'src/views/wallet/trading/common/TradingBalance'; -import { AccountTypeBadge } from 'src/components/suite/AccountTypeBadge'; -import { useTradingBuildAccountGroups } from 'src/hooks/wallet/trading/form/common/useTradingBuildAccountGroups'; -import { Translation } from 'src/components/suite'; +import { TradingFormInputAccountOption } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccountOption'; export const TradingFormInputAccount = < TFieldValues extends TradingSellFormProps | TradingExchangeFormProps, diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccountOption.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccountOption.tsx index d162867d7cd..061447997f3 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccountOption.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccountOption.tsx @@ -1,5 +1,5 @@ import { amountToSmallestUnit } from '@suite-common/wallet-utils'; -import { Row, Text, Badge } from '@trezor/components'; +import { Badge, Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { HiddenPlaceholder } from 'src/components/suite'; @@ -9,9 +9,9 @@ import { TradingAccountsOptionsGroupProps, } from 'src/types/trading/trading'; import { - tradingGetAccountLabel, cryptoIdToNetwork, parseCryptoId, + tradingGetAccountLabel, } from 'src/utils/wallet/trading/tradingUtils'; import { TradingCoinLogo } from 'src/views/wallet/trading/common/TradingCoinLogo'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCountry.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCountry.tsx index e3be370e099..600469536a9 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCountry.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCountry.tsx @@ -1,19 +1,19 @@ import { Control, Controller } from 'react-hook-form'; -import { Flag, Select, Row } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import { regional } from '@suite-common/invity'; +import { Flag, Row, Select } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { CountryOption } from 'src/types/wallet/tradingCommonTypes'; -import { getCountryLabelParts } from 'src/utils/wallet/trading/tradingUtils'; +import { Translation } from 'src/components/suite'; +import { FORM_COUNTRY_SELECT } from 'src/constants/wallet/trading/form'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { TradingTradeBuySellType } from 'src/types/trading/trading'; import { TradingBuySellFormProps, TradingFormInputDefaultProps, } from 'src/types/trading/tradingForm'; -import { FORM_COUNTRY_SELECT } from 'src/constants/wallet/trading/form'; -import { TradingTradeBuySellType } from 'src/types/trading/trading'; -import { Translation } from 'src/components/suite'; +import { CountryOption } from 'src/types/wallet/tradingCommonTypes'; +import { getCountryLabelParts } from 'src/utils/wallet/trading/tradingUtils'; export const TradingFormInputCountry = ({ label }: TradingFormInputDefaultProps) => { const { control, setAmountLimits, defaultCountry } = diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCryptoSelect.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCryptoSelect.tsx index d3068734f6b..fd4238d87e3 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCryptoSelect.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCryptoSelect.tsx @@ -1,46 +1,46 @@ -import { Controller } from 'react-hook-form'; import { useMemo, useState } from 'react'; +import { Controller } from 'react-hook-form'; import { CryptoId } from 'invity-api'; +import { Network, NetworkSymbol, getNetworkByCoingeckoId } from '@suite-common/wallet-config'; import { Badge, Row, Select, Text } from '@trezor/components'; import { - SearchAsset, - SelectAssetModal, - NetworkTabs, + AssetOptionBaseProps, AssetProps, ITEM_HEIGHT, - AssetOptionBaseProps, + NetworkTabs, + SearchAsset, + SelectAssetModal, } from '@trezor/product-components'; -import { getNetworkByCoingeckoId, Network, NetworkSymbol } from '@suite-common/wallet-config'; import { spacings } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; +import { + FORM_CRYPTO_CURRENCY_SELECT, + FORM_RECEIVE_CRYPTO_CURRENCY_SELECT, +} from 'src/constants/wallet/trading/form'; +import { useTranslation } from 'src/hooks/suite'; +import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { + SelectAssetOptionProps, TradingAccountOptionsGroupOptionProps, TradingCryptoSelectItemProps, TradingTradeBuyExchangeType, - SelectAssetOptionProps, } from 'src/types/trading/trading'; -import { Translation } from 'src/components/suite'; import { TradingBuyFormProps, TradingExchangeFormProps, TradingFormInputCryptoSelectProps, } from 'src/types/trading/tradingForm'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { isTradingExchangeContext } from 'src/utils/wallet/trading/tradingTypingUtils'; import { cryptoIdToNetwork, cryptoPlatformSeparator, isCryptoIdForNativeToken, parseCryptoId, } from 'src/utils/wallet/trading/tradingUtils'; -import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { - FORM_CRYPTO_CURRENCY_SELECT, - FORM_RECEIVE_CRYPTO_CURRENCY_SELECT, -} from 'src/constants/wallet/trading/form'; -import { isTradingExchangeContext } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { useTranslation } from 'src/hooks/suite'; import { TradingCoinLogo } from '../../TradingCoinLogo'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputCryptoAmount.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputCryptoAmount.tsx index cc678913625..3de847b5cb6 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputCryptoAmount.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputCryptoAmount.tsx @@ -1,23 +1,27 @@ 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 { formInputsMaxLength } from '@suite-common/validators'; +import { getDisplaySymbol } from '@suite-common/wallet-config'; import { FormState } from '@suite-common/wallet-types'; -import { useDidUpdate } from '@trezor/react-utils'; +import { getInputState } from '@suite-common/wallet-utils'; import { NumberInput } from '@trezor/product-components'; -import { getDisplaySymbol } from '@suite-common/wallet-config'; +import { useDidUpdate } from '@trezor/react-utils'; -import { useSelector, useTranslation } from 'src/hooks/suite'; import { - validateDecimals, - validateInteger, - validateCryptoLimits, - validateMin, - validateReserveOrBalance, -} from 'src/utils/suite/validation'; + FORM_OUTPUT_AMOUNT, + FORM_OUTPUT_MAX, + FORM_SEND_CRYPTO_CURRENCY_SELECT, +} from 'src/constants/wallet/trading/form'; +import { useSelector, useTranslation } from 'src/hooks/suite'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { useBitcoinAmountUnit } from 'src/hooks/wallet/useBitcoinAmountUnit'; +import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { + TradingAccountOptionsGroupOptionProps, + TradingCryptoListProps, +} from 'src/types/trading/trading'; import { TradingAllFormProps, TradingBuyFormProps, @@ -25,25 +29,21 @@ import { TradingSellExchangeFormProps, } from 'src/types/trading/tradingForm'; import { - tradingGetAccountLabel, - getTradingNetworkDecimals, -} from 'src/utils/wallet/trading/tradingUtils'; -import { - FORM_OUTPUT_AMOUNT, - FORM_OUTPUT_MAX, - FORM_SEND_CRYPTO_CURRENCY_SELECT, -} from 'src/constants/wallet/trading/form'; -import { - TradingAccountOptionsGroupOptionProps, - TradingCryptoListProps, -} from 'src/types/trading/trading'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; + validateCryptoLimits, + validateDecimals, + validateInteger, + validateMin, + validateReserveOrBalance, +} from 'src/utils/suite/validation'; import { isTradingBuyContext, isTradingExchangeContext, isTradingSellContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { + getTradingNetworkDecimals, + tradingGetAccountLabel, +} from 'src/utils/wallet/trading/tradingUtils'; export const TradingFormInputCryptoAmount = ({ cryptoInputName, diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiat.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiat.tsx index ea172047439..8032d762a4d 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiat.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiat.tsx @@ -1,24 +1,24 @@ import { FieldErrors, UseControllerProps } from 'react-hook-form'; -import { getInputState } from '@suite-common/wallet-utils'; import { formInputsMaxLength } from '@suite-common/validators'; +import { getInputState } from '@suite-common/wallet-utils'; +import { NumberInput } from '@trezor/product-components'; import { useDidUpdate } from '@trezor/react-utils'; import { BigNumber } from '@trezor/utils'; -import { NumberInput } from '@trezor/product-components'; +import { FORM_OUTPUT_AMOUNT, FORM_OUTPUT_FIAT } from 'src/constants/wallet/trading/form'; import { useSelector, useTranslation } from 'src/hooks/suite'; -import { validateDecimals, validateMin } from 'src/utils/suite/validation'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { TradingFormInputCurrency } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCurrency'; +import { selectLanguage } from 'src/reducers/suite/suiteReducer'; import { TradingAllFormProps, TradingBuyFormProps, TradingFormInputFiatCryptoProps, TradingSellExchangeFormProps, } from 'src/types/trading/tradingForm'; -import { FORM_OUTPUT_AMOUNT, FORM_OUTPUT_FIAT } from 'src/constants/wallet/trading/form'; +import { validateDecimals, validateMin } from 'src/utils/suite/validation'; import { isTradingExchangeContext } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { selectLanguage } from 'src/reducers/suite/suiteReducer'; +import { TradingFormInputCurrency } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCurrency'; export const TradingFormInputFiat = ({ cryptoInputName, diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiatCrypto.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiatCrypto.tsx index 35efe993b54..3dba7232983 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiatCrypto.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiatCrypto.tsx @@ -1,18 +1,18 @@ import { getDisplaySymbol } from '@suite-common/wallet-config'; +import { Translation } from 'src/components/suite'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { TradingBuyFormProps, TradingExchangeFormProps, TradingFormInputFiatCryptoWrapProps, TradingSellFormProps, } from 'src/types/trading/tradingForm'; -import { TradingFormSwitcherCryptoFiat } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormSwitcherCryptoFiat'; import { tradingGetAmountLabels } from 'src/utils/wallet/trading/tradingUtils'; import { TradingFormInputCryptoAmount } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputCryptoAmount'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { TradingFormInputFiat } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiat'; -import { Translation } from 'src/components/suite'; +import { TradingFormSwitcherCryptoFiat } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormSwitcherCryptoFiat'; export const TradingFormInputFiatCrypto = < TFieldValues extends TradingSellFormProps | TradingBuyFormProps | TradingExchangeFormProps, diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputPaymentMethod.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputPaymentMethod.tsx index da9b2832f02..9f0d5d59065 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputPaymentMethod.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputPaymentMethod.tsx @@ -2,15 +2,15 @@ import { Control, Controller } from 'react-hook-form'; import { Select } from '@trezor/components'; -import { TradingPaymentMethodListProps, TradingTradeBuySellType } from 'src/types/trading/trading'; +import { Translation } from 'src/components/suite'; +import { FORM_PAYMENT_METHOD_SELECT } from 'src/constants/wallet/trading/form'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { TradingPaymentMethodListProps, TradingTradeBuySellType } from 'src/types/trading/trading'; import { TradingBuySellFormProps, TradingFormInputDefaultProps, } from 'src/types/trading/tradingForm'; import { TradingPaymentPlainType } from 'src/views/wallet/trading/common/TradingPaymentPlainType'; -import { FORM_PAYMENT_METHOD_SELECT } from 'src/constants/wallet/trading/form'; -import { Translation } from 'src/components/suite'; export const TradingFormInputPaymentMethod = ({ label }: TradingFormInputDefaultProps) => { const { diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormSwitcherExchangeRates.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormSwitcherExchangeRates.tsx index 0cfee0db492..16ebd2513e8 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormSwitcherExchangeRates.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormSwitcherExchangeRates.tsx @@ -2,17 +2,17 @@ import { UseFormSetValue } from 'react-hook-form'; import styled from 'styled-components'; -import { Radio, Column, Card, Grid, Paragraph, useElevation } from '@trezor/components'; -import { borders, spacingsPx, spacings, Elevation, mapElevationToBackground } from '@trezor/theme'; +import { Card, Column, Grid, Paragraph, Radio, useElevation } from '@trezor/components'; +import { Elevation, borders, mapElevationToBackground, spacings, spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; -import { TradingExchangeFormProps, RateType } from 'src/types/trading/tradingForm'; +import { TranslationKey } from 'src/components/suite/Translation'; import { FORM_RATE_FIXED, FORM_RATE_FLOATING, FORM_RATE_TYPE, } from 'src/constants/wallet/trading/form'; -import { TranslationKey } from 'src/components/suite/Translation'; +import { RateType, TradingExchangeFormProps } from 'src/types/trading/tradingForm'; const ItemWrapper = styled.div<{ $isSelected: boolean; $elevation: Elevation }>` padding: ${spacingsPx.sm} ${spacingsPx.md}; diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInputs.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInputs.tsx index 513415448a0..56877369cd3 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInputs.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormInputs.tsx @@ -1,16 +1,17 @@ -import { spacings } from '@trezor/theme'; +import { TokenAddress } from '@suite-common/wallet-types'; +import { formatAmount } from '@suite-common/wallet-utils'; import { - Row, - Column, Card, + Column, ElevationContext, FractionButton, FractionButtonProps, + Row, } from '@trezor/components'; import { hasBitcoinOnlyFirmware } from '@trezor/device-utils/src/firmwareUtils'; -import { TokenAddress } from '@suite-common/wallet-types'; -import { formatAmount } from '@suite-common/wallet-utils'; +import { spacings } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; import { Fees } from 'src/components/wallet/Fees/Fees'; import { FORM_CRYPTO_CURRENCY_SELECT, @@ -28,19 +29,18 @@ import { TradingSellFormProps, TradingUseFormActionsReturnProps, } from 'src/types/trading/tradingForm'; -import { TradingFormInputCryptoSelect } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCryptoSelect'; -import { TradingFormInputAccount } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccount'; -import { TradingFormInputCountry } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCountry'; -import { TradingFormInputPaymentMethod } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputPaymentMethod'; -import { TradingFormSwitcherExchangeRates } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormSwitcherExchangeRates'; -import { TradingFormInputFiatCrypto } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiatCrypto'; -import { TradingBalance } from 'src/views/wallet/trading/common/TradingBalance'; -import { getTradingNetworkDecimals } from 'src/utils/wallet/trading/tradingUtils'; import { isTradingExchangeContext, isTradingSellContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { Translation } from 'src/components/suite'; +import { getTradingNetworkDecimals } from 'src/utils/wallet/trading/tradingUtils'; +import { TradingBalance } from 'src/views/wallet/trading/common/TradingBalance'; +import { TradingFormInputAccount } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputAccount'; +import { TradingFormInputCountry } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCountry'; +import { TradingFormInputCryptoSelect } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCryptoSelect'; +import { TradingFormInputFiatCrypto } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiatCrypto'; +import { TradingFormInputPaymentMethod } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputPaymentMethod'; +import { TradingFormSwitcherExchangeRates } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormSwitcherExchangeRates'; const generateFractionButtons = ( helpers: TradingUseFormActionsReturnProps, diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormLayout.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormLayout.tsx index 2d2e4423a52..6e4a9914dc2 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormLayout.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormLayout.tsx @@ -3,12 +3,12 @@ import styled from 'styled-components'; import { Card, Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { useTradingDeviceDisconnected } from 'src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected'; +import { ConnectDeviceGenericPromo } from 'src/views/wallet/receive/components/ConnectDevicePromo'; +import { TradingFeaturedOffers } from 'src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffers'; import { TradingFormInputs } from 'src/views/wallet/trading/common/TradingForm/TradingFormInputs'; import { TradingFormOffer } from 'src/views/wallet/trading/common/TradingForm/TradingFormOffer'; -import { TradingFeaturedOffers } from 'src/views/wallet/trading/common/TradingFeaturedOffers/TradingFeaturedOffers'; import { TradingWrapper } from 'src/views/wallet/trading/common/TradingWrapper'; -import { ConnectDeviceGenericPromo } from 'src/views/wallet/receive/components/ConnectDevicePromo'; -import { useTradingDeviceDisconnected } from 'src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected'; const TradingFormLayoutWrapper = styled.form` ${TradingWrapper} diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffer.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffer.tsx index 2a6efc9ccbd..85b588e6310 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffer.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffer.tsx @@ -2,34 +2,34 @@ import { useState } from 'react'; import { CryptoId } from 'invity-api'; -import { Button, TextButton, Row, Column, Paragraph } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import type { TradingTradeType, TradingType } from '@suite-common/invity'; +import { Button, Column, Paragraph, Row, TextButton } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { Translation } from 'src/components/suite'; +import { FORM_EXCHANGE_DEX, FORM_EXCHANGE_TYPE } from 'src/constants/wallet/trading/form'; +import { useTradingDeviceDisconnected } from 'src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { TradingFormContextValues } from 'src/types/trading/tradingForm'; import { getCryptoQuoteAmountProps, getProvidersInfoProps, - getSelectedCrypto, getSelectQuoteTyped, + getSelectedCrypto, isTradingExchangeContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { Translation } from 'src/components/suite'; -import { TradingFormOfferItem } from 'src/views/wallet/trading/common/TradingForm/TradingFormOfferItem'; -import { TradingFormOfferCryptoAmount } from 'src/views/wallet/trading/common/TradingForm/TradingFormOfferCryptoAmount'; import { + getBestRatedQuote, + parseCryptoId, tradingGetAmountLabels, tradingGetRoundedFiatAmount, tradingGetSectionActionLabel, - getBestRatedQuote, - parseCryptoId, } from 'src/utils/wallet/trading/tradingUtils'; +import { TradingFormOfferCryptoAmount } from 'src/views/wallet/trading/common/TradingForm/TradingFormOfferCryptoAmount'; import { TradingFormOfferFiatAmount } from 'src/views/wallet/trading/common/TradingForm/TradingFormOfferFiatAmount'; -import { TradingFormContextValues } from 'src/types/trading/tradingForm'; -import { FORM_EXCHANGE_DEX, FORM_EXCHANGE_TYPE } from 'src/constants/wallet/trading/form'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { TradingFormOfferItem } from 'src/views/wallet/trading/common/TradingForm/TradingFormOfferItem'; import { TradingFormOffersSwitcher } from 'src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcher'; -import { useTradingDeviceDisconnected } from 'src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected'; const getSelectedQuote = ( context: TradingFormContextValues, diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferFiatAmount.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferFiatAmount.tsx index e805d81af4f..eabc40899be 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferFiatAmount.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferFiatAmount.tsx @@ -1,5 +1,5 @@ -import { spacings } from '@trezor/theme'; import { Row, Text } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { useSelector } from 'src/hooks/suite'; import { selectLanguage } from 'src/reducers/suite/suiteReducer'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferItem.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferItem.tsx index 6581e613470..90a4f110a37 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferItem.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferItem.tsx @@ -1,5 +1,5 @@ import type { TradingTradeType } from '@suite-common/invity'; -import { Row, Spinner, Card, Paragraph } from '@trezor/components'; +import { Card, Paragraph, Row, Spinner } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcher.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcher.tsx index 9c8d982a622..a644ab69a27 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcher.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcher.tsx @@ -1,10 +1,8 @@ -import { spacings } from '@trezor/theme'; -import { Row, Card, Column, Spinner, Paragraph } from '@trezor/components'; import type { TradingTradeType } from '@suite-common/invity'; +import { Card, Column, Paragraph, Row, Spinner } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; -import { TradingUtilsProvidersProps } from 'src/types/trading/trading'; -import { TradingExchangeFormContextProps } from 'src/types/trading/tradingForm'; import { FORM_EXCHANGE_CEX, FORM_EXCHANGE_DEX, @@ -12,6 +10,8 @@ import { FORM_RATE_FLOATING, FORM_RATE_TYPE, } from 'src/constants/wallet/trading/form'; +import { TradingUtilsProvidersProps } from 'src/types/trading/trading'; +import { TradingExchangeFormContextProps } from 'src/types/trading/tradingForm'; import { TradingFormOffersSwitcherItem } from 'src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcherItem'; interface TradingFormOffersSwitcherProps { diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcherItem.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcherItem.tsx index ef3f10de060..11d72817c3b 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcherItem.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcherItem.tsx @@ -1,13 +1,13 @@ import { ExchangeTrade } from 'invity-api'; 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 { Badge, Radio, Row, Text, Tooltip, useElevation } from '@trezor/components'; +import { Elevation, borders, mapElevationToBackground, spacings, spacingsPx } from '@trezor/theme'; -import { TradingUtilsProvidersProps } from 'src/types/trading/trading'; import { Translation } from 'src/components/suite'; -import { ExchangeType } from 'src/types/trading/tradingForm'; import { FORM_EXCHANGE_CEX, FORM_EXCHANGE_DEX } from 'src/constants/wallet/trading/form'; +import { TradingUtilsProvidersProps } from 'src/types/trading/trading'; +import { ExchangeType } from 'src/types/trading/tradingForm'; import { TradingUtilsProvider } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider'; const Offer = styled.div<{ $isSelected: boolean; $elevation: Elevation }>` diff --git a/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingExchangeHeaderSummary.tsx b/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingExchangeHeaderSummary.tsx index 9274f00f872..34188d0d4a4 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingExchangeHeaderSummary.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingExchangeHeaderSummary.tsx @@ -1,15 +1,15 @@ -import { useTheme } from 'styled-components'; import { CryptoId } from 'invity-api'; +import { useTheme } from 'styled-components'; -import { H3, Icon, Row, Text } from '@trezor/components'; +import type { TradingExchangeType } from '@suite-common/invity'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; +import { H3, Icon, Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import type { TradingExchangeType } from '@suite-common/invity'; -import { useSelector } from 'src/hooks/suite'; import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite'; -import { TradingCryptoAmount } from 'src/views/wallet/trading/common/TradingCryptoAmount'; +import { useSelector } from 'src/hooks/suite'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { TradingCryptoAmount } from 'src/views/wallet/trading/common/TradingCryptoAmount'; interface TradingExchangeHeaderSummaryProps { sendAmount: string | number | undefined; diff --git a/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeader.tsx b/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeader.tsx index 53568b0da86..17e355ac5e5 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeader.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeader.tsx @@ -1,20 +1,20 @@ 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 { spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; -import { ExtendedMessageDescriptor } from 'src/types/suite'; import { INVITY_API_RELOAD_QUOTES_AFTER_SECONDS } from 'src/constants/wallet/trading/metadata'; +import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { ExtendedMessageDescriptor } from 'src/types/suite'; import { getCryptoQuoteAmountProps, isTradingExchangeContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { TradingHeaderSummary } from 'src/views/wallet/trading/common/TradingHeader/TradingHeaderSummary'; import { TradingRefreshTime } from 'src/views/wallet/trading/common'; import { TradingHeaderFilter } from 'src/views/wallet/trading/common/TradingHeader/TradingHeaderFilter'; -import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { TradingHeaderSummary } from 'src/views/wallet/trading/common/TradingHeader/TradingHeaderSummary'; const Header = styled.div` padding-top: ${spacingsPx.sm}; diff --git a/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeaderFilter.tsx b/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeaderFilter.tsx index ad5d09d9316..97b47370621 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeaderFilter.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeaderFilter.tsx @@ -1,10 +1,8 @@ import styled from 'styled-components'; -import { spacingsPx } from '@trezor/theme'; import { Row } from '@trezor/components'; +import { spacingsPx } from '@trezor/theme'; -import { TradingFormInputCountry } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCountry'; -import { TradingBuyFormProps, TradingSellFormProps } from 'src/types/trading/tradingForm'; import { FORM_CRYPTO_CURRENCY_SELECT, FORM_CRYPTO_INPUT, @@ -13,14 +11,16 @@ import { FORM_OUTPUT_FIAT, FORM_SEND_CRYPTO_CURRENCY_SELECT, } from 'src/constants/wallet/trading/form'; -import { TradingFormInputFiatCrypto } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiatCrypto'; -import { TradingOffersExchangeFiltersPanel } from 'src/views/wallet/trading/common/TradingHeader/TradingOffersExchangeFiltersPanel'; -import { TradingFormInputPaymentMethod } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputPaymentMethod'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { TradingBuyFormProps, TradingSellFormProps } from 'src/types/trading/tradingForm'; import { isTradingBuyContext, isTradingExchangeContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; +import { TradingFormInputCountry } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputCountry'; +import { TradingFormInputFiatCrypto } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputFiatCrypto/TradingFormInputFiatCrypto'; +import { TradingFormInputPaymentMethod } from 'src/views/wallet/trading/common/TradingForm/TradingFormInput/TradingFormInputPaymentMethod'; +import { TradingOffersExchangeFiltersPanel } from 'src/views/wallet/trading/common/TradingHeader/TradingOffersExchangeFiltersPanel'; const InputWrapper = styled.div` width: 254px; diff --git a/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeaderSummary.tsx b/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeaderSummary.tsx index c33d0c94a3a..74aa7cd5e84 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeaderSummary.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingHeaderSummary.tsx @@ -4,15 +4,15 @@ import { H3, Icon, Row } from '@trezor/components'; import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; import { spacingsPx } from '@trezor/theme'; -import { TradingExchangeHeaderSummary } from 'src/views/wallet/trading/common/TradingHeader/TradingExchangeHeaderSummary'; -import { TradingFiatAmount } from 'src/views/wallet/trading/common/TradingFiatAmount'; -import { TradingCryptoAmount } from 'src/views/wallet/trading/common/TradingCryptoAmount'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { TradingCryptoAmountProps } from 'src/types/trading/trading'; import { isTradingExchangeContext, isTradingSellContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { TradingCryptoAmountProps } from 'src/types/trading/trading'; +import { TradingCryptoAmount } from 'src/views/wallet/trading/common/TradingCryptoAmount'; +import { TradingFiatAmount } from 'src/views/wallet/trading/common/TradingFiatAmount'; +import { TradingExchangeHeaderSummary } from 'src/views/wallet/trading/common/TradingHeader/TradingExchangeHeaderSummary'; const IconWrapper = styled.div` margin-left: ${spacingsPx.sm}; diff --git a/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingOffersExchangeFiltersPanel.tsx b/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingOffersExchangeFiltersPanel.tsx index 2acb060388f..3a405958ce0 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingOffersExchangeFiltersPanel.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingHeader/TradingOffersExchangeFiltersPanel.tsx @@ -1,8 +1,8 @@ import styled from 'styled-components'; +import type { TradingExchangeType } from '@suite-common/invity'; import { Row, Select } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import type { TradingExchangeType } from '@suite-common/invity'; import { Translation } from 'src/components/suite'; import { diff --git a/packages/suite/src/views/wallet/trading/common/TradingIcon.tsx b/packages/suite/src/views/wallet/trading/common/TradingIcon.tsx index 507538caeac..648fffc7e82 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingIcon.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingIcon.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -import { Box, iconSizes, Image } from '@trezor/components'; +import { Box, Image, iconSizes } from '@trezor/components'; import { borders, spacings } from '@trezor/theme'; import { useSelector } from 'src/hooks/suite'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayout.tsx b/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayout.tsx index 42b687626cf..e8ca2cdb1b6 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayout.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayout.tsx @@ -1,11 +1,11 @@ import { PropsWithChildren } from 'react'; -import { spacings } from '@trezor/theme'; import { Column } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { TradingLayoutNavigation } from 'src/views/wallet/trading/common/TradingLayout/TradingLayoutNavigation'; import { useSelector } from 'src/hooks/suite'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; +import { TradingLayoutNavigation } from 'src/views/wallet/trading/common/TradingLayout/TradingLayoutNavigation'; interface TradingLayoutProps extends PropsWithChildren {} diff --git a/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayoutHeader.tsx b/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayoutHeader.tsx index cc40b844c52..038a8e6a10b 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayoutHeader.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayoutHeader.tsx @@ -1,16 +1,16 @@ import { PropsWithChildren, useMemo } from 'react'; -import { IconButton, Row, Box, Button } from '@trezor/components'; -import { spacings } from '@trezor/theme'; -import { Route } from '@suite-common/suite-types'; import type { TradingType } from '@suite-common/invity'; +import { Route } from '@suite-common/suite-types'; +import { Box, Button, IconButton, Row } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { goto } from 'src/actions/suite/routerActions'; +import { Translation, TranslationKey } from 'src/components/suite/Translation'; import { PageHeader } from 'src/components/suite/layouts/SuiteLayout'; import { BasicName } from 'src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/BasicName'; -import { useLayout, useSelector, useTranslation, useDispatch } from 'src/hooks/suite'; +import { useDispatch, useLayout, useSelector, useTranslation } from 'src/hooks/suite'; import { selectRouteName } from 'src/reducers/suite/routerReducer'; -import { TranslationKey, Translation } from 'src/components/suite/Translation'; -import { goto } from 'src/actions/suite/routerActions'; const getBackRoute = (route?: Route['name'], activeSection?: TradingType): Route['name'] => { const routePrefix = 'wallet-trading-'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayoutNavigation.tsx b/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayoutNavigation.tsx index 8f027ce9688..128ba8b4d01 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayoutNavigation.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingLayout/TradingLayoutNavigation.tsx @@ -1,9 +1,9 @@ -import { IconName, SubTabs } from '@trezor/components'; import { Route } from '@suite-common/suite-types'; +import { IconName, SubTabs } from '@trezor/components'; -import { useDispatch } from 'src/hooks/suite'; -import { Translation, TranslationKey } from 'src/components/suite/Translation'; import { goto } from 'src/actions/suite/routerActions'; +import { Translation, TranslationKey } from 'src/components/suite/Translation'; +import { useDispatch } from 'src/hooks/suite'; type TradingLayoutNavigationProps = { route?: Route['name']; diff --git a/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffers.tsx b/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffers.tsx index eeabe1fba7a..3ee91e52e78 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffers.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffers.tsx @@ -2,11 +2,11 @@ import { useTradingDeviceDisconnected } from 'src/hooks/wallet/trading/form/comm import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { isTradingExchangeContext } from 'src/utils/wallet/trading/tradingTypingUtils'; import { getBestRatedQuote } from 'src/utils/wallet/trading/tradingUtils'; +import { ConnectDeviceGenericPromo } from 'src/views/wallet/receive/components/ConnectDevicePromo'; import { TradingHeader } from 'src/views/wallet/trading/common/TradingHeader/TradingHeader'; import { TradingOffersEmpty } from 'src/views/wallet/trading/common/TradingOffers/TradingOffersEmpty'; import { TradingOffersExchange } from 'src/views/wallet/trading/common/TradingOffers/TradingOffersExchange'; import { TradingOffersItem } from 'src/views/wallet/trading/common/TradingOffers/TradingOffersItem'; -import { ConnectDeviceGenericPromo } from 'src/views/wallet/receive/components/ConnectDevicePromo'; export const TradingOffers = () => { const context = useTradingFormContext(); diff --git a/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffersExchange.tsx b/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffersExchange.tsx index db5b7aa8f26..d8ed76d2660 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffersExchange.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffersExchange.tsx @@ -14,8 +14,8 @@ import { EXCHANGE_COMPARATOR_RATE_FILTER_FLOATING_CEX, } from 'src/constants/wallet/trading/form'; import { KYC_DEX, KYC_NO_KYC } from 'src/constants/wallet/trading/kyc'; -import { TradingOffersExchangeQuotesByTypeSection } from 'src/views/wallet/trading/common/TradingOffers/TradingOffersExchangeQuotesByTypeSection'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { TradingOffersExchangeQuotesByTypeSection } from 'src/views/wallet/trading/common/TradingOffers/TradingOffersExchangeQuotesByTypeSection'; export const TradingOffersExchange = () => { const { quotes, exchangeInfo, getValues } = useTradingFormContext(); diff --git a/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffersItem.tsx b/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffersItem.tsx index 1a6db7da38c..b2f7be586d0 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffersItem.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingOffers/TradingOffersItem.tsx @@ -1,11 +1,13 @@ -import styled, { useTheme } from 'styled-components'; import { SellFiatTrade } from 'invity-api'; +import styled, { useTheme } from 'styled-components'; import { Badge, Button, Card, Row, Text } from '@trezor/components'; -import { spacings, spacingsPx } from '@trezor/theme'; import { SCREEN_QUERY } from '@trezor/components/src/config/variables'; +import { spacings, spacingsPx } from '@trezor/theme'; import { Translation } from 'src/components/suite'; +import { useTradingDeviceDisconnected } from 'src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected'; +import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { TradingTradeDetailMapProps } from 'src/types/trading/trading'; import { getCryptoQuoteAmountProps, @@ -15,12 +17,10 @@ import { isTradingSellContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; import { getTagAndInfoNote } from 'src/utils/wallet/trading/tradingUtils'; -import { TradingUtilsKyc } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsKyc'; import { TradingTestWrapper } from 'src/views/wallet/trading'; +import { TradingUtilsKyc } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsKyc'; import { TradingUtilsPrice } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsPrice'; import { TradingUtilsProvider } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider'; -import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { useTradingDeviceDisconnected } from 'src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected'; const Offer = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/common/TradingPaymentType.tsx b/packages/suite/src/views/wallet/trading/common/TradingPaymentType.tsx index c64f11c81ca..17cfec71a46 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingPaymentType.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingPaymentType.tsx @@ -1,9 +1,9 @@ +import { type TradingPaymentMethodType, invityAPI } from '@suite-common/invity'; import { Row } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { invityAPI, type TradingPaymentMethodType } from '@suite-common/invity'; -import { TradingPaymentPlainType } from 'src/views/wallet/trading/common/TradingPaymentPlainType'; import { TradingIcon } from 'src/views/wallet/trading/common/TradingIcon'; +import { TradingPaymentPlainType } from 'src/views/wallet/trading/common/TradingPaymentPlainType'; interface TradingPaymentTypeProps { method?: TradingPaymentMethodType; diff --git a/packages/suite/src/views/wallet/trading/common/TradingProviderInfo.tsx b/packages/suite/src/views/wallet/trading/common/TradingProviderInfo.tsx index ef17648027e..a9fa77e1ad2 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingProviderInfo.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingProviderInfo.tsx @@ -1,6 +1,6 @@ +import { invityAPI } from '@suite-common/invity'; import { Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { invityAPI } from '@suite-common/invity'; import { Translation } from 'src/components/suite'; import { TradingIcon } from 'src/views/wallet/trading/common/TradingIcon'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingRefreshTime.tsx b/packages/suite/src/views/wallet/trading/common/TradingRefreshTime.tsx index 6f20a25cdff..f8ebcf51c00 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingRefreshTime.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingRefreshTime.tsx @@ -2,7 +2,7 @@ import { ReactElement } from 'react'; import styled from 'styled-components'; -import { variables, Spinner, ProgressPie } from '@trezor/components'; +import { ProgressPie, Spinner, variables } from '@trezor/components'; import { spacingsPx } from '@trezor/theme'; const Wrapper = styled.div` diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoExchangeType.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoExchangeType.tsx index bdfbcb43051..df5f93c2aa0 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoExchangeType.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoExchangeType.tsx @@ -1,7 +1,7 @@ import { ExchangeTrade } from 'invity-api'; -import { Row, Tooltip, Text } from '@trezor/components'; import type { TradingTradeType } from '@suite-common/invity'; +import { Row, Text, Tooltip } from '@trezor/components'; import { Translation } from 'src/components/suite'; import { TradingExchangeProvidersInfoProps } from 'src/types/trading/trading'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoHeader.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoHeader.tsx index e4688369ca6..ce673e9dead 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoHeader.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoHeader.tsx @@ -1,8 +1,8 @@ import { CryptoId } from 'invity-api'; +import { getDisplaySymbol } from '@suite-common/wallet-config'; import { Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { getDisplaySymbol } from '@suite-common/wallet-config'; import { Translation } from 'src/components/suite'; import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoItem.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoItem.tsx index be56b68b66d..ec2e9cf4c0e 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoItem.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoItem.tsx @@ -1,9 +1,9 @@ import { CryptoId } from 'invity-api'; +import type { TradingType } from '@suite-common/invity'; import { Account } from '@suite-common/wallet-types'; -import { Column, Row, InfoItem, Text } from '@trezor/components'; +import { Column, InfoItem, Row, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import type { TradingType } from '@suite-common/invity'; import { AccountLabeling, Translation } from 'src/components/suite'; import { TradingPayGetLabelType } from 'src/types/trading/trading'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferBuy/TradingOfferBuy.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferBuy/TradingOfferBuy.tsx index 8b792e9de5e..4576a6fe0c6 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferBuy/TradingOfferBuy.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferBuy/TradingOfferBuy.tsx @@ -1,9 +1,9 @@ import { Card } from '@trezor/components'; +import useTradingVerifyAccount from 'src/hooks/wallet/trading/form/useTradingVerifyAccount'; +import { TradingOfferBuyProps } from 'src/types/trading/tradingForm'; import { TradingSelectedOfferInfo } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo'; import { TradingVerify } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerify'; -import { TradingOfferBuyProps } from 'src/types/trading/tradingForm'; -import useTradingVerifyAccount from 'src/hooks/wallet/trading/form/useTradingVerifyAccount'; export const TradingOfferBuy = ({ account, diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchange.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchange.tsx index 3a2552d83a7..cf6808129e8 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchange.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchange.tsx @@ -1,21 +1,21 @@ import { Fragment } from 'react'; -import { Divider, Card } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import type { TradingExchangeType } from '@suite-common/invity'; +import { Card, Divider } from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { TradingSelectedOfferInfo } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo'; -import { TradingVerify } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerify'; -import { TradingOfferExchangeProps } from 'src/types/trading/tradingForm'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import useTradingVerifyAccount from 'src/hooks/wallet/trading/form/useTradingVerifyAccount'; +import { TradingOfferExchangeProps } from 'src/types/trading/tradingForm'; +import { TradingOfferExchangeSend } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSend'; +import { TradingOfferExchangeSendApproval } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendApproval'; +import { TradingOfferExchangeSendSwap } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendSwap'; +import { TradingSelectedOfferInfo } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo'; import { TradingSelectedOfferStepper, TradingSelectedOfferStepperItemProps, } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferStepper'; -import { TradingOfferExchangeSend } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSend'; -import { TradingOfferExchangeSendSwap } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendSwap'; -import { TradingOfferExchangeSendApproval } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendApproval'; +import { TradingVerify } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerify'; export const TradingOfferExchange = ({ account, diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSend.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSend.tsx index 84bf21f77a9..19745c3783d 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSend.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSend.tsx @@ -1,12 +1,12 @@ import { useEffect } from 'react'; +import type { TradingExchangeType } from '@suite-common/invity'; import { Button, Column, Divider, InfoItem, Spinner, Text } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import type { TradingExchangeType } from '@suite-common/invity'; +import { AccountLabeling, Translation } from 'src/components/suite'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { useTradingWatchTrade } from 'src/hooks/wallet/trading/useTradingWatchTrade'; -import { AccountLabeling, Translation } from 'src/components/suite'; import { useTradingNavigation } from 'src/hooks/wallet/useTradingNavigation'; export const TradingOfferExchangeSend = () => { diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendApproval.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendApproval.tsx index b9e80ffc3e5..6f653c70a6f 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendApproval.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendApproval.tsx @@ -1,32 +1,32 @@ import { useState } from 'react'; -import styled from 'styled-components'; import { DexApprovalType } from 'invity-api'; +import styled from 'styled-components'; +import type { TradingExchangeType } from '@suite-common/invity'; import { - Button, Banner, - Spinner, - Radio, - Paragraph, + Button, + Card, Column, Divider, InfoItem, + Paragraph, + Radio, + Spinner, Text, - Card, } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import type { TradingExchangeType } from '@suite-common/invity'; -import { Translation, AccountLabeling } from 'src/components/suite'; -import { useTradingNavigation } from 'src/hooks/wallet/useTradingNavigation'; +import { saveSelectedQuote } from 'src/actions/wallet/tradingExchangeActions'; +import { AccountLabeling, Translation } from 'src/components/suite'; +import { IOAddress } from 'src/components/suite/copy/IOAddress'; +import { useDispatch, useSelector } from 'src/hooks/suite'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { useTradingExchangeWatchSendApproval } from 'src/hooks/wallet/trading/form/useTradingExchangeWatchSendApproval'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { saveSelectedQuote } from 'src/actions/wallet/tradingExchangeActions'; +import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; +import { useTradingNavigation } from 'src/hooks/wallet/useTradingNavigation'; import { cryptoIdToSymbol, parseCryptoId } from 'src/utils/wallet/trading/tradingUtils'; -import { IOAddress } from 'src/components/suite/copy/IOAddress'; // add APPROVED means no approval request is necessary type ExtendedDexApprovalType = DexApprovalType | 'APPROVED'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendSwap.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendSwap.tsx index 4cb17e62460..31d513ed2cb 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendSwap.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchangeSendSwap.tsx @@ -1,33 +1,33 @@ -import { useState, ChangeEvent } from 'react'; +import { ChangeEvent, useState } from 'react'; import { FieldError } from 'react-hook-form'; import useDebounce from 'react-use/lib/useDebounce'; import styled from 'styled-components'; +import { TranslationKey } from '@suite-common/intl-types'; +import type { TradingExchangeType } from '@suite-common/invity'; +import { getDisplaySymbol } from '@suite-common/wallet-config'; import { Button, - Input, - InfoItem, - Column, Card, - Row, + Column, Divider, + ElevationContext, + InfoItem, + Input, + Row, SelectBar, Tooltip, - ElevationContext, } from '@trezor/components'; -import { BigNumber } from '@trezor/utils/src/bigNumber'; import { BottomText } from '@trezor/components/src/components/form/BottomText'; -import { TranslationKey } from '@suite-common/intl-types'; import { spacings } from '@trezor/theme'; -import { getDisplaySymbol } from '@suite-common/wallet-config'; -import type { TradingExchangeType } from '@suite-common/invity'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Translation, AccountLabeling, FormattedCryptoAmount } from 'src/components/suite'; +import { AccountLabeling, FormattedCryptoAmount, Translation } from 'src/components/suite'; +import { FORM_SEND_CRYPTO_CURRENCY_SELECT } from 'src/constants/wallet/trading/form'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { getTradingNetworkDecimals } from 'src/utils/wallet/trading/tradingUtils'; -import { FORM_SEND_CRYPTO_CURRENCY_SELECT } from 'src/constants/wallet/trading/form'; const BreakableValue = styled.span` word-break: break-all; diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSell.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSell.tsx index 57b5e3d69ca..575420b86f4 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSell.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSell.tsx @@ -1,8 +1,8 @@ import { Fragment } from 'react'; -import { Divider, Card } from '@trezor/components'; -import { spacings } from '@trezor/theme'; import type { TradingSellType } from '@suite-common/invity'; +import { Card, Divider } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { TradingOfferSellProps } from 'src/types/trading/tradingForm'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSellBankAccount.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSellBankAccount.tsx index 55e4faa444e..e97aaf2d803 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSellBankAccount.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSellBankAccount.tsx @@ -1,15 +1,15 @@ import { useState } from 'react'; -import styled, { useTheme } from 'styled-components'; import { BankAccount } from 'invity-api'; +import styled, { useTheme } from 'styled-components'; -import { Button, Select, Icon, Row } from '@trezor/components'; -import { fontWeights, spacingsPx, typography } from '@trezor/theme'; import type { TradingSellType } from '@suite-common/invity'; +import { Button, Icon, Row, Select } from '@trezor/components'; +import { fontWeights, spacingsPx, typography } from '@trezor/theme'; import { QuestionTooltip, Translation } from 'src/components/suite'; -import { formatIban } from 'src/utils/wallet/trading/sellUtils'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { formatIban } from 'src/utils/wallet/trading/sellUtils'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSellTransaction.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSellTransaction.tsx index 07f9329cf03..553111389f8 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSellTransaction.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSellTransaction.tsx @@ -1,12 +1,12 @@ import styled from 'styled-components'; +import type { TradingSellType } from '@suite-common/invity'; import { Button, Column, Spinner, Text } from '@trezor/components'; import { spacings, spacingsPx, typography } from '@trezor/theme'; -import type { TradingSellType } from '@suite-common/invity'; -import { Translation, AccountLabeling } from 'src/components/suite'; -import { useTradingWatchTrade } from 'src/hooks/wallet/trading/useTradingWatchTrade'; +import { AccountLabeling, Translation } from 'src/components/suite'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { useTradingWatchTrade } from 'src/hooks/wallet/trading/useTradingWatchTrade'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOffer.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOffer.tsx index 9923b309026..24c54b6e19c 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOffer.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOffer.tsx @@ -3,7 +3,13 @@ import styled from 'styled-components'; import { Column } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { useTradingDeviceDisconnected } from 'src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { + TradingOfferBuyProps, + TradingOfferExchangeProps, + TradingOfferSellProps, +} from 'src/types/trading/tradingForm'; import { getCryptoQuoteAmountProps, getPaymentMethod, @@ -12,17 +18,11 @@ import { isTradingExchangeContext, isTradingSellContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; -import { TradingOfferSell } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSell'; +import { ConnectDeviceGenericPromo } from 'src/views/wallet/receive/components/ConnectDevicePromo'; import { TradingOfferBuy } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferBuy/TradingOfferBuy'; import { TradingOfferExchange } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferExchange/TradingOfferExchange'; +import { TradingOfferSell } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingOfferSell/TradingOfferSell'; import { TradingWrapper } from 'src/views/wallet/trading/common/TradingWrapper'; -import { useTradingDeviceDisconnected } from 'src/hooks/wallet/trading/form/common/useTradingDeviceDisconnected'; -import { ConnectDeviceGenericPromo } from 'src/views/wallet/receive/components/ConnectDevicePromo'; -import { - TradingOfferBuyProps, - TradingOfferExchangeProps, - TradingOfferSellProps, -} from 'src/types/trading/tradingForm'; const Wrapper = styled.div` ${TradingWrapper} diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo.tsx index 8772e4a357d..66812816ccb 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOfferInfo.tsx @@ -3,16 +3,16 @@ import { CryptoId } from 'invity-api'; import { Column, Divider } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { TradingExchangeProvidersInfoProps } from 'src/types/trading/trading'; +import { TradingSelectedOfferInfoProps } from 'src/types/trading/tradingForm'; import { tradingGetAmountLabels } from 'src/utils/wallet/trading/tradingUtils'; +import { TradingInfoExchangeType } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoExchangeType'; import { TradingInfoHeader } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoHeader'; import { TradingInfoItem } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoItem'; -import { TradingInfoProvider } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoProvider'; import { TradingInfoPaymentMethod } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoPaymentMethod'; -import { TradingInfoExchangeType } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoExchangeType'; -import { TradingSelectedOfferInfoProps } from 'src/types/trading/tradingForm'; -import { TradingUtilsKyc } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsKyc'; -import { TradingExchangeProvidersInfoProps } from 'src/types/trading/trading'; +import { TradingInfoProvider } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingInfo/TradingInfoProvider'; import { TradingTransactionId } from 'src/views/wallet/trading/common/TradingTransactionId'; +import { TradingUtilsKyc } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsKyc'; export const TradingSelectedOfferInfo = ({ account, diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerify.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerify.tsx index 89e996449bf..3b9489eefdc 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerify.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerify.tsx @@ -2,29 +2,29 @@ import { useEffect } from 'react'; import { CryptoId } from 'invity-api'; +import { TradingExchangeType } from '@suite-common/invity'; +import { getDisplaySymbol } from '@suite-common/wallet-config'; +import { isHexValid, isInteger } from '@suite-common/wallet-utils'; import addressValidator from '@trezor/address-validator'; -import { Input, Button, Paragraph, Divider, Column, Tooltip } from '@trezor/components'; +import { Button, Column, Divider, Input, Paragraph, Tooltip } from '@trezor/components'; import { spacings } from '@trezor/theme'; -import { isHexValid, isInteger } from '@suite-common/wallet-utils'; -import { getDisplaySymbol } from '@suite-common/wallet-config'; -import { TradingExchangeType } from '@suite-common/invity'; +import * as modalActions from 'src/actions/suite/modalActions'; +import { TRADING_BUY } from 'src/actions/wallet/constants'; import { Translation } from 'src/components/suite'; +import { useDispatch } from 'src/hooks/suite'; import { useTranslation } from 'src/hooks/suite/useTranslation'; -import { ConfirmedOnTrezor } from 'src/views/wallet/trading/common/ConfirmedOnTrezor'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { TradingVerifyOptions } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptions'; -import { TradingVerifyAccountReturnProps } from 'src/types/trading/tradingVerify'; -import { TradingAddressOptions } from 'src/views/wallet/trading/common/TradingAddressOptions'; import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; -import { useDispatch } from 'src/hooks/suite'; -import { TRADING_BUY } from 'src/actions/wallet/constants'; -import * as modalActions from 'src/actions/suite/modalActions'; +import { TradingVerifyAccountReturnProps } from 'src/types/trading/tradingVerify'; import { isTradingBuyContext, isTradingExchangeContext, } from 'src/utils/wallet/trading/tradingTypingUtils'; import { cryptoIdToNetwork } from 'src/utils/wallet/trading/tradingUtils'; +import { ConfirmedOnTrezor } from 'src/views/wallet/trading/common/ConfirmedOnTrezor'; +import { TradingAddressOptions } from 'src/views/wallet/trading/common/TradingAddressOptions'; +import { TradingVerifyOptions } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptions'; interface TradingVerifyProps { tradingVerifyAccount: TradingVerifyAccountReturnProps; diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptions.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptions.tsx index 63685865be1..41131d5aca1 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptions.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptions.tsx @@ -4,8 +4,8 @@ import { Select } from '@trezor/components'; import { Translation } from 'src/components/suite'; import { useTradingInfo } from 'src/hooks/wallet/trading/useTradingInfo'; import { - TradingVerifyOptionsProps, TradingVerifyFormAccountOptionProps, + TradingVerifyOptionsProps, } from 'src/types/trading/tradingVerify'; import { parseCryptoId } from 'src/utils/wallet/trading/tradingUtils'; import { TradingVerifyOptionsItem } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptionsItem'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptionsItem.tsx b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptionsItem.tsx index 20b8290b5cb..0ae7786db9f 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptionsItem.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingSelectedOffer/TradingVerify/TradingVerifyOptionsItem.tsx @@ -1,9 +1,9 @@ import styled from 'styled-components'; +import { getNetwork } from '@suite-common/wallet-config'; import { Column, Icon, Row, variables } from '@trezor/components'; import { CoinLogo } from '@trezor/product-components'; import { spacings } from '@trezor/theme'; -import { getNetwork } from '@suite-common/wallet-config'; import { AccountLabeling, Translation } from 'src/components/suite'; import { FORM_SEND_CRYPTO_CURRENCY_SELECT } from 'src/constants/wallet/trading/form'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingTransactionId.tsx b/packages/suite/src/views/wallet/trading/common/TradingTransactionId.tsx index 498f9ba6635..e664dd56abc 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingTransactionId.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingTransactionId.tsx @@ -1,12 +1,12 @@ import styled from 'styled-components'; +import { notificationsActions } from '@suite-common/toast-notifications'; import { Button, Row } from '@trezor/components'; import { copyToClipboard } from '@trezor/dom-utils'; -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'; +import { useDispatch } from 'src/hooks/suite'; const LabelWrapper = styled.div` width: 100%; diff --git a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionAmounts.tsx b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionAmounts.tsx index e6b43027069..27735eb87bb 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionAmounts.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionAmounts.tsx @@ -1,4 +1,4 @@ -import { Icon, iconSizes, Row } from '@trezor/components'; +import { Icon, Row, iconSizes } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { FormattedCryptoAmount, HiddenPlaceholder } from 'src/components/suite'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionStatus.tsx b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionStatus.tsx index d6b25117658..682ddfa7a8e 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionStatus.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionStatus.tsx @@ -1,13 +1,13 @@ -import { DefaultTheme, useTheme } from 'styled-components'; import { BuyTradeStatus, ExchangeTradeStatus, SellTradeStatus } from 'invity-api'; +import { DefaultTheme, useTheme } from 'styled-components'; import { Icon, Row, Text } from '@trezor/components'; import { Translation } from 'src/components/suite'; +import { Trade } from 'src/types/wallet/tradingCommonTypes'; import { getStatusMessage as getBuyStatusMessage } from 'src/utils/wallet/trading/buyUtils'; import { getStatusMessage as getExchangeStatusMessage } from 'src/utils/wallet/trading/exchangeUtils'; import { getStatusMessage as getSellStatusMessage } from 'src/utils/wallet/trading/sellUtils'; -import { Trade } from 'src/types/wallet/tradingCommonTypes'; const getBuyTradeData = (status: BuyTradeStatus, theme: DefaultTheme) => { const message = getBuyStatusMessage(status); diff --git a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionExchange.tsx b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionExchange.tsx index 05dff436267..1f8bd9328b8 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionExchange.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionExchange.tsx @@ -2,18 +2,18 @@ import { ExchangeProviderInfo } from 'invity-api'; import { Button } from '@trezor/components'; -import { TradeExchange } from 'src/types/wallet/tradingCommonTypes'; import { goto } from 'src/actions/suite/routerActions'; import { saveTransactionId } from 'src/actions/wallet/tradingExchangeActions'; -import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; import { useTradingWatchTrade } from 'src/hooks/wallet/trading/useTradingWatchTrade'; +import { Account } from 'src/types/wallet'; +import { TradeExchange } from 'src/types/wallet/tradingCommonTypes'; import { TradingTransactionAmounts } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionAmounts'; -import { TradingTransactionInfo } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionInfo'; +import { TradingTransactionContainer } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionContainer'; import { TradingTransactionId } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionId'; +import { TradingTransactionInfo } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionInfo'; import { TradingTransactionProvider } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionProvider'; -import { TradingTransactionContainer } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionContainer'; interface TradingTransactionExchangeProps { trade: TradeExchange; diff --git a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsBuy.tsx b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsBuy.tsx index 0fdc22e5f73..1f77c559183 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsBuy.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsBuy.tsx @@ -3,17 +3,17 @@ import { BuyProviderInfo } from 'invity-api'; import { Button } from '@trezor/components'; import { saveTransactionDetailId } from 'src/actions/wallet/tradingBuyActions'; -import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; -import { TradeBuy } from 'src/types/wallet/tradingCommonTypes'; import { useDispatch } from 'src/hooks/suite'; -import { useTradingNavigation } from 'src/hooks/wallet/useTradingNavigation'; import { useTradingWatchTrade } from 'src/hooks/wallet/trading/useTradingWatchTrade'; +import { useTradingNavigation } from 'src/hooks/wallet/useTradingNavigation'; +import { Account } from 'src/types/wallet'; +import { TradeBuy } from 'src/types/wallet/tradingCommonTypes'; +import { TradingTransactionAmounts } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionAmounts'; +import { TradingTransactionContainer } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionContainer'; import { TradingTransactionId } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionId'; import { TradingTransactionInfo } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionInfo'; -import { TradingTransactionAmounts } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionAmounts'; import { TradingTransactionProvider } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionProvider'; -import { TradingTransactionContainer } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionContainer'; interface TradingTransactionBuyProps { trade: TradeBuy; diff --git a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsList.tsx b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsList.tsx index a811e15945f..08ed6e43f25 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsList.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsList.tsx @@ -6,9 +6,9 @@ import { spacingsPx, typography } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; import { useTradingLoadData } from 'src/hooks/wallet/trading/useTradingLoadData'; -import { TradingTransactionSell } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransactionsSell'; -import { TradingTransactionBuy } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransactionsBuy'; import { TradingTransactionExchange } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransactionExchange'; +import { TradingTransactionBuy } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransactionsBuy'; +import { TradingTransactionSell } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransactionsSell'; const Wrapper = styled.div` padding: ${spacingsPx.zero} ${spacingsPx.lg}; diff --git a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsSell.tsx b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsSell.tsx index ecf780a78f6..7f4c78c631b 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsSell.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingTransactions/TradingTransactionsSell.tsx @@ -9,16 +9,16 @@ import { saveTransactionId, setIsFromRedirect, } from 'src/actions/wallet/tradingSellActions'; -import { TradingTransactionId } from 'src/views/wallet/trading/common'; -import { Account } from 'src/types/wallet'; import { Translation } from 'src/components/suite'; -import { TradeSell } from 'src/types/wallet/tradingCommonTypes'; import { useDispatch, useSelector } from 'src/hooks/suite'; import { useTradingWatchTrade } from 'src/hooks/wallet/trading/useTradingWatchTrade'; +import { Account } from 'src/types/wallet'; +import { TradeSell } from 'src/types/wallet/tradingCommonTypes'; +import { TradingTransactionId } from 'src/views/wallet/trading/common'; import { TradingTransactionAmounts } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionAmounts'; +import { TradingTransactionContainer } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionContainer'; import { TradingTransactionInfo } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionInfo'; import { TradingTransactionProvider } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionProvider'; -import { TradingTransactionContainer } from 'src/views/wallet/trading/common/TradingTransactions/TradingTransaction/TradingTransactionContainer'; interface TradingTransactionSellProps { trade: TradeSell; diff --git a/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsKyc.tsx b/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsKyc.tsx index 6a3b5bceabb..8c259b4f807 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsKyc.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsKyc.tsx @@ -1,11 +1,9 @@ -import { useTheme } from 'styled-components'; import { ExchangeKYCType } from 'invity-api'; +import { useTheme } from 'styled-components'; import { Banner, Icon, Tooltip } from '@trezor/components'; import { Translation } from 'src/components/suite'; -import { TooltipIcon, TooltipText, TooltipWrap } from 'src/views/wallet/trading'; -import { TradingExchangeProvidersInfoProps } from 'src/types/trading/trading'; import { KYC_DEX, KYC_NO_KYC, @@ -13,6 +11,8 @@ import { KYC_REQUIRED, KYC_YES_REFUND, } from 'src/constants/wallet/trading/kyc'; +import { TradingExchangeProvidersInfoProps } from 'src/types/trading/trading'; +import { TooltipIcon, TooltipText, TooltipWrap } from 'src/views/wallet/trading'; interface TradingUtilsProviderProps { exchange?: string; diff --git a/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsPrice.tsx b/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsPrice.tsx index 6a6ff833ba8..1de788e878d 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsPrice.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsPrice.tsx @@ -1,14 +1,14 @@ import styled from 'styled-components'; -import { spacingsPx, typography } from '@trezor/theme'; import { FONT_SIZE, SCREEN_QUERY } from '@trezor/components/src/config/variables'; +import { spacingsPx, typography } from '@trezor/theme'; import { Translation } from 'src/components/suite'; -import { tradingGetAmountLabels } from 'src/utils/wallet/trading/tradingUtils'; -import { TradingFiatAmount } from 'src/views/wallet/trading/common/TradingFiatAmount'; -import { TradingCryptoAmount } from 'src/views/wallet/trading/common/TradingCryptoAmount'; import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { TradingCryptoAmountProps } from 'src/types/trading/trading'; +import { tradingGetAmountLabels } from 'src/utils/wallet/trading/tradingUtils'; +import { TradingCryptoAmount } from 'src/views/wallet/trading/common/TradingCryptoAmount'; +import { TradingFiatAmount } from 'src/views/wallet/trading/common/TradingFiatAmount'; const PriceWrap = styled.div``; diff --git a/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider.tsx b/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider.tsx index 612bc6c2376..d11c7c4bb11 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider.tsx @@ -1,8 +1,8 @@ import styled from 'styled-components'; -import { spacings } from '@trezor/theme'; -import { Row } from '@trezor/components'; import { invityAPI } from '@suite-common/invity'; +import { Row } from '@trezor/components'; +import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; import { TradingUtilsProvidersProps } from 'src/types/trading/trading'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsTooltip.tsx b/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsTooltip.tsx index 41e6212cb8d..39c49821785 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsTooltip.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsTooltip.tsx @@ -5,8 +5,8 @@ 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/trading'; -import { TradingUtilsTooltipFee } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsTooltipFee'; import { TradingOffersItemProps } from 'src/views/wallet/trading/common/TradingOffers/TradingOffersItem'; +import { TradingUtilsTooltipFee } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsTooltipFee'; // IN TESTING MODE export const TradingUtilsTooltip = ({ quote }: Pick) => { diff --git a/packages/suite/src/views/wallet/trading/exchange/TradingExchangeConfirm.tsx b/packages/suite/src/views/wallet/trading/exchange/TradingExchangeConfirm.tsx index f1b47f81fc5..20001067048 100644 --- a/packages/suite/src/views/wallet/trading/exchange/TradingExchangeConfirm.tsx +++ b/packages/suite/src/views/wallet/trading/exchange/TradingExchangeConfirm.tsx @@ -1,8 +1,8 @@ -import { UseTradingProps } from 'src/types/trading/trading'; import { TradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { TradingSelectedOffer } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOffer'; import { useTradingExchangeForm } from 'src/hooks/wallet/trading/form/useTradingExchangeForm'; +import { UseTradingProps } from 'src/types/trading/trading'; import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; +import { TradingSelectedOffer } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOffer'; const TradingExchangeConfirmComponent = ({ selectedAccount }: UseTradingProps) => { const tradingExchangeContextValues = useTradingExchangeForm({ diff --git a/packages/suite/src/views/wallet/trading/exchange/TradingExchangeForm.tsx b/packages/suite/src/views/wallet/trading/exchange/TradingExchangeForm.tsx index 24a1a79ae7c..88ca6272660 100644 --- a/packages/suite/src/views/wallet/trading/exchange/TradingExchangeForm.tsx +++ b/packages/suite/src/views/wallet/trading/exchange/TradingExchangeForm.tsx @@ -1,9 +1,9 @@ -import { UseTradingProps } from 'src/types/trading/trading'; -import { useTradingExchangeForm } from 'src/hooks/wallet/trading/form/useTradingExchangeForm'; import { TradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { useTradingExchangeForm } from 'src/hooks/wallet/trading/form/useTradingExchangeForm'; +import { UseTradingProps } from 'src/types/trading/trading'; +import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; import { TradingFormLayout } from 'src/views/wallet/trading/common/TradingForm/TradingFormLayout'; import { TradingLayout } from 'src/views/wallet/trading/common/TradingLayout/TradingLayout'; -import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; const TradingExchangeFormComponent = ({ selectedAccount }: UseTradingProps) => { const tradingExchangeContextValue = useTradingExchangeForm({ selectedAccount }); diff --git a/packages/suite/src/views/wallet/trading/exchange/TradingExchangeOffers.tsx b/packages/suite/src/views/wallet/trading/exchange/TradingExchangeOffers.tsx index 592dc856ed4..8fb003bffa1 100644 --- a/packages/suite/src/views/wallet/trading/exchange/TradingExchangeOffers.tsx +++ b/packages/suite/src/views/wallet/trading/exchange/TradingExchangeOffers.tsx @@ -1,8 +1,8 @@ -import { UseTradingProps } from 'src/types/trading/trading'; -import { TradingOffers } from 'src/views/wallet/trading/common/TradingOffers/TradingOffers'; +import { TradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { useTradingExchangeForm } from 'src/hooks/wallet/trading/form/useTradingExchangeForm'; +import { UseTradingProps } from 'src/types/trading/trading'; import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; -import { TradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; +import { TradingOffers } from 'src/views/wallet/trading/common/TradingOffers/TradingOffers'; const TradingExchangeOffersComponent = ({ selectedAccount }: UseTradingProps) => { const tradingExchangeContextValues = useTradingExchangeForm({ diff --git a/packages/suite/src/views/wallet/trading/redirect/TradingRedirect.tsx b/packages/suite/src/views/wallet/trading/redirect/TradingRedirect.tsx index a3abf095110..18b988cc288 100644 --- a/packages/suite/src/views/wallet/trading/redirect/TradingRedirect.tsx +++ b/packages/suite/src/views/wallet/trading/redirect/TradingRedirect.tsx @@ -1,15 +1,15 @@ import { useEffect } from 'react'; -import styled from 'styled-components'; import { CryptoId } from 'invity-api'; +import styled from 'styled-components'; import { variables } from '@trezor/components'; import { FeeLevel } from '@trezor/connect'; +import { Translation } from 'src/components/suite'; import { useSelector } from 'src/hooks/suite'; -import { Account } from 'src/types/wallet'; import { useTradingRedirect } from 'src/hooks/wallet/useTradingRedirect'; -import { Translation } from 'src/components/suite'; +import { Account } from 'src/types/wallet'; const Wrapper = styled.div` display: flex; diff --git a/packages/suite/src/views/wallet/trading/sell/TradingSellConfirm.tsx b/packages/suite/src/views/wallet/trading/sell/TradingSellConfirm.tsx index 141e38cf0e1..95bdfc6a387 100644 --- a/packages/suite/src/views/wallet/trading/sell/TradingSellConfirm.tsx +++ b/packages/suite/src/views/wallet/trading/sell/TradingSellConfirm.tsx @@ -1,8 +1,8 @@ -import { UseTradingProps } from 'src/types/trading/trading'; import { TradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { TradingSelectedOffer } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOffer'; import { useTradingSellForm } from 'src/hooks/wallet/trading/form/useTradingSellForm'; +import { UseTradingProps } from 'src/types/trading/trading'; import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; +import { TradingSelectedOffer } from 'src/views/wallet/trading/common/TradingSelectedOffer/TradingSelectedOffer'; const TradingSellConfirmComponent = ({ selectedAccount }: UseTradingProps) => { const tradingSellContextValues = useTradingSellForm({ diff --git a/packages/suite/src/views/wallet/trading/sell/TradingSellForm.tsx b/packages/suite/src/views/wallet/trading/sell/TradingSellForm.tsx index a2f9c9488b6..2919b5b8cb6 100644 --- a/packages/suite/src/views/wallet/trading/sell/TradingSellForm.tsx +++ b/packages/suite/src/views/wallet/trading/sell/TradingSellForm.tsx @@ -1,9 +1,9 @@ -import { UseTradingProps } from 'src/types/trading/trading'; import { TradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; -import { TradingFormLayout } from 'src/views/wallet/trading/common/TradingForm/TradingFormLayout'; -import { TradingLayout } from 'src/views/wallet/trading/common/TradingLayout/TradingLayout'; import { useTradingSellForm } from 'src/hooks/wallet/trading/form/useTradingSellForm'; +import { UseTradingProps } from 'src/types/trading/trading'; import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; +import { TradingFormLayout } from 'src/views/wallet/trading/common/TradingForm/TradingFormLayout'; +import { TradingLayout } from 'src/views/wallet/trading/common/TradingLayout/TradingLayout'; const TradingSellFormComponent = ({ selectedAccount }: UseTradingProps) => { const tradingSellContextValues = useTradingSellForm({ selectedAccount }); diff --git a/packages/suite/src/views/wallet/trading/sell/TradingSellOffers.tsx b/packages/suite/src/views/wallet/trading/sell/TradingSellOffers.tsx index 426588baaef..89292f31006 100644 --- a/packages/suite/src/views/wallet/trading/sell/TradingSellOffers.tsx +++ b/packages/suite/src/views/wallet/trading/sell/TradingSellOffers.tsx @@ -1,8 +1,8 @@ -import { UseTradingProps } from 'src/types/trading/trading'; import { TradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm'; import { useTradingSellForm } from 'src/hooks/wallet/trading/form/useTradingSellForm'; -import { TradingOffers } from 'src/views/wallet/trading/common/TradingOffers/TradingOffers'; +import { UseTradingProps } from 'src/types/trading/trading'; import { TradingContainer } from 'src/views/wallet/trading/common/TradingContainer'; +import { TradingOffers } from 'src/views/wallet/trading/common/TradingOffers/TradingOffers'; const TradingSellOffersComponent = ({ selectedAccount }: UseTradingProps) => { const tradingSellFormContextValues = useTradingSellForm({ diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinExplanation.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinExplanation.tsx index 1f52264e455..a51fde76416 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinExplanation.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinExplanation/CoinjoinExplanation.tsx @@ -1,10 +1,10 @@ -import styled from 'styled-components'; import { darken } from 'polished'; +import styled from 'styled-components'; 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 { HELP_CENTER_COINJOIN_URL } from '@trezor/urls'; import { Translation } from 'src/components/suite'; import { LearnMoreButton } from 'src/components/suite/LearnMoreButton'; 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 267c03b8a5b..ed4f798bb19 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/BalancePrivacyBreakdown.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/BalancePrivacyBreakdown.tsx @@ -1,7 +1,7 @@ import styled, { useTheme } from 'styled-components'; -import { Icon } from '@trezor/components'; import { isZero } from '@suite-common/wallet-utils'; +import { Icon } from '@trezor/components'; import { Translation } from 'src/components/suite/Translation'; import { useSelector } from 'src/hooks/suite'; 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 d39ad6cfaa6..c3090c73a26 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/CryptoAmountWithHeader.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/BalancePrivacyBreakdown/CryptoAmountWithHeader.tsx @@ -2,9 +2,9 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; -import { variables } from '@trezor/components'; import { NetworkSymbol } from '@suite-common/wallet-config'; import { formatNetworkAmount } from '@suite-common/wallet-utils'; +import { variables } from '@trezor/components'; import { FiatValue } from 'src/components/suite/FiatValue'; import { FormattedCryptoAmount } from 'src/components/suite/FormattedCryptoAmount'; diff --git a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceError.tsx b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceError.tsx index 54cb5fb4ab6..c5f85aa506e 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceError.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinBalanceError.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components'; -import { variables } from '@trezor/components'; import { TranslationKey } from '@suite-common/intl-types'; +import { variables } from '@trezor/components'; import { Translation } from 'src/components/suite/Translation'; 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 0a6347a1df9..be773e9acb9 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressContent.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressContent.tsx @@ -2,18 +2,18 @@ import { FormattedNumber } from 'react-intl'; import styled, { useTheme } from 'styled-components'; -import { Spinner, Icon, Tooltip } from '@trezor/components'; +import { Icon, Spinner, 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 { Translation } from 'src/components/suite/Translation'; +import { useCoinjoinSessionBlockers } from 'src/hooks/coinjoin/useCoinjoinSessionBlockers'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectCurrentCoinjoinWheelStates, selectCurrentSessionDeadlineInfo, selectRoundsDurationInHours, } from 'src/reducers/wallet/coinjoinReducer'; -import { useCoinjoinSessionBlockers } from 'src/hooks/coinjoin/useCoinjoinSessionBlockers'; 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 84bb151597c..5e9752641d1 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressWheel.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinProgressWheel.tsx @@ -1,26 +1,26 @@ import { useCallback, useState } from 'react'; -import styled, { css, DefaultTheme, keyframes } from 'styled-components'; import { lighten, rgba } from 'polished'; +import styled, { DefaultTheme, css, keyframes } from 'styled-components'; import { Tooltip } from '@trezor/components'; +import { openModal } from 'src/actions/suite/modalActions'; +import { goto } from 'src/actions/suite/routerActions'; +import { + coinjoinSessionAutostop, + startCoinjoinSession, +} from 'src/actions/wallet/coinjoinAccountActions'; +import { stopCoinjoinSession } from 'src/actions/wallet/coinjoinClientActions'; +import { Translation } from 'src/components/suite/Translation'; +import { useCoinjoinSessionBlockers } from 'src/hooks/coinjoin/useCoinjoinSessionBlockers'; +import { useDispatch } from 'src/hooks/suite/useDispatch'; import { useSelector } from 'src/hooks/suite/useSelector'; import { selectCurrentCoinjoinWheelStates, selectSessionProgressByAccountKey, selectStartCoinjoinSessionArguments, } from 'src/reducers/wallet/coinjoinReducer'; -import { useDispatch } from 'src/hooks/suite/useDispatch'; -import { useCoinjoinSessionBlockers } from 'src/hooks/coinjoin/useCoinjoinSessionBlockers'; -import { goto } from 'src/actions/suite/routerActions'; -import { Translation } from 'src/components/suite/Translation'; -import { openModal } from 'src/actions/suite/modalActions'; -import { stopCoinjoinSession } from 'src/actions/wallet/coinjoinClientActions'; -import { - startCoinjoinSession, - coinjoinSessionAutostop, -} from 'src/actions/wallet/coinjoinAccountActions'; import { CoinjoinProgressContent, 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 421b279cb8e..f0b3f2ff71b 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusMessage.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusMessage.tsx @@ -1,10 +1,10 @@ import styled from 'styled-components'; -import { typography, spacingsPx } from '@trezor/theme'; +import { spacingsPx, typography } 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'; +import { Translation } from 'src/components/suite/Translation'; +import { SESSION_PHASE_MESSAGES } from 'src/constants/suite/coinjoin'; import { useCoinjoinSessionPhase } from 'src/hooks/coinjoin'; import { useSelector } from 'src/hooks/suite/useSelector'; import { 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 3ecec8c1361..72d0ae2964d 100644 --- a/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusWheel.tsx +++ b/packages/suite/src/views/wallet/transactions/CoinjoinSummary/CoinjoinStatusWheel/CoinjoinStatusWheel.tsx @@ -1,16 +1,16 @@ import styled from 'styled-components'; -import { Card, Button } from '@trezor/components'; +import { Button, Card } from '@trezor/components'; import { typography } from '@trezor/theme'; -import { useSelector } from 'src/hooks/suite/useSelector'; -import { selectCurrentCoinjoinWheelStates } from 'src/reducers/wallet/coinjoinReducer'; +import { stopCoinjoinSession } from 'src/actions/wallet/coinjoinClientActions'; import { Translation } from 'src/components/suite'; import { useDispatch } from 'src/hooks/suite'; -import { stopCoinjoinSession } from 'src/actions/wallet/coinjoinClientActions'; +import { useSelector } from 'src/hooks/suite/useSelector'; +import { selectCurrentCoinjoinWheelStates } from 'src/reducers/wallet/coinjoinReducer'; -import { CoinjoinStatusMessage } from './CoinjoinStatusMessage'; import { CoinjoinProgressWheel } from './CoinjoinProgressWheel'; +import { CoinjoinStatusMessage } from './CoinjoinStatusMessage'; // 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/TradeBox/TradeBox.tsx b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx index 14bb7435929..b1ccadcbdbe 100644 --- a/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx +++ b/packages/suite/src/views/wallet/transactions/TradeBox/TradeBox.tsx @@ -1,28 +1,28 @@ -import { spacings } from '@trezor/theme'; import { + getNetwork, + getNetworkDisplaySymbol, + getNetworkDisplaySymbolName, +} from '@suite-common/wallet-config'; +import { + Button, Card, - Row, - variables, Flex, - Text, InfoItem, - Button, + Row, + Text, useMediaQuery, + variables, } from '@trezor/components'; -import { CoinLogo } from '@trezor/product-components'; -import { - getNetwork, - getNetworkDisplaySymbol, - getNetworkDisplaySymbolName, -} from '@suite-common/wallet-config'; import { hasBitcoinOnlyFirmware } from '@trezor/device-utils'; +import { CoinLogo } from '@trezor/product-components'; import { EventType, analytics } from '@trezor/suite-analytics'; +import { spacings } from '@trezor/theme'; import { goto } from 'src/actions/suite/routerActions'; -import { Account } from 'src/types/wallet'; -import { Translation, PriceTicker, TrendTicker } from 'src/components/suite'; -import { useDevice, useDispatch } from 'src/hooks/suite'; import { DashboardSection } from 'src/components/dashboard'; +import { PriceTicker, Translation, TrendTicker } from 'src/components/suite'; +import { useDevice, useDispatch } from 'src/hooks/suite'; +import { Account } from 'src/types/wallet'; type TradeBoxProps = { account: Account; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/NoSearchResults.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/NoSearchResults.tsx index 49dad581c28..8af2769339d 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/NoSearchResults.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/NoSearchResults.tsx @@ -3,8 +3,8 @@ import { useState } from 'react'; import styled from 'styled-components'; import { Card, Column, variables } from '@trezor/components'; -import { getWeakRandomNumberInRange } from '@trezor/utils'; import { typography } from '@trezor/theme'; +import { getWeakRandomNumberInRange } from '@trezor/utils'; import { Translation } from 'src/components/suite'; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/SkeletonTransactionItem.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/SkeletonTransactionItem.tsx index e0d4c4dd50a..6c6cf87f9d8 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/SkeletonTransactionItem.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/SkeletonTransactionItem.tsx @@ -1,4 +1,4 @@ -import { SkeletonStack, SkeletonSpread, SkeletonRectangle } from '@trezor/components'; +import { SkeletonRectangle, SkeletonSpread, SkeletonStack } from '@trezor/components'; export const SkeletonTransactionItem = () => ( diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionCandidates.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionCandidates.tsx index b8b5f8a56d0..341c26235f8 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionCandidates.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionCandidates.tsx @@ -4,13 +4,13 @@ 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'; -import { TxTypeIconWrapper } from 'src/components/wallet/TransactionItem/CommonComponents'; -import { Translation } from 'src/components/suite/Translation'; import TooltipSymbol from 'src/components/suite/TooltipSymbol'; +import { Translation } from 'src/components/suite/Translation'; +import { TxTypeIconWrapper } from 'src/components/wallet/TransactionItem/CommonComponents'; +import { TransactionTypeIcon } from 'src/components/wallet/TransactionItem/TransactionTypeIcon'; import { SUBPAGE_NAV_HEIGHT } from 'src/constants/suite/layout'; +import { useSelector } from 'src/hooks/suite'; +import { selectCoinjoinAccountByKey } from 'src/reducers/wallet/coinjoinReducer'; const Header = styled.div` position: sticky; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionGroupedList.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionGroupedList.tsx index 1a13e31630e..b98299639d2 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionGroupedList.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionGroupedList.tsx @@ -1,16 +1,16 @@ +import { getNetwork } from '@suite-common/wallet-config'; import { - getTransactionWithLowestNonce, GroupedTransactionsByDate, + getTransactionWithLowestNonce, 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 { useSelector } from 'src/hooks/suite'; import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { Account, WalletAccountTransaction } from 'src/types/wallet'; import { TransactionsGroup } from './TransactionsGroup/TransactionsGroup'; diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx index 12156320504..4c77897426c 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx @@ -2,33 +2,33 @@ import { useEffect, useMemo, useRef, useState } from 'react'; import useDebounce from 'react-use/lib/useDebounce'; +import { getTxsPerPage } from '@suite-common/suite-utils'; import { fetchAllTransactionsForAccountThunk, fetchTransactionsPageThunk, } from '@suite-common/wallet-core'; -import { arrayPartition } from '@trezor/utils'; import { advancedSearchTransactions, groupTransactionsByDate, isPending, } from '@suite-common/wallet-utils'; -import { getTxsPerPage } from '@suite-common/suite-utils'; import { SkeletonStack } from '@trezor/components'; +import { arrayPartition } from '@trezor/utils'; -import { Translation } from 'src/components/suite'; import { DashboardSection } from 'src/components/dashboard'; +import { Translation } from 'src/components/suite'; +import { Pagination } from 'src/components/wallet'; import { useDispatch, useSelector } from 'src/hooks/suite'; +import { selectLabelingDataForAccount } from 'src/reducers/suite/metadataReducer'; import { Account, WalletAccountTransaction } from 'src/types/wallet'; -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 { SkeletonTransactionItem } from './SkeletonTransactionItem'; import { TransactionCandidates } from './TransactionCandidates'; -import { PendingGroupHeader } from './TransactionsGroup/PendingGroupHeader'; import { TransactionGroupedList } from './TransactionGroupedList'; +import { TransactionListActions } from './TransactionListActions/TransactionListActions'; +import { PendingGroupHeader } from './TransactionsGroup/PendingGroupHeader'; interface TransactionListProps { transactions: WalletAccountTransaction[]; 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 40cdb63a22c..ae10393deb1 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/ExportAction.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/ExportAction.tsx @@ -1,21 +1,21 @@ -import { useState, useCallback } from 'react'; +import { useCallback, useState } from 'react'; -import { Spinner, Dropdown } from '@trezor/components'; -import { analytics, EventType } from '@trezor/suite-analytics'; +import { AccountLabels } from '@suite-common/metadata-types'; import { notificationsActions } from '@suite-common/toast-notifications'; +import { getNetwork } from '@suite-common/wallet-config'; import { fetchAllTransactionsForAccountThunk } from '@suite-common/wallet-core'; import { ExportFileType } from '@suite-common/wallet-types'; import { getTitleForCoinjoinAccount } from '@suite-common/wallet-utils'; -import { AccountLabels } from '@suite-common/metadata-types'; -import { getNetwork } from '@suite-common/wallet-config'; +import { Dropdown, Spinner } from '@trezor/components'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { exportTransactionsThunk } from 'src/actions/wallet/exportTransactionsActions'; 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 { exportTransactionsThunk } from 'src/actions/wallet/exportTransactionsActions'; -import { Account } from 'src/types/wallet'; +import { useTranslation } from 'src/hooks/suite/useTranslation'; import { selectLabelingDataForSelectedAccount } from 'src/reducers/suite/metadataReducer'; +import { Account } from 'src/types/wallet'; 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 e5e762f6100..aa51c7d6166 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/TransactionListActions.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionListActions/TransactionListActions.tsx @@ -2,14 +2,14 @@ import { Dispatch, SetStateAction, useCallback, useEffect, useState } from 'reac import styled from 'styled-components'; +import { AccountLabels } from '@suite-common/metadata-types'; 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 { SearchAction } from 'src/components/wallet/SearchAction'; +import { useDispatch, useSelector, useTranslation } from 'src/hooks/suite'; import { ExportAction } from './ExportAction'; 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 13c56564480..03b90ad4894 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/DayHeader.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionsGroup/DayHeader.tsx @@ -1,10 +1,10 @@ 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 type { NetworkSymbol } from '@suite-common/wallet-config'; +import { isTestnet, parseTransactionDateKey } from '@suite-common/wallet-utils'; import { Row } from '@trezor/components'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; import { FormattedCryptoAmount, HiddenPlaceholder } from 'src/components/suite'; 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 2b66ca8e293..b58526c2cd0 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,12 @@ -import { useState, ReactNode } from 'react'; +import { ReactNode, useState } from 'react'; import styled from 'styled-components'; +import { FiatCurrencyCode } from '@suite-common/suite-config'; +import { isTokenDefinitionKnown, selectCoinDefinitions } from '@suite-common/token-definitions'; import type { NetworkSymbol } from '@suite-common/wallet-config'; +import { selectHistoricFiatRates } from '@suite-common/wallet-core'; +import { Timestamp, TokenAddress } from '@suite-common/wallet-types'; import { getFiatRateKey, isNftTokenTransfer, @@ -10,10 +14,6 @@ import { sumTransactions, sumTransactionsFiat, } from '@suite-common/wallet-utils'; -import { FiatCurrencyCode } from '@suite-common/suite-config'; -import { selectHistoricFiatRates } from '@suite-common/wallet-core'; -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'; diff --git a/packages/suite/src/views/wallet/transactions/Transactions.tsx b/packages/suite/src/views/wallet/transactions/Transactions.tsx index cc117c81ab5..64b207f0811 100644 --- a/packages/suite/src/views/wallet/transactions/Transactions.tsx +++ b/packages/suite/src/views/wallet/transactions/Transactions.tsx @@ -5,17 +5,17 @@ import { selectIsLoadingAccountTransactions, } from '@suite-common/wallet-core'; -import { WalletLayout, CoinjoinAccountDiscoveryProgress } from 'src/components/wallet'; +import { CoinjoinAccountDiscoveryProgress, WalletLayout } 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'; -import { TransactionSummary } from './components/TransactionSummary'; import { CoinjoinExplanation } from './CoinjoinExplanation/CoinjoinExplanation'; import { CoinjoinSummary } from './CoinjoinSummary/CoinjoinSummary'; import { TradeBox } from './TradeBox/TradeBox'; +import { TransactionList } from './TransactionList/TransactionList'; +import { AccountEmpty } from './components/AccountEmpty'; +import { NoTransactions } from './components/NoTransactions'; +import { TransactionSummary } from './components/TransactionSummary'; interface LayoutProps { selectedAccount: AppState['wallet']['selectedAccount']; diff --git a/packages/suite/src/views/wallet/transactions/components/AccountEmpty.tsx b/packages/suite/src/views/wallet/transactions/components/AccountEmpty.tsx index 05a238b08ea..bbe0f99b591 100644 --- a/packages/suite/src/views/wallet/transactions/components/AccountEmpty.tsx +++ b/packages/suite/src/views/wallet/transactions/components/AccountEmpty.tsx @@ -1,11 +1,11 @@ -import { analytics, EventType } from '@trezor/suite-analytics'; import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; +import { EventType, analytics } from '@trezor/suite-analytics'; +import { goto } from 'src/actions/suite/routerActions'; import { Translation } from 'src/components/suite'; +import { AccountExceptionLayout } from 'src/components/wallet'; import { useDispatch } from 'src/hooks/suite'; import { Account } from 'src/types/wallet'; -import { goto } from 'src/actions/suite/routerActions'; -import { AccountExceptionLayout } from 'src/components/wallet'; interface AccountEmptyProps { account: Account; diff --git a/packages/suite/src/views/wallet/transactions/components/InfoCard.tsx b/packages/suite/src/views/wallet/transactions/components/InfoCard.tsx index 94e85f67d79..3a6798efe5d 100644 --- a/packages/suite/src/views/wallet/transactions/components/InfoCard.tsx +++ b/packages/suite/src/views/wallet/transactions/components/InfoCard.tsx @@ -2,10 +2,10 @@ import { ReactNode } from 'react'; import styled from 'styled-components'; -import { variables, Card, SkeletonRectangle, Column } from '@trezor/components'; +import { Card, Column, SkeletonRectangle, variables } from '@trezor/components'; import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { HiddenPlaceholder, FormattedCryptoAmount, Sign } from 'src/components/suite'; +import { FormattedCryptoAmount, HiddenPlaceholder, Sign } from 'src/components/suite'; import { Account } from 'src/types/wallet'; const Title = styled.div` diff --git a/packages/suite/src/views/wallet/transactions/components/NoTransactions.tsx b/packages/suite/src/views/wallet/transactions/components/NoTransactions.tsx index 2bfdadd4f47..8d69f23df50 100644 --- a/packages/suite/src/views/wallet/transactions/components/NoTransactions.tsx +++ b/packages/suite/src/views/wallet/transactions/components/NoTransactions.tsx @@ -1,7 +1,7 @@ import { getNetwork } from '@suite-common/wallet-config'; -import { AccountExceptionLayout } from 'src/components/wallet'; import { Translation, TrezorLink } from 'src/components/suite'; +import { AccountExceptionLayout } from 'src/components/wallet'; import { Account } from 'src/types/wallet'; interface NoTransactionsProps { diff --git a/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx b/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx index d001b6a2489..ec29df2fd85 100644 --- a/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx +++ b/packages/suite/src/views/wallet/transactions/components/SummaryCards.tsx @@ -1,11 +1,11 @@ import styled from 'styled-components'; -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 { variables } from '@trezor/components'; +import { BigNumber } from '@trezor/utils/src/bigNumber'; -import { Translation, HiddenPlaceholder, FormattedDate } from 'src/components/suite'; +import { FormattedDate, HiddenPlaceholder, Translation } 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'; diff --git a/packages/suite/src/views/wallet/transactions/components/TransactionSummary.tsx b/packages/suite/src/views/wallet/transactions/components/TransactionSummary.tsx index 06e796c6993..e2a48bd631e 100644 --- a/packages/suite/src/views/wallet/transactions/components/TransactionSummary.tsx +++ b/packages/suite/src/views/wallet/transactions/components/TransactionSummary.tsx @@ -1,10 +1,10 @@ -import styled from 'styled-components'; import { getUnixTime } from 'date-fns'; +import styled from 'styled-components'; import { calcTicks, calcTicksFromData } from '@suite-common/suite-utils'; -import { variables, Button, Card, Row, Column } from '@trezor/components'; +import { Button, Card, Column, Row, variables } from '@trezor/components'; -import { Account } from 'src/types/wallet'; +import { getGraphDataForInterval, updateGraphData } from 'src/actions/wallet/graphActions'; import { GraphRangeSelector, HiddenPlaceholder, @@ -12,12 +12,12 @@ import { Translation, } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; -import { getGraphDataForInterval, updateGraphData } from 'src/actions/wallet/graphActions'; -import { aggregateBalanceHistory, getMinMaxValueFromData } from 'src/utils/wallet/graph'; import { selectLocalCurrency } from 'src/reducers/wallet/settingsReducer'; +import { Account } from 'src/types/wallet'; +import { aggregateBalanceHistory, getMinMaxValueFromData } from 'src/utils/wallet/graph'; -import { TransactionSummaryDropdown } from './TransactionSummaryDropdown'; import { SummaryCards } from './SummaryCards'; +import { TransactionSummaryDropdown } from './TransactionSummaryDropdown'; const ErrorMessage = styled.div` display: flex;