import {BarCodeScanner} from 'expo-barcode-scanner'; import React, {ReactElement, useState} from 'react'; import {Text, View} from 'react-native'; import {Button, DefaultTheme, HelperText, Subheading, TextInput, Title} from 'react-native-paper'; import {ButtonProps, ScannerProps} from '../models/ElementProps'; import {colors, styles} from './Styles'; declare type CameraType = number | 'front' | 'back' | undefined; export const Scanner = (props: ScannerProps): ReactElement => { const [componentKey, setComponentKey] = useState(0); const [cameraType, setCameraType] = useState('back'); const _toggleCameraType = () => { setCameraType(cameraType === 'front' ? 'back' : 'front'); setComponentKey(componentKey + 1); } const ScanCamera = (): ReactElement => { return Hold your ID card up, with the barcode facing the camera. Keep the card in the green box. ; } return ; }; export const ScanButton = (props: ButtonProps): ReactElement => { return ; }; export const InputIdButton = (props: ButtonProps): ReactElement => { return ; }; export const IdNumberInput = (props: ScannerProps): ReactElement => { const [inputStr, setInputStr] = useState(''); const pattern = /^[\d]{9}$/; const hasErrors = () => { return !pattern.test(inputStr); }; const onSubmit = () => { props.onScanned({type: '', data: inputStr}); } return Settings Please double check that you have entered the number correctly. Entering an incorrect ID number will prevent patients from receiving their test results. setInputStr(inputStr)} mode="outlined" theme={DefaultTheme} /> ID number must be exactly 9 digits. No other characters are allowed. ; };