diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-05 10:24:10 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-05 10:24:10 +0800 |
commit | 1eb8d17ce36274093583069aab0025768a4a91ce (patch) | |
tree | 13ca27cc615ed28633e3513f1e7a5dde303c36a6 /packages/instant/src/containers | |
parent | c5084f023ac0356660b9480f9e1f477001a61284 (diff) | |
download | dexon-sol-tools-1eb8d17ce36274093583069aab0025768a4a91ce.tar dexon-sol-tools-1eb8d17ce36274093583069aab0025768a4a91ce.tar.gz dexon-sol-tools-1eb8d17ce36274093583069aab0025768a4a91ce.tar.bz2 dexon-sol-tools-1eb8d17ce36274093583069aab0025768a4a91ce.tar.lz dexon-sol-tools-1eb8d17ce36274093583069aab0025768a4a91ce.tar.xz dexon-sol-tools-1eb8d17ce36274093583069aab0025768a4a91ce.tar.zst dexon-sol-tools-1eb8d17ce36274093583069aab0025768a4a91ce.zip |
Create SelectedAssetInputAmount
Diffstat (limited to 'packages/instant/src/containers')
-rw-r--r-- | packages/instant/src/containers/selected_asset_amount_input.tsx | 36 |
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..f5e1e134a --- /dev/null +++ b/packages/instant/src/containers/selected_asset_amount_input.tsx @@ -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 { Dispatch } from 'redux'; + +import { State } from '../redux/reducer'; +import { ColorOption } from '../style/theme'; +import { Action, ActionTypes } from '../types'; + +import { AmountInput, AmountInputProps } 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)( + AmountInput, +); |