Skip to content

Commit

Permalink
Add props for buttons in editor 1 (#65068)
Browse files Browse the repository at this point in the history
* Add props for buttons in editor 1

* Address feedback

* remove extra class name and extra styles

Co-authored-by: AKSHAT2802 <akshat2802@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
5 people authored Sep 12, 2024
1 parent 6d32f4f commit a895274
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 26 deletions.
3 changes: 1 addition & 2 deletions packages/editor/src/components/block-manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ function BlockManager( {
numberOfHiddenBlocks
) }
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
variant="link"
onClick={ () => enableAllBlockTypes( blockTypes ) }
>
Expand Down
3 changes: 1 addition & 2 deletions packages/editor/src/components/editor-history/redo.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ function EditorHistoryRedo( props, ref ) {
const { redo } = useDispatch( editorStore );
return (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
{ ...props }
ref={ ref }
icon={ ! isRTL() ? redoIcon : undoIcon }
Expand Down
3 changes: 1 addition & 2 deletions packages/editor/src/components/editor-history/undo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ function EditorHistoryUndo( props, ref ) {
const { undo } = useDispatch( editorStore );
return (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
{ ...props }
ref={ ref }
icon={ ! isRTL() ? undoIcon : redoIcon }
Expand Down
7 changes: 1 addition & 6 deletions packages/editor/src/components/error-boundary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ function getContent() {
function CopyButton( { text, children } ) {
const ref = useCopyToClipboard( text );
return (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
variant="secondary"
ref={ ref }
>
<Button __next40pxDefaultSize variant="secondary" ref={ ref }>
{ children }
</Button>
);
Expand Down
4 changes: 1 addition & 3 deletions packages/editor/src/components/post-excerpt/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ function PrivateExcerpt() {
ref={ setPopoverAnchor }
renderToggle={ ( { onToggle } ) => (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
className="editor-post-excerpt__dropdown__trigger"
__next40pxDefaultSize
onClick={ onToggle }
variant="link"
>
Expand Down
9 changes: 3 additions & 6 deletions packages/editor/src/components/post-featured-image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ function PostFeaturedImage( {
render={ ( { open } ) => (
<div className="editor-post-featured-image__container">
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
ref={ toggleRef }
className={
! featuredImageId
Expand Down Expand Up @@ -202,17 +201,15 @@ function PostFeaturedImage( {
{ !! featuredImageId && (
<HStack className="editor-post-featured-image__actions">
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
className="editor-post-featured-image__action"
onClick={ open }
aria-haspopup="dialog"
>
{ __( 'Replace' ) }
</Button>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
className="editor-post-featured-image__action"
onClick={ () => {
onRemoveImage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}

.editor-post-featured-image__preview {
height: auto;
height: auto !important;
outline: $border-width solid rgba($black, 0.1);

.editor-post-featured-image__preview-image {
Expand All @@ -65,10 +65,6 @@
}

.editor-post-featured-image__toggle {
height: 100%;
line-height: 20px;
padding: $grid-unit-10 0;
text-align: center;
box-shadow: inset 0 0 0 $border-width $gray-400;
}

Expand Down

1 comment on commit a895274

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in a895274.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10838069263
📝 Reported issues:

Please sign in to comment.