aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/erc20_asset_amount_input.tsx
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-12-04 08:36:27 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-12-04 08:36:27 +0800
commite592b27f771839fecd718c21fc1045c695a14f85 (patch)
treebc75f3f64681b582cb86360062dbc6f167343ac3 /packages/instant/src/components/erc20_asset_amount_input.tsx
parent2601d16efbb1e85eadca459e5dc64e78099e738a (diff)
downloaddexon-sol-tools-e592b27f771839fecd718c21fc1045c695a14f85.tar.gz
dexon-sol-tools-e592b27f771839fecd718c21fc1045c695a14f85.tar.zst
dexon-sol-tools-e592b27f771839fecd718c21fc1045c695a14f85.zip
fix(instant): render token selector when only one asset is available
Diffstat (limited to 'packages/instant/src/components/erc20_asset_amount_input.tsx')
-rw-r--r--packages/instant/src/components/erc20_asset_amount_input.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx
index ff900842a..4da82eb73 100644
--- a/packages/instant/src/components/erc20_asset_amount_input.tsx
+++ b/packages/instant/src/components/erc20_asset_amount_input.tsx
@@ -113,7 +113,7 @@ export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInput
);
};
private readonly _renderChevronIcon = (): React.ReactNode => {
- if (!this._areMultipleAssetsAvailable()) {
+ if (!this._areAnyAssetsAvailable()) {
return null;
}
return (
@@ -134,14 +134,14 @@ export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInput
// We don't want to allow opening the token selection panel if there are no assets.
// Since styles are inferred from the presence of a click handler, we want to return undefined
// instead of providing a noop.
- if (!this._areMultipleAssetsAvailable() || _.isUndefined(this.props.onSelectAssetClick)) {
+ if (!this._areAnyAssetsAvailable() || _.isUndefined(this.props.onSelectAssetClick)) {
return undefined;
}
return this._handleSelectAssetClick;
};
- private readonly _areMultipleAssetsAvailable = (): boolean => {
+ private readonly _areAnyAssetsAvailable = (): boolean => {
const { numberOfAssetsAvailable } = this.props;
- return !_.isUndefined(numberOfAssetsAvailable) && numberOfAssetsAvailable > 1;
+ return !_.isUndefined(numberOfAssetsAvailable) && numberOfAssetsAvailable > 0;
};
private readonly _handleSelectAssetClick = (): void => {
if (this.props.onSelectAssetClick) {