Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
() => (
);
async () => {
await Brightness.setBrightnessAsync(0.65);
await Brightness.setSystemBrightnessAsync(0.75);
const br1 = await Brightness.getBrightnessAsync();
const br2 = await Brightness.getSystemBrightnessAsync();
};
Camera.Constants.AutoFocus;
Camera.Constants.Type;
Camera.Constants.FlashMode;
Camera.Constants.WhiteBalance;
Camera.Constants.VideoQuality;
Camera.Constants.BarCodeType;
() => {
return( {
if (component) {
component.recordAsync();
}
}} />);
};
async (camera: CameraObject) => {
const picture = await camera.takePictureAsync({
quality: 0.5,
base64: true,
);
() => (
);
async () => {
await Brightness.setBrightnessAsync(0.65);
await Brightness.setSystemBrightnessAsync(0.75);
const br1 = await Brightness.getBrightnessAsync();
const br2 = await Brightness.getSystemBrightnessAsync();
};
Camera.Constants.AutoFocus;
Camera.Constants.Type;
Camera.Constants.FlashMode;
Camera.Constants.WhiteBalance;
Camera.Constants.VideoQuality;
Camera.Constants.BarCodeType;
() => {
return( {
if (component) {
component.recordAsync();
}
}} />);
};
async (camera: CameraObject) => {
const picture = await camera.takePictureAsync({
quality: 0.5,
base64: true,
constructor(props){
super(props);
this.state = {
modalVisible: false,
comment: '',
hasCameraPermission: null,
type: Camera.Constants.Type.back,
selectedIndex: null,
displayCamera: false
}
}
onPress={() => {
this.setState({
type: this.state.type === Camera.Constants.Type.back
? Camera.Constants.Type.front
: Camera.Constants.Type.back,
});
}}
>
flashMode={flashMode}
ratio="1:1"
ref={(ref) => { this.camera = ref; }}
>
{(cameraType === Camera.Constants.Type.back && mode === 'photo') && (
)}
Dimensions,
Platform,
StyleSheet,
} from 'react-native';
import { Feather } from '@expo/vector-icons';
import { Camera, Permissions } from 'expo';
import { colors } from '../../config/Theme';
const win = Dimensions.get('window');
const DESIRED_RATIO = "1:1";
export default class CameraComponent extends React.Component {
state = {
isMounted: false,
hasCameraPermission: null,
type: Camera.Constants.Type.back,
ratio: DESIRED_RATIO,
photo: null,
processingPhoto: false,
};
async componentDidMount() {
this.setState({isMounted: true});
const {status} = await Permissions.getAsync(Permissions.CAMERA);
if (this.state.isMounted) {
this.setState({ hasCameraPermission: status === 'granted' });
this.processImage(null);
if (status !== 'granted') {
const {status} = await Permissions.askAsync(Permissions.CAMERA);
render() {
const { photo } = this.state;
return (
);
}
}