From a9909569b8f1568f2f3728841157c545696b5dea Mon Sep 17 00:00:00 2001 From: yurixander <101931215+yurixander@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:27:29 -0500 Subject: [PATCH] fix(tangle-dapp): Fix build errors --- .../NominationsTable/NominationsTable.tsx | 2 +- apps/tangle-dapp/src/components/index.ts | 2 +- .../src/components/tables/Vaults/index.tsx | 2 +- .../src/containers/AssetsAndBalancesTable.tsx | 15 ++++++++------- .../src/containers/LockedBalancesTable/index.tsx | 4 ++-- .../LockedBalancesTable/useVestingLockRows.ts | 2 +- .../src/data/balances/useBalanceLocks.ts | 2 +- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/apps/tangle-dapp/src/components/NominationsTable/NominationsTable.tsx b/apps/tangle-dapp/src/components/NominationsTable/NominationsTable.tsx index 06044f9d32..66ebf2d07b 100644 --- a/apps/tangle-dapp/src/components/NominationsTable/NominationsTable.tsx +++ b/apps/tangle-dapp/src/components/NominationsTable/NominationsTable.tsx @@ -29,7 +29,7 @@ import calculateCommission from '../../utils/calculateCommission'; import { HeaderCell, StringCell } from '../tableCells'; import PercentageCell from '../tableCells/PercentageCell'; import TokenAmountCell from '../tableCells/TokenAmountCell'; -import pluralize from '../../utils/pluralize'; +import pluralize from '@webb-tools/webb-ui-components/utils/pluralize'; const columnHelper = createColumnHelper(); diff --git a/apps/tangle-dapp/src/components/index.ts b/apps/tangle-dapp/src/components/index.ts index b0e0ef7051..29298155bc 100644 --- a/apps/tangle-dapp/src/components/index.ts +++ b/apps/tangle-dapp/src/components/index.ts @@ -1,5 +1,5 @@ export * from './BondedTokensBalanceInfo'; -export { default as GlassCardWithLogo } from './GlassCardWithLogo'; +export { default as CardWithTangleLogo } from './CardWithTangleLogo'; export * from './HeaderChip'; export * from './KeyStatsItem'; export * from './NominationsTable'; diff --git a/apps/tangle-dapp/src/components/tables/Vaults/index.tsx b/apps/tangle-dapp/src/components/tables/Vaults/index.tsx index 30507ebc0b..a3493de663 100644 --- a/apps/tangle-dapp/src/components/tables/Vaults/index.tsx +++ b/apps/tangle-dapp/src/components/tables/Vaults/index.tsx @@ -25,7 +25,7 @@ import { twMerge } from 'tailwind-merge'; import { PagePath, QueryParamKey } from '../../../types'; import type { Props, VaultData } from './types'; import sortByLocaleCompare from '../../../utils/sortByLocaleCompare'; -import pluralize from '../../../utils/pluralize'; +import pluralize from '@webb-tools/webb-ui-components/utils/pluralize'; const columnHelper = createColumnHelper(); diff --git a/apps/tangle-dapp/src/containers/AssetsAndBalancesTable.tsx b/apps/tangle-dapp/src/containers/AssetsAndBalancesTable.tsx index 4d8513b180..83b7c83d98 100644 --- a/apps/tangle-dapp/src/containers/AssetsAndBalancesTable.tsx +++ b/apps/tangle-dapp/src/containers/AssetsAndBalancesTable.tsx @@ -22,9 +22,7 @@ import { import { TableVariant } from '@webb-tools/webb-ui-components/components/Table/types'; import { FC, useCallback, useMemo, useState } from 'react'; -import LsTokenIcon from '../components/LsTokenIcon'; import StatItem from '../components/StatItem'; -import TableCellWrapper from '../components/tables/TableCellWrapper'; import { HeaderCell } from '../components/tableCells'; import addCommasToNumber from '@webb-tools/webb-ui-components/utils/addCommasToNumber'; import { ArrowRight } from '@webb-tools/icons'; @@ -32,15 +30,17 @@ import { PagePath } from '../types'; import { Link } from 'react-router'; import sortByLocaleCompare from '../utils/sortByLocaleCompare'; import { twMerge } from 'tailwind-merge'; -import formatFractional from '../utils/formatFractional'; -import useRestakeBalances from '../data/restake/useRestakeBalances'; import useRestakeAssetMap from '@webb-tools/tangle-shared-ui/data/restake/useRestakeAssetMap'; -import { TableStatus } from '../components'; -import useRestakeRewardConfig from '../data/restake/useRestakeRewardConfig'; -import useRestakeDelegatorInfo from '../data/restake/useRestakeDelegatorInfo'; import useIsAccountConnected from '../hooks/useIsAccountConnected'; import useLsPools from '../data/liquidStaking/useLsPools'; import { TANGLE_TOKEN_DECIMALS } from '@webb-tools/dapp-config'; +import TableCellWrapper from '@webb-tools/tangle-shared-ui/components/tables/TableCellWrapper'; +import LsTokenIcon from '@webb-tools/tangle-shared-ui/components/LsTokenIcon'; +import formatFractional from '@webb-tools/webb-ui-components/utils/formatFractional'; +import useRestakeBalances from '@webb-tools/tangle-shared-ui/data/restake/useRestakeBalances'; +import useRestakeRewardConfig from '../data/restake/useRestakeRewardConfig'; +import useRestakeDelegatorInfo from '@webb-tools/tangle-shared-ui/data/restake/useRestakeDelegatorInfo'; +import TableStatus from '@webb-tools/tangle-shared-ui/components/tables/TableStatus'; enum RowType { ASSET, @@ -327,6 +327,7 @@ const AssetsAndBalancesTable: FC = () => { }); }, [allPools, getTotalLockedInAsset]); + // All rows combined. const rows = useMemo(() => { // Sort by highest available balance (descending). return [...assetRows, ...lsPoolRows].sort((a, b) => { diff --git a/apps/tangle-dapp/src/containers/LockedBalancesTable/index.tsx b/apps/tangle-dapp/src/containers/LockedBalancesTable/index.tsx index 43d0fa4a69..a366a029d9 100644 --- a/apps/tangle-dapp/src/containers/LockedBalancesTable/index.tsx +++ b/apps/tangle-dapp/src/containers/LockedBalancesTable/index.tsx @@ -23,9 +23,9 @@ import useLockRows from './useLockRows'; import { BN } from '@polkadot/util'; import { SubstrateLockId } from '../../constants'; import useIsAccountConnected from '../../hooks/useIsAccountConnected'; -import { TableStatus } from '../../components'; -import pluralize from '../../utils/pluralize'; import { CheckboxCircleFill } from '@webb-tools/icons'; +import TableStatus from '@webb-tools/tangle-shared-ui/components/tables/TableStatus'; +import pluralize from '@webb-tools/webb-ui-components/utils/pluralize'; export enum LockUnlocksAtKind { ERA, diff --git a/apps/tangle-dapp/src/containers/LockedBalancesTable/useVestingLockRows.ts b/apps/tangle-dapp/src/containers/LockedBalancesTable/useVestingLockRows.ts index ceb19e2df2..1f6a4ffbc1 100644 --- a/apps/tangle-dapp/src/containers/LockedBalancesTable/useVestingLockRows.ts +++ b/apps/tangle-dapp/src/containers/LockedBalancesTable/useVestingLockRows.ts @@ -2,12 +2,12 @@ import { useCallback } from 'react'; import useVestingInfo from '../../data/vesting/useVestingInfo'; import useApi from '../../hooks/useApi'; import useApiRx from '@webb-tools/tangle-shared-ui/hooks/useApiRx'; -import { sortVestingSchedulesAscending } from '../BalancesTableContainer/LockedBalanceDetails/VestingScheduleBalances'; import getBlockDate from '../../utils/getBlockDate'; import calculateTimeRemaining from '../../utils/calculateTimeRemaining'; import { BalanceLockRow, LockUnlocksAtKind } from '.'; import { SubstrateLockId } from '../../constants'; import addCommasToNumber from '@webb-tools/webb-ui-components/utils/addCommasToNumber'; +import { sortVestingSchedulesAscending } from '../BalancesTableContainer/LockedBalanceDetails/utils'; const useVestingLockRows = (): BalanceLockRow[] | null => { const { schedulesOpt: vestingSchedulesOpt } = useVestingInfo(); diff --git a/apps/tangle-dapp/src/data/balances/useBalanceLocks.ts b/apps/tangle-dapp/src/data/balances/useBalanceLocks.ts index c8f0e21a4c..3cd93da03b 100644 --- a/apps/tangle-dapp/src/data/balances/useBalanceLocks.ts +++ b/apps/tangle-dapp/src/data/balances/useBalanceLocks.ts @@ -1,5 +1,5 @@ import useApiRx from '@webb-tools/tangle-shared-ui/hooks/useApiRx'; -import useSubstrateAddress from '../../hooks/useSubstrateAddress'; +import useSubstrateAddress from '@webb-tools/tangle-shared-ui/hooks/useSubstrateAddress'; import { useCallback } from 'react'; const useBalanceLocks = () => {