fix constants in defaultProps
This commit is contained in:
parent
d786581d08
commit
8b25689456
28
Camera.js
28
Camera.js
|
@ -32,12 +32,12 @@ function convertStringProps(props) {
|
||||||
if (typeof props.type === 'string') {
|
if (typeof props.type === 'string') {
|
||||||
newProps.type = Camera.constants.Type[props.type];
|
newProps.type = Camera.constants.Type[props.type];
|
||||||
}
|
}
|
||||||
|
|
||||||
return newProps;
|
return newProps;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Camera extends Component {
|
export default class Camera extends Component {
|
||||||
|
|
||||||
static constants = {
|
static constants = {
|
||||||
Aspect: CameraManager.Aspect,
|
Aspect: CameraManager.Aspect,
|
||||||
BarCodeType: CameraManager.BarCodeType,
|
BarCodeType: CameraManager.BarCodeType,
|
||||||
|
@ -48,7 +48,7 @@ export default class Camera extends Component {
|
||||||
FlashMode: CameraManager.FlashMode,
|
FlashMode: CameraManager.FlashMode,
|
||||||
TorchMode: CameraManager.TorchMode
|
TorchMode: CameraManager.TorchMode
|
||||||
};
|
};
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
...View.propTypes,
|
...View.propTypes,
|
||||||
aspect: PropTypes.oneOfType([
|
aspect: PropTypes.oneOfType([
|
||||||
|
@ -86,25 +86,25 @@ export default class Camera extends Component {
|
||||||
PropTypes.number
|
PropTypes.number
|
||||||
])
|
])
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
aspect: Camera.constants.Aspect.fill,
|
aspect: CameraManager.Aspect.fill,
|
||||||
type: Camera.constants.Type.back,
|
type: CameraManager.Type.back,
|
||||||
orientation: Camera.constants.Orientation.auto,
|
orientation: CameraManager.Orientation.auto,
|
||||||
captureAudio: true,
|
captureAudio: true,
|
||||||
captureMode: Camera.constants.CaptureMode.still,
|
captureMode: CameraManager.CaptureMode.still,
|
||||||
captureTarget: Camera.constants.CaptureTarget.cameraRoll,
|
captureTarget: CameraManager.CaptureTarget.cameraRoll,
|
||||||
defaultOnFocusComponent: true,
|
defaultOnFocusComponent: true,
|
||||||
flashMode: Camera.constants.FlashMode.off,
|
flashMode: CameraManager.FlashMode.off,
|
||||||
torchMode: Camera.constants.TorchMode.off
|
torchMode: CameraManager.TorchMode.off
|
||||||
};
|
};
|
||||||
|
|
||||||
static checkDeviceAuthorizationStatus = CameraManager.checkDeviceAuthorizationStatus;
|
static checkDeviceAuthorizationStatus = CameraManager.checkDeviceAuthorizationStatus;
|
||||||
|
|
||||||
setNativeProps(props) {
|
setNativeProps(props) {
|
||||||
this.refs[CAMERA_REF].setNativeProps(props);
|
this.refs[CAMERA_REF].setNativeProps(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.state = {
|
this.state = {
|
||||||
|
@ -164,7 +164,7 @@ export default class Camera extends Component {
|
||||||
this.setState({ isRecording: false });
|
this.setState({ isRecording: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getFOV() {
|
getFOV() {
|
||||||
return CameraManager.getFOV();
|
return CameraManager.getFOV();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue