// @flow import React, { Component } from 'react'; import translate from 'translations'; import { toFixedIfLarger } from 'utils/formatters'; import type { Pairs } from 'actions/swap'; import { bityReferralURL } from 'config/data'; import bityLogoWhite from 'assets/images/logo-bity-white.svg'; export default class CurrentRates extends Component { props: Pairs; state = { ETHBTCAmount: 1, ETHREPAmount: 1, BTCETHAmount: 1, BTCREPAmount: 1 }; onChange = (event: SyntheticInputEvent) => { const target = event.target; const value = target.value; const name = target.name; this.setState({ [name]: value }); }; render() { const { ETHBTC, ETHREP, BTCETH, BTCREP } = this.props; return (
{translate('SWAP_rates')}

{` ETH = ${toFixedIfLarger( this.state.ETHBTCAmount * ETHBTC, 6 )} BTC`}

{` ETH = ${toFixedIfLarger( this.state.ETHREPAmount * ETHREP, 6 )} REP`}

{` BTC = ${toFixedIfLarger( this.state.BTCETHAmount * BTCETH, 6 )} ETH`}

{` BTC = ${toFixedIfLarger( this.state.BTCREPAmount * BTCREP, 6 )} REP`}

); } }