Skip to content

Commit 8c9b24b

Browse files
committed
add orange indicator and description
1 parent 7093ffd commit 8c9b24b

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/components/block-styles-control/editor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
}
9191

9292
.components-panel__body-description {
93-
margin: 0;
93+
margin: -12px 0 0;
9494
}
9595

9696
.ugb-block-styles-controls__selected-icon {

src/components/block-styles-control/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ export const BlockStylesControl = props => {
152152
iconPosition="right"
153153
iconSize={ 12 }
154154
onClick={ () => {
155-
// Clicking this button when the popover is open also triggers the popover's `onClose`,
156-
// so the popover will close automatically.
155+
// Clicking this button when the popover is open also triggers the popover's `onClose`, so the popover will close automatically.
157156
if ( ! openPopover && ! popoverOnCloseRef.current ) {
158157
setOpenPopover( true )
159158
}
@@ -198,7 +197,9 @@ export const BlockStylesControl = props => {
198197
>
199198
<PanelBody>
200199
<h2 className="components-panel__body-title">{ __( 'Block Styles', i18n ) }</h2>
201-
<p className="components-panel__body-description">Description</p>
200+
<p className="components-panel__body-description">
201+
{ __( 'Choose a block style to quickly apply a predefined set of styles to this block.', i18n ) }
202+
</p>
202203
<ul className="ugb-block-styles-controls__list">
203204
<li>
204205
<Button

src/plugins/global-settings/block-styles/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ import {
2020
*/
2121
import { addFilter, applyFilters } from '@wordpress/hooks'
2222
import { Fragment, useState } from '@wordpress/element'
23+
import { useSelect } from '@wordpress/data'
2324
import { __ } from '@wordpress/i18n'
2425

2526
export { GlobalBlockStyles } from './editor-loader'
2627

2728
addFilter( 'stackable.global-settings.inspector', 'stackable/global-block-styles', output => {
2829
const [ isOpen, setIsOpen ] = useState( false )
30+
const hasBlockStyles = useSelect( select => {
31+
const blockStyles = select( 'stackable/global-block-styles' ).getAllBlockStyles()
32+
33+
return Object.keys( blockStyles ).length > 0
34+
}, [] )
2935

3036
if ( showProNotice || isPro ) {
3137
return (
@@ -35,6 +41,7 @@ addFilter( 'stackable.global-settings.inspector', 'stackable/global-block-styles
3541
title={ __( 'Global Block Styles', i18n ) }
3642
className="ugb-global-block-styles__panel"
3743
isPremiumPanel={ ! isPro }
44+
showModifiedIndicator={ isPro && hasBlockStyles }
3845
onToggle={ isOpen => setIsOpen( isOpen ) }
3946
>
4047
{ ! isPro && <ProControl type="global-block-styles" /> }

0 commit comments

Comments
 (0)