MyCrypto/common/components/BalanceSidebar/EquivalentValues.jsx
William O'Beirne 8854d42fd9 Sidebar refactor / style update (#173)
* Convert bootstrap to sass instead of checked in and less

* Darken body, adjust header.

* First pass at tab styles, each tab will need a lot of individual love tho.

* Update footer to main site content, improve responsiveness.

* Missing key added.

* Fix dropdowns.

* Convert GenerateWallet HTML over, still needs styling.

* Send form.

* Current rates styled.

* CurrencySwap form styles.

* SwapInfoHeader styled.

* Finish up swap restyling, minor usability improvements for mobile.

* Fix up notifications / alert customizations

* Import v3 variables.

* Fix notification spacing.

* Align input height base with buttons.

* Revert height base, add additional bootstrap overrides.

* Grid overrides.

* Move overrides to their own folder. Adjust naming.

* Fix inconsistencies.

* Style generate wallet pt 1.

* Style generate wallet pt 2

* Style generate wallet pt 3

* Fix swap

* Added some missing overries, fixed the fallout.

* Remove header text, indicate alpha version.

* Fix radio / checkbox weights.

* Bind => arrow

* Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown.

* Fix token balances buttons, footr icons.

* Break out files, style up account info.

* Style up token balances.

* Equivalent values styling.

* Sidebar promos.

* Fix up delete button and add custom form.

* Even spacing.

* Unlog

* Convert Big types to Ether types

* Fix test to expect Ether instead of Big
2017-09-08 14:26:51 -05:00

48 lines
1.3 KiB
JavaScript

// @flow
import './EquivalentValues.scss';
import React from 'react';
import translate from 'translations';
import { Link } from 'react-router';
import { formatNumber } from 'utils/formatters';
import type Big from 'bignumber.js';
import { Ether } from 'libs/units';
const ratesKeys = ['BTC', 'REP', 'EUR', 'USD', 'GBP', 'CHF'];
type Props = {
balance: Ether,
rates: { [string]: number }
};
export default class EquivalentValues extends React.Component {
props: Props;
render() {
const { balance, rates } = this.props;
return (
<div className="EquivalentValues">
<h5 className="EquivalentValues-title">
{translate('sidebar_Equiv')}
</h5>
<ul className="EquivalentValues-values">
{ratesKeys.map(key => {
if (!rates[key]) return null;
return (
<li className="EquivalentValues-values-currency" key={key}>
<span className="EquivalentValues-values-currency-label">
{key}:
</span>
<span className="EquivalentValues-values-currency-value">
{' '}{formatNumber(balance.amount.times(rates[key]))}
</span>
</li>
);
})}
</ul>
</div>
);
}
}