Skip to content

Commit f07c4a8

Browse files
committed
fix: merge conflicts and FLashList api
1 parent 6c5f741 commit f07c4a8

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

package/src/components/Message/Message.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useEffect, useMemo, useRef, useState } from 'react';
22
import {
33
GestureResponderEvent,
4-
Keyboard,
54
StatusBar,
65
StyleProp,
76
useWindowDimensions,

package/src/components/MessageList/MessageFlashList.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
316316
const [scrollToBottomButtonVisible, setScrollToBottomButtonVisible] = useState(false);
317317
const [isUnreadNotificationOpen, setIsUnreadNotificationOpen] = useState<boolean>(false);
318318
const [stickyHeaderDate, setStickyHeaderDate] = useState<Date | undefined>();
319+
const [scrollEnabled, setScrollEnabled] = useState<boolean>(true);
319320

320321
const stickyHeaderDateRef = useRef<Date | undefined>(undefined);
321322
/**
@@ -717,20 +718,28 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
717718
[],
718719
);
719720

721+
const setNativeScrollability = useStableCallback((value: boolean) => {
722+
// FlashList does not have setNativeProps exposed, hence we cannot use that.
723+
// Instead, we resort to state.
724+
setScrollEnabled(value);
725+
});
726+
720727
const messageListItemContextValue: MessageListItemContextValue = useMemo(
721728
() => ({
722729
goToMessage,
723730
messageListPreviousAndNextMessageStore,
724731
modifiedTheme,
725732
noGroupByUser,
726733
onThreadSelect,
734+
setNativeScrollability,
727735
}),
728736
[
729737
goToMessage,
730738
messageListPreviousAndNextMessageStore,
731739
modifiedTheme,
732740
noGroupByUser,
733741
onThreadSelect,
742+
setNativeScrollability,
734743
],
735744
);
736745

@@ -1083,6 +1092,7 @@ const MessageFlashListWithContext = (props: MessageFlashListPropsWithContext) =>
10831092
onViewableItemsChanged={stableOnViewableItemsChanged}
10841093
ref={refCallback}
10851094
renderItem={renderItem}
1095+
scrollEnabled={scrollEnabled}
10861096
scrollEventThrottle={isLiveStreaming ? 16 : undefined}
10871097
showsVerticalScrollIndicator={false}
10881098
style={flatListStyle}

package/src/components/UIComponents/BottomSheetModal.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ import {
99
useWindowDimensions,
1010
View,
1111
} from 'react-native';
12-
import {
13-
Gesture,
14-
GestureDetector,
15-
GestureHandlerRootView,
16-
GestureUpdateEvent,
17-
PanGestureHandlerEventPayload,
18-
} from 'react-native-gesture-handler';
12+
import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler';
13+
import type { KeyboardEventData } from 'react-native-keyboard-controller';
1914
import Animated, {
2015
cancelAnimation,
2116
Easing,
@@ -26,11 +21,9 @@ import Animated, {
2621
withTiming,
2722
} from 'react-native-reanimated';
2823

29-
import type { KeyboardEventData } from 'react-native-keyboard-controller';
30-
3124
import { useTheme } from '../../contexts/themeContext/ThemeContext';
32-
import { KeyboardControllerPackage } from '../KeyboardCompatibleView/KeyboardControllerAvoidingView';
3325
import { useStableCallback } from '../../hooks';
26+
import { KeyboardControllerPackage } from '../KeyboardCompatibleView/KeyboardControllerAvoidingView';
3427

3528
export type BottomSheetModalProps = {
3629
onClose: () => void;

0 commit comments

Comments
 (0)