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.
46 lines
1.5 KiB
46 lines
1.5 KiB
4 years ago
|
import { connect } from 'react-redux';
|
||
7 years ago
|
import {
|
||
7 years ago
|
getConversionRate,
|
||
7 years ago
|
getGasTotal,
|
||
7 years ago
|
getPrimaryCurrency,
|
||
5 years ago
|
getSendToken,
|
||
7 years ago
|
getSendAmount,
|
||
7 years ago
|
getSendFromBalance,
|
||
7 years ago
|
getTokenBalance,
|
||
5 years ago
|
getSendMaxModeState,
|
||
7 years ago
|
sendAmountIsInError,
|
||
4 years ago
|
} from '../../../../selectors';
|
||
|
import { getAmountErrorObject, getGasFeeErrorObject } from '../../send.utils';
|
||
|
import { setMaxModeTo, updateSendAmount } from '../../../../store/actions';
|
||
|
import { updateSendErrors } from '../../../../ducks/send/send.duck';
|
||
|
import SendAmountRow from './send-amount-row.component';
|
||
7 years ago
|
|
||
4 years ago
|
export default connect(mapStateToProps, mapDispatchToProps)(SendAmountRow);
|
||
7 years ago
|
|
||
4 years ago
|
function mapStateToProps(state) {
|
||
7 years ago
|
return {
|
||
|
amount: getSendAmount(state),
|
||
|
balance: getSendFromBalance(state),
|
||
|
conversionRate: getConversionRate(state),
|
||
7 years ago
|
gasTotal: getGasTotal(state),
|
||
|
inError: sendAmountIsInError(state),
|
||
|
primaryCurrency: getPrimaryCurrency(state),
|
||
5 years ago
|
sendToken: getSendToken(state),
|
||
7 years ago
|
tokenBalance: getTokenBalance(state),
|
||
5 years ago
|
maxModeOn: getSendMaxModeState(state),
|
||
4 years ago
|
};
|
||
7 years ago
|
}
|
||
|
|
||
4 years ago
|
function mapDispatchToProps(dispatch) {
|
||
7 years ago
|
return {
|
||
5 years ago
|
setMaxModeTo: (bool) => dispatch(setMaxModeTo(bool)),
|
||
|
updateSendAmount: (newAmount) => dispatch(updateSendAmount(newAmount)),
|
||
7 years ago
|
updateGasFeeError: (amountDataObject) => {
|
||
4 years ago
|
dispatch(updateSendErrors(getGasFeeErrorObject(amountDataObject)));
|
||
7 years ago
|
},
|
||
7 years ago
|
updateSendAmountError: (amountDataObject) => {
|
||
4 years ago
|
dispatch(updateSendErrors(getAmountErrorObject(amountDataObject)));
|
||
7 years ago
|
},
|
||
4 years ago
|
};
|
||
7 years ago
|
}
|