Skip to content

Commit

Permalink
Dialog: remove unused onClosed property
Browse files Browse the repository at this point in the history
Used to be used a long time ago (removed in #8969) in Reader Full Post dialog
to call a callback when dialog is unmounted.
  • Loading branch information
jsnajdr committed May 8, 2019
1 parent c5c7529 commit beb8b0e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
16 changes: 1 addition & 15 deletions client/components/dialog/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { defer, noop } from 'lodash';

/**
* Internal dependencies
Expand All @@ -18,31 +17,18 @@ class Dialog extends Component {
baseClassName: PropTypes.string,
leaveTimeout: PropTypes.number,
onClose: PropTypes.func,
onClosed: PropTypes.func,
shouldCloseOnEsc: PropTypes.bool,
};

static defaultProps = {
isVisible: false,
leaveTimeout: 200,
onClosed: noop,
};

checkOnClosed = ref => {
if ( null === ref ) {
defer( this.props.onClosed );
}
};

render() {
return (
<RootChild>
<DialogBase
{ ...this.props }
ref={ this.checkOnClosed }
key="dialog"
onDialogClose={ this.onDialogClose }
/>
<DialogBase { ...this.props } onDialogClose={ this.onDialogClose } />
</RootChild>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ exports[`LanguagePickerModal should render 1`] = `
isVisible={true}
leaveTimeout={200}
onClose={[Function]}
onClosed={[Function]}
>
<SectionNav
allowDropdown={true}
Expand Down

0 comments on commit beb8b0e

Please sign in to comment.