Skip to content

Commit

Permalink
Merge pull request #122 from newfold-labs/PRESS8-139-create-navigatio…
Browse files Browse the repository at this point in the history
…n-link-in-Section-Themes-to-Block-Styles

PRESS8-139 Create navigation link in Section Themes to Block Styles
  • Loading branch information
zlateska authored Nov 15, 2024
2 parents d40cf76 + 8901e0e commit d39e2f7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
1 change: 0 additions & 1 deletion build/2.6.1/wonder-blocks.asset.php
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '53161b9a3edac185467c');
1 change: 0 additions & 1 deletion build/2.6.1/wonder-blocks.js
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
=
1 change: 1 addition & 0 deletions build/2.6.1/wonder-blocks.js.map

Large diffs are not rendered by default.

19 changes: 15 additions & 4 deletions src/blocks/inspector-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ const withInspectorControls = createHigherOrderComponent((BlockEdit) => {
return (props) => {
const { name, clientId } = props;

const openStylesTab = () => {
const stylesTabButton = document.querySelector(
".block-editor-block-inspector__tab-item[aria-label='Styles']"
);

if (stylesTabButton) {
stylesTabButton.click();
}
};

const selectedGroupDivider = props?.attributes?.nfdGroupDivider ?? "default";
const selectedGroupTheme = props?.attributes?.nfdGroupTheme ?? "";
const selectedGroupEffect = props?.attributes?.nfdGroupEffect ?? "";
Expand Down Expand Up @@ -362,10 +372,11 @@ const withInspectorControls = createHigherOrderComponent((BlockEdit) => {
status="warning"
isDismissible={false}
>
{__(
"This feature is now located in the Block Styles section.",
"nfd-wonder-blocks"
)}
{__("This feature is now located in the", "nfd-wonder-blocks")}{" "}
<Button onClick={openStylesTab} variant="link">
{__("Block Styles", "nfd-wonder-blocks")}
</Button>
{" " + __("section.", "nfd-wonder-blocks")}
</Notice>
{customThemeStyles.map((style) => {
const buttonText = style.isDefault
Expand Down

0 comments on commit d39e2f7

Please sign in to comment.