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
parent
commit
246881ccd4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/components/AccountPage/index.js
  2. 6
      src/components/BalanceSummary/BalanceInfos.js
  3. 8
      src/components/SelectAccount/index.js
  4. 9
      src/components/modals/OperationDetails.js

2
src/components/AccountPage/index.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]}

6
src/components/BalanceSummary/BalanceInfos.js

@ -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}
/> />

8
src/components/SelectAccount/index.js

@ -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>
) )

9
src/components/modals/OperationDetails.js

@ -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

Loading…
Cancel
Save