Skip to content

Commit 4e463d3

Browse files
authored
feat(android)!: remove deprecated positiveButtonLabel, negativeButtonLabel, neutralButtonLabel props (#1039)
1 parent 2577e71 commit 4e463d3

File tree

6 files changed

+0
-71
lines changed

6 files changed

+0
-71
lines changed

README.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -568,31 +568,6 @@ Set the negative button label and text color.
568568
<RNDateTimePicker negativeButton={{label: 'Cancel', textColor: 'red'}} />
569569
```
570570

571-
#### `positiveButtonLabel` (`optional`, `Android only`, deprecated)
572-
573-
Changes the label of the positive button.
574-
575-
```js
576-
<RNDateTimePicker positiveButtonLabel="OK!" />
577-
```
578-
579-
#### `negativeButtonLabel` (`optional`, `Android only`, deprecated)
580-
581-
Changes the label of the negative button.
582-
583-
```js
584-
<RNDateTimePicker negativeButtonLabel="Negative" />
585-
```
586-
587-
#### `neutralButtonLabel` (`optional`, `Android only`, deprecated)
588-
589-
Allows displaying neutral button on picker dialog.
590-
Pressing button can be observed in onChange handler as `event.type === 'neutralButtonPressed'`
591-
592-
```js
593-
<RNDateTimePicker neutralButtonLabel="clear" />
594-
```
595-
596571
#### `minuteInterval` (`optional`)
597572

598573
The interval at which minutes can be selected.

src/DateTimePickerAndroid.android.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ function open(props: AndroidNativeProps) {
4242
positiveButton,
4343
negativeButton,
4444
neutralButton,
45-
neutralButtonLabel,
46-
positiveButtonLabel,
47-
negativeButtonLabel,
4845
testID,
4946
firstDayOfWeek,
5047
title,
@@ -63,17 +60,14 @@ function open(props: AndroidNativeProps) {
6360
try {
6461
const dialogButtons = {
6562
positive: {
66-
label: positiveButtonLabel,
6763
...positiveButton,
6864
textColor: processColor(positiveButton?.textColor),
6965
},
7066
neutral: {
71-
label: neutralButtonLabel,
7267
...neutralButton,
7368
textColor: processColor(neutralButton?.textColor),
7469
},
7570
negative: {
76-
label: negativeButtonLabel,
7771
...negativeButton,
7872
textColor: processColor(negativeButton?.textColor),
7973
},

src/androidUtils.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,6 @@ function validateAndroidProps(props: AndroidNativeProps) {
121121
!(display === ANDROID_DISPLAY.clock && mode === ANDROID_MODE.date),
122122
`display: ${display} and mode: ${mode} cannot be used together.`,
123123
);
124-
if (
125-
props?.positiveButtonLabel !== undefined ||
126-
props?.negativeButtonLabel !== undefined ||
127-
props?.neutralButtonLabel !== undefined
128-
) {
129-
console.warn(
130-
'positiveButtonLabel, negativeButtonLabel and neutralButtonLabel are deprecated.' +
131-
'Use positive / negative / neutralButton prop instead.',
132-
);
133-
}
134124
}
135125

136126
function validateMaterial3PropsNotUsed(props: AndroidNativeProps) {

src/datetimepicker.android.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ export default function RNDateTimePickerAndroid(
2828
positiveButton,
2929
negativeButton,
3030
neutralButton,
31-
positiveButtonLabel,
32-
negativeButtonLabel,
33-
neutralButtonLabel,
3431
testID,
3532
firstDayOfWeek,
3633
title,
@@ -64,9 +61,6 @@ export default function RNDateTimePickerAndroid(
6461
positiveButton,
6562
negativeButton,
6663
neutralButton,
67-
positiveButtonLabel,
68-
negativeButtonLabel,
69-
neutralButtonLabel,
7064
testID,
7165
firstDayOfWeek,
7266
title,

src/index.d.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,6 @@ export type AndroidNativeProps = Readonly<
165165
neutralButton?: ButtonType;
166166
negativeButton?: ButtonType;
167167

168-
/**
169-
* @deprecated use neutralButton instead
170-
* */
171-
neutralButtonLabel?: string;
172-
/**
173-
* @deprecated use positiveButton instead
174-
* */
175-
positiveButtonLabel?: string;
176-
/**
177-
* @deprecated use negativeButton instead
178-
* */
179-
negativeButtonLabel?: string;
180168
/**
181169
* Sets the first day of the week shown in the calendar
182170
*/

src/types.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,6 @@ export type AndroidNativeProps = $ReadOnly<{|
237237
// Not supported in Material 3 pickers
238238
neutralButton?: ButtonType,
239239
negativeButton?: ButtonType,
240-
/**
241-
* @deprecated use neutralButton instead
242-
* */
243-
neutralButtonLabel?: string,
244-
/**
245-
* @deprecated use positiveButton instead
246-
* */
247-
positiveButtonLabel?: string,
248-
/**
249-
* @deprecated use negativeButton instead
250-
* */
251-
negativeButtonLabel?: string,
252240
/**
253241
* Sets the first day of the week shown in the calendar
254242
*/

0 commit comments

Comments
 (0)