fix(suite): remove circular dependency in AssetsView

- Extracted AssetData type to separate types.ts file
- AssetTable now imports type directly instead of from AssetsView
- This breaks the circular import between AssetTable and AssetsView
- Resolves: packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTable.tsx > packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx
This commit is contained in:
Martin Varmuza
2026-02-18 08:50:53 +01:00
parent fa15e5f09c
commit 2f55f072f5
4 changed files with 16 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ import type { BaseCurrencyCode } from '@trezor/blockchain-link-types';
import { Table } from '@trezor/components';
import { spacings } from '@trezor/theme';
import { AssetData } from '../AssetsView';
import type { AssetData } from '../types';
import { AssetRow } from './AssetRow';
import { AssetRowSkeleton } from './AssetRowSkeleton';

View File

@@ -3,7 +3,6 @@ import styled, { useTheme } from 'styled-components';
import { Translation } from '@suite/intl';
import { AssetFiatBalance } from '@suite-common/assets';
import {
type Network,
type NetworkSymbol,
getNetwork,
getNetworkFeatures,
@@ -18,7 +17,6 @@ import {
import { RatesByKey } from '@suite-common/wallet-types';
import {
AMOUNT_UNIT_ZERO,
AmountUnit,
BASE_CURRENCY_ZERO,
asAmountUnit,
getFiatRateKey,
@@ -44,6 +42,7 @@ import { selectDiscoveryOverallStatus } from 'src/utils/wallet/selectDiscoveryOv
import { AssetCard, AssetCardSkeleton } from './AssetCard/AssetCard';
import { AssetTable } from './AssetTable/AssetTable';
import type { AssetData } from './types';
const InfoMessage = styled.div`
padding: ${spacingsPx.md} ${spacingsPx.xl};
@@ -59,16 +58,6 @@ const GridWrapper = styled.div`
grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
`;
export type AssetData = {
network: Network;
failed: boolean;
assetNativeCryptoBalance: AmountUnit;
stakingAccounts: Account[];
assetTokens: TokenInfo[];
isStakeNetwork?: boolean;
accounts: Account[];
};
const useAssetsFiatBalances = (
assetsData: AssetData[],
accounts: { [key: string]: Account[] },

View File

@@ -0,0 +1,14 @@
import type { Network } from '@suite-common/wallet-config';
import type { Account } from '@suite-common/wallet-types';
import type { AmountUnit } from '@suite-common/wallet-utils';
import type { TokenInfo } from '@trezor/blockchain-link-types';
export type AssetData = {
network: Network;
failed: boolean;
assetNativeCryptoBalance: AmountUnit;
stakingAccounts: Account[];
assetTokens: TokenInfo[];
isStakeNetwork?: boolean;
accounts: Account[];
};

View File

@@ -53,7 +53,6 @@ packages/suite/src/components/suite/troubleshooting/TroubleshootingTips.tsx > pa
packages/suite/src/components/wallet/Fees/CollapsibleFees/CustomFee/CustomFee.tsx > packages/suite/src/components/wallet/Fees/CollapsibleFees/CustomFee/CustomFeeMisc.tsx
packages/suite/src/utils/wallet/graph/utils.ts > packages/suite/src/utils/wallet/graph/utilsShared.ts > packages/suite/src/utils/wallet/graph/utilsWorker.ts
packages/suite/src/utils/wallet/graph/utilsShared.ts > packages/suite/src/utils/wallet/graph/utilsWorker.ts
packages/suite/src/views/dashboard/AssetsView/AssetTable/AssetTable.tsx > packages/suite/src/views/dashboard/AssetsView/AssetsView.tsx
suite-common/graph/src/graphDataFetching.ts > suite-common/graph/src/graphUtils.ts
suite-common/wallet-core/src/stake/stakeThunks.ts > suite-common/wallet-core/src/stake/stakeSelectors.ts > suite-common/wallet-core/src/stake/stakeReducer.ts
suite-common/wallet-core/src/transactions/transactionsSelectors.ts > suite-common/wallet-core/src/transactions/transactionsReducer.ts > suite-common/wallet-core/src/transactions/transactionsThunks.ts