Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { connect } from 'react-redux'
import { Container } from 'src/ui/structure'
import { Button } from 'react-native-material-ui'
import { QrScanEvent } from 'src/ui/generic/qrcodeScanner'
import I18n from 'src/locales/i18n'
import strings from 'src/locales/strings'
import { JolocomLib } from 'jolocom-lib'
import { interactionHandlers } from 'src/lib/storage/interactionTokens'
import { ThunkDispatch } from 'src/store'
import { showErrorScreen } from 'src/actions/generic'
import { withLoading, withErrorScreen } from 'src/actions/modifiers'
import { NavigationScreenProps } from 'react-navigation'
import { AppError, ErrorCode } from 'src/lib/errors'
import { Colors } from 'src/styles'
const QRScanner = require('react-native-qrcode-scanner').default
export interface QrScanEvent {
data: string
}
interface Props
extends ReturnType,
NavigationScreenProps {}
interface State {}
const SCREEN_HEIGHT = Dimensions.get('window').height
const SCREEN_WIDTH = Dimensions.get('window').width
const overlayColor = 'rgba(0,0,0,0.65)'
const overlayMargin = 44
}
interface State {
isTorch: boolean
key: number
permission: Status
isCamera: boolean
}
interface PermissionResults {
AUTHORIZED: Status
DENIED: Status
RESTRICTED: Status
}
const QRScanner = require('react-native-qrcode-scanner').default
const CAMERA_PERMISSION = 'camera'
const RESULTS: PermissionResults = {
AUTHORIZED: 'authorized',
DENIED: 'denied',
RESTRICTED: 'restricted',
}
const IS_IOS = Platform.OS === 'ios'
const SCREEN_HEIGHT = Dimensions.get('window').height
const SCREEN_WIDTH = Dimensions.get('window').width
const MARKER_SIZE = SCREEN_WIDTH * 0.75
const styles = StyleSheet.create({
rectangle: {
height: MARKER_SIZE,