aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/inputs/balance_bounded_input.tsx
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2018-02-05 19:33:40 +0800
committerGitHub <noreply@github.com>2018-02-05 19:33:40 +0800
commit7b4f2b47de393b7ed6d5c264c8e80864d196180c (patch)
tree8e86af8000e0aedd7241a00c2189d8f7ca0fc2ad /packages/website/ts/components/inputs/balance_bounded_input.tsx
parent400a97e7a8f76d894d47368425bbe1e33fa5b255 (diff)
parentc7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8 (diff)
downloaddexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar
dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.gz
dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.bz2
dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.lz
dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.xz
dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.zst
dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.zip
Merge branch 'development' into fix/ether_token_address
Diffstat (limited to 'packages/website/ts/components/inputs/balance_bounded_input.tsx')
-rw-r--r--packages/website/ts/components/inputs/balance_bounded_input.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/website/ts/components/inputs/balance_bounded_input.tsx b/packages/website/ts/components/inputs/balance_bounded_input.tsx
index ddc434b51..3bbc7a5f6 100644
--- a/packages/website/ts/components/inputs/balance_bounded_input.tsx
+++ b/packages/website/ts/components/inputs/balance_bounded_input.tsx
@@ -18,6 +18,7 @@ interface BalanceBoundedInputProps {
validate?: (amount: BigNumber) => InputErrMsg;
onVisitBalancesPageClick?: () => void;
shouldHideVisitBalancesLink?: boolean;
+ isDisabled?: boolean;
}
interface BalanceBoundedInputState {
@@ -29,6 +30,7 @@ export class BalanceBoundedInput extends React.Component<BalanceBoundedInputProp
public static defaultProps: Partial<BalanceBoundedInputProps> = {
shouldShowIncompleteErrs: false,
shouldHideVisitBalancesLink: false,
+ isDisabled: false,
};
constructor(props: BalanceBoundedInputProps) {
super(props);
@@ -88,6 +90,7 @@ export class BalanceBoundedInput extends React.Component<BalanceBoundedInputProp
hintText={<span style={{ textTransform: 'capitalize' }}>amount</span>}
onChange={this._onValueChange.bind(this)}
underlineStyle={{ width: 'calc(100% + 50px)' }}
+ disabled={this.props.isDisabled}
/>
);
}
@@ -100,7 +103,7 @@ export class BalanceBoundedInput extends React.Component<BalanceBoundedInputProp
},
() => {
const isValid = _.isUndefined(errMsg);
- if (utils.isNumeric(amountString)) {
+ if (utils.isNumeric(amountString) && !_.includes(amountString, '-')) {
this.props.onChange(isValid, new BigNumber(amountString));
} else {
this.props.onChange(isValid);