Skip to content

Commit 027920d

Browse files
committed
fix: change flatlist inside the bottom sheet modal and fix gesture in bottom sheet
1 parent f79bc2b commit 027920d

File tree

3 files changed

+42
-30
lines changed

3 files changed

+42
-30
lines changed

package/src/components/MessageMenu/MessageActionList.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React from 'react';
2-
import { StyleSheet, View } from 'react-native';
2+
import { StyleSheet } from 'react-native';
3+
4+
import { ScrollView } from 'react-native-gesture-handler';
35

46
import { MessageActionType } from './MessageActionListItem';
57

@@ -31,14 +33,14 @@ export const MessageActionList = (props: MessageActionListProps) => {
3133
if (messageActions?.length === 0) return null;
3234

3335
return (
34-
<View accessibilityLabel='Message action list' style={[styles.container, container]}>
36+
<ScrollView accessibilityLabel='Message action list' style={[styles.container, container]}>
3537
{messageActions?.map((messageAction, index) => (
3638
<MessageActionListItem
3739
key={messageAction.title}
3840
{...{ ...messageAction, index, length: messageActions.length }}
3941
/>
4042
))}
41-
</View>
43+
</ScrollView>
4244
);
4345
};
4446

package/src/components/MessageMenu/MessageUserReactions.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useMemo } from 'react';
2-
import { FlatList, StyleSheet, Text, View } from 'react-native';
2+
import { StyleSheet, Text, View } from 'react-native';
3+
import { FlatList } from 'react-native-gesture-handler';
34

45
import { ReactionSortBase } from 'stream-chat';
56

@@ -179,7 +180,9 @@ export const MessageUserReactions = (props: MessageUserReactionsProps) => {
179180
};
180181

181182
const styles = StyleSheet.create({
182-
container: {},
183+
container: {
184+
flex: 1,
185+
},
183186
contentContainer: {
184187
flexGrow: 1,
185188
justifyContent: 'space-around',

package/src/components/UIComponents/BottomSheetModal.tsx

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import React, { PropsWithChildren, useEffect } from 'react';
22
import {
33
Animated,
4-
Keyboard,
5-
KeyboardEvent,
4+
Dimensions,
65
Modal,
76
StyleSheet,
8-
TouchableWithoutFeedback,
97
useWindowDimensions,
8+
TouchableWithoutFeedback,
109
View,
10+
Keyboard,
11+
KeyboardEvent,
1112
} from 'react-native';
1213
import {
1314
Gesture,
@@ -119,32 +120,38 @@ export const BottomSheetModal = (props: PropsWithChildren<BottomSheetModalProps>
119120
});
120121

121122
return (
122-
<GestureHandlerRootView style={{ flex: 1 }}>
123-
<Modal animationType='fade' onRequestClose={handleDismiss} transparent visible={visible}>
124-
<TouchableWithoutFeedback onPress={handleDismiss}>
125-
<View style={[styles.overlay, { backgroundColor: overlay }, overlayTheme]}>
123+
<View style={{ alignItems: 'center', flex: 1, justifyContent: 'center' }}>
124+
<Modal onRequestClose={onClose} transparent visible={visible}>
125+
<TouchableWithoutFeedback onPress={onClose} style={{ flex: 1 }}>
126+
<GestureHandlerRootView style={{ flex: 1 }}>
126127
<GestureDetector gesture={gesture}>
127-
<Animated.View
128-
style={[
129-
styles.container,
130-
{
131-
backgroundColor: white_snow,
132-
height,
133-
transform: [{ translateY }],
134-
},
135-
container,
136-
]}
137-
>
138-
<View
139-
style={[styles.handle, { backgroundColor: grey, width: windowWidth / 4 }, handle]}
140-
/>
141-
<View style={[styles.contentContainer, contentContainer]}>{children}</View>
142-
</Animated.View>
128+
<View style={[styles.overlay, { backgroundColor: overlay }, overlayTheme]}>
129+
<Animated.View
130+
style={[
131+
styles.container,
132+
{
133+
backgroundColor: white_snow,
134+
height,
135+
transform: [{ translateY }],
136+
},
137+
container,
138+
]}
139+
>
140+
<View
141+
style={[
142+
styles.handle,
143+
{ backgroundColor: grey, width: windowWidth / 4 },
144+
handle,
145+
]}
146+
/>
147+
<View style={[styles.contentContainer, contentContainer]}>{children}</View>
148+
</Animated.View>
149+
</View>
143150
</GestureDetector>
144-
</View>
151+
</GestureHandlerRootView>
145152
</TouchableWithoutFeedback>
146153
</Modal>
147-
</GestureHandlerRootView>
154+
</View>
148155
);
149156
};
150157

0 commit comments

Comments
 (0)