diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-27 04:46:14 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-27 04:46:14 +0800 |
commit | 1880c34ce066a8e33047690ef9fb90393100abd9 (patch) | |
tree | c6facf128bb4af4eadd3b45023b0de209e7d847a /packages/instant/src/components/erc20_asset_amount_input.tsx | |
parent | af91a56a5594d07d7da6caaeff79f5a7fb31ff98 (diff) | |
download | dexon-0x-contracts-1880c34ce066a8e33047690ef9fb90393100abd9.tar.gz dexon-0x-contracts-1880c34ce066a8e33047690ef9fb90393100abd9.tar.zst dexon-0x-contracts-1880c34ce066a8e33047690ef9fb90393100abd9.zip |
feat(instant): Disable input when processing
Diffstat (limited to 'packages/instant/src/components/erc20_asset_amount_input.tsx')
-rw-r--r-- | packages/instant/src/components/erc20_asset_amount_input.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index 583fad28b..9b32827e7 100644 --- a/packages/instant/src/components/erc20_asset_amount_input.tsx +++ b/packages/instant/src/components/erc20_asset_amount_input.tsx @@ -17,6 +17,7 @@ export interface ERC20AssetAmountInputProps { onChange: (value?: BigNumberInput, asset?: ERC20Asset) => void; startingFontSizePx: number; fontColor?: ColorOption; + disabled: boolean; } export interface ERC20AssetAmountInputState { @@ -26,6 +27,7 @@ export interface ERC20AssetAmountInputState { export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInputProps, ERC20AssetAmountInputState> { public static defaultProps = { onChange: util.boundNoop, + disabled: false, }; constructor(props: ERC20AssetAmountInputProps) { super(props); @@ -35,9 +37,10 @@ export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInput } public render(): React.ReactNode { const { asset, onChange, ...rest } = this.props; + const amountBorderBottom = this.props.disabled ? '' : `1px solid ${transparentWhite}`; return ( <Container whiteSpace="nowrap"> - <Container borderBottom={`1px solid ${transparentWhite}`} display="inline-block"> + <Container borderBottom={amountBorderBottom} display="inline-block"> <ScalingAmountInput {...rest} textLengthThreshold={this._textLengthThresholdForAsset(asset)} |