diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-06 17:10:27 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-06 17:10:27 +0800 |
commit | cbfed99bc6f9c86dee2dc31cafe401ded0fc9084 (patch) | |
tree | 6a1608b6fca9366f6b407e8a2cf746a79b86858b /packages/website/ts/components/wallet/wallet.tsx | |
parent | 05b9dfbe30c55a67e6d2d63898f52e5fa412fcfb (diff) | |
parent | 39570a9663abae56b0220745306386197fae65c1 (diff) | |
download | dexon-0x-contracts-cbfed99bc6f9c86dee2dc31cafe401ded0fc9084.tar dexon-0x-contracts-cbfed99bc6f9c86dee2dc31cafe401ded0fc9084.tar.gz dexon-0x-contracts-cbfed99bc6f9c86dee2dc31cafe401ded0fc9084.tar.bz2 dexon-0x-contracts-cbfed99bc6f9c86dee2dc31cafe401ded0fc9084.tar.lz dexon-0x-contracts-cbfed99bc6f9c86dee2dc31cafe401ded0fc9084.tar.xz dexon-0x-contracts-cbfed99bc6f9c86dee2dc31cafe401ded0fc9084.tar.zst dexon-0x-contracts-cbfed99bc6f9c86dee2dc31cafe401ded0fc9084.zip |
Merge branch 'v2-prototype' into fixes/misc-small-fixes
* v2-prototype:
Remove TranslatedText
Fix prettier
Add back UMD bundles for 0x.js
Move portal disclaimer to the account management section
Move prices into portal
Use stricter check for subscribe input text
Make buttons stack on mobile
Do not show subscribe form if language is not english
Address PR feedback
Lint and cleanup
Implement subscription form
Add styled-components and polished
Have basic newsletter subscribe form working
Diffstat (limited to 'packages/website/ts/components/wallet/wallet.tsx')
-rw-r--r-- | packages/website/ts/components/wallet/wallet.tsx | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/packages/website/ts/components/wallet/wallet.tsx b/packages/website/ts/components/wallet/wallet.tsx index 7059ca350..37233930e 100644 --- a/packages/website/ts/components/wallet/wallet.tsx +++ b/packages/website/ts/components/wallet/wallet.tsx @@ -32,10 +32,11 @@ import { TokenIcon } from 'ts/components/ui/token_icon'; import { WalletDisconnectedItem } from 'ts/components/wallet/wallet_disconnected_item'; import { WrapEtherItem } from 'ts/components/wallet/wrap_ether_item'; import { Dispatcher } from 'ts/redux/dispatcher'; +import { colors } from 'ts/style/colors'; +import { zIndex } from 'ts/style/z_index'; import { BalanceErrs, BlockchainErrs, - ItemByAddress, ProviderType, ScreenWidths, Side, @@ -45,10 +46,7 @@ import { TokenStateByAddress, WebsitePaths, } from 'ts/types'; -import { backendClient } from 'ts/utils/backend_client'; -import { colors } from 'ts/utils/colors'; import { constants } from 'ts/utils/constants'; -import { zIndex } from 'ts/utils/style'; import { utils } from 'ts/utils/utils'; import { styles as walletItemStyles } from 'ts/utils/wallet_item_styles'; @@ -523,34 +521,6 @@ export class Wallet extends React.Component<WalletProps, WalletState> { }); return trackedTokenStateByAddress; } - - private async _getPriceByAddressAsync(tokenAddresses: string[]): Promise<ItemByAddress<BigNumber>> { - if (_.isEmpty(tokenAddresses)) { - return {}; - } - // for each input token address, search for the corresponding symbol in this.props.tokenByAddress, if it exists - // create a mapping from existing symbols -> address - const tokenAddressBySymbol: { [symbol: string]: string } = {}; - _.each(tokenAddresses, address => { - const tokenIfExists = _.get(this.props.tokenByAddress, address); - if (!_.isUndefined(tokenIfExists)) { - const symbol = tokenIfExists.symbol; - tokenAddressBySymbol[symbol] = address; - } - }); - const tokenSymbols = _.keys(tokenAddressBySymbol); - try { - const priceBySymbol = await backendClient.getPriceInfoAsync(tokenSymbols); - const priceByAddress = _.mapKeys(priceBySymbol, (value, symbol) => _.get(tokenAddressBySymbol, symbol)); - const result = _.mapValues(priceByAddress, price => { - const priceBigNumber = new BigNumber(price); - return priceBigNumber; - }); - return result; - } catch (err) { - return {}; - } - } private _openWrappedEtherActionRow(wrappedEtherDirection: Side): void { this.setState({ wrappedEtherDirection, |