A Metamask fork with Infura removed and default networks editable
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.
ciphermask/ui/app/components/send_/send-content/send-to-row/send-to-row.container.js

44 lines
1.1 KiB

import { connect } from 'react-redux'
7 years ago
import {
getCurrentNetwork,
getSendTo,
getSendToAccounts,
7 years ago
} from '../../send.selectors.js'
import {
getToDropdownOpen,
sendToIsInError,
} from './send-to-row.selectors.js'
import { getToErrorObject } from './send-to-row.utils.js'
import {
updateSendTo,
} from '../../../../actions'
7 years ago
import {
updateSendErrors,
openToDropdown,
closeToDropdown,
} from '../../../../ducks/send'
7 years ago
import SendToRow from './send-to-row.component'
export default connect(mapStateToProps, mapDispatchToProps)(SendToRow)
function mapStateToProps (state) {
return {
inError: sendToIsInError(state),
network: getCurrentNetwork(state),
7 years ago
to: getSendTo(state),
toAccounts: getSendToAccounts(state),
toDropdownOpen: getToDropdownOpen(state),
}
}
function mapDispatchToProps (dispatch) {
return {
closeToDropdown: () => dispatch(closeToDropdown()),
openToDropdown: () => dispatch(openToDropdown()),
updateSendTo: (to, nickname) => dispatch(updateSendTo(to, nickname)),
7 years ago
updateSendToError: (to) => {
dispatch(updateSendErrors(getToErrorObject(to)))
},
}
}