From 086b98f8fb7f2b91eaafb178485eee4737c2fb4d Mon Sep 17 00:00:00 2001 From: Danish Ahmed Mirza Date: Tue, 26 Jul 2022 02:37:10 +0530 Subject: [PATCH] Fix FlatList not working properly in ActionSheet --- app/containers/ActionSheet/ActionSheet.tsx | 3 +-- app/containers/EmojiPicker/EmojiCategory.tsx | 13 ++----------- app/containers/EmojiPicker/index.tsx | 2 -- app/definitions/IEmoji.ts | 1 - 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index 7ee96e0c3..3a715bdea 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -140,8 +140,7 @@ const ActionSheet = React.memo( style={{ ...styles.container, ...bottomSheet }} backgroundStyle={{ backgroundColor: colors.focusedBackground }} onChange={index => index === -1 && onClose()} - activeOffsetY={[-5, 5]} - failOffsetX={[-5, 5]} + enableContentPanningGesture={false} {...androidTablet} > diff --git a/app/containers/EmojiPicker/EmojiCategory.tsx b/app/containers/EmojiPicker/EmojiCategory.tsx index 33d8078f9..19800744d 100644 --- a/app/containers/EmojiPicker/EmojiCategory.tsx +++ b/app/containers/EmojiPicker/EmojiCategory.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { Text, Pressable } from 'react-native'; -import { BottomSheetFlatList } from '@gorhom/bottom-sheet'; -import { FlatList as GHFlatList } from 'react-native-gesture-handler'; +import { FlatList } from 'react-native-gesture-handler'; import shortnameToUnicode from '../../lib/methods/helpers/shortnameToUnicode'; import styles from './styles'; @@ -36,18 +35,10 @@ const Emoji = React.memo(({ emoji, size, baseUrl }: IEmojiProps) => { ); }); -const EmojiCategory = ({ - baseUrl, - onEmojiSelected, - emojis, - width, - tabsCount, - isBottomSheet -}: IEmojiCategory): React.ReactElement | null => { +const EmojiCategory = ({ baseUrl, onEmojiSelected, emojis, width, tabsCount }: IEmojiCategory): React.ReactElement | null => { const emojiSize = width ? Math.min(width / tabsCount, MAX_EMOJI_SIZE) : MAX_EMOJI_SIZE; const numColumns = Math.trunc(width ? width / emojiSize : tabsCount); const { colors } = useTheme(); - const FlatList = isBottomSheet ? BottomSheetFlatList : GHFlatList; const renderItem = (emoji: IEmoji) => ( ); }; @@ -159,7 +158,6 @@ const EmojiPicker = ({ baseUrl={baseUrl} tabLabel={'searching'} tabsCount={tabsCount} - isBottomSheet={!isEmojiKeyboard} /> ) : ( ; tabLabel: string; tabsCount: number; - isBottomSheet: boolean; } export type TGetCustomEmoji = (name: string) => any;