Skip to content

Commit

Permalink
if show premium notices are disabled, also hide this
Browse files Browse the repository at this point in the history
  • Loading branch information
bfintal@gmail.com committed Jan 22, 2025
1 parent 2521917 commit 6bceaf8
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions src/plugins/global-settings/icon-library.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/**
* External dependencies
*/
import { i18n, isPro } from 'stackable'
import {
i18n, showProNotice, isPro,
} from 'stackable'
import {
PanelAdvancedSettings,
ProControl,
Expand All @@ -11,23 +13,24 @@ import { addFilter, applyFilters } from '@wordpress/hooks'
import { Fragment } from '@wordpress/element'
import { __ } from '@wordpress/i18n'

addFilter( 'stackable.global-settings.inspector', 'stackable/icon-library', output => {
return (
<Fragment>
{ output }

<PanelAdvancedSettings
title={ __( 'Icon Library', i18n ) }
id="icon-library-settings"
isPremiumPanel={ ! isPro }
>
{ ! isPro && <ProControl type="icon-library" /> }
{ isPro &&
applyFilters( 'stackable.global-settings.inspector.icon-library.control', null )
}
if ( showProNotice || isPro ) {
addFilter( 'stackable.global-settings.inspector', 'stackable/icon-library', output => {
return (
<Fragment>
{ output }

</PanelAdvancedSettings>
</Fragment>
)
} )
<PanelAdvancedSettings
title={ __( 'Icon Library', i18n ) }
id="icon-library-settings"
isPremiumPanel={ ! isPro }
>
{ ! isPro && <ProControl type="icon-library" /> }
{ isPro &&
applyFilters( 'stackable.global-settings.inspector.icon-library.control', null )
}

</PanelAdvancedSettings>
</Fragment>
)
} )
}

0 comments on commit 6bceaf8

Please sign in to comment.