aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers/selected_asset_amount_input.tsx
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-11 20:25:47 +0800
committerFabio Berger <me@fabioberger.com>2018-10-11 20:25:47 +0800
commit295a8c760a6d5b567a12d6a2d83ae73021ea343c (patch)
treefaf6810a6b5b810869e36c20641fd4fe25e03ddb /packages/instant/src/containers/selected_asset_amount_input.tsx
parent9b147f14955c5f6a0b38e03ae30ac13b1be183d1 (diff)
parent1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4 (diff)
downloaddexon-0x-contracts-295a8c760a6d5b567a12d6a2d83ae73021ea343c.tar.gz
dexon-0x-contracts-295a8c760a6d5b567a12d6a2d83ae73021ea343c.tar.zst
dexon-0x-contracts-295a8c760a6d5b567a12d6a2d83ae73021ea343c.zip
merge dev-section-redesign
Diffstat (limited to 'packages/instant/src/containers/selected_asset_amount_input.tsx')
-rw-r--r--packages/instant/src/containers/selected_asset_amount_input.tsx36
1 files changed, 36 insertions, 0 deletions
diff --git a/packages/instant/src/containers/selected_asset_amount_input.tsx b/packages/instant/src/containers/selected_asset_amount_input.tsx
new file mode 100644
index 000000000..800a4c568
--- /dev/null
+++ b/packages/instant/src/containers/selected_asset_amount_input.tsx
@@ -0,0 +1,36 @@
+import { BigNumber } from '@0xproject/utils';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+
+import { State } from '../redux/reducer';
+import { ColorOption } from '../style/theme';
+import { Action, ActionTypes } from '../types';
+
+import { AmountInput } from '../components/amount_input';
+
+export interface SelectedAssetAmountInputProps {
+ fontColor?: ColorOption;
+ fontSize?: string;
+}
+
+interface ConnectedState {
+ value?: BigNumber;
+}
+
+interface ConnectedDispatch {
+ onChange?: (value?: BigNumber) => void;
+}
+
+const mapStateToProps = (state: State, _ownProps: SelectedAssetAmountInputProps): ConnectedState => ({
+ value: state.selectedAssetAmount,
+});
+
+const mapDispatchToProps = (dispatch: Dispatch<Action>): ConnectedDispatch => ({
+ onChange: value => dispatch({ type: ActionTypes.UPDATE_SELECTED_ASSET_AMOUNT, data: value }),
+});
+
+export const SelectedAssetAmountInput: React.ComponentClass<SelectedAssetAmountInputProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(AmountInput);