Skip to content

Commit

Permalink
Add props for buttons in editor 2 (#65083)
Browse files Browse the repository at this point in the history
* Add __next40pxDefaultSize for editor 2 files

* Update packages/editor/src/components/post-publish-panel/index.js

Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>

* update test snapshots

---------

Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>

Co-authored-by: AKSHAT2802 <akshat2802@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
5 people committed Sep 12, 2024
1 parent 0cbc7be commit a18d831
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 16 deletions.
3 changes: 1 addition & 2 deletions packages/editor/src/components/post-format/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ export default function PostFormat() {
{ suggestion && suggestion.id !== postFormat && (
<p className="editor-post-format__suggestion">
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
variant="link"
onClick={ () =>
onUpdatePostFormat( suggestion.id )
Expand Down
3 changes: 1 addition & 2 deletions packages/editor/src/components/post-last-revision/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ function PostLastRevision() {
return (
<PostLastRevisionCheck>
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
href={ addQueryArgs( 'revision.php', {
revision: lastRevisionId,
} ) }
Expand Down
6 changes: 2 additions & 4 deletions packages/editor/src/components/post-locked-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,15 @@ export default function PostLockedModal() {
>
{ ! isTakeover && (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
variant="tertiary"
href={ unlockUrl }
>
{ __( 'Take over' ) }
</Button>
) }
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
variant="primary"
href={ allPostsUrl }
>
Expand Down
3 changes: 1 addition & 2 deletions packages/editor/src/components/post-publish-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ export class PostPublishPanel extends Component {
<div className="editor-post-publish-panel__header">
{ isPostPublish ? (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
size="compact"
onClick={ onClose }
icon={ closeSmall }
label={ __( 'Close panel' ) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const PostFormatSuggestion = ( {
onUpdatePostFormat,
} ) => (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
variant="link"
onClick={ () => onUpdatePostFormat( suggestedPostFormat ) }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ export default function MaybeUploadMediaPanel() {
<Spinner />
) : (
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
__next40pxDefaultSize
variant="primary"
onClick={ uploadImages }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
>
<button
aria-label="Close panel"
class="components-button has-icon"
class="components-button is-compact has-icon"
type="button"
>
<svg
Expand Down Expand Up @@ -252,7 +252,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
>
<button
aria-label="Close panel"
class="components-button has-icon"
class="components-button is-compact has-icon"
type="button"
>
<svg
Expand Down

0 comments on commit a18d831

Please sign in to comment.