aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/containers/inputs
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-19 21:57:00 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-19 21:57:00 +0800
commit52a6e6357b521e3e290103ba31ab91e9ede79d5c (patch)
tree648a8cd5eb98036b1ab069c0ee1fc738047d889e /packages/website/ts/containers/inputs
parentdead04dce8b26a09cb0b451711517bcb4dea182c (diff)
downloaddexon-sol-tools-52a6e6357b521e3e290103ba31ab91e9ede79d5c.tar
dexon-sol-tools-52a6e6357b521e3e290103ba31ab91e9ede79d5c.tar.gz
dexon-sol-tools-52a6e6357b521e3e290103ba31ab91e9ede79d5c.tar.bz2
dexon-sol-tools-52a6e6357b521e3e290103ba31ab91e9ede79d5c.tar.lz
dexon-sol-tools-52a6e6357b521e3e290103ba31ab91e9ede79d5c.tar.xz
dexon-sol-tools-52a6e6357b521e3e290103ba31ab91e9ede79d5c.tar.zst
dexon-sol-tools-52a6e6357b521e3e290103ba31ab91e9ede79d5c.zip
Add lifecycle messages
Diffstat (limited to 'packages/website/ts/containers/inputs')
-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,
+);