You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.5 KiB
53 lines
1.5 KiB
7 years ago
|
import { connect } from 'react-redux'
|
||
7 years ago
|
import {
|
||
7 years ago
|
getAmountConversionRate,
|
||
7 years ago
|
getConversionRate,
|
||
7 years ago
|
getGasTotal,
|
||
7 years ago
|
getPrimaryCurrency,
|
||
7 years ago
|
getSelectedToken,
|
||
|
getSendAmount,
|
||
7 years ago
|
getSendFromBalance,
|
||
7 years ago
|
getTokenBalance,
|
||
7 years ago
|
} from '../../send.selectors'
|
||
7 years ago
|
import {
|
||
7 years ago
|
sendAmountIsInError,
|
||
7 years ago
|
} from './send-amount-row.selectors'
|
||
7 years ago
|
import { getAmountErrorObject, getGasFeeErrorObject } from '../../send.utils'
|
||
7 years ago
|
import {
|
||
7 years ago
|
setMaxModeTo,
|
||
7 years ago
|
updateSendAmount,
|
||
6 years ago
|
} from '../../../../store/actions'
|
||
7 years ago
|
import {
|
||
|
updateSendErrors,
|
||
6 years ago
|
} from '../../../../ducks/send/send.duck'
|
||
7 years ago
|
import SendAmountRow from './send-amount-row.component'
|
||
7 years ago
|
|
||
7 years ago
|
export default connect(mapStateToProps, mapDispatchToProps)(SendAmountRow)
|
||
7 years ago
|
|
||
|
function mapStateToProps (state) {
|
||
7 years ago
|
return {
|
||
|
amount: getSendAmount(state),
|
||
7 years ago
|
amountConversionRate: getAmountConversionRate(state),
|
||
7 years ago
|
balance: getSendFromBalance(state),
|
||
|
conversionRate: getConversionRate(state),
|
||
7 years ago
|
gasTotal: getGasTotal(state),
|
||
|
inError: sendAmountIsInError(state),
|
||
|
primaryCurrency: getPrimaryCurrency(state),
|
||
|
selectedToken: getSelectedToken(state),
|
||
|
tokenBalance: getTokenBalance(state),
|
||
7 years ago
|
}
|
||
7 years ago
|
}
|
||
|
|
||
|
function mapDispatchToProps (dispatch) {
|
||
7 years ago
|
return {
|
||
7 years ago
|
setMaxModeTo: bool => dispatch(setMaxModeTo(bool)),
|
||
|
updateSendAmount: newAmount => dispatch(updateSendAmount(newAmount)),
|
||
7 years ago
|
updateGasFeeError: (amountDataObject) => {
|
||
6 years ago
|
dispatch(updateSendErrors(getGasFeeErrorObject(amountDataObject)))
|
||
7 years ago
|
},
|
||
7 years ago
|
updateSendAmountError: (amountDataObject) => {
|
||
6 years ago
|
dispatch(updateSendErrors(getAmountErrorObject(amountDataObject)))
|
||
7 years ago
|
},
|
||
|
}
|
||
7 years ago
|
}
|