Fix a few ESLint errors

This commit is contained in:
Marc Rousavy 2021-02-23 11:57:43 +01:00
parent 80797ce8ef
commit 32da54ab46
4 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const pak = require('../package.json');

View File

@ -1,10 +1,14 @@
import React, { useCallback, useEffect, useState } from 'react';
import type { ImageRequireSource } from 'react-native';
import { StyleSheet, View, Text, Image } from 'react-native';
import { Navigation, NavigationFunctionComponent } from 'react-native-navigation';
import { Camera, CameraPermissionStatus } from 'react-native-vision-camera';
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 }) => {
const [cameraPermissionStatus, setCameraPermissionStatus] = useState<CameraPermissionStatus>('not-determined');
const [microphonePermissionStatus, setMicrophonePermissionStatus] = useState<CameraPermissionStatus>('not-determined');
@ -24,7 +28,7 @@ export const Splash: NavigationFunctionComponent = ({ componentId }) => {
}, []);
useEffect(() => {
const checkPermissions = async () => {
const checkPermissions = async (): Promise<void> => {
console.log('Checking Permission status...');
const [cameraPermission, microphonePermission] = await Promise.all([
Camera.getCameraPermissionStatus(),
@ -58,9 +62,8 @@ export const Splash: NavigationFunctionComponent = ({ componentId }) => {
return (
<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>
<View style={styles.permissionsContainer}>
{cameraPermissionStatus !== 'authorized' && (
<Text style={styles.permissionText}>

View File

@ -125,7 +125,7 @@ const _CaptureButton: React.FC<Props> = ({
} catch (e) {
console.error('failed to start recording!', e, 'camera');
}
}, [camera, flash, onMediaCaptured, onStoppedRecording, recordingProgress, stopRecording]);
}, [camera, flash, onMediaCaptured, onStoppedRecording]);
//#endregion
//#region Tap handler

View File

@ -5,7 +5,7 @@ import StaticSafeAreaInsets from 'react-native-static-safe-area-insets';
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;
return (