Skip to content

Commit 1d28a1a

Browse files
committed
fix: replace TouchableOpacity with Pressable
1 parent b3c67eb commit 1d28a1a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { StyleSheet, View } from 'react-native';
3-
import { TouchableOpacity } from 'react-native-gesture-handler';
3+
import { Pressable } from 'react-native-gesture-handler';
44

55
import { ChannelAvatar } from './ChannelAvatar';
66
import type { ChannelPreviewProps } from './ChannelPreview';
@@ -130,13 +130,14 @@ const ChannelPreviewMessengerWithContext = (props: ChannelPreviewMessengerPropsW
130130
);
131131

132132
return (
133-
<TouchableOpacity
133+
<Pressable
134134
onPress={() => {
135135
if (onSelect) {
136136
onSelect(channel);
137137
}
138138
}}
139-
style={[
139+
style={({ pressed }) => [
140+
{ opacity: pressed ? 0.5 : 1 },
140141
styles.container,
141142
{ backgroundColor: white_snow, borderBottomColor: border },
142143
container,
@@ -164,7 +165,7 @@ const ChannelPreviewMessengerWithContext = (props: ChannelPreviewMessengerPropsW
164165
/>
165166
</View>
166167
</View>
167-
</TouchableOpacity>
168+
</Pressable>
168169
);
169170
};
170171

package/src/components/MessageInput/MoreOptionsButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import type { GestureResponderEvent } from 'react-native';
3-
import { TouchableOpacity } from 'react-native-gesture-handler';
3+
import { Pressable } from 'react-native-gesture-handler';
44

55
import { useTheme } from '../../contexts/themeContext/ThemeContext';
66
import { CircleRight } from '../../icons/CircleRight';
@@ -21,14 +21,14 @@ export const MoreOptionsButton = (props: MoreOptionsButtonProps) => {
2121
} = useTheme();
2222

2323
return (
24-
<TouchableOpacity
24+
<Pressable
2525
hitSlop={{ bottom: 15, left: 15, right: 15, top: 15 }}
2626
onPress={handleOnPress}
27-
style={[moreOptionsButton]}
27+
style={({ pressed }) => [{ opacity: pressed ? 0.5 : 1 }, moreOptionsButton]}
2828
testID='more-options-button'
2929
>
3030
<CircleRight pathFill={accent_blue} />
31-
</TouchableOpacity>
31+
</Pressable>
3232
);
3333
};
3434

0 commit comments

Comments
 (0)