2018-04-26 18:38:38 +02:00
|
|
|
import { connect } from 'react-redux'
|
2018-04-07 00:29:51 +02:00
|
|
|
import {
|
|
|
|
getCurrentNetwork,
|
2018-04-27 02:38:14 +02:00
|
|
|
getSendTo,
|
2018-04-26 18:38:38 +02:00
|
|
|
getSendToAccounts,
|
2018-04-07 00:29:51 +02:00
|
|
|
} from '../../send.selectors.js'
|
|
|
|
import {
|
|
|
|
getToDropdownOpen,
|
|
|
|
sendToIsInError,
|
|
|
|
} from './send-to-row.selectors.js'
|
|
|
|
import {
|
|
|
|
updateSendTo,
|
2018-04-26 18:38:38 +02:00
|
|
|
} from '../../../../actions'
|
2018-04-07 00:29:51 +02:00
|
|
|
import {
|
2018-04-27 21:03:00 +02:00
|
|
|
updateSendErrors,
|
|
|
|
openToDropdown,
|
|
|
|
closeToDropdown,
|
2018-05-14 14:19:09 +02:00
|
|
|
} from '../../../../ducks/send.duck'
|
2018-04-07 00:29:51 +02:00
|
|
|
import SendToRow from './send-to-row.component'
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SendToRow)
|
|
|
|
|
|
|
|
function mapStateToProps (state) {
|
|
|
|
return {
|
2018-04-27 02:38:14 +02:00
|
|
|
inError: sendToIsInError(state),
|
|
|
|
network: getCurrentNetwork(state),
|
2018-04-07 00:29:51 +02:00
|
|
|
to: getSendTo(state),
|
|
|
|
toAccounts: getSendToAccounts(state),
|
|
|
|
toDropdownOpen: getToDropdownOpen(state),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function mapDispatchToProps (dispatch) {
|
|
|
|
return {
|
2018-04-27 02:38:14 +02:00
|
|
|
closeToDropdown: () => dispatch(closeToDropdown()),
|
|
|
|
openToDropdown: () => dispatch(openToDropdown()),
|
|
|
|
updateSendTo: (to, nickname) => dispatch(updateSendTo(to, nickname)),
|
2018-05-23 18:43:25 +02:00
|
|
|
updateSendToError: (toErrorObject) => {
|
|
|
|
dispatch(updateSendErrors(toErrorObject))
|
2018-04-07 00:29:51 +02:00
|
|
|
},
|
|
|
|
}
|
2018-04-27 02:38:14 +02:00
|
|
|
}
|