Skip to content

Commit

Permalink
add icon library in global settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkae committed Sep 17, 2024
1 parent 0288c5d commit 0401825
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/plugins/global-settings/icon-library.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* External dependencies
*/
import { i18n, isPro } from 'stackable'
import {
PanelAdvancedSettings,
ProControl,
} from '~stackable/components'

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="transforms" /> }
{ isPro &&
applyFilters( 'stackable.global-settings.inspector.icon-library.control', null )
}

</PanelAdvancedSettings>
</Fragment>
)
} )

1 change: 1 addition & 0 deletions src/plugins/global-settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import './editor-loader'
import './block-defaults'
import './icon-library'

/**
* External dependencies
Expand Down

0 comments on commit 0401825

Please sign in to comment.