From fd3a03ad2b5f447c613bf9eb41c91549528009cb Mon Sep 17 00:00:00 2001
From: johntheZ <55151626+johntheZ@users.noreply.github.com>
Date: Thu, 9 May 2024 05:57:24 -0400
Subject: [PATCH] remove the unnecessary touchable wrapper (#537)
---
src/components/BaseToast.tsx | 9 ++++-----
src/components/Touchable.tsx | 20 --------------------
2 files changed, 4 insertions(+), 25 deletions(-)
delete mode 100644 src/components/Touchable.tsx
diff --git a/src/components/BaseToast.tsx b/src/components/BaseToast.tsx
index 92ffcba2c..cbb962ae0 100644
--- a/src/components/BaseToast.tsx
+++ b/src/components/BaseToast.tsx
@@ -1,16 +1,15 @@
import React from 'react';
-import { Text, View } from 'react-native';
+import { Text, View, TouchableOpacity } from 'react-native';
import { BaseToastProps } from '../types';
import { getTestId } from '../utils/test-id';
import { styles } from './BaseToast.styles';
-import { Touchable } from './Touchable';
export function BaseToast({
text1,
text2,
onPress,
- activeOpacity,
+ activeOpacity = 1,
style,
touchableContainerProps,
contentContainerStyle,
@@ -25,7 +24,7 @@ export function BaseToast({
renderTrailingIcon
}: BaseToastProps) {
return (
-
{renderTrailingIcon && renderTrailingIcon()}
-
+
);
}
diff --git a/src/components/Touchable.tsx b/src/components/Touchable.tsx
deleted file mode 100644
index 0e426410f..000000000
--- a/src/components/Touchable.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import React from 'react';
-import { TouchableOpacity, TouchableOpacityProps } from 'react-native';
-
-import { ReactChildren } from '../types';
-
-type TouchableProps = {
- children: ReactChildren;
-} & TouchableOpacityProps;
-
-export function Touchable({
- children,
- activeOpacity = 1,
- ...rest
-}: TouchableProps) {
- return (
-
- {children}
-
- );
-}