Skip to content

Commit

Permalink
wrap buttons (#52249)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskoster authored and tellthemachines committed Jul 7, 2023
1 parent b9b4bfa commit eb94b26
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function PostStatus( { isOpened, onTogglePanel } ) {
marginTop: '16px',
} }
spacing={ 4 }
wrap
>
<PostSwitchToDraftButton />
<PostTrash />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
* WordPress dependencies
*/
import { PostTrash as PostTrashLink, PostTrashCheck } from '@wordpress/editor';
import { FlexItem } from '@wordpress/components';

export default function PostTrash() {
return (
<PostTrashCheck>
<FlexItem isBlock>
<PostTrashLink />
</FlexItem>
<PostTrashLink />
</PostTrashCheck>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import {
Button,
FlexItem,
__experimentalConfirmDialog as ConfirmDialog,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
Expand Down Expand Up @@ -41,15 +40,15 @@ function PostSwitchToDraftButton( {
};

return (
<FlexItem isBlock>
<>
<Button
className="editor-post-switch-to-draft"
onClick={ () => {
setShowConfirmDialog( true );
} }
disabled={ isSaving }
variant="secondary"
style={ { width: '100%', display: 'block' } }
style={ { flexGrow: '1', justifyContent: 'center' } }
>
{ __( 'Switch to draft' ) }
</Button>
Expand All @@ -60,7 +59,7 @@ function PostSwitchToDraftButton( {
>
{ alertMessage }
</ConfirmDialog>
</FlexItem>
</>
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/components/post-trash/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.editor-post-trash.components-button {
width: 100%;
display: block;
flex-grow: 1;
justify-content: center;
}

0 comments on commit eb94b26

Please sign in to comment.