-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Site editor]: Lower emphasis on style variations in navigation sidebar
- Loading branch information
1 parent
2d1d0fa
commit a3ceb0d
Showing
4 changed files
with
106 additions
and
104 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
packages/edit-site/src/components/sidebar-navigation-screen-browse-global-styles/index.js
This file contains 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,48 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { useSelect } from '@wordpress/data'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { BlockEditorProvider } from '@wordpress/block-editor'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { unlock } from '../../lock-unlock'; | ||
import { store as editSiteStore } from '../../store'; | ||
import StyleVariationsContainer from '../global-styles/style-variations-container'; | ||
import SidebarNavigationScreen from '../sidebar-navigation-screen'; | ||
|
||
const noop = () => {}; | ||
|
||
export default function SidebarNavigationScreenBrowseGlobalStyles() { | ||
const { storedSettings } = useSelect( ( select ) => { | ||
const { getSettings } = unlock( select( editSiteStore ) ); | ||
|
||
return { | ||
storedSettings: getSettings( false ), | ||
}; | ||
}, [] ); | ||
return ( | ||
<SidebarNavigationScreen | ||
title={ __( 'Browse styles' ) } | ||
description={ __( | ||
'Choose a different style combination for the theme styles.' | ||
) } | ||
content={ | ||
// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are | ||
// loaded. This is necessary because the Iframe component waits until | ||
// the block editor store's `__internalIsInitialized` is true before | ||
// rendering the iframe. Without this, the iframe previews will not render | ||
// in mobile viewport sizes, where the editor canvas is hidden. | ||
<BlockEditorProvider | ||
settings={ storedSettings } | ||
onChange={ noop } | ||
onInput={ noop } | ||
> | ||
<StyleVariationsContainer /> | ||
</BlockEditorProvider> | ||
} | ||
/> | ||
); | ||
} |
This file contains 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 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 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