-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Featured Image block: Use resolution tool component #68471
base: trunk
Are you sure you want to change the base?
Featured Image block: Use resolution tool component #68471
Conversation
Size Change: -28 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Flaky tests detected in adac6e8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12593129054
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@@ -40,14 +42,11 @@ import DimensionControls from './dimension-controls'; | |||
import OverlayControls from './overlay-controls'; | |||
import Overlay from './overlay'; | |||
import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; | |||
import { unlock } from '../lock-unlock'; | |||
import { DEFAULT_MEDIA_SIZE_SLUG } from './constants'; |
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.
Suggestion: There's no reason to extract constant into a separate file if it's only used once. Let's just inline it.
function getMediaSourceUrlBySizeSlug( media, slug ) { | ||
return ( | ||
media?.media_details?.sizes?.[ slug ]?.source_url || media?.source_url | ||
); | ||
} |
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.
Why remove this helper?
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.
Its used only once, so don't see need for separate function.
Thanks for suggestion, I'll work on it. |
What?
Originally discussed at #67456 (comment), Featured image block have resolution control under dimension control. while other bock have it in block control panel.
Why? And How?
Relocate
ResolutionTool
control to block control like every other image block in Gutenberg.Testing Instructions
Screenshots or screencast