mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-30 08:09:15 +01:00
086003555c
Co-authored-by: Olaf Tomalka <olaf.tomalka@gmail.com> Co-authored-by: Vincent Shadbolt <vince.shadbolt@gmail.com> Co-authored-by: Brad Decker <bhdecker84@gmail.com> Co-authored-by: Brad Decker <git@braddecker.dev>
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
import { compose } from 'redux';
|
|
import { connect } from 'react-redux';
|
|
import { withRouter } from 'react-router-dom';
|
|
import {
|
|
addToAddressBook,
|
|
showQrScanner,
|
|
qrCodeDetected,
|
|
} from '../../../../store/actions';
|
|
import { getQrCodeData } from '../../../../ducks/app/app';
|
|
import {
|
|
getDomainError,
|
|
getDomainResolution,
|
|
resetDomainResolution,
|
|
} from '../../../../ducks/domains';
|
|
import AddContact from './add-contact.component';
|
|
|
|
const mapStateToProps = (state) => {
|
|
return {
|
|
qrCodeData: getQrCodeData(state),
|
|
domainError: getDomainError(state),
|
|
domainResolution: getDomainResolution(state),
|
|
};
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
return {
|
|
addToAddressBook: (recipient, nickname) =>
|
|
dispatch(addToAddressBook(recipient, nickname)),
|
|
scanQrCode: () => dispatch(showQrScanner()),
|
|
qrCodeDetected: (data) => dispatch(qrCodeDetected(data)),
|
|
resetDomainResolution: () => dispatch(resetDomainResolution()),
|
|
};
|
|
};
|
|
|
|
export default compose(
|
|
withRouter,
|
|
connect(mapStateToProps, mapDispatchToProps),
|
|
)(AddContact);
|