-
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
Use Card instead of Panel for the block editor #22827
Conversation
Size Change: +84 B (0%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
<CardHeader className="edit-navigation-menu-editor__block-editor-panel-header"> | ||
{ __( 'Navigation menu' ) } | ||
</CardHeader> | ||
<CardBody> | ||
<div className="components-panel__header-actions"> | ||
<Button isPrimary onClick={ saveBlocks }> |
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.
I think it would make sense to put the <Button>
component up within the <CardHeader>
component, and maybe position it to the right-side of the header.
<CardHeader className="edit-navigation-menu-editor__block-editor-panel-header"> | ||
{ __( 'Navigation menu' ) } | ||
</CardHeader> | ||
<CardBody> | ||
<div className="components-panel__header-actions"> |
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.
Whats the purpose of this .components-panel__header-actions
element?
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.
It's all gone now
@shaunandrews while I was at it, I also moved the delete link to the top: |
Feel free to ignore me, but that delete link at the top looks like an important message, a red thing at the top is panicky, and can be hit instead of save. |
I don’t think we need a duplicate save button at the bottom. |
@shaunandrews Some additional context is that one of the next action items for this screen is adding a switch between horizontal and vertical mode of displaying the menu and the save button at the bottom could be useful in the vertical mode. If you still recommending removing it, I'll do it - just LMK. |
Yes let’s remove the bottom button. Thanks. |
c6a7912
to
e5a625e
Compare
@shaunandrews @draganescu This is ready for a re-review now. |
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} |
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.
should these be bundled in the Card component or not? Genuinely asking, I don't have the answer but if I understand properly when we find ourselves doing this kind of override (which we do often), maybe we're missing something in the abstraction. cc @ItsJonQ
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.
Thanks for the heads up @youknowriad !
We recently merged in an update that added a new layout-based component, <Flex />
, that handles this very use-case!
https://github.com/WordPress/gutenberg/tree/master/packages/components/src/flex
I can update the <Card />
sub-components to use <Flex />
, which should save us from having to write CSS like this in future use
Description
There is no reason to make the BlockEditorPanel collapsible, so let's use Card instead of Panel there. A follow-up PR will make the other panel only collapsible on mobile devices.
Before:
After:
Types of changes
Non-breaking changes
Checklist: