@@ -25,6 +25,7 @@ export default class CustomDatePickerIOS extends React.PureComponent {
2525 customTitleContainerIOS : PropTypes . node ,
2626 dismissOnBackdropPressIOS : PropTypes . bool ,
2727 hideTitleContainerIOS : PropTypes . bool ,
28+ isDarkModeEnabled : PropTypes . bool ,
2829 isVisible : PropTypes . bool ,
2930 date : PropTypes . instanceOf ( Date ) ,
3031 datePickerContainerStyleIOS : PropTypes . any ,
@@ -46,6 +47,7 @@ export default class CustomDatePickerIOS extends React.PureComponent {
4647 date : new Date ( ) ,
4748 dismissOnBackdropPressIOS : true ,
4849 hideTitleContainerIOS : false ,
50+ isDarkModeEnabled : false ,
4951 isVisible : false ,
5052 mode : "date" ,
5153 neverDisableConfirmIOS : false ,
@@ -131,6 +133,7 @@ export default class CustomDatePickerIOS extends React.PureComponent {
131133 datePickerContainerStyleIOS,
132134 dismissOnBackdropPressIOS,
133135 hideTitleContainerIOS,
136+ isDarkModeEnabled,
134137 isVisible,
135138 minuteInterval,
136139 mode,
@@ -185,6 +188,8 @@ export default class CustomDatePickerIOS extends React.PureComponent {
185188 ...reactNativeModalPropsIOS
186189 } ;
187190
191+ const backgroundColor = isDarkModeEnabled ? BACKGROUND_COLOR_DARK : BACKGROUND_COLOR_LIGHT ;
192+
188193 return (
189194 < ReactNativeModal
190195 isVisible = { isVisible }
@@ -194,7 +199,7 @@ export default class CustomDatePickerIOS extends React.PureComponent {
194199 backdropOpacity = { 0.4 }
195200 { ...reactNativeModalProps }
196201 >
197- < View style = { [ styles . datepickerContainer , datePickerContainerStyleIOS ] } >
202+ < View style = { [ styles . datepickerContainer , { backgroundColor } , datePickerContainerStyleIOS ] } >
198203 { ! hideTitleContainerIOS &&
199204 ( customTitleContainerIOS || titleContainer ) }
200205 < View
@@ -224,7 +229,7 @@ export default class CustomDatePickerIOS extends React.PureComponent {
224229 </ View >
225230
226231 < TouchableHighlight
227- style = { [ styles . cancelButton , cancelButtonContainerStyleIOS ] }
232+ style = { [ styles . cancelButton , { backgroundColor } , cancelButtonContainerStyleIOS ] }
228233 underlayColor = { HIGHLIGHT_COLOR }
229234 onPress = { this . handleCancel }
230235 >
@@ -236,7 +241,8 @@ export default class CustomDatePickerIOS extends React.PureComponent {
236241}
237242
238243const BORDER_RADIUS = 13 ;
239- const BACKGROUND_COLOR = "white" ;
244+ const BACKGROUND_COLOR_LIGHT = "white" ;
245+ const BACKGROUND_COLOR_DARK = "#0E0E0E" ;
240246const BORDER_COLOR = "#d5d5d5" ;
241247const TITLE_FONT_SIZE = 13 ;
242248const TITLE_COLOR = "#8f8f8f" ;
@@ -251,7 +257,6 @@ const styles = StyleSheet.create({
251257 margin : 10
252258 } ,
253259 datepickerContainer : {
254- backgroundColor : BACKGROUND_COLOR ,
255260 borderRadius : BORDER_RADIUS ,
256261 marginBottom : 8 ,
257262 overflow : "hidden"
@@ -282,7 +287,6 @@ const styles = StyleSheet.create({
282287 backgroundColor : "transparent"
283288 } ,
284289 cancelButton : {
285- backgroundColor : BACKGROUND_COLOR ,
286290 borderRadius : BORDER_RADIUS ,
287291 height : 57 ,
288292 marginBottom : isIphoneX ( ) ? 20 : 0 ,
0 commit comments