-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Site Editor: Try template drill down on shell sidebar (browse mode) #45100
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
Merged
Merged
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
957a3f2
Refactor SidebarNavigationRoot to use NavigatorScreen
oandregal 3710f13
Introduce new screen for templates
oandregal 89a21c8
Introduce chevron for SidebarNavigationItem
oandregal 125cb41
Templates screen: add edit button
oandregal 6c2dc03
Signal the template that is selected
oandregal 3a96aa2
Select Templates if any is active
oandregal c576632
Set template being edited, no matter the theme
oandregal 79718d6
Center align text for "manage all templates"
oandregal 0371b34
Fix VStack/HStack alias
oandregal 5bdebc3
Use same padding bottom in sidebar
oandregal edbf202
Make template list scrollable
oandregal 3ad7b33
Refactor the sidebar styles and components
youknowriad d3867ac
Add template parts
youknowriad d61d0c2
Keep the title sticky
youknowriad 0195866
Add shadow to panel header
jameskoster de04a76
Apply different styles to hover / current states
jameskoster 4e84696
Remove icons
youknowriad b9a6fd8
Fix box shadow
youknowriad 586cf8f
update the design of the manage templates link
youknowriad 2e242c3
Fix active template when the home page is static
youknowriad b9aacce
Add custom scrollbars
youknowriad 3ad1e1d
Fix active element
youknowriad 3e26da3
Space out the see all button
youknowriad aefdbb2
increase the border width
youknowriad ad33eca
Fix the jumping
youknowriad a10399a
Adds comment to CSS
youknowriad 753b99d
Fix e2e test
youknowriad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 0 additions & 86 deletions
86
packages/edit-site/src/components/sidebar-navigation-root/index.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
packages/edit-site/src/components/sidebar-navigation-root/style.scss
This file was deleted.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
packages/edit-site/src/components/sidebar-navigation-screen-main/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| import { | ||
| __experimentalItemGroup as ItemGroup, | ||
| __experimentalHStack as HStack, | ||
| __experimentalNavigatorButton as NavigatorButton, | ||
| Button, | ||
| } from '@wordpress/components'; | ||
| import { __ } from '@wordpress/i18n'; | ||
| import { layout, symbolFilled } from '@wordpress/icons'; | ||
| import { useDispatch } from '@wordpress/data'; | ||
| import { useViewportMatch } from '@wordpress/compose'; | ||
|
|
||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import SidebarNavigationScreen from '../sidebar-navigation-screen'; | ||
| import SidebarNavigationItem from '../sidebar-navigation-item'; | ||
| import { useLocation } from '../routes'; | ||
| import { store as editSiteStore } from '../../store'; | ||
| import getIsListPage from '../../utils/get-is-list-page'; | ||
|
|
||
| export default function SidebarNavigationScreenMain() { | ||
| const { params } = useLocation(); | ||
| const isListPage = getIsListPage( params ); | ||
| const isEditorPage = ! isListPage; | ||
| const { __unstableSetCanvasMode } = useDispatch( editSiteStore ); | ||
| const isMobileViewport = useViewportMatch( 'medium', '<' ); | ||
|
|
||
| return ( | ||
| <SidebarNavigationScreen | ||
| path="/" | ||
| title={ | ||
| <HStack style={ { minHeight: 36 } }> | ||
| <div>{ __( 'Design' ) }</div> | ||
| { ! isMobileViewport && isEditorPage && ( | ||
| <Button | ||
| className="edit-site-layout__edit-button" | ||
| label={ __( 'Open the editor' ) } | ||
| onClick={ () => { | ||
| __unstableSetCanvasMode( 'edit' ); | ||
| } } | ||
| > | ||
| { __( 'Edit' ) } | ||
| </Button> | ||
| ) } | ||
| </HStack> | ||
| } | ||
| content={ | ||
| <ItemGroup> | ||
| <NavigatorButton | ||
| as={ SidebarNavigationItem } | ||
| path="/templates" | ||
| withChevron | ||
| icon={ layout } | ||
| > | ||
| { __( 'Templates' ) } | ||
| </NavigatorButton> | ||
| <NavigatorButton | ||
| as={ SidebarNavigationItem } | ||
| path="/template-parts" | ||
| withChevron | ||
| icon={ symbolFilled } | ||
| > | ||
| { __( 'Template Parts' ) } | ||
| </NavigatorButton> | ||
| </ItemGroup> | ||
| } | ||
| /> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.