Skip to content

Commit

Permalink
Clean up post publish modal methods that were used in the post publis…
Browse files Browse the repository at this point in the history
…h panel but not needed in the modal
  • Loading branch information
brentswisher committed Aug 24, 2019
1 parent 49d184a commit 58d3e29
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
8 changes: 0 additions & 8 deletions packages/editor/src/components/post-publish-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ export class PostPublishModal extends Component {
this.onSubmit = this.onSubmit.bind( this );
}

componentDidUpdate( prevProps ) {
// Automatically collapse the publish sidebar when a post
// is published and the user makes an edit.
if ( prevProps.isPublished && ! this.props.isSaving && this.props.isDirty ) {
this.props.onClose();
}
}

onSubmit() {
const { onClose, hasPublishAction, isPostTypeViewable } = this.props;
if ( ! hasPublishAction || ! isPostTypeViewable ) {
Expand Down
16 changes: 0 additions & 16 deletions packages/editor/src/components/post-publish-modal/postpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,16 @@ import { Component, createRef } from '@wordpress/element';
import { withSelect } from '@wordpress/data';
import { safeDecodeURIComponent } from '@wordpress/url';

/**
* Internal dependencies
*/
// import PostScheduleLabel from '../post-schedule/label';

class PostPublishModalPostpublish extends Component {
constructor() {
super( ...arguments );
this.state = {
showCopyConfirmation: false,
};
this.onCopy = this.onCopy.bind( this );
this.onSelectInput = this.onSelectInput.bind( this );
this.postLink = createRef();
}

// componentDidMount() {
// if ( this.props.focusOnMount ) {
// this.postLink.current.focus();
// }
// }

componentWillUnmount() {
clearTimeout( this.dismissCopyConfirmation );
}
Expand All @@ -52,10 +40,6 @@ class PostPublishModalPostpublish extends Component {
}, 4000 );
}

onSelectInput( event ) {
event.target.select();
}

render() {
const { children, isScheduled, post, postType } = this.props;
const postLabel = get( postType, [ 'labels', 'singular_name' ] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { get, find } from 'lodash';
* WordPress dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
// import { PanelBody } from '@wordpress/components';

import { withSelect } from '@wordpress/data';

/**
Expand All @@ -17,10 +15,6 @@ import { withSelect } from '@wordpress/data';
import PostVisibilityLabel from '../post-visibility/label';
import PostScheduleLabel from '../post-schedule/label';
import { visibilityOptions } from '../post-visibility/utils';
// import PostVisibility from '../post-visibility';
// import PostSchedule from '../post-schedule';
// import MaybeTagsPanel from './maybe-tags-panel';
// import MaybePostFormatPanel from './maybe-post-format-panel';

function PostPublishModalPrepublish( {
hasPublishAction,
Expand Down

0 comments on commit 58d3e29

Please sign in to comment.