Skip to content

Commit f9b9f9b

Browse files
fix (block styles): fix if show pro notice is false, the other design systems will not appear
1 parent 615f256 commit f9b9f9b

File tree

1 file changed

+9
-12
lines changed
  • src/plugins/global-settings/block-styles

1 file changed

+9
-12
lines changed

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ import { __ } from '@wordpress/i18n'
2525

2626
export { GlobalBlockStyles } from './editor-loader'
2727

28-
addFilter( 'stackable.global-settings.inspector', 'stackable/global-block-styles', output => {
29-
const [ isOpen, setIsOpen ] = useState( false )
30-
const hasBlockStyles = useSelect( select => {
31-
const blockStyles = select( 'stackable/global-block-styles' ).getAllBlockStyles()
28+
if ( showProNotice || isPro ) {
29+
addFilter( 'stackable.global-settings.inspector', 'stackable/global-block-styles', output => {
30+
const [ isOpen, setIsOpen ] = useState( false )
31+
const hasBlockStyles = useSelect( select => {
32+
const blockStyles = select( 'stackable/global-block-styles' ).getAllBlockStyles()
3233

33-
return Object.keys( blockStyles ).length > 0
34-
}, [] )
34+
return Object.keys( blockStyles ).length > 0
35+
}, [] )
3536

36-
if ( showProNotice || isPro ) {
3737
return (
3838
<Fragment>
3939
{ output }
@@ -50,8 +50,5 @@ addFilter( 'stackable.global-settings.inspector', 'stackable/global-block-styles
5050
</PanelAdvancedSettings>
5151
</Fragment>
5252
)
53-
}
54-
55-
return <Fragment />
56-
}, 8 )
57-
53+
}, 8 )
54+
}

0 commit comments

Comments
 (0)