aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-12 06:55:32 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-12 06:55:32 +0800
commitee7d6fb3afad313fa699018c727c24db4f2024bd (patch)
tree3cc9a4401b1fe00de897fb354271c5f11d637c9a /packages/instant/src/components
parent286474ca767e955b4f7fca985d3864511fa4dfbb (diff)
downloaddexon-sol-tools-ee7d6fb3afad313fa699018c727c24db4f2024bd.tar
dexon-sol-tools-ee7d6fb3afad313fa699018c727c24db4f2024bd.tar.gz
dexon-sol-tools-ee7d6fb3afad313fa699018c727c24db4f2024bd.tar.bz2
dexon-sol-tools-ee7d6fb3afad313fa699018c727c24db4f2024bd.tar.lz
dexon-sol-tools-ee7d6fb3afad313fa699018c727c24db4f2024bd.tar.xz
dexon-sol-tools-ee7d6fb3afad313fa699018c727c24db4f2024bd.tar.zst
dexon-sol-tools-ee7d6fb3afad313fa699018c727c24db4f2024bd.zip
Show as 0 when selected
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r--packages/instant/src/components/order_details.tsx18
1 files changed, 11 insertions, 7 deletions
diff --git a/packages/instant/src/components/order_details.tsx b/packages/instant/src/components/order_details.tsx
index 2fcde5aa4..67090898e 100644
--- a/packages/instant/src/components/order_details.tsx
+++ b/packages/instant/src/components/order_details.tsx
@@ -3,10 +3,10 @@ import { BigNumber } from '@0x/utils';
import * as _ from 'lodash';
import * as React from 'react';
+import { DEFAULT_UNKOWN_ASSET_NAME } from '../constants';
import { ColorOption } from '../style/theme';
import { BaseCurrency } from '../types';
import { buyQuoteUtil } from '../util/buy_quote';
-import { format } from '../util/format';
import { AmountPlaceholder } from './amount_placeholder';
@@ -171,7 +171,7 @@ export interface TokenAmountRowProps {
numTokens?: BigNumber;
}
export class TokenAmountRow extends React.Component<TokenAmountRowProps> {
- public static DEFAULT_TEXT: string = 'Token Price';
+ public static DEFAULT_TEXT: string = 'Token Amount';
public render(): React.ReactNode {
return (
<OrderDetailsRow
@@ -182,11 +182,15 @@ export class TokenAmountRow extends React.Component<TokenAmountRowProps> {
);
}
private _labelText(): string {
- if (this.props.isLoading) {
- return TokenAmountRow.DEFAULT_TEXT;
- }
- const { numTokens, displayPricePerToken, assetName } = this.props;
- if (numTokens) {
+ const { displayPricePerToken, assetName } = this.props;
+
+ // Display as 0 if we have a selected asset
+ const numTokens =
+ assetName && assetName !== DEFAULT_UNKOWN_ASSET_NAME && _.isUndefined(this.props.numTokens)
+ ? 0
+ : this.props.numTokens;
+
+ if (!_.isUndefined(numTokens)) {
let numTokensWithSymbol = numTokens.toString();
if (assetName) {