File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ const propTypes = {
14
14
cancelText : PropTypes . string ,
15
15
itemStyle : PropTypes . object ,
16
16
onSubmit : PropTypes . func ,
17
+ onPressCancel : PropTypes . func ,
18
+ onPressConfirm : PropTypes . func ,
17
19
} ;
18
20
19
21
export default class CountryPicker extends Component {
@@ -44,12 +46,20 @@ export default class CountryPicker extends Component {
44
46
}
45
47
46
48
onPressCancel ( ) {
49
+ if ( this . props . onPressCancel ) {
50
+ this . props . onPressCancel ( ) ;
51
+ }
52
+
47
53
this . setState ( {
48
54
modalVisible : false ,
49
55
} ) ;
50
56
}
51
57
52
58
onPressSubmit ( ) {
59
+ if ( this . props . onPressConfirm ) {
60
+ this . props . onPressConfirm ( ) ;
61
+ }
62
+
53
63
if ( this . props . onSubmit ) {
54
64
this . props . onSubmit ( this . state . selectedCountry ) ;
55
65
}
Original file line number Diff line number Diff line change @@ -225,6 +225,8 @@ export default class PhoneInput extends Component {
225
225
confirmTextStyle = { this . props . confirmTextStyle }
226
226
pickerBackgroundColor = { this . props . pickerBackgroundColor }
227
227
itemStyle = { this . props . pickerItemStyle }
228
+ onPressCancel = { this . props . onPressCancel }
229
+ onPressConfirm = { this . props . onPressConfirm }
228
230
/>
229
231
</ View >
230
232
) ;
@@ -244,6 +246,8 @@ PhoneInput.propTypes = {
244
246
offset : PropTypes . number ,
245
247
textProps : PropTypes . object ,
246
248
onSelectCountry : PropTypes . func ,
249
+ onPressCancel : PropTypes . func ,
250
+ onPressConfirm : PropTypes . func ,
247
251
pickerButtonColor : PropTypes . string ,
248
252
pickerBackgroundColor : PropTypes . string ,
249
253
pickerItemStyle : styleType ,
You can’t perform that action at this time.
0 commit comments