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/pages/send/send-content/send-to-row/send-to-row.container.js

55 lines
1.4 KiB

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