aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/containers
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-25 07:02:21 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-25 07:02:21 +0800
commit9c81692d48fed4942fe6482949d6eed3629d4037 (patch)
treeaefc2a71dcfce2589c1e8505e6b64f2e6c9a9dfe /packages/website/ts/containers
parentc505ba6f3e05f4bb415f50352fbb124fec3a71ad (diff)
parentfac90c446cc3a79ffe57ae13c685e7555714cf23 (diff)
downloaddexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar.gz
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar.bz2
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar.lz
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar.xz
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.tar.zst
dexon-sol-tools-9c81692d48fed4942fe6482949d6eed3629d4037.zip
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/upgrade-allowance-toggles-to-locks-and-checks
Diffstat (limited to 'packages/website/ts/containers')
-rw-r--r--packages/website/ts/containers/inputs/eth_amount_input.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/packages/website/ts/containers/inputs/eth_amount_input.ts b/packages/website/ts/containers/inputs/eth_amount_input.ts
new file mode 100644
index 000000000..9ef903b55
--- /dev/null
+++ b/packages/website/ts/containers/inputs/eth_amount_input.ts
@@ -0,0 +1,36 @@
+import { BigNumber } from '@0xproject/utils';
+import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { State } from 'ts/redux/reducer';
+import { ValidatedBigNumberCallback } from 'ts/types';
+import { constants } from 'ts/utils/constants';
+
+import { EthAmountInput as EthAmountInputComponent } from 'ts/components/inputs/eth_amount_input';
+
+interface EthAmountInputProps {
+ label?: string;
+ amount?: BigNumber;
+ hintText?: string;
+ onChange: ValidatedBigNumberCallback;
+ onErrorMsgChange?: (errorMsg: React.ReactNode) => void;
+ shouldShowIncompleteErrs: boolean;
+ shouldCheckBalance: boolean;
+ shouldShowErrs?: boolean;
+ shouldShowUnderline?: boolean;
+ style?: React.CSSProperties;
+ labelStyle?: React.CSSProperties;
+ inputHintStyle?: React.CSSProperties;
+}
+
+interface ConnectedState {
+ balance: BigNumber;
+}
+
+const mapStateToProps = (state: State, _ownProps: EthAmountInputProps): ConnectedState => ({
+ balance: Web3Wrapper.toUnitAmount(state.userEtherBalanceInWei, constants.DECIMAL_PLACES_ETH),
+});
+
+export const EthAmountInput: React.ComponentClass<EthAmountInputProps> = connect(mapStateToProps)(
+ EthAmountInputComponent,
+);