@@ -5,17 +5,17 @@ import DateTimePicker from "@react-native-community/datetimepicker";
55import Modal from "./Modal" ;
66import { isIphoneX } from "./utils" ;
77
8- const BORDER_RADIUS = 13 ;
9- const BACKGROUND_COLOR_LIGHT = "white" ;
10- const BACKGROUND_COLOR_DARK = "#0E0E0E" ;
11- const BORDER_COLOR = "#d5d5d5" ;
12- const TITLE_FONT_SIZE = 20 ;
13- const TITLE_COLOR = "#8f8f8f" ;
14- const BUTTON_FONT_WEIGHT = "normal" ;
15- const BUTTON_FONT_COLOR = "#007ff9" ;
16- const BUTTON_FONT_SIZE = 20 ;
17- const HIGHLIGHT_COLOR_LIGHT = "#ebebeb" ;
18- const HIGHLIGHT_COLOR_DARK = "#444444" ;
8+ export const BORDER_RADIUS = 13 ;
9+ export const BACKGROUND_COLOR_LIGHT = "white" ;
10+ export const BACKGROUND_COLOR_DARK = "#0E0E0E" ;
11+ export const BORDER_COLOR = "#d5d5d5" ;
12+ export const TITLE_FONT_SIZE = 20 ;
13+ export const TITLE_COLOR = "#8f8f8f" ;
14+ export const BUTTON_FONT_WEIGHT = "normal" ;
15+ export const BUTTON_FONT_COLOR = "#007ff9" ;
16+ export const BUTTON_FONT_SIZE = 20 ;
17+ export const HIGHLIGHT_COLOR_LIGHT = "#ebebeb" ;
18+ export const HIGHLIGHT_COLOR_DARK = "#444444" ;
1919
2020const deprecatedPropsInfo = [
2121 { prop : "titleIOS" , newProp : "headerTextIOS" } ,
@@ -35,7 +35,7 @@ const unsopportedPropsInfo = [
3535 { prop : "reactNativeModalPropsIOS" }
3636] ;
3737
38- export default class DateTimePickerModal extends React . PureComponent {
38+ export class DateTimePickerModal extends React . PureComponent {
3939 static propTypes = {
4040 cancelTextIOS : PropTypes . string ,
4141 confirmTextIOS : PropTypes . string ,
@@ -232,15 +232,15 @@ const pickerStyles = StyleSheet.create({
232232 }
233233} ) ;
234234
235- export const Header = ( { label } ) => {
235+ export const Header = ( { label, style = headerStyles } ) => {
236236 return (
237- < View style = { headerStyles . root } >
238- < Text style = { headerStyles . text } > { label } </ Text >
237+ < View style = { style . root } >
238+ < Text style = { style . text } > { label } </ Text >
239239 </ View >
240240 ) ;
241241} ;
242242
243- const headerStyles = StyleSheet . create ( {
243+ export const headerStyles = StyleSheet . create ( {
244244 root : {
245245 borderBottomColor : BORDER_COLOR ,
246246 borderBottomWidth : StyleSheet . hairlineWidth ,
@@ -258,24 +258,25 @@ export const ConfirmButton = ({
258258 isDarkModeEnabled,
259259 isDisabled,
260260 onPress,
261- label
261+ label,
262+ style = confirmButtonStyles
262263} ) => {
263264 const underlayColor = isDarkModeEnabled
264265 ? HIGHLIGHT_COLOR_DARK
265266 : HIGHLIGHT_COLOR_LIGHT ;
266267 return (
267268 < TouchableHighlight
268- style = { confirmButtonStyles . button }
269+ style = { style . button }
269270 underlayColor = { underlayColor }
270271 onPress = { onPress }
271272 disabled = { isDisabled }
272273 >
273- < Text style = { confirmButtonStyles . text } > { label } </ Text >
274+ < Text style = { style . text } > { label } </ Text >
274275 </ TouchableHighlight >
275276 ) ;
276277} ;
277278
278- const confirmButtonStyles = StyleSheet . create ( {
279+ export const confirmButtonStyles = StyleSheet . create ( {
279280 button : {
280281 borderColor : BORDER_COLOR ,
281282 borderTopWidth : StyleSheet . hairlineWidth ,
@@ -292,7 +293,12 @@ const confirmButtonStyles = StyleSheet.create({
292293 }
293294} ) ;
294295
295- export const CancelButton = ( { isDarkModeEnabled, onPress, label } ) => {
296+ export const CancelButton = ( {
297+ isDarkModeEnabled,
298+ onPress,
299+ label,
300+ style = cancelButtonStyles
301+ } ) => {
296302 const themedButtonStyle = isDarkModeEnabled
297303 ? cancelButtonStyles . buttonDark
298304 : cancelButtonStyles . buttonLight ;
@@ -301,16 +307,16 @@ export const CancelButton = ({ isDarkModeEnabled, onPress, label }) => {
301307 : HIGHLIGHT_COLOR_LIGHT ;
302308 return (
303309 < TouchableHighlight
304- style = { [ cancelButtonStyles . button , themedButtonStyle ] }
310+ style = { [ style . button , themedButtonStyle ] }
305311 underlayColor = { underlayColor }
306312 onPress = { onPress }
307313 >
308- < Text style = { cancelButtonStyles . text } > { label } </ Text >
314+ < Text style = { style . text } > { label } </ Text >
309315 </ TouchableHighlight >
310316 ) ;
311317} ;
312318
313- const cancelButtonStyles = StyleSheet . create ( {
319+ export const cancelButtonStyles = StyleSheet . create ( {
314320 button : {
315321 borderRadius : BORDER_RADIUS ,
316322 height : 57 ,
0 commit comments