Skip to content

Commit 02cd74f

Browse files
committed
fix: code improvements
1 parent 8a0d12c commit 02cd74f

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

app/containers/ActionSheet/BottomSheetContent.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FlatList, Platform, Text, useWindowDimensions, View, type ViewProps } from 'react-native';
1+
import { FlatList, Text, useWindowDimensions, View, type ViewProps } from 'react-native';
22
import React from 'react';
33
import { useSafeAreaInsets } from 'react-native-safe-area-context';
44

@@ -30,6 +30,7 @@ const BottomSheetContent = React.memo(
3030
const { fontScale } = useWindowDimensions();
3131
const height = 48 * fontScale;
3232
const paddingBottom = bottom + height;
33+
const minHeightStyle = isAndroid || !contentMinHeight ? undefined : { minHeight: contentMinHeight };
3334

3435
const renderFooter = () =>
3536
hasCancel ? (
@@ -65,19 +66,7 @@ const BottomSheetContent = React.memo(
6566
);
6667
}
6768
return (
68-
<View
69-
testID='action-sheet'
70-
style={
71-
fullContainer
72-
? {
73-
width: '100%',
74-
height: '100%',
75-
flex: 0,
76-
...(Platform.OS === 'ios' && contentMinHeight != null && { minHeight: contentMinHeight })
77-
}
78-
: undefined
79-
}
80-
onLayout={onLayout}>
69+
<View testID='action-sheet' style={fullContainer ? [styles.fullContainer, minHeightStyle] : undefined} onLayout={onLayout}>
8170
{children}
8271
</View>
8372
);

app/containers/ActionSheet/styles.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,10 @@ export default StyleSheet.create({
7171
},
7272
contentContainer: {
7373
flex: 0
74+
},
75+
fullContainer: {
76+
width: '100%',
77+
height: '100%',
78+
flex: 0
7479
}
7580
});

0 commit comments

Comments
 (0)