1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-03 14:44:27 +01:00
metamask-extension/ui/app/components/modals/qr-scanner/qr-scanner.container.js

25 lines
684 B
JavaScript
Raw Normal View History

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
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
}
}
export default connect(mapStateToProps, mapDispatchToProps)(QrScanner)