aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-22 02:47:31 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-22 02:47:31 +0800
commit921d9d7ed5a549878b3a9130a99b9cbe2ae11903 (patch)
treeee20d3005850619160e7dc985736e47813c4af68 /packages/instant/src/components
parentb2e1be5cfe373f7cdafd5bd9a0c3ec1ea1e5f1d5 (diff)
parent68c15de8908b1e8eb8f04d26301fec62ed2af1c1 (diff)
downloaddexon-sol-tools-921d9d7ed5a549878b3a9130a99b9cbe2ae11903.tar
dexon-sol-tools-921d9d7ed5a549878b3a9130a99b9cbe2ae11903.tar.gz
dexon-sol-tools-921d9d7ed5a549878b3a9130a99b9cbe2ae11903.tar.bz2
dexon-sol-tools-921d9d7ed5a549878b3a9130a99b9cbe2ae11903.tar.lz
dexon-sol-tools-921d9d7ed5a549878b3a9130a99b9cbe2ae11903.tar.xz
dexon-sol-tools-921d9d7ed5a549878b3a9130a99b9cbe2ae11903.tar.zst
dexon-sol-tools-921d9d7ed5a549878b3a9130a99b9cbe2ae11903.zip
Merge branch 'development' into feature/instant/rollbar-env
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r--packages/instant/src/components/erc20_asset_amount_input.tsx12
-rw-r--r--packages/instant/src/components/zero_ex_instant_provider.tsx5
2 files changed, 9 insertions, 8 deletions
diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx
index 520ac33d5..b825255c4 100644
--- a/packages/instant/src/components/erc20_asset_amount_input.tsx
+++ b/packages/instant/src/components/erc20_asset_amount_input.tsx
@@ -22,7 +22,8 @@ export interface ERC20AssetAmountInputProps {
onSelectAssetClick?: (asset?: ERC20Asset) => void;
startingFontSizePx: number;
fontColor?: ColorOption;
- isDisabled: boolean;
+ isInputDisabled: boolean;
+ canSelectOtherAsset: boolean;
numberOfAssetsAvailable?: number;
}
@@ -50,14 +51,15 @@ export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInput
);
}
private readonly _renderContentForAsset = (asset: ERC20Asset): React.ReactNode => {
- const { onChange, ...rest } = this.props;
- const amountBorderBottom = this.props.isDisabled ? '' : `1px solid ${transparentWhite}`;
+ const { onChange, isInputDisabled, ...rest } = this.props;
+ const amountBorderBottom = isInputDisabled ? '' : `1px solid ${transparentWhite}`;
const onSymbolClick = this._generateSelectAssetClickHandler();
return (
<React.Fragment>
<Container borderBottom={amountBorderBottom} display="inline-block">
<ScalingAmountInput
{...rest}
+ isDisabled={isInputDisabled}
textLengthThreshold={this._textLengthThresholdForAsset(asset)}
maxFontSizePx={this.props.startingFontSizePx}
onAmountChange={this._handleChange}
@@ -74,11 +76,11 @@ export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInput
fontSize={`${this.state.currentFontSizePx}px`}
fontColor={ColorOption.white}
textTransform="uppercase"
- onClick={onSymbolClick}
+ onClick={this.props.canSelectOtherAsset ? onSymbolClick : undefined}
>
{assetUtils.formattedSymbolForAsset(asset)}
</Text>
- {this._renderChevronIcon()}
+ {this.props.canSelectOtherAsset && this._renderChevronIcon()}
</Flex>
</Container>
</React.Fragment>
diff --git a/packages/instant/src/components/zero_ex_instant_provider.tsx b/packages/instant/src/components/zero_ex_instant_provider.tsx
index 00d3e95b2..1f53f2d96 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -21,9 +21,6 @@ import { Heartbeater } from '../util/heartbeater';
import { generateAccountHeartbeater, generateBuyQuoteHeartbeater } from '../util/heartbeater_factory';
import { providerStateFactory } from '../util/provider_state_factory';
-setupRollbar();
-fonts.include();
-
export type ZeroExInstantProviderProps = ZeroExInstantProviderRequiredProps &
Partial<ZeroExInstantProviderOptionalProps>;
@@ -90,6 +87,8 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
}
constructor(props: ZeroExInstantProviderProps) {
super(props);
+ setupRollbar();
+ fonts.include();
const initialAppState = ZeroExInstantProvider._mergeDefaultStateWithProps(this.props);
this._store = store.create(initialAppState);
}