Fix a few ESLint errors
This commit is contained in:
parent
80797ce8ef
commit
32da54ab46
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const pak = require('../package.json');
|
const pak = require('../package.json');
|
||||||
|
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
|
import type { ImageRequireSource } from 'react-native';
|
||||||
|
|
||||||
import { StyleSheet, View, Text, Image } from 'react-native';
|
import { StyleSheet, View, Text, Image } from 'react-native';
|
||||||
import { Navigation, NavigationFunctionComponent } from 'react-native-navigation';
|
import { Navigation, NavigationFunctionComponent } from 'react-native-navigation';
|
||||||
import { Camera, CameraPermissionStatus } from 'react-native-vision-camera';
|
import { Camera, CameraPermissionStatus } from 'react-native-vision-camera';
|
||||||
import { CONTENT_SPACING, SAFE_AREA_PADDING } from './Constants';
|
import { CONTENT_SPACING, SAFE_AREA_PADDING } from './Constants';
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
const BANNER_IMAGE = require('../../img/11.png') as ImageRequireSource;
|
||||||
|
|
||||||
export const Splash: NavigationFunctionComponent = ({ componentId }) => {
|
export const Splash: NavigationFunctionComponent = ({ componentId }) => {
|
||||||
const [cameraPermissionStatus, setCameraPermissionStatus] = useState<CameraPermissionStatus>('not-determined');
|
const [cameraPermissionStatus, setCameraPermissionStatus] = useState<CameraPermissionStatus>('not-determined');
|
||||||
const [microphonePermissionStatus, setMicrophonePermissionStatus] = useState<CameraPermissionStatus>('not-determined');
|
const [microphonePermissionStatus, setMicrophonePermissionStatus] = useState<CameraPermissionStatus>('not-determined');
|
||||||
@ -24,7 +28,7 @@ export const Splash: NavigationFunctionComponent = ({ componentId }) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const checkPermissions = async () => {
|
const checkPermissions = async (): Promise<void> => {
|
||||||
console.log('Checking Permission status...');
|
console.log('Checking Permission status...');
|
||||||
const [cameraPermission, microphonePermission] = await Promise.all([
|
const [cameraPermission, microphonePermission] = await Promise.all([
|
||||||
Camera.getCameraPermissionStatus(),
|
Camera.getCameraPermissionStatus(),
|
||||||
@ -58,9 +62,8 @@ export const Splash: NavigationFunctionComponent = ({ componentId }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Image source={require('../../img/11.png')} style={styles.banner} />
|
<Image source={BANNER_IMAGE} style={styles.banner} />
|
||||||
<Text style={styles.welcome}>Welcome to{'\n'}Vision Camera.</Text>
|
<Text style={styles.welcome}>Welcome to{'\n'}Vision Camera.</Text>
|
||||||
|
|
||||||
<View style={styles.permissionsContainer}>
|
<View style={styles.permissionsContainer}>
|
||||||
{cameraPermissionStatus !== 'authorized' && (
|
{cameraPermissionStatus !== 'authorized' && (
|
||||||
<Text style={styles.permissionText}>
|
<Text style={styles.permissionText}>
|
||||||
|
@ -125,7 +125,7 @@ const _CaptureButton: React.FC<Props> = ({
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('failed to start recording!', e, 'camera');
|
console.error('failed to start recording!', e, 'camera');
|
||||||
}
|
}
|
||||||
}, [camera, flash, onMediaCaptured, onStoppedRecording, recordingProgress, stopRecording]);
|
}, [camera, flash, onMediaCaptured, onStoppedRecording]);
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region Tap handler
|
//#region Tap handler
|
||||||
|
@ -5,7 +5,7 @@ import StaticSafeAreaInsets from 'react-native-static-safe-area-insets';
|
|||||||
|
|
||||||
const FALLBACK_COLOR = 'rgba(140, 140, 140, 0.3)';
|
const FALLBACK_COLOR = 'rgba(140, 140, 140, 0.3)';
|
||||||
|
|
||||||
const StatusBarBlurBackgroundImpl = ({ style, ...props }: BlurViewProperties) => {
|
const StatusBarBlurBackgroundImpl = ({ style, ...props }: BlurViewProperties): React.ReactElement | null => {
|
||||||
if (Platform.OS !== 'ios') return null;
|
if (Platform.OS !== 'ios') return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user