Browse Source

Disable balance rounding where it's important (where enough space)

master
Gaëtan Renaudeau 7 years ago
parent
commit
4319c1b421
  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 horizontal>
<BalanceTotal
showCryptoEvenIfNotAvailable
isAvailable={isAvailable}
totalBalance={account.balance}
unit={account.unit}
>
<FormattedVal
animateTicker
disableRounding
alwaysShowSign={false}
color="warmGrey"
unit={counterValue.units[0]}

6
src/components/BalanceSummary/BalanceInfos.js

@ -32,6 +32,7 @@ type BalanceTotalProps = {
unit: Unit,
isAvailable: boolean,
totalBalance: number,
showCryptoEvenIfNotAvailable?: boolean,
}
type Props = {
@ -90,10 +91,10 @@ export function BalanceSinceDiff(props: Props) {
}
export function BalanceTotal(props: BalanceTotalProps) {
const { unit, totalBalance, isAvailable, children } = props
const { unit, totalBalance, isAvailable, showCryptoEvenIfNotAvailable, children } = props
return (
<Box grow {...props}>
{!isAvailable ? (
{!isAvailable && !showCryptoEvenIfNotAvailable ? (
<PlaceholderLine width={150} />
) : (
<FormattedVal
@ -101,6 +102,7 @@ export function BalanceTotal(props: BalanceTotalProps) {
color="dark"
unit={unit}
fontSize={8}
disableRounding
showCode
val={totalBalance}
/>

8
src/components/SelectAccount/index.js

@ -43,7 +43,13 @@ const renderOption = a => {
</Text>
</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>
)

9
src/components/modals/OperationDetails.js

@ -126,7 +126,14 @@ const OperationDetails = connect(mapStateToProps)((props: Props) => {
/>
<Box my={4} alignItems="center">
<Box>
<FormattedVal unit={unit} alwaysShowSign showCode val={amount} fontSize={7} />
<FormattedVal
unit={unit}
alwaysShowSign
showCode
val={amount}
fontSize={7}
disableRounding
/>
</Box>
<Box mt={1}>
<CounterValue

Loading…
Cancel
Save