1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
import {
getSelectedToken,
getPrimaryCurrency,
getAmountConversionRate,
getConvertedCurrency,
getSendAmount,
getGasTotal,
getSelectedBalance,
getTokenBalance,
getSendFromBalance,
} from '../../send.selectors.js'
import {
getMaxModeOn,
sendAmountIsInError,
} from './send-amount-row.selectors.js'
import { getAmountErrorObject } from './send-amount-row.utils.js'
import {
updateSendAmount,
setMaxModeTo,
} from '../../../actions'
import SendAmountRow from './send-amount-row.component'
export default connect(mapStateToProps, mapDispatchToProps)(SendToRow)
function mapStateToProps (state) {
updateSendTo
return {
selectedToken: getSelectedToken(state),
primaryCurrency: getPrimaryCurrency(state),
convertedCurrency: getConvertedCurrency(state),
amountConversionRate: getAmountConversionRate(state),
inError: sendAmountIsInError(state),
amount: getSendAmount(state),
maxModeOn: getMaxModeOn(state),
gasTotal: getGasTotal(state),
tokenBalance: getTokenBalance(state),
balance: getSendFromBalance(state),
}
}
function mapDispatchToProps (dispatch) {
return {
updateSendAmountError: (amountDataObject) => {
dispatch(updateSendErrors(getAmountErrorObject(amountDataObject)))
},
updateSendAmount: newAmount => dispatch(updateSendAmount(newAmount)),
setMaxModeTo: bool => dispatch(setMaxModeTo(bool)),
}
}
|