Skip to content

Commit 45206d9

Browse files
committed
Added Platform.Select to different devices and web
1 parent 7ca4d8e commit 45206d9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Date/DatePickerModal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import DatePickerModalContent, {
1414
DatePickerModalContentRangeProps,
1515
DatePickerModalContentSingleProps,
1616
} from './DatePickerModalContent'
17+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
1718

1819
interface DatePickerModalProps {
1920
visible: boolean
@@ -65,6 +66,7 @@ export function DatePickerModal(
6566
})
6667

6768
const isTransparent = presentationStyle === 'pageSheet' ? false : true
69+
const insets = useSafeAreaInsets()
6870

6971
return (
7072
<View style={[StyleSheet.absoluteFill]} pointerEvents="box-none">
@@ -103,7 +105,11 @@ export function DatePickerModal(
103105
<View
104106
style={[
105107
{
106-
height: StatusBar.currentHeight,
108+
height: Platform.select({
109+
ios: StatusBar.currentHeight,
110+
android: StatusBar.currentHeight,
111+
web: insets.top,
112+
}),
107113
backgroundColor: theme.colors.primary,
108114
},
109115
]}

0 commit comments

Comments
 (0)