2018-07-30 23:50:05 +02:00
|
|
|
import { connect } from 'react-redux'
|
|
|
|
import QrScanner from './qr-scanner.component'
|
|
|
|
|
2018-08-04 00:57:23 +02:00
|
|
|
const { hideModal, qrCodeDetected, showQrScanner } = require('../../../actions')
|
|
|
|
import {
|
|
|
|
SEND_ROUTE,
|
|
|
|
} from '../../../routes'
|
2018-07-30 23:50:05 +02:00
|
|
|
|
2018-08-01 00:30:40 +02:00
|
|
|
const mapStateToProps = state => {
|
|
|
|
return {
|
|
|
|
error: state.appState.modal.modalState.props.error,
|
|
|
|
errorType: state.appState.modal.modalState.props.errorType,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-30 23:50:05 +02:00
|
|
|
const mapDispatchToProps = dispatch => {
|
|
|
|
return {
|
|
|
|
hideModal: () => dispatch(hideModal()),
|
|
|
|
qrCodeDetected: (data) => dispatch(qrCodeDetected(data)),
|
2018-08-04 00:57:23 +02:00
|
|
|
scanQrCode: () => dispatch(showQrScanner(SEND_ROUTE)),
|
2018-07-30 23:50:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-01 00:30:40 +02:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(QrScanner)
|