-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
129 additions
and
31 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
packages/edit-site/src/components/sidebar-navigation-screen-not-supported/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,17 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
import { Notice, __experimentalSpacer as Spacer } from '@wordpress/components'; | ||
|
||
export default function SidebarNavigationScreenNotSupported() { | ||
return ( | ||
<Spacer paddingY={ 6 }> | ||
<Notice status="warning" isDismissible={ false }> | ||
{ __( | ||
'The theme you are currently using does not support current screen.' | ||
) } | ||
</Notice> | ||
</Spacer> | ||
); | ||
} |
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
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
14 changes: 14 additions & 0 deletions
14
packages/edit-site/src/components/site-editor-routes/utils.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,14 @@ | ||
/** | ||
* Check if the classic theme supports the stylebook. | ||
* | ||
* @param {Object} siteData - The site data provided by the site editor route area resolvers. | ||
* @return {boolean} True if the stylebook is supported, false otherwise. | ||
*/ | ||
export function isClassicThemeStyleBookSupported( siteData ) { | ||
const isBlockTheme = siteData.currentTheme?.is_block_theme; | ||
const supportsEditorStyles = | ||
siteData.currentTheme?.theme_supports[ 'editor-styles' ]; | ||
// supportsLayout is equivalent to the `wp_theme_has_theme_json()` PHP function. | ||
const hasThemeJson = siteData.editorSettings?.supportsLayout; | ||
return ! isBlockTheme && ( supportsEditorStyles || hasThemeJson ); | ||
} |
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