Skip to content
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
20 changes: 4 additions & 16 deletions packages/edit-post/src/components/sidebar/post-schedule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,25 @@
*/
import { __ } from '@wordpress/i18n';
import { PanelRow, Dropdown, Button } from '@wordpress/components';
import { withInstanceId } from '@wordpress/compose';
import { PostSchedule as PostScheduleForm, PostScheduleLabel, PostScheduleCheck } from '@wordpress/editor';

export function PostSchedule( { instanceId } ) {
export function PostSchedule() {
return (
<PostScheduleCheck>
<PanelRow className="edit-post-post-schedule">
<label
htmlFor={ `edit-post-post-schedule__toggle-${ instanceId }` }
id={ `edit-post-post-schedule__heading-${ instanceId }` }
>
<span>
{ __( 'Publish' ) }
</label>
</span>
<Dropdown
position="bottom left"
contentClassName="edit-post-post-schedule__dialog"
renderToggle={ ( { onToggle, isOpen } ) => (
<>
<label
className="edit-post-post-schedule__label"
htmlFor={ `edit-post-post-schedule__toggle-${ instanceId }` }
>
<PostScheduleLabel /> { __( 'Click to change' ) }
</label>
<Button
id={ `edit-post-post-schedule__toggle-${ instanceId }` }
type="button"
className="edit-post-post-schedule__toggle"
onClick={ onToggle }
aria-expanded={ isOpen }
aria-live="polite"
isLink
>
<PostScheduleLabel />
Expand All @@ -47,4 +35,4 @@ export function PostSchedule( { instanceId } ) {
);
}

export default withInstanceId( PostSchedule );
export default PostSchedule;
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
position: relative;
}

.edit-post-post-schedule__label {
display: none;
}

.components-button.edit-post-post-schedule__toggle {
text-align: right;
}
Expand Down