Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoncalves committed Feb 6, 2024
1 parent 1ecc81f commit 13a5346
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
10 changes: 3 additions & 7 deletions src/components/token/utils.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 ||
Expand Down
7 changes: 2 additions & 5 deletions src/screens/home/PortfolioComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/shared/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { SendBitcoinRequest } from '@rsksmart/rif-wallet-bitcoin'
import {
BitcoinNetwork,
SendBitcoinRequest,
} from '@rsksmart/rif-wallet-bitcoin'

import { Request } from 'lib/eoaWallet'

import {
rootTabsRouteNames,
RootTabsScreenProps,
} from 'navigation/rootNavigator'
import { ITokenWithoutLogo } from 'src/redux/slices/balancesSlice/types'

export interface ErrorWithMessage {
message: string
Expand All @@ -28,3 +32,5 @@ export type ContactWithAddressRequired = Partial<Omit<Contact, 'address'>> & {

export type ActivityMainScreenProps =
RootTabsScreenProps<rootTabsRouteNames.Activity>

export type TokenOrBitcoinNetwork = ITokenWithoutLogo | BitcoinNetwork

0 comments on commit 13a5346

Please sign in to comment.