react-native-date-picker
Advanced tools
Comparing version 4.1.5 to 4.2.0
@@ -103,4 +103,7 @@ import { Component } from 'react' | ||
title?: string | null | ||
/** Modal color theme on iOS. Defaults to 'auto' */ | ||
theme?: 'light' | 'dark' | 'auto' | ||
} | ||
export default class DatePicker extends Component<DatePickerProps> {} |
{ | ||
"name": "react-native-date-picker", | ||
"version": "4.1.5", | ||
"version": "4.2.0", | ||
"description": "A datetime picker for React Native. In-modal or inlined. Supports Android and iOS.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -39,2 +39,3 @@ import React, { useEffect } from 'react' | ||
minimumDate: props.minimumDate ? props.minimumDate.getTime() : undefined, | ||
theme: props.theme ? props.theme : 'auto', | ||
} | ||
@@ -41,0 +42,0 @@ } |
@@ -56,2 +56,8 @@ export function throwIfInvalidProps(props) { | ||
const themeCheck = new PropCheck( | ||
(props) => | ||
props && props.theme && !['light', 'dark', 'auto'].includes(props.theme), | ||
"Invalid theme. Valid options: 'light', 'dark', 'auto'" | ||
) | ||
const checks = [ | ||
@@ -63,2 +69,3 @@ dateCheck, | ||
androidVariantCheck, | ||
themeCheck, | ||
] |
@@ -11,2 +11,6 @@ import { Platform, ViewPropTypes } from 'react-native' | ||
const iOSPropTypes = { | ||
theme: PropTypes.oneOf(['light', 'dark', 'auto']), | ||
} | ||
const modalPropTypes = { | ||
@@ -25,3 +29,3 @@ modal: PropTypes.bool, | ||
export default { | ||
...(Platform === 'android' ? androidPropTypes : {}), | ||
...(Platform === 'android' ? androidPropTypes : iOSPropTypes), | ||
date: DateType.isRequired, | ||
@@ -28,0 +32,0 @@ onChange: PropTypes.func, |
Sorry, the diff of this file is not supported yet
181165
594