-
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
Site Editor: Add template tab to sidebar #28633
Conversation
*/ | ||
import { useSelect } from '@wordpress/data'; | ||
import { Icon } from '@wordpress/components'; | ||
import { page } from '@wordpress/icons'; |
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.
Do we have an icon representing a template?
Size Change: +1.41 kB (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
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.
Looking good for the most part!
The icon is slightly too small though – it should be 24x24.
Also, let's use the layout
icon:
The funny thing is, I actually copied the styles of that layout. But there is a bug in that one that causes the icon to shrink if the description is long: Screen.Recording.2021-02-02.at.14.31.58.movHere is a recording with Screen.Recording.2021-02-02.at.14.35.48.mov |
Since the block card's styling is unrelated to this PR, I'll spin up a new PR for that one. |
ce12171
to
73a0f0c
Compare
Rebased to update the icon. |
TestingBehavior
Browsers
|
It seems we're getting closer to briding edit-post and edit-site. Opening the template in the post editor already shows a "template" tab on the sidebar. I believe at some point edit-site could become just a proxy to edit-post with a bunch of extra settings... |
a40c627
to
dcda8cd
Compare
import { STORE_NAME } from '../../../store/constants'; | ||
import { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants'; | ||
|
||
const SettingsHeader = ( { sidebarName } ) => { |
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.
Nitpick: what about calling this SidebarHeader
?
I was thrown off by the difference between component name and file name (sidebar/header
).
In the same vein, it would also be fine to rename the folder to sidebar/settings-header
(but imho it's less clear).
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 renamed the folder to settings-heade
. edit-post
is using sidebar/settings-header
as well. SettingsSidebar
is only used together with the default (settings) sidebar (it's not used with the global styles sidebar). That's why I'd keep the Settings
in the name.
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 makes sense to align the naming with edit-post
here.
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.
The tests are failing after the folder rename. Imports in packages/edit-site/src/style.scss
also have to be updated.
Seems like this PR might have broken an e2e test on master. Or at least, the failure started happening with this merge. |
Created a draft PR to see if that fixes the e2e tests. #28950 |
Looks like some changes were made in this PR #28835 that removed the custom component based toolbar control. This PR still included that check so probably that's why it's failing. |
Description
Add template tab to settings sidebar. Resolves #27470
How has this been tested?
Screenshots
Screen.Recording.2021-02-01.at.14.51.35.mov
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: