How to use react-native-qrcode-scanner - 2 common examples

To help you get started, we’ve selected a few react-native-qrcode-scanner examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jolocom / smartwallet-app / src / ui / generic / qrcodeScanner.tsx View on Github external
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
github jolocom / smartwallet-app / src / ui / interaction / component / qrScanner.tsx View on Github external
}

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,

react-native-qrcode-scanner

A QR code scanner for React Native.

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis

Popular react-native-qrcode-scanner functions