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.
31 lines
797 B
31 lines
797 B
4 years ago
|
import { compose } from 'redux';
|
||
|
import { connect } from 'react-redux';
|
||
|
import { withRouter } from 'react-router-dom';
|
||
5 years ago
|
import {
|
||
4 years ago
|
addToAddressBook,
|
||
|
showQrScanner,
|
||
|
qrCodeDetected,
|
||
4 years ago
|
} from '../../../../store/actions';
|
||
|
import { getQrCodeData } from '../../../../selectors';
|
||
|
import AddContact from './add-contact.component';
|
||
5 years ago
|
|
||
5 years ago
|
const mapStateToProps = (state) => {
|
||
5 years ago
|
return {
|
||
|
qrCodeData: getQrCodeData(state),
|
||
4 years ago
|
};
|
||
|
};
|
||
5 years ago
|
|
||
5 years ago
|
const mapDispatchToProps = (dispatch) => {
|
||
5 years ago
|
return {
|
||
4 years ago
|
addToAddressBook: (recipient, nickname) =>
|
||
|
dispatch(addToAddressBook(recipient, nickname)),
|
||
5 years ago
|
scanQrCode: () => dispatch(showQrScanner()),
|
||
5 years ago
|
qrCodeDetected: (data) => dispatch(qrCodeDetected(data)),
|
||
4 years ago
|
};
|
||
|
};
|
||
5 years ago
|
|
||
|
export default compose(
|
||
|
withRouter,
|
||
4 years ago
|
connect(mapStateToProps, mapDispatchToProps),
|
||
4 years ago
|
)(AddContact);
|