From fa30720fedaa8f647683d5943b893ba057281047 Mon Sep 17 00:00:00 2001 From: Kirill Shestakov Date: Mon, 16 Oct 2017 17:51:19 +0400 Subject: [PATCH 1/2] Add an ability to set custom text styles --- src/CustomDatePickerIOS/index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/CustomDatePickerIOS/index.js b/src/CustomDatePickerIOS/index.js index 0d596d4..aedc5cc 100644 --- a/src/CustomDatePickerIOS/index.js +++ b/src/CustomDatePickerIOS/index.js @@ -23,6 +23,9 @@ export default class CustomDatePickerIOS extends Component { titleIOS: PropTypes.string, isVisible: PropTypes.bool, reactNativeModalPropsIOS: PropTypes.any, + titleStyle: PropTypes.any, + confirmTextStyle: PropTypes.any, + cancelTextStyle: PropTypes.any, }; static defaultProps = { @@ -94,12 +97,15 @@ export default class CustomDatePickerIOS extends Component { datePickerContainerStyleIOS, reactNativeModalPropsIOS, date, + titleStyle, + confirmTextStyle, + cancelTextStyle, ...otherProps } = this.props; const titleContainer = ( - {titleIOS} + {titleIOS} ); let confirmButton; @@ -119,9 +125,9 @@ export default class CustomDatePickerIOS extends Component { confirmButton = customConfirmButtonIOS; } } else { - confirmButton = {confirmTextIOS}; + confirmButton = {confirmTextIOS}; } - const cancelButton = {cancelTextIOS}; + const cancelButton = {cancelTextIOS}; return ( Date: Tue, 17 Oct 2017 02:23:50 +0400 Subject: [PATCH 2/2] Add info in README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a70f97c..6f7bd0f 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,9 @@ export default class DateTimePickerTester extends Component { | Name | Type| Default | Description | | --- | --- | --- | --- | | cancelTextIOS | string | 'Cancel' | The text on the cancel button on iOS | +| cancelTextStyle | style | | The style of the cancel button text on iOS | | confirmTextIOS | string | 'Confirm' | The text on the confirm button on iOS | +| confirmTextStyle | style | | The style of the confirm button text on iOS | | customCancelButtonIOS | node | | A custom component for the cancel button on iOS | | customConfirmButtonIOS | node | | A custom component for the confirm button on iOS | | customTitleContainerIOS | node | | A custom component for the title container on iOS | @@ -80,6 +82,7 @@ export default class DateTimePickerTester extends Component { | onHideAfterConfirm | func | () => {} | Called after the hiding animation if a date was picked | | onCancel | func | **REQUIRED** | Function called on dismiss | | titleIOS | string | 'Pick a date' | The title text on iOS | +| titleStyle | style | | The style of the title text on iOS | | minimumDate | Date | undefined | Min Date. Does not work with 'time' picker on Android. | | maximumDate | Date | undefined | Max Date. Does not work with 'time' picker on Android. | | is24Hour | bool | true | If false, the picker shows an AM/PM chooser on Android |