| 1 |
import { __ } from '@wordpress/i18n'; |
| 2 |
import { useBlockProps, InspectorControls } from '@wordpress/block-editor'; |
| 3 |
import { PanelBody, ToggleControl } from '@wordpress/components'; |
| 4 |
|
| 5 |
export const edit = ( props ) => { |
| 6 |
const blockProps = useBlockProps(); |
| 7 |
return ( |
| 8 |
<> |
| 9 |
<InspectorControls> |
| 10 |
<PanelBody title={ __( 'Settings', 'learnpress' ) }> |
| 11 |
<ToggleControl |
| 12 |
label={ __( 'Open links in new tab', 'learnpress' ) } |
| 13 |
checked={ props.attributes.target ? true : false } |
| 14 |
onChange={ ( value ) => { |
| 15 |
props.setAttributes( { |
| 16 |
target: value ? true : false, |
| 17 |
} ); |
| 18 |
} } |
| 19 |
/> |
| 20 |
<ToggleControl |
| 21 |
label={ __( 'Add nofollow attribute', 'learnpress' ) } |
| 22 |
checked={ props.attributes.nofollow ? true : false } |
| 23 |
onChange={ ( value ) => { |
| 24 |
props.setAttributes( { |
| 25 |
nofollow: value ? true : false, |
| 26 |
} ); |
| 27 |
} } |
| 28 |
/> |
| 29 |
</PanelBody> |
| 30 |
</InspectorControls> |
| 31 |
<div { ...blockProps }> |
| 32 |
<div className="instructor-social"> |
| 33 |
<i className="lp-user-ico lp-icon-facebook"></i> |
| 34 |
<i className="lp-user-ico lp-icon-twitter"></i> |
| 35 |
<i className="lp-user-ico lp-icon-youtube-play"></i> |
| 36 |
<i className="lp-user-ico lp-icon-linkedin"></i> |
| 37 |
</div> |
| 38 |
</div> |
| 39 |
</> |
| 40 |
); |
| 41 |
}; |
| 42 |
|