Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jed Shi committed Aug 27, 2024
1 parent b0cafbb commit ba8b73e
Showing 1 changed file with 31 additions and 25 deletions.
56 changes: 31 additions & 25 deletions src/Date/DatePickerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
useWindowDimensions,
View,
Platform,
Dimensions,
} from 'react-native'
import { useTheme } from 'react-native-paper'
import DatePickerModalContent, {
Expand Down Expand Up @@ -75,33 +76,35 @@ export function DatePickerModal(
supportedOrientations={supportedOrientations}
statusBarTranslucent={true}
>
<TouchableWithoutFeedback onPress={rest.onDismiss}>
<View
style={[
StyleSheet.absoluteFill,
sharedStyles.root,
{ backgroundColor: theme.colors.backdrop },
]}
/>
</TouchableWithoutFeedback>
<View
style={[StyleSheet.absoluteFill, styles.modalRoot]}
pointerEvents="box-none"
>
<View style={styles.modal}>
<TouchableWithoutFeedback onPress={rest.onDismiss}>
<View
style={[
StyleSheet.absoluteFill,
sharedStyles.root,
{ backgroundColor: theme.colors.backdrop },
]}
/>
</TouchableWithoutFeedback>
<View
style={[
styles.modalContent,
{ backgroundColor: theme.colors.surface },
dimensions.width > 650 ? styles.modalContentBig : null,
]}
style={[StyleSheet.absoluteFill, styles.modalRoot]}
pointerEvents="box-none"
>
<DatePickerModalContent
{...rest}
inputEnabled={inputEnabled}
disableSafeTop={disableStatusBarPadding}
disableStatusBar={disableStatusBar}
statusBarOnTopOfBackdrop={isPageSheet || statusBarOnTopOfBackdrop}
/>
<View
style={[
styles.modalContent,
{ backgroundColor: theme.colors.surface },
dimensions.width > 650 ? styles.modalContentBig : null,
]}
>
<DatePickerModalContent
{...rest}
inputEnabled={inputEnabled}
disableSafeTop={disableStatusBarPadding}
disableStatusBar={disableStatusBar}
statusBarOnTopOfBackdrop={isPageSheet || statusBarOnTopOfBackdrop}
/>
</View>
</View>
</View>
</Modal>
Expand All @@ -110,6 +113,9 @@ export function DatePickerModal(
}

const styles = StyleSheet.create({
modal: {
height: Dimensions.get('screen').height
},
modalContent: {
flex: 1,
width: '100%',
Expand Down

0 comments on commit ba8b73e

Please sign in to comment.