diff --git a/RNDatePicker.js b/RNDatePicker.js index e0b69b5..9f4e7d2 100644 --- a/RNDatePicker.js +++ b/RNDatePicker.js @@ -1,6 +1,7 @@ -import React, { +import React, {Component} from 'react'; + +import { Platform, - Component, Modal, View, DatePickerIOS, @@ -54,6 +55,7 @@ export default class CustomDatePicker extends Component { } openIOSDatePicker() { + this.props.onOpen ? this.props.onOpen() : null; this.setState({ showModal: true }); } @@ -105,7 +107,6 @@ export default class CustomDatePicker extends Component { if (Platform.OS === 'ios') { return ( @@ -163,6 +164,7 @@ export default class CustomDatePicker extends Component { CustomDatePicker.propTypes = { onDone: React.PropTypes.func.isRequired, onCancel: React.PropTypes.func, + onOpen: React.PropTypes.func, initialDate: React.PropTypes.instanceOf(Date), minDate: React.PropTypes.instanceOf(Date), maxDate: React.PropTypes.instanceOf(Date), @@ -187,7 +189,8 @@ const styles = StyleSheet.create({ top: 0, left: 0, alignItems: 'center', - justifyContent: 'flex-end' + justifyContent: 'flex-end', + backgroundColor: 'rgba(0,0,0,0.5)' }, btnContainer: { width: WIN.width, @@ -199,9 +202,7 @@ const styles = StyleSheet.create({ }, datePickerIOSWrapper: { width: WIN.width, - backgroundColor: 'white', - alignItems: 'center', - justifyContent: 'center' + backgroundColor: 'white' }, datePickerIOS: { backgroundColor: 'white' diff --git a/package.json b/package.json index 590f959..65b5e3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-date-picker", - "version": "0.0.1", + "version": "0.0.2", "description": "Cross platform wrapper around RN date pickers", "main": "RNDatePicker.js", "scripts": {