Skip to content

Dialog remove deprecated prop #1550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/src/screens/componentScreens/ChipScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default class ChipScreen extends Component {
const {showDialog} = this.state;

return (
<Dialog migrate visible={showDialog} useSafeArea bottom onDismiss={this.closeDialog}>
<Dialog visible={showDialog} useSafeArea bottom onDismiss={this.closeDialog}>
{this.renderContent()}
</Dialog>
);
Expand Down
1 change: 0 additions & 1 deletion demo/src/screens/componentScreens/DialogScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ Scroll: ${scroll}`;

return (
<Dialog
migrate
useSafeArea
key={this.getDialogKey(height)}
top={position === 'top'}
Expand Down
1 change: 0 additions & 1 deletion demo/src/screens/componentScreens/PickerScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export default class PickerScreen extends Component {

return (
<Dialog
migrate
visible={visible}
onDismiss={() => {
onDone();
Expand Down
2 changes: 1 addition & 1 deletion generatedTypes/src/components/actionSheet/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ declare type ActionSheetProps = {
/**
* Called once the modal has been dismissed (iOS only, modal only)
*/
onModalDismissed?: DialogProps['onModalDismissed'];
onModalDismissed?: DialogProps['onDialogDismissed'];
/**
* Whether or not to handle SafeArea
*/
Expand Down
4 changes: 0 additions & 4 deletions generatedTypes/src/components/dialog/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ export interface DialogProps extends AlignmentModifiers, RNPartialProps {
* Whether or not to handle SafeArea
*/
useSafeArea?: boolean;
/**
* Called once the modal has been dismissed (iOS only) - Deprecated, use onDialogDismissed instead
*/
onModalDismissed?: (props: any) => void;
/**
* Called once the dialog has been dismissed completely
*/
Expand Down
6 changes: 3 additions & 3 deletions src/components/actionSheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import Image from '../image';
import ListItem from '../listItem';
import PanningProvider from '../panningViews/panningProvider';

const VERTICAL_PADDING = 8;

const VERTICAL_PADDING = 8;
type ActionSheetOnOptionPress = (index: number) => void;

type ActionSheetProps = {
Expand Down Expand Up @@ -84,7 +84,7 @@ type ActionSheetProps = {
/**
* Called once the modal has been dismissed (iOS only, modal only)
*/
onModalDismissed?: DialogProps['onModalDismissed'];
onModalDismissed?: DialogProps['onDialogDismissed'];
/**
* Whether or not to handle SafeArea
*/
Expand Down Expand Up @@ -233,7 +233,7 @@ class ActionSheet extends Component<ActionSheetProps> {
containerStyle={[styles.dialog, dialogStyle]}
visible={visible}
onDismiss={onDismiss}
onModalDismissed={onModalDismissed}
onDialogDismissed={onModalDismissed}
panDirection={PanningProvider.Directions.DOWN}
>
{this.renderSheet()}
Expand Down
1 change: 0 additions & 1 deletion src/components/dateTimePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ class DateTimePicker extends Component {

return (
<Dialog
migrate
visible={showExpandableOverlay}
width="100%"
height={null}
Expand Down
16 changes: 0 additions & 16 deletions src/components/dialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {Colors} from '../../style';
import Constants, {orientations} from '../../helpers/Constants';
import {AlignmentModifiers, extractAlignmentsValues} from '../../commons/modifiers';
import {asBaseComponent} from '../../commons/new';
import {LogService} from '../../services';
import Modal from '../modal';
import View from '../view';
import PanListenerView from '../panningViews/panListenerView';
Expand Down Expand Up @@ -58,10 +57,6 @@ export interface DialogProps extends AlignmentModifiers, RNPartialProps {
* Whether or not to handle SafeArea
*/
useSafeArea?: boolean;
/**
* Called once the modal has been dismissed (iOS only) - Deprecated, use onDialogDismissed instead
*/
onModalDismissed?: (props: any) => void;
/**
* Called once the dialog has been dismissed completely
*/
Expand Down Expand Up @@ -125,10 +120,6 @@ class Dialog extends Component<DialogProps, DialogState> {

this.styles = createStyles(this.props);
this.setAlignment();

if (!_.isUndefined(props.onModalDismissed)) {
LogService.deprecationWarn({component: 'Dialog', oldProp: 'onModalDismissed', newProp: 'onDialogDismissed'});
}
}

componentDidMount() {
Expand Down Expand Up @@ -171,7 +162,6 @@ class Dialog extends Component<DialogProps, DialogState> {
if (!this.state.modalVisibility) {
setTimeout(() => { // unfortunately this is needed if a modal needs to open on iOS
this.props.onDialogDismissed?.(this.props);
this.props.onModalDismissed?.(this.props);
}, 100);
}
}
Expand Down Expand Up @@ -199,11 +189,6 @@ class Dialog extends Component<DialogProps, DialogState> {
}
};

onModalDismissed = () => {
this.props.onDialogDismissed?.(this.props);
this.props.onModalDismissed?.(this.props);
}

hideDialogView = () => {
this.setState({dialogVisibility: false});
};
Expand Down Expand Up @@ -290,7 +275,6 @@ class Dialog extends Component<DialogProps, DialogState> {
animationType={'none'}
onBackgroundPress={onBackgroundPress}
onRequestClose={onBackgroundPress}
// onDismiss={this.onModalDismissed}
supportedOrientations={supportedOrientations}
accessibilityLabel={accessibilityLabel}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/picker/PickerDialog.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class PickerDialog extends BaseComponent {
// TODO: should be taken from dialogProps but there's an issue with "babel-plugin-typescript-to-proptypes" plugin
const {panDirection} = this.props;
return (
<Dialog {...dialogProps} migrate height="50%" width="77%" panDirection={panDirection}>
<Dialog {...dialogProps} height="50%" width="77%" panDirection={panDirection}>
<View style={styles.dialog}>
{this.renderHeader()}
<View flex center paddingH-24>
Expand Down
2 changes: 1 addition & 1 deletion src/components/picker/PickerDialog.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PickerDialog extends BaseComponent {
// TODO: should be taken from dialogProps but there's an issue with "babel-plugin-typescript-to-proptypes" plugin
const {panDirection} = this.props;
return (
<Dialog {...dialogProps} width="100%" migrate bottom animationConfig={{duration: 300}} panDirection={panDirection}>
<Dialog {...dialogProps} width="100%" bottom animationConfig={{duration: 300}} panDirection={panDirection}>
<View flex bg-white>
{this.renderHeader()}
<View centerV flex>
Expand Down