Skip to content

Commit 6bceaf8

Browse files
if show premium notices are disabled, also hide this
1 parent 2521917 commit 6bceaf8

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed
Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/**
22
* External dependencies
33
*/
4-
import { i18n, isPro } from 'stackable'
4+
import {
5+
i18n, showProNotice, isPro,
6+
} from 'stackable'
57
import {
68
PanelAdvancedSettings,
79
ProControl,
@@ -11,23 +13,24 @@ import { addFilter, applyFilters } from '@wordpress/hooks'
1113
import { Fragment } from '@wordpress/element'
1214
import { __ } from '@wordpress/i18n'
1315

14-
addFilter( 'stackable.global-settings.inspector', 'stackable/icon-library', output => {
15-
return (
16-
<Fragment>
17-
{ output }
18-
19-
<PanelAdvancedSettings
20-
title={ __( 'Icon Library', i18n ) }
21-
id="icon-library-settings"
22-
isPremiumPanel={ ! isPro }
23-
>
24-
{ ! isPro && <ProControl type="icon-library" /> }
25-
{ isPro &&
26-
applyFilters( 'stackable.global-settings.inspector.icon-library.control', null )
27-
}
16+
if ( showProNotice || isPro ) {
17+
addFilter( 'stackable.global-settings.inspector', 'stackable/icon-library', output => {
18+
return (
19+
<Fragment>
20+
{ output }
2821

29-
</PanelAdvancedSettings>
30-
</Fragment>
31-
)
32-
} )
22+
<PanelAdvancedSettings
23+
title={ __( 'Icon Library', i18n ) }
24+
id="icon-library-settings"
25+
isPremiumPanel={ ! isPro }
26+
>
27+
{ ! isPro && <ProControl type="icon-library" /> }
28+
{ isPro &&
29+
applyFilters( 'stackable.global-settings.inspector.icon-library.control', null )
30+
}
3331

32+
</PanelAdvancedSettings>
33+
</Fragment>
34+
)
35+
} )
36+
}

0 commit comments

Comments
 (0)