Skip to content

Commit f1b17e0

Browse files
committed
fix:bottom sheet transparent click area
1 parent 26380ee commit f1b17e0

File tree

3 files changed

+41
-32
lines changed

3 files changed

+41
-32
lines changed

package/src/components/MessageMenu/MessageActionList.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,19 @@ export const MessageActionList = (props: MessageActionListProps) => {
2525
const {
2626
theme: {
2727
messageMenu: {
28-
actionList: { container },
28+
actionList: { container, contentContainer },
2929
},
3030
},
3131
} = useTheme();
3232

3333
if (messageActions?.length === 0) return null;
3434

3535
return (
36-
<ScrollView accessibilityLabel='Message action list' style={[styles.container, container]}>
36+
<ScrollView
37+
accessibilityLabel='Message action list'
38+
contentContainerStyle={[styles.contentContainer, contentContainer]}
39+
style={[styles.container, container]}
40+
>
3741
{messageActions?.map((messageAction, index) => (
3842
<MessageActionListItem
3943
key={messageAction.title}
@@ -45,7 +49,8 @@ export const MessageActionList = (props: MessageActionListProps) => {
4549
};
4650

4751
const styles = StyleSheet.create({
48-
container: {
52+
container: {},
53+
contentContainer: {
4954
paddingHorizontal: 16,
5055
},
5156
});

package/src/components/UIComponents/BottomSheetModal.tsx

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -119,36 +119,33 @@ export const BottomSheetModal = (props: PropsWithChildren<BottomSheetModalProps>
119119
});
120120

121121
return (
122-
<View style={{ alignItems: 'center', flex: 1, justifyContent: 'center' }}>
122+
<View style={styles.wrapper}>
123123
<Modal onRequestClose={onClose} transparent visible={visible}>
124-
<TouchableWithoutFeedback onPress={onClose} style={{ flex: 1 }}>
125-
<GestureHandlerRootView style={{ flex: 1 }}>
126-
<GestureDetector gesture={gesture}>
127-
<View style={[styles.overlay, { backgroundColor: overlay }, overlayTheme]}>
128-
<Animated.View
129-
style={[
130-
styles.container,
131-
{
132-
backgroundColor: white_snow,
133-
height,
134-
transform: [{ translateY }],
135-
},
136-
container,
137-
]}
138-
>
139-
<View
140-
style={[
141-
styles.handle,
142-
{ backgroundColor: grey, width: windowWidth / 4 },
143-
handle,
144-
]}
145-
/>
146-
<View style={[styles.contentContainer, contentContainer]}>{children}</View>
147-
</Animated.View>
148-
</View>
149-
</GestureDetector>
150-
</GestureHandlerRootView>
151-
</TouchableWithoutFeedback>
124+
<GestureHandlerRootView style={{ flex: 1 }}>
125+
<GestureDetector gesture={gesture}>
126+
<View style={[styles.overlay, { backgroundColor: overlay }, overlayTheme]}>
127+
<TouchableWithoutFeedback onPress={onClose} style={{ flex: 1 }}>
128+
<View style={{ flex: 1 }} />
129+
</TouchableWithoutFeedback>
130+
<Animated.View
131+
style={[
132+
styles.container,
133+
{
134+
backgroundColor: white_snow,
135+
height,
136+
transform: [{ translateY }],
137+
},
138+
container,
139+
]}
140+
>
141+
<View
142+
style={[styles.handle, { backgroundColor: grey, width: windowWidth / 4 }, handle]}
143+
/>
144+
<View style={[styles.contentContainer, contentContainer]}>{children}</View>
145+
</Animated.View>
146+
</View>
147+
</GestureDetector>
148+
</GestureHandlerRootView>
152149
</Modal>
153150
</View>
154151
);
@@ -177,4 +174,9 @@ const styles = StyleSheet.create({
177174
flex: 1,
178175
justifyContent: 'flex-end',
179176
},
177+
wrapper: {
178+
alignItems: 'center',
179+
flex: 1,
180+
justifyContent: 'center',
181+
},
180182
});

package/src/contexts/themeContext/utils/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ export type Theme = {
442442
messageMenu: {
443443
actionList: {
444444
container: ViewStyle;
445+
contentContainer: ViewStyle;
445446
};
446447
actionListItem: {
447448
container: ViewStyle;
@@ -1196,6 +1197,7 @@ export const defaultTheme: Theme = {
11961197
messageMenu: {
11971198
actionList: {
11981199
container: {},
1200+
contentContainer: {},
11991201
},
12001202
actionListItem: {
12011203
container: {},

0 commit comments

Comments
 (0)