/** * FontAwesome Inspector control. */ import PropTypes from 'prop-types'; import './editor.scss'; import IconSelector from './icon-selector'; const { __ } = wp.i18n; const { Component } = wp.element; // Import block components. const { InspectorControls } = wp.editor; const { RangeControl, TextControl, PanelBody, } = wp.components; // Create an Inspector Controls wrapper Component. export default class FontAwesome extends Component { state = { currentIcon: '', } fontAwesomeIcons() { const FA = GT_Icons.fontawesome; return FA.filter( ( icon ) => { const name = icon.i; return name.includes( this.state.currentIcon ); } ); } render() { const { iconSize } = this.props.attributes; return ( [ ( ), this.props.setAttributes( { iconSize: value } ) } min={ 10 } max={ 200 } beforeIcon="editor-textcolor" afterIcon="editor-textcolor" /> this.setState( { currentIcon: value } ) } /> , ] ); } } FontAwesome.propTypes = { icon: PropTypes.string.isRequired, iconSize: PropTypes.number.isRequired, onSelect: PropTypes.func.isRequired, };