Browse Source
Merge pull request #698 from gre/no-rounding-in-critical-parts
Disable balance rounding where it's important (where enough space)
master
Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
21 additions and
4 deletions
-
src/components/AccountPage/index.js
-
src/components/BalanceSummary/BalanceInfos.js
-
src/components/SelectAccount/index.js
-
src/components/modals/OperationDetails.js
|
@ -150,12 +150,14 @@ class AccountPage extends PureComponent<Props> { |
|
|
<Box flow={4} mb={2}> |
|
|
<Box flow={4} mb={2}> |
|
|
<Box horizontal> |
|
|
<Box horizontal> |
|
|
<BalanceTotal |
|
|
<BalanceTotal |
|
|
|
|
|
showCryptoEvenIfNotAvailable |
|
|
isAvailable={isAvailable} |
|
|
isAvailable={isAvailable} |
|
|
totalBalance={account.balance} |
|
|
totalBalance={account.balance} |
|
|
unit={account.unit} |
|
|
unit={account.unit} |
|
|
> |
|
|
> |
|
|
<FormattedVal |
|
|
<FormattedVal |
|
|
animateTicker |
|
|
animateTicker |
|
|
|
|
|
disableRounding |
|
|
alwaysShowSign={false} |
|
|
alwaysShowSign={false} |
|
|
color="warmGrey" |
|
|
color="warmGrey" |
|
|
unit={counterValue.units[0]} |
|
|
unit={counterValue.units[0]} |
|
|
|
@ -32,6 +32,7 @@ type BalanceTotalProps = { |
|
|
unit: Unit, |
|
|
unit: Unit, |
|
|
isAvailable: boolean, |
|
|
isAvailable: boolean, |
|
|
totalBalance: number, |
|
|
totalBalance: number, |
|
|
|
|
|
showCryptoEvenIfNotAvailable?: boolean, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
type Props = { |
|
|
type Props = { |
|
@ -90,10 +91,10 @@ export function BalanceSinceDiff(props: Props) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export function BalanceTotal(props: BalanceTotalProps) { |
|
|
export function BalanceTotal(props: BalanceTotalProps) { |
|
|
const { unit, totalBalance, isAvailable, children } = props |
|
|
const { unit, totalBalance, isAvailable, showCryptoEvenIfNotAvailable, children } = props |
|
|
return ( |
|
|
return ( |
|
|
<Box grow {...props}> |
|
|
<Box grow {...props}> |
|
|
{!isAvailable ? ( |
|
|
{!isAvailable && !showCryptoEvenIfNotAvailable ? ( |
|
|
<PlaceholderLine width={150} /> |
|
|
<PlaceholderLine width={150} /> |
|
|
) : ( |
|
|
) : ( |
|
|
<FormattedVal |
|
|
<FormattedVal |
|
@ -101,6 +102,7 @@ export function BalanceTotal(props: BalanceTotalProps) { |
|
|
color="dark" |
|
|
color="dark" |
|
|
unit={unit} |
|
|
unit={unit} |
|
|
fontSize={8} |
|
|
fontSize={8} |
|
|
|
|
|
disableRounding |
|
|
showCode |
|
|
showCode |
|
|
val={totalBalance} |
|
|
val={totalBalance} |
|
|
/> |
|
|
/> |
|
|
|
@ -43,7 +43,13 @@ const renderOption = a => { |
|
|
</Text> |
|
|
</Text> |
|
|
</Box> |
|
|
</Box> |
|
|
<Box> |
|
|
<Box> |
|
|
<FormattedVal color="grey" val={account.balance} unit={account.unit} showCode /> |
|
|
<FormattedVal |
|
|
|
|
|
color="grey" |
|
|
|
|
|
val={account.balance} |
|
|
|
|
|
unit={account.unit} |
|
|
|
|
|
showCode |
|
|
|
|
|
disableRounding |
|
|
|
|
|
/> |
|
|
</Box> |
|
|
</Box> |
|
|
</Box> |
|
|
</Box> |
|
|
) |
|
|
) |
|
|
|
@ -126,7 +126,14 @@ const OperationDetails = connect(mapStateToProps)((props: Props) => { |
|
|
/> |
|
|
/> |
|
|
<Box my={4} alignItems="center"> |
|
|
<Box my={4} alignItems="center"> |
|
|
<Box> |
|
|
<Box> |
|
|
<FormattedVal unit={unit} alwaysShowSign showCode val={amount} fontSize={7} /> |
|
|
<FormattedVal |
|
|
|
|
|
unit={unit} |
|
|
|
|
|
alwaysShowSign |
|
|
|
|
|
showCode |
|
|
|
|
|
val={amount} |
|
|
|
|
|
fontSize={7} |
|
|
|
|
|
disableRounding |
|
|
|
|
|
/> |
|
|
</Box> |
|
|
</Box> |
|
|
<Box mt={1}> |
|
|
<Box mt={1}> |
|
|
<CounterValue |
|
|
<CounterValue |
|
|