diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-22 06:14:27 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-22 06:14:27 +0800 |
commit | 0adc8f5053894de7df85aacb6a8bf8714f989f0a (patch) | |
tree | 24ddf4531ef472739b276711a4b85e9a3017b156 /packages/instant/src/components | |
parent | eca63b1a5815c61901453837f9c2b737fa82eb20 (diff) | |
parent | f46a49fd13c88dd86c9661d76bace18844642c04 (diff) | |
download | dexon-sol-tools-0adc8f5053894de7df85aacb6a8bf8714f989f0a.tar dexon-sol-tools-0adc8f5053894de7df85aacb6a8bf8714f989f0a.tar.gz dexon-sol-tools-0adc8f5053894de7df85aacb6a8bf8714f989f0a.tar.bz2 dexon-sol-tools-0adc8f5053894de7df85aacb6a8bf8714f989f0a.tar.lz dexon-sol-tools-0adc8f5053894de7df85aacb6a8bf8714f989f0a.tar.xz dexon-sol-tools-0adc8f5053894de7df85aacb6a8bf8714f989f0a.tar.zst dexon-sol-tools-0adc8f5053894de7df85aacb6a8bf8714f989f0a.zip |
Merge branch 'development' into feature/header-tweaks
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r-- | packages/instant/src/components/erc20_asset_amount_input.tsx | 12 | ||||
-rw-r--r-- | packages/instant/src/components/zero_ex_instant_provider.tsx | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index ab8c019c7..0706833d2 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} @@ -75,11 +77,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 9435d8c7c..9814aabf8 100644 --- a/packages/instant/src/components/zero_ex_instant_provider.tsx +++ b/packages/instant/src/components/zero_ex_instant_provider.tsx @@ -20,8 +20,6 @@ import { Heartbeater } from '../util/heartbeater'; import { generateAccountHeartbeater, generateBuyQuoteHeartbeater } from '../util/heartbeater_factory'; import { providerStateFactory } from '../util/provider_state_factory'; -fonts.include(); - export type ZeroExInstantProviderProps = ZeroExInstantProviderRequiredProps & Partial<ZeroExInstantProviderOptionalProps>; @@ -88,6 +86,7 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider } constructor(props: ZeroExInstantProviderProps) { super(props); + fonts.include(); const initialAppState = ZeroExInstantProvider._mergeDefaultStateWithProps(this.props); this._store = store.create(initialAppState); } |