-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add props for buttons in editor 1 #65068
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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 | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note for posterity: In our app code, sizes are added by the consumers. gutenberg/packages/editor/src/components/document-tools/index.js Lines 151 to 156 in 9523fb4
|
||||||||||||||
{ ...props } | ||||||||||||||
ref={ ref } | ||||||||||||||
icon={ ! isRTL() ? redoIcon : undoIcon } | ||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,7 @@ function CopyButton( { text, children } ) { | |
const ref = useCopyToClipboard( text ); | ||
return ( | ||
<Button | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
variant="secondary" | ||
ref={ ref } | ||
> | ||
AKSHAT2802 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,8 +198,7 @@ function PrivateExcerpt() { | |
ref={ setPopoverAnchor } | ||
renderToggle={ ( { onToggle } ) => ( | ||
<Button | ||
// TODO: Switch to `true` (40px size) if possible | ||
__next40pxDefaultSize={ false } | ||
__next40pxDefaultSize | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
className="editor-post-excerpt__dropdown__trigger" | ||
AKSHAT2802 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
onClick={ onToggle } | ||
variant="link" | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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 | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like we can remove most of these style overrides?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hii @mirka removed extra styles |
||||||||||||||||||||
ref={ toggleRef } | ||||||||||||||||||||
className={ | ||||||||||||||||||||
! featuredImageId | ||||||||||||||||||||
|
@@ -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 | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the before/after images are reversed in this one. We probably need an
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hii @mirka , There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed a weird flash on focus, but this happens on trunk too so I'll post a separate issue. CleanShot.2024-09-13.at.05.11.47.mp4There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue submitted at #65299 |
||||||||||||||||||||
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(); | ||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style didn't change because there are explicit styles for Reset in code. But adding
__next40pxDefaultSize
will ensure that it will not be listed in lint next timeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for posterity: There are no explicit height styles for this, just that
"link"
variant Buttons haveheight: auto
applied.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅