From 6b9bf33dfa8e53a3ac3f42b5908e65fd7cc2f359 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Fri, 30 Aug 2024 18:43:50 -0400 Subject: [PATCH] OPS: Lint --- components/Button.tsx | 8 ++++---- components/CopyTextToClipboard.tsx | 2 +- components/SecondButton.tsx | 2 +- components/SquareButton.tsx | 2 +- screen/settings/EncryptStorage.tsx | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/Button.tsx b/components/Button.tsx index 5abf1f8e5..09189806d 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -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((props, ref) => { +export const Button = forwardRef, ButtonProps>((props, ref) => { const { colors } = useTheme(); let backgroundColor = props.backgroundColor ?? colors.mainColor; @@ -56,6 +55,7 @@ export const Button = forwardRef((props, ref) => accessibilityRole="button" onPress={props.onPress} disabled={props.disabled} + {...props} > {buttonView} diff --git a/components/CopyTextToClipboard.tsx b/components/CopyTextToClipboard.tsx index accd9ab97..db49653d6 100644 --- a/components/CopyTextToClipboard.tsx +++ b/components/CopyTextToClipboard.tsx @@ -19,7 +19,7 @@ const styleCopyTextToClipboard = StyleSheet.create({ }, }); -const CopyTextToClipboard = forwardRef(({ text, truncated }, ref) => { +const CopyTextToClipboard = forwardRef, CopyTextToClipboardProps>(({ text, truncated }, ref) => { const [hasTappedText, setHasTappedText] = useState(false); const [address, setAddress] = useState(text); diff --git a/components/SecondButton.tsx b/components/SecondButton.tsx index 57909faa3..eb3fb414f 100644 --- a/components/SecondButton.tsx +++ b/components/SecondButton.tsx @@ -20,7 +20,7 @@ type SecondButtonProps = { testID?: string; }; -export const SecondButton = forwardRef((props, ref) => { +export const SecondButton = forwardRef, SecondButtonProps>((props, ref) => { const { colors } = useTheme(); let backgroundColor = props.backgroundColor ? props.backgroundColor : colors.buttonGrayBackgroundColor; let fontColor = colors.secondButtonTextColor; diff --git a/components/SquareButton.tsx b/components/SquareButton.tsx index cb5c3f049..8fce329b3 100644 --- a/components/SquareButton.tsx +++ b/components/SquareButton.tsx @@ -10,7 +10,7 @@ interface SquareButtonProps { testID?: string; } -export const SquareButton = forwardRef((props, ref) => { +export const SquareButton = forwardRef, SquareButtonProps>((props, ref) => { const { title, onPress, style, testID } = props; const { colors } = useTheme(); diff --git a/screen/settings/EncryptStorage.tsx b/screen/settings/EncryptStorage.tsx index 321caa3e7..5e1d793a3 100644 --- a/screen/settings/EncryptStorage.tsx +++ b/screen/settings/EncryptStorage.tsx @@ -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]} /> )}