Skip to content

Commit

Permalink
Try moving to editor package
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Silverstein committed Aug 24, 2018
1 parent 0476023 commit ca9fa60
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 15 deletions.
3 changes: 1 addition & 2 deletions edit-post/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
* WordPress dependencies
*/
import { withSelect } from '@wordpress/data';
import { EditorProvider, ErrorBoundary } from '@wordpress/editor';
import { EditorProvider, ErrorBoundary, PostLockedModal } from '@wordpress/editor';
import { StrictMode } from '@wordpress/element';
import PostLockedModal from '../packages/components/src/post-locked-modal';
/**
* Internal dependencies
*/
Expand Down
25 changes: 25 additions & 0 deletions packages/components/src/modal/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,28 @@
overflow: auto;
padding: $panel-padding;
}

.post-locked-modal {
max-height: 152px;
padding-right: 10px;
padding-left: 10px;
padding-top: 10px;
border: red;

a.button,
button.components-button {
margin: 5px;
}
img.components-modal__image {
float: left;
margin: 5px;
margin-right: 15px;
}

.components-modal__header {
height: 36px;
}
.components-modal__content {
overflow: hidden;
}
}
1 change: 1 addition & 0 deletions packages/editor/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export { default as PostVisibilityCheck } from './post-visibility/check';
export { default as TableOfContents } from './table-of-contents';
export { default as UnsavedChangesWarning } from './unsaved-changes-warning';
export { default as WordCount } from './word-count';
export { default as PostLockedModal } from './post-locked-modal';

// Content Related Components
export { default as BlockInspector } from './block-inspector';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { Component, Fragment } from '@wordpress/element';
import { withSelect } from '@wordpress/data';
import {
PostPreviewButton,
} from '@wordpress/editor';
import './style.scss';
} from '../post-preview-button';

import { addQueryArgs } from '@wordpress/url';
import { getPostEditURL } from '../../../../edit-post/components/browser-url';
import { getWPAdminURL } from '../../../editor/src/utils/url';
import { getPostEditURL } from '../../../../../edit-post/components/browser-url';
import { getWPAdminURL } from '../../../src/utils/url';

class PostLockedModal extends Component {
constructor() {
Expand Down Expand Up @@ -69,23 +69,19 @@ class PostLockedModal extends Component {
{
this.takeover ?
<p>
<a href={ getWPAdminURL( 'edit.php' ) }>
<a href={ getWPAdminURL( 'edit.php' ) } className={ 'button' }>
{ __( 'View all posts' ) }
</a>
</p> :
<a href={ allPosts } >
<button className={ 'button' } >
{ __( 'All Posts' ) }
</button>
<a href={ allPosts } className={ 'button' }>
{ __( 'All Posts' ) }
</a>
}
{ ! this.takeover &&
<span>
<PostPreviewButton />
<a href={ unlockUrl }>
<button className="button button-primary" >
{ __( 'Take Over' ) }
</button>
<a href={ unlockUrl } className={ 'button button-primary' }>
{ __( 'Take Over' ) }
</a>
</span>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
padding-right: 10px;
padding-left: 10px;
padding-top: 10px;
border: red;

button.button,
button.components-button {
Expand Down

0 comments on commit ca9fa60

Please sign in to comment.