From 13a53464c7c8b1af3fd9c9e925838eb1f88365d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Santana=20Gon=C3=A7alves?= Date: Tue, 6 Feb 2024 10:51:54 -0300 Subject: [PATCH] fix imports --- src/components/token/utils.ts | 10 +++------- src/screens/home/PortfolioComponent.tsx | 7 ++----- src/shared/types/index.ts | 8 +++++++- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/components/token/utils.ts b/src/components/token/utils.ts index 74ca09e25..46db31fee 100644 --- a/src/components/token/utils.ts +++ b/src/components/token/utils.ts @@ -1,9 +1,5 @@ -import { BitcoinNetwork } from '@rsksmart/rif-wallet-bitcoin' - -import { ITokenWithoutLogo } from 'src/redux/slices/balancesSlice/types' -import { TokenSymbol } from 'src/screens/home/TokenImage' - -export type TokenOrBitcoinNetwork = ITokenWithoutLogo | BitcoinNetwork +import { TokenSymbol } from 'screens/home/TokenImage' +import { TokenOrBitcoinNetwork } from 'src/shared/types' // default order should be RIF, USDRIF, RBTC, BTC and RDOC // other tokens should be sorted alphabetically by symbol @@ -60,7 +56,7 @@ export const sortTokensBySymbol = ( // note that RDOC is not a default token // which means it can be hidden if its balance is 0 -export const isDefaultToken = (symbol: string) => +export const isDefaultToken = (symbol: TokenSymbol) => symbol === TokenSymbol.RIF || symbol === TokenSymbol.TRIF || symbol === TokenSymbol.USDRIF || diff --git a/src/screens/home/PortfolioComponent.tsx b/src/screens/home/PortfolioComponent.tsx index 8784eee69..8ea735c04 100644 --- a/src/screens/home/PortfolioComponent.tsx +++ b/src/screens/home/PortfolioComponent.tsx @@ -3,13 +3,10 @@ import { useTranslation } from 'react-i18next' import { ScrollView, StyleProp, View, ViewStyle } from 'react-native' import { PortfolioCard } from 'components/Porfolio/PortfolioCard' +import { isDefaultToken, sortTokensBySymbol } from 'components/token/utils' import { getTokenColor } from 'screens/home/tokenColor' import { sharedColors } from 'shared/constants' -import { - TokenOrBitcoinNetwork, - isDefaultToken, - sortTokensBySymbol, -} from 'src/components/token/utils' +import { TokenOrBitcoinNetwork } from 'shared/types' interface Props { setSelectedAddress: (token: string | undefined) => void diff --git a/src/shared/types/index.ts b/src/shared/types/index.ts index 0f5206273..b6194ea9f 100644 --- a/src/shared/types/index.ts +++ b/src/shared/types/index.ts @@ -1,4 +1,7 @@ -import { SendBitcoinRequest } from '@rsksmart/rif-wallet-bitcoin' +import { + BitcoinNetwork, + SendBitcoinRequest, +} from '@rsksmart/rif-wallet-bitcoin' import { Request } from 'lib/eoaWallet' @@ -6,6 +9,7 @@ import { rootTabsRouteNames, RootTabsScreenProps, } from 'navigation/rootNavigator' +import { ITokenWithoutLogo } from 'src/redux/slices/balancesSlice/types' export interface ErrorWithMessage { message: string @@ -28,3 +32,5 @@ export type ContactWithAddressRequired = Partial> & { export type ActivityMainScreenProps = RootTabsScreenProps + +export type TokenOrBitcoinNetwork = ITokenWithoutLogo | BitcoinNetwork