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.
55 lines
1.4 KiB
55 lines
1.4 KiB
7 years ago
|
import { connect } from 'react-redux'
|
||
7 years ago
|
import {
|
||
|
getCurrentNetwork,
|
||
6 years ago
|
getSelectedToken,
|
||
7 years ago
|
getSendTo,
|
||
7 years ago
|
getSendToAccounts,
|
||
6 years ago
|
getSendHexData,
|
||
7 years ago
|
} from '../../send.selectors.js'
|
||
|
import {
|
||
|
getToDropdownOpen,
|
||
6 years ago
|
getTokens,
|
||
7 years ago
|
sendToIsInError,
|
||
6 years ago
|
sendToIsInWarning,
|
||
7 years ago
|
} from './send-to-row.selectors.js'
|
||
|
import {
|
||
|
updateSendTo,
|
||
6 years ago
|
} from '../../../../store/actions'
|
||
7 years ago
|
import {
|
||
7 years ago
|
updateSendErrors,
|
||
6 years ago
|
updateSendWarnings,
|
||
7 years ago
|
openToDropdown,
|
||
|
closeToDropdown,
|
||
6 years ago
|
} from '../../../../ducks/send/send.duck'
|
||
7 years ago
|
import SendToRow from './send-to-row.component'
|
||
|
|
||
|
export default connect(mapStateToProps, mapDispatchToProps)(SendToRow)
|
||
|
|
||
|
function mapStateToProps (state) {
|
||
|
return {
|
||
6 years ago
|
hasHexData: Boolean(getSendHexData(state)),
|
||
7 years ago
|
inError: sendToIsInError(state),
|
||
6 years ago
|
inWarning: sendToIsInWarning(state),
|
||
7 years ago
|
network: getCurrentNetwork(state),
|
||
6 years ago
|
selectedToken: getSelectedToken(state),
|
||
7 years ago
|
to: getSendTo(state),
|
||
|
toAccounts: getSendToAccounts(state),
|
||
|
toDropdownOpen: getToDropdownOpen(state),
|
||
6 years ago
|
tokens: getTokens(state),
|
||
7 years ago
|
}
|
||
|
}
|
||
|
|
||
|
function mapDispatchToProps (dispatch) {
|
||
|
return {
|
||
7 years ago
|
closeToDropdown: () => dispatch(closeToDropdown()),
|
||
|
openToDropdown: () => dispatch(openToDropdown()),
|
||
|
updateSendTo: (to, nickname) => dispatch(updateSendTo(to, nickname)),
|
||
7 years ago
|
updateSendToError: (toErrorObject) => {
|
||
|
dispatch(updateSendErrors(toErrorObject))
|
||
7 years ago
|
},
|
||
6 years ago
|
updateSendToWarning: (toWarningObject) => {
|
||
|
dispatch(updateSendWarnings(toWarningObject))
|
||
|
},
|
||
7 years ago
|
}
|
||
7 years ago
|
}
|