Skip to content

Commit

Permalink
fix(balances): show balances when they are 0 (#6306)
Browse files Browse the repository at this point in the history
  • Loading branch information
mperdomo-bc authored Mar 5, 2024
1 parent ca5571f commit 421e39e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const Balance = ({ coin, coinTicker }: Props) => {
const { data, hasError, isLoading, isNotAsked } = useRemote(
selectors.balances.getCoinTotalBalance(coin)
)

const handleRefresh = () => {
if (window.coins?.[coin]?.coinfig?.type.erc20Address) {
dispatch(fetchErc20Data(coin))
Expand All @@ -23,7 +24,7 @@ const Balance = ({ coin, coinTicker }: Props) => {
}
}

if (isLoading || isNotAsked || !data) {
if (isLoading || isNotAsked || typeof data !== 'number') {
return <LoadingBalance coinTicker={coinTicker} />
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,13 @@ import { LinkContainer } from 'react-router-bootstrap'
import styled from 'styled-components'

import { SkeletonRectangle, Text } from 'blockchain-info-components'
import CoinDisplay from 'components/Display/CoinDisplay'
import FiatDisplay from 'components/Display/FiatDisplay'
import SwitchableDisplay from 'components/Display/SwitchableDisplay'

const CoinBalanceMain = styled.div`
display: inline-flex;
flex-direction: row;
align-items: center;
padding-right: 15px;
> div:last-child {
margin-left: 10px;
> div {
color: ${(props) => props.theme.blue900};
}
}
`
const CoinBalanceSwitchable = styled.div`
display: flex;
justify-content: space-between;
`

const BalanceSkeleton = styled.div`
margin-top: 4px;
`
const CoinSkeletonWrapper = styled.div`
display: flex;
align-items: center;
Expand Down

0 comments on commit 421e39e

Please sign in to comment.