@@ -11,7 +11,9 @@ import {
1111 PanelBody , TextControl , Spinner ,
1212} from '@wordpress/components'
1313import { __ } from '@wordpress/i18n'
14- import { useState , useEffect } from '@wordpress/element'
14+ import {
15+ useState , useEffect , Fragment ,
16+ } from '@wordpress/element'
1517
1618/**
1719 * External dependencies
@@ -25,7 +27,7 @@ import {
2527import { faGetIcon , faFetchIcon } from '~stackable/util'
2628import { FileDrop } from 'react-file-drop'
2729import classnames from 'classnames'
28- import { applyFilters } from '@wordpress/hooks'
30+ import { applyFilters , doAction } from '@wordpress/hooks'
2931
3032let searchTimeout = null
3133let tempMediaUpload = null
@@ -152,9 +154,7 @@ const IconSearchPopover = props => {
152154 setIsDropping ( false )
153155 const svgString = cleanSvgString ( addCustomIconClass ( e . target . result ) )
154156
155- if ( isPro && props . showPrompt ) {
156- applyFilters ( 'stackable.global-settings.inspector.icon-library.prompt' , null , svgString )
157- }
157+ doAction ( 'stackable.icon-search-popover.svg-upload' , svgString )
158158
159159 props . onChange ( svgString )
160160 props . onClose ( )
@@ -173,6 +173,8 @@ const IconSearchPopover = props => {
173173 'ugb-icon--has-reset' : props . allowReset ,
174174 } )
175175
176+ const IconLibraryIcons = applyFilters ( 'stackable.global-settings.inspector.icon-library.icons' , Fragment )
177+
176178 const content = (
177179 < div className = "stk-icon-search-popover-container" >
178180 < FileDrop
@@ -249,9 +251,11 @@ const IconSearchPopover = props => {
249251 </ div >
250252 < div className = "ugb-icon-popover__iconlist" >
251253 { isBusy && < Spinner /> }
252- { ! isBusy && applyFilters ( 'stackable.global-settings.inspector.icon-library.icons' , null , {
253- icons : results . iconLibrary , onChange : props . onChange , onClose : props . onClose ,
254- } ) }
254+ { ! isBusy && < IconLibraryIcons
255+ icons = { results . iconLibrary }
256+ onChange = { props . onChange }
257+ onClose = { props . onClose }
258+ /> }
255259 { ! isBusy && results . faIcons . map ( ( { prefix, iconName } , i ) => {
256260 const iconValue = `${ prefix } -${ iconName } `
257261 return < button
@@ -326,7 +330,6 @@ IconSearchPopover.defaultProps = {
326330 onClose : noop ,
327331 returnSVGValue : true , // If true, the value provided in onChange will be the SVG markup of the icon. If false, the value will be a prefix-iconName value.
328332 allowReset : true ,
329- showPrompt : true ,
330333 __deprecatedAnchorRef : undefined ,
331334 __deprecatedPosition : 'center' ,
332335 __deprecatedOnClickOutside : noop ,
0 commit comments