-
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
Extract header used in PostVisibility and PublishDateTimePicker to a new InspectorPopoverHeader component #41362
Conversation
Size Change: -35 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
c79f127
to
d93ff2b
Compare
791d9c8
to
929d1ba
Compare
929d1ba
to
8b4dd4d
Compare
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.
This worked as advertised for me
…new InspectorPopoverHeader component
8b4dd4d
to
2f9f8df
Compare
Added the Needs Dev Note label in case this needs a dev note (either individual or as part of a "misc" dev note) for WP 6.1 release. |
I think we can probably go without as it's a fairly niche API that's marked experimental. |
What?
Adds a new
InspectorPopoverHeader
component which is used byPostVisibility
,PublishDateTimePicker
, and more to come.Why?
The headers in
PostVisibility
,PublishDateTimePicker
, and the popovers in the new sidebar design are identical so we should not duplicate the code.How?
The new component is in
@wordpress/block-editor
so thatPublishDateTimePicker
, which is used by the Post Date block, can use it. Another option is@wordpress/components
(and name itPopoverHeader
) but I'm not 100% convinced that this is a pattern we'll see in other parts of WordPress. It's easier to move from@wordpress/block-editor
→@wordpress/components
than the other way around so I think best to start off here.I opted to go with
InspectorPopoverHeader
instead ofInspectorPopover
because that fits in nicely with how we've organised the existing popovers which is that the content of the popover is a seperate component passed intoDropdown
'srenderContent
.Naming things is hard. I went with
InspectorPopoverHeader
which is a fairly literal description of its intended use. Open to suggestions.Testing Instructions
Screenshots or screencast