mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
92971d3c87
* Update eslint-plugin-import version * Convert JS files to use ESM * Update ESLint rules to check imports * Fix test:unit:global command env * Cleanup mock-dev script
31 lines
875 B
JavaScript
31 lines
875 B
JavaScript
import AddContact from './add-contact.component'
|
|
import { compose } from 'recompose'
|
|
import { connect } from 'react-redux'
|
|
import { withRouter } from 'react-router-dom'
|
|
import { addToAddressBook, showQrScanner, qrCodeDetected } from '../../../../store/actions'
|
|
import {
|
|
CONTACT_ADD_ROUTE,
|
|
} from '../../../../helpers/constants/routes'
|
|
import {
|
|
getQrCodeData,
|
|
} from '../../../send/send.selectors'
|
|
|
|
const mapStateToProps = state => {
|
|
return {
|
|
qrCodeData: getQrCodeData(state),
|
|
}
|
|
}
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
return {
|
|
addToAddressBook: (recipient, nickname) => dispatch(addToAddressBook(recipient, nickname)),
|
|
scanQrCode: () => dispatch(showQrScanner(CONTACT_ADD_ROUTE)),
|
|
qrCodeDetected: (data) => dispatch(qrCodeDetected(data)),
|
|
}
|
|
}
|
|
|
|
export default compose(
|
|
withRouter,
|
|
connect(mapStateToProps, mapDispatchToProps)
|
|
)(AddContact)
|