Add prop enableContentPanningGesture to action sheet

This commit is contained in:
Danish Ahmed Mirza 2022-07-30 16:45:42 +05:30 committed by Danish
parent 7c43029bf0
commit d9fa16977e
4 changed files with 9 additions and 6 deletions

View File

@ -140,7 +140,8 @@ const ActionSheet = React.memo(
style={{ ...styles.container, ...bottomSheet }}
backgroundStyle={{ backgroundColor: colors.focusedBackground }}
onChange={index => index === -1 && onClose()}
enableContentPanningGesture={false}
// We need this to allow horizontal swipe gesture inside the bottom sheet like in reaction picker
enableContentPanningGesture={data?.enableContentPanningGesture ?? true}
{...androidTablet}
>
<BottomSheetContent options={data?.options} hide={hide} children={data?.children} hasCancel={data?.hasCancel} />

View File

@ -63,7 +63,7 @@ const EmojiSearchBar = React.forwardRef<TextInput, IEmojiSearchBarProps>(
onChangeText(text);
};
const renderItem = React.memo((emoji: IEmoji) => (
const ListItem = React.memo(({ emoji }: { emoji: IEmoji }) => (
<View style={[styles.emojiContainer]}>
<Pressable onPress={() => onEmojiSelected(emoji)}>
<Emoji emoji={emoji} baseUrl={baseUrl} />
@ -76,7 +76,7 @@ const EmojiSearchBar = React.forwardRef<TextInput, IEmojiSearchBarProps>(
<FlatList
horizontal
data={searchText ? emojis : frequentlyUsedEmojis}
renderItem={({ item }) => renderItem(item as IEmoji)}
renderItem={({ item }) => <ListItem emoji={item as IEmoji} />}
showsHorizontalScrollIndicator={false}
ListEmptyComponent={() => (
<View style={styles.listEmptyComponent}>
@ -92,7 +92,8 @@ const EmojiSearchBar = React.forwardRef<TextInput, IEmojiSearchBarProps>(
<Pressable
style={({ pressed }: { pressed: boolean }) => [styles.openEmojiKeyboard, { opacity: pressed ? 0.7 : 1 }]}
onPress={openEmoji}
hitSlop={BUTTON_HIT_SLOP}>
hitSlop={BUTTON_HIT_SLOP}
>
<CustomIcon name='chevron-left' size={30} color={colors.collapsibleChevron} />
</Pressable>
<View style={{ flex: 1 }}>

View File

@ -83,7 +83,7 @@ const ReactionPicker = ({ onEmojiSelected, message, reactionClose }: IReactionPi
returnKeyType='search'
underlineColorAndroid='transparent'
onChangeText={handleTextChange}
style={[styles.reactionPickerSearchbar, { backgroundColor: colors.passcodeButtonActive }]}
style={[styles.reactionPickerSearchbar, { backgroundColor: colors.borderColor }]}
value={searchText}
onClearInput={() => handleTextChange('')}
iconRight={'search'}

View File

@ -842,7 +842,8 @@ class RoomView extends React.Component<IRoomViewProps, IRoomViewState> {
height={height}
/>
),
snaps: [400, '100%']
snaps: [400, '100%'],
enableContentPanningGesture: false
});
};