OPS: Lint

This commit is contained in:
Marcos Rodriguez Velez 2024-08-30 18:43:50 -04:00
parent b9090191a3
commit 6b9bf33dfa
5 changed files with 10 additions and 10 deletions

View file

@ -1,11 +1,10 @@
import React, { forwardRef } from 'react';
import { StyleProp, StyleSheet, Text, TouchableOpacity, View, ViewStyle } from 'react-native';
import { StyleProp, StyleSheet, Text, TouchableOpacity, TouchableOpacityProps, View, ViewStyle } from 'react-native';
import { Icon } from '@rneui/themed';
import { useTheme } from './themes';
// Define an interface for the props
interface ButtonProps {
interface ButtonProps extends TouchableOpacityProps {
backgroundColor?: string;
buttonTextColor?: string;
disabled?: boolean;
@ -20,7 +19,7 @@ interface ButtonProps {
onPress?: () => void;
}
export const Button = forwardRef<TouchableOpacity, ButtonProps>((props, ref) => {
export const Button = forwardRef<React.ElementRef<typeof TouchableOpacity>, ButtonProps>((props, ref) => {
const { colors } = useTheme();
let backgroundColor = props.backgroundColor ?? colors.mainColor;
@ -56,6 +55,7 @@ export const Button = forwardRef<TouchableOpacity, ButtonProps>((props, ref) =>
accessibilityRole="button"
onPress={props.onPress}
disabled={props.disabled}
{...props}
>
{buttonView}
</TouchableOpacity>

View file

@ -19,7 +19,7 @@ const styleCopyTextToClipboard = StyleSheet.create({
},
});
const CopyTextToClipboard = forwardRef<TouchableOpacity, CopyTextToClipboardProps>(({ text, truncated }, ref) => {
const CopyTextToClipboard = forwardRef<React.ElementRef<typeof TouchableOpacity>, CopyTextToClipboardProps>(({ text, truncated }, ref) => {
const [hasTappedText, setHasTappedText] = useState(false);
const [address, setAddress] = useState(text);

View file

@ -20,7 +20,7 @@ type SecondButtonProps = {
testID?: string;
};
export const SecondButton = forwardRef<TouchableOpacity, SecondButtonProps>((props, ref) => {
export const SecondButton = forwardRef<React.ElementRef<typeof TouchableOpacity>, SecondButtonProps>((props, ref) => {
const { colors } = useTheme();
let backgroundColor = props.backgroundColor ? props.backgroundColor : colors.buttonGrayBackgroundColor;
let fontColor = colors.secondButtonTextColor;

View file

@ -10,7 +10,7 @@ interface SquareButtonProps {
testID?: string;
}
export const SquareButton = forwardRef<TouchableOpacity, SquareButtonProps>((props, ref) => {
export const SquareButton = forwardRef<React.ElementRef<typeof TouchableOpacity>, SquareButtonProps>((props, ref) => {
const { title, onPress, style, testID } = props;
const { colors } = useTheme();

View file

@ -1,8 +1,8 @@
import React, { useCallback, useEffect, useReducer, useRef } from 'react';
import { Alert, Platform, ScrollView, StyleSheet, Text, TouchableOpacity, TouchableWithoutFeedback, View } from 'react-native';
import { Alert, Platform, ScrollView, StyleSheet, Text, TouchableWithoutFeedback, View } from 'react-native';
import { BlueCard, BlueSpacing20, BlueText } from '../../BlueComponents';
import presentAlert from '../../components/Alert';
import ListItem from '../../components/ListItem';
import ListItem, { TouchableOpacityWrapper } from '../../components/ListItem';
import { useTheme } from '../../components/themes';
import { unlockWithBiometrics, useBiometrics } from '../../hooks/useBiometrics';
import loc from '../../loc';
@ -195,7 +195,7 @@ const EncryptStorage = () => {
title={loc.settings.plausible_deniability}
chevron
testID="PlausibleDeniabilityButton"
Component={TouchableOpacity}
Component={TouchableOpacityWrapper}
containerStyle={[styles.row, styleHooks.root]}
/>
)}