import React, {ReactElement, useState} from 'react'; import {View} from 'react-native'; import {DefaultTheme, Subheading, Title, RadioButton, Paragraph, TextInput, HelperText, Button} from 'react-native-paper'; import {CameraType, SettingsScreenProps} from '../models/ElementProps'; import {colors, styles} from './Styles'; export const SettingsScreen = (props: SettingsScreenProps): ReactElement => { const [newCameraType, setNewCameraType] = useState(props.cameraType); const [newLocationStr, setNewLocationStr] = useState(props.locationStr); const pattern = /^[\d]{4}$/; const hasErrors = () => { return !pattern.test(newLocationStr); }; return Settings Camera to Use setNewCameraType(value as CameraType)} value={newCameraType as string} > Location Code Please do NOT change this unless you know what you are doing. Entering an incorrect location number may prevent patients from getting accurate info about their test results. setNewLocationStr(inputStr)} mode="outlined" theme={DefaultTheme} /> Location number must be exactly 4 digits. No other characters are allowed. }