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 19:26:51 +00:00
|
|
|
// @flow
|
|
|
|
import './EquivalentValues.scss';
|
|
|
|
import React from 'react';
|
|
|
|
import translate from 'translations';
|
|
|
|
import { formatNumber } from 'utils/formatters';
|
|
|
|
import { Ether } from 'libs/units';
|
|
|
|
|
|
|
|
const ratesKeys = ['BTC', 'REP', 'EUR', 'USD', 'GBP', 'CHF'];
|
|
|
|
|
|
|
|
type Props = {
|
2017-09-12 22:15:23 +00:00
|
|
|
balance: ?Ether,
|
|
|
|
rates: ?{ [string]: number }
|
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 19:26:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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">
|
2017-09-12 22:15:23 +00:00
|
|
|
{rates
|
|
|
|
? 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">
|
|
|
|
{' '}{balance
|
|
|
|
? formatNumber(balance.amount.times(rates[key]))
|
|
|
|
: '???'}
|
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
);
|
|
|
|
})
|
|
|
|
: <h5>No rates were loaded.</h5>}
|
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 19:26:51 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|