btc: round denominated amounts on invoice and sent screens

This commit is contained in:
pkova 2021-04-22 16:53:13 +03:00 committed by ixv
parent 89b7a24109
commit a740b7ea1f
4 changed files with 12 additions and 6 deletions

View File

@ -61,6 +61,7 @@ export default class Balance extends Component {
<Send
api={api}
psbt={this.props.state.psbt}
currencyRates={this.props.state.currencyRates}
shipWallets={this.props.state.shipWallets}
value={value}
denomination={denomination}

View File

@ -15,6 +15,8 @@ import * as bip39 from 'bip39';
import Sent from './sent.js'
import { satsToCurrency } from '../../lib/util.js';
window.bitcoin = bitcoin;
window.kg = kg;
window.bip39 = bip39;
@ -73,7 +75,7 @@ export default class Invoice extends Component {
}
render() {
const { stopSending, payee, denomination, denomAmount, satsAmount, psbt } = this.props;
const { stopSending, payee, denomination, satsAmount, psbt, currencyRates } = this.props;
const { sent } = this.state;
return (
<>
@ -82,7 +84,7 @@ export default class Invoice extends Component {
payee={payee}
stopSending={stopSending}
denomination={denomination}
denomAmount={denomAmount}
currencyRates={currencyRates}
satsAmount={satsAmount}
/> :
<Col
@ -121,7 +123,7 @@ export default class Invoice extends Component {
<Text
color='green'
fontSize='14px'
>{`$${denomAmount} ${denomination}`}</Text>
>{satsToCurrency(satsAmount, denomination, currencyRates)}</Text>
<Text
ml={2}
fontSize='14px'

View File

@ -94,6 +94,7 @@ export default class Send extends Component {
render() {
const { api, value, conversion, stopSending, denomination, psbt } = this.props;
const { api, value, conversion, stopSending, denomination, psbt, currencyRates } = this.props;
const { denomAmount, satsAmount, signing, payee } = this.state;
return (
@ -102,10 +103,10 @@ export default class Send extends Component {
<Invoice
api={api}
psbt={psbt}
currencyRates={currencyRates}
stopSending={stopSending}
payee={payee}
denomination={denomination}
denomAmount={denomAmount}
satsAmount={satsAmount}
/> :
<Col

View File

@ -10,8 +10,10 @@ import {
Col,
} from '@tlon/indigo-react';
import { satsToCurrency } from '../../lib/util.js';
export default function Sent(props) {
const { payee, denomination, denomAmount, satsAmount, stopSending } = props;
const { payee, denomination, satsAmount, stopSending, currencyRates } = props;
return (
<Col
height='400px'
@ -42,7 +44,7 @@ export default function Sent(props) {
color='white'
fontSize='52px'
>
{`$${denomAmount}`}
{satsToCurrency(satsAmount, denomination, currencyRates)}
</Text>
<Text
color='white'