import DateTimePicker from '@react-native-community/datetimepicker'; import type { FC } from 'react'; import { Platform, StyleSheet, View } from 'react-native'; import TButton from '../TButton/TButton'; import { withTheme, useTheme } from '../../core/theming'; import type { Theme } from '../../utils/types'; import { defaultScale } from '../../utils/Common'; import { moderateScale } from 'react-native-size-matters'; import TBottomModal from '../TModal/TBottomModal'; // import DeviceInfo from 'react-native-device-info'; interface Prop { date: Date; onChange: (selectedDate: any) => void; showPicker?: boolean; onCancelPress: () => void; onOkPress: () => void; negativeLabel?: string; positiveLabel?: string; theme: Theme; maxDate: Date; minDate: Date; txtColor?: string; } const TCalendar: FC = ({ date, onChange, showPicker, onCancelPress, onOkPress, negativeLabel = '', positiveLabel = '', maxDate, minDate, txtColor = '#000000', }): any => { const { colors } = useTheme(); const styleWithProps = styles({ colors }); return ( <> {Platform.OS === 'android' && showPicker && ( )} {Platform.OS === 'ios' && ( {/* {DeviceInfo.hasNotch() && Platform.OS === 'ios' && ( )} */} } /> )} ); }; const styles = (props: { colors: any }) => StyleSheet.create({ modalContentView: { alignItems: 'flex-end', flexDirection: 'row', justifyContent: 'space-between', height: moderateScale(45, defaultScale), backgroundColor: props.colors.white, }, dateContainer: { backgroundColor: props.colors.white, }, btnRightStyle: { marginLeft: moderateScale(15, defaultScale), }, btnLeftStyle: { marginRight: moderateScale(15, defaultScale), }, bottomModalView: { justifyContent: 'flex-end', margin: 0, }, bottomPaddingView: { position: 'absolute', bottom: 0, left: 0, right: 0, height: 36, backgroundColor: props.colors.white, }, }); export default withTheme(TCalendar);