Skip to content

Commit

Permalink
chore(balances): remove unused large prop (#6293)
Browse files Browse the repository at this point in the history
  • Loading branch information
mperdomo-bc committed Feb 16, 2024
1 parent 11179a1 commit 0608eb8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LoadingBalance } from '../../model'
import Error from './template.error'
import Success from './template.success'

const Balance = ({ coin, coinTicker, large }: Props) => {
const Balance = ({ coin, coinTicker }: Props) => {
const dispatch = useDispatch()
const { data, hasError, isLoading, isNotAsked } = useRemote(
selectors.balances.getCoinTotalBalance(coin)
Expand All @@ -24,18 +24,17 @@ const Balance = ({ coin, coinTicker, large }: Props) => {
}

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

if (hasError) return <Error onRefresh={handleRefresh} />

return <Success balance={data} large={large} coin={coin} coinTicker={coinTicker} />
return <Success balance={data} coin={coin} coinTicker={coinTicker} />
}

export type Props = {
coin: CoinType
coinTicker: string
large?: boolean
}

export default Balance
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import React from 'react'
import { CoinBalanceWrapper } from '../../model'
import { Props as OwnProps } from '.'

const Success = ({ balance, coin, coinTicker, large }: Props) => {
const Success = ({ balance, coin, coinTicker }: Props) => {
return (
<div data-e2e={`balanceDropdown-wallet-${coin}`}>
<CoinBalanceWrapper balance={balance} coin={coin} coinTicker={coinTicker} large={large} />
<CoinBalanceWrapper balance={balance} coin={coin} coinTicker={coinTicker} />
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,9 @@ type Props = {
balance: number
coin: string
coinTicker: string
large: boolean
}

export const CoinBalanceWrapper = ({ balance, coin, coinTicker, large }: Props) => {
if (large) {
return (
<CoinBalanceMain>
<CoinDisplay coin={coin} cursor='pointer' mobileSize='14px' size='18px' weight={400}>
{balance}
</CoinDisplay>
<FiatDisplay coin={coin} cursor='pointer' mobileSize='14px' size='18px' weight={400}>
{balance}
</FiatDisplay>
</CoinBalanceMain>
)
}
export const CoinBalanceWrapper = ({ balance, coin, coinTicker }: Props) => {
return (
<LinkContainer to={`/coins/${coin}`}>
<CoinBalanceSwitchable>
Expand All @@ -81,14 +68,7 @@ export const CoinBalanceWrapper = ({ balance, coin, coinTicker, large }: Props)
)
}

export const LoadingBalance = ({ coinTicker, large }: Pick<Props, 'coinTicker' | 'large'>) => {
if (large) {
return (
<BalanceSkeleton>
<SkeletonRectangle width='170px' height='12px' />
</BalanceSkeleton>
)
}
export const LoadingBalance = ({ coinTicker }: { coinTicker: string }) => {
return (
<CoinSkeletonWrapper>
<Text size='12px' weight={600} color='grey800'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react'
import { connect, ConnectedProps } from 'react-redux'
import { withRouter } from 'react-router-dom'
import { lift } from 'ramda'
import { bindActionCreators } from 'redux'

import { ExtractSuccess, InvitationsType } from '@core/types'
import { InvitationsType } from '@core/types'
import { actions, selectors } from 'data'
import { RootState } from 'data/rootReducer'

Expand Down

0 comments on commit 0608eb8

Please sign in to comment.