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 }} style={{ ...styles.container, ...bottomSheet }}
backgroundStyle={{ backgroundColor: colors.focusedBackground }} backgroundStyle={{ backgroundColor: colors.focusedBackground }}
onChange={index => index === -1 && onClose()} 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} {...androidTablet}
> >
<BottomSheetContent options={data?.options} hide={hide} children={data?.children} hasCancel={data?.hasCancel} /> <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); onChangeText(text);
}; };
const renderItem = React.memo((emoji: IEmoji) => ( const ListItem = React.memo(({ emoji }: { emoji: IEmoji }) => (
<View style={[styles.emojiContainer]}> <View style={[styles.emojiContainer]}>
<Pressable onPress={() => onEmojiSelected(emoji)}> <Pressable onPress={() => onEmojiSelected(emoji)}>
<Emoji emoji={emoji} baseUrl={baseUrl} /> <Emoji emoji={emoji} baseUrl={baseUrl} />
@ -76,7 +76,7 @@ const EmojiSearchBar = React.forwardRef<TextInput, IEmojiSearchBarProps>(
<FlatList <FlatList
horizontal horizontal
data={searchText ? emojis : frequentlyUsedEmojis} data={searchText ? emojis : frequentlyUsedEmojis}
renderItem={({ item }) => renderItem(item as IEmoji)} renderItem={({ item }) => <ListItem emoji={item as IEmoji} />}
showsHorizontalScrollIndicator={false} showsHorizontalScrollIndicator={false}
ListEmptyComponent={() => ( ListEmptyComponent={() => (
<View style={styles.listEmptyComponent}> <View style={styles.listEmptyComponent}>
@ -92,7 +92,8 @@ const EmojiSearchBar = React.forwardRef<TextInput, IEmojiSearchBarProps>(
<Pressable <Pressable
style={({ pressed }: { pressed: boolean }) => [styles.openEmojiKeyboard, { opacity: pressed ? 0.7 : 1 }]} style={({ pressed }: { pressed: boolean }) => [styles.openEmojiKeyboard, { opacity: pressed ? 0.7 : 1 }]}
onPress={openEmoji} onPress={openEmoji}
hitSlop={BUTTON_HIT_SLOP}> hitSlop={BUTTON_HIT_SLOP}
>
<CustomIcon name='chevron-left' size={30} color={colors.collapsibleChevron} /> <CustomIcon name='chevron-left' size={30} color={colors.collapsibleChevron} />
</Pressable> </Pressable>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>

View File

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

View File

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