Skip to content

Commit 6915130

Browse files
authored
Dialog remove deprecated prop (#1550)
* Dialog - remove 'onModalDismissed' (use 'onDialogDismissed') * remove 'migrate' prop from demos
1 parent 75b2599 commit 6915130

File tree

10 files changed

+7
-30
lines changed

10 files changed

+7
-30
lines changed

demo/src/screens/componentScreens/ChipScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default class ChipScreen extends Component {
7272
const {showDialog} = this.state;
7373

7474
return (
75-
<Dialog migrate visible={showDialog} useSafeArea bottom onDismiss={this.closeDialog}>
75+
<Dialog visible={showDialog} useSafeArea bottom onDismiss={this.closeDialog}>
7676
{this.renderContent()}
7777
</Dialog>
7878
);

demo/src/screens/componentScreens/DialogScreen.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ Scroll: ${scroll}`;
235235

236236
return (
237237
<Dialog
238-
migrate
239238
useSafeArea
240239
key={this.getDialogKey(height)}
241240
top={position === 'top'}

demo/src/screens/componentScreens/PickerScreen.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export default class PickerScreen extends Component {
5757

5858
return (
5959
<Dialog
60-
migrate
6160
visible={visible}
6261
onDismiss={() => {
6362
onDone();

generatedTypes/src/components/actionSheet/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ declare type ActionSheetProps = {
6666
/**
6767
* Called once the modal has been dismissed (iOS only, modal only)
6868
*/
69-
onModalDismissed?: DialogProps['onModalDismissed'];
69+
onModalDismissed?: DialogProps['onDialogDismissed'];
7070
/**
7171
* Whether or not to handle SafeArea
7272
*/

generatedTypes/src/components/dialog/index.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ export interface DialogProps extends AlignmentModifiers, RNPartialProps {
3939
* Whether or not to handle SafeArea
4040
*/
4141
useSafeArea?: boolean;
42-
/**
43-
* Called once the modal has been dismissed (iOS only) - Deprecated, use onDialogDismissed instead
44-
*/
45-
onModalDismissed?: (props: any) => void;
4642
/**
4743
* Called once the dialog has been dismissed completely
4844
*/

src/components/actionSheet/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import Image from '../image';
1313
import ListItem from '../listItem';
1414
import PanningProvider from '../panningViews/panningProvider';
1515

16-
const VERTICAL_PADDING = 8;
1716

17+
const VERTICAL_PADDING = 8;
1818
type ActionSheetOnOptionPress = (index: number) => void;
1919

2020
type ActionSheetProps = {
@@ -84,7 +84,7 @@ type ActionSheetProps = {
8484
/**
8585
* Called once the modal has been dismissed (iOS only, modal only)
8686
*/
87-
onModalDismissed?: DialogProps['onModalDismissed'];
87+
onModalDismissed?: DialogProps['onDialogDismissed'];
8888
/**
8989
* Whether or not to handle SafeArea
9090
*/
@@ -233,7 +233,7 @@ class ActionSheet extends Component<ActionSheetProps> {
233233
containerStyle={[styles.dialog, dialogStyle]}
234234
visible={visible}
235235
onDismiss={onDismiss}
236-
onModalDismissed={onModalDismissed}
236+
onDialogDismissed={onModalDismissed}
237237
panDirection={PanningProvider.Directions.DOWN}
238238
>
239239
{this.renderSheet()}

src/components/dateTimePicker/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ class DateTimePicker extends Component {
205205

206206
return (
207207
<Dialog
208-
migrate
209208
visible={showExpandableOverlay}
210209
width="100%"
211210
height={null}

src/components/dialog/index.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {Colors} from '../../style';
55
import Constants, {orientations} from '../../helpers/Constants';
66
import {AlignmentModifiers, extractAlignmentsValues} from '../../commons/modifiers';
77
import {asBaseComponent} from '../../commons/new';
8-
import {LogService} from '../../services';
98
import Modal from '../modal';
109
import View from '../view';
1110
import PanListenerView from '../panningViews/panListenerView';
@@ -58,10 +57,6 @@ export interface DialogProps extends AlignmentModifiers, RNPartialProps {
5857
* Whether or not to handle SafeArea
5958
*/
6059
useSafeArea?: boolean;
61-
/**
62-
* Called once the modal has been dismissed (iOS only) - Deprecated, use onDialogDismissed instead
63-
*/
64-
onModalDismissed?: (props: any) => void;
6560
/**
6661
* Called once the dialog has been dismissed completely
6762
*/
@@ -125,10 +120,6 @@ class Dialog extends Component<DialogProps, DialogState> {
125120

126121
this.styles = createStyles(this.props);
127122
this.setAlignment();
128-
129-
if (!_.isUndefined(props.onModalDismissed)) {
130-
LogService.deprecationWarn({component: 'Dialog', oldProp: 'onModalDismissed', newProp: 'onDialogDismissed'});
131-
}
132123
}
133124

134125
componentDidMount() {
@@ -171,7 +162,6 @@ class Dialog extends Component<DialogProps, DialogState> {
171162
if (!this.state.modalVisibility) {
172163
setTimeout(() => { // unfortunately this is needed if a modal needs to open on iOS
173164
this.props.onDialogDismissed?.(this.props);
174-
this.props.onModalDismissed?.(this.props);
175165
}, 100);
176166
}
177167
}
@@ -199,11 +189,6 @@ class Dialog extends Component<DialogProps, DialogState> {
199189
}
200190
};
201191

202-
onModalDismissed = () => {
203-
this.props.onDialogDismissed?.(this.props);
204-
this.props.onModalDismissed?.(this.props);
205-
}
206-
207192
hideDialogView = () => {
208193
this.setState({dialogVisibility: false});
209194
};
@@ -290,7 +275,6 @@ class Dialog extends Component<DialogProps, DialogState> {
290275
animationType={'none'}
291276
onBackgroundPress={onBackgroundPress}
292277
onRequestClose={onBackgroundPress}
293-
// onDismiss={this.onModalDismissed}
294278
supportedOrientations={supportedOrientations}
295279
accessibilityLabel={accessibilityLabel}
296280
>

src/components/picker/PickerDialog.android.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class PickerDialog extends BaseComponent {
6767
// TODO: should be taken from dialogProps but there's an issue with "babel-plugin-typescript-to-proptypes" plugin
6868
const {panDirection} = this.props;
6969
return (
70-
<Dialog {...dialogProps} migrate height="50%" width="77%" panDirection={panDirection}>
70+
<Dialog {...dialogProps} height="50%" width="77%" panDirection={panDirection}>
7171
<View style={styles.dialog}>
7272
{this.renderHeader()}
7373
<View flex center paddingH-24>

src/components/picker/PickerDialog.ios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class PickerDialog extends BaseComponent {
4242
// TODO: should be taken from dialogProps but there's an issue with "babel-plugin-typescript-to-proptypes" plugin
4343
const {panDirection} = this.props;
4444
return (
45-
<Dialog {...dialogProps} width="100%" migrate bottom animationConfig={{duration: 300}} panDirection={panDirection}>
45+
<Dialog {...dialogProps} width="100%" bottom animationConfig={{duration: 300}} panDirection={panDirection}>
4646
<View flex bg-white>
4747
{this.renderHeader()}
4848
<View centerV flex>

0 commit comments

Comments
 (0)