PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / trunk
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses vtrunk
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / assets / src / apps / js / blocks / instructor-elements / instructor-course / edit.js

edit.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses trunk, at assets/src/apps/js/blocks/instructor-elements/instructor-course/edit.js

47 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2 import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
3 import { PanelBody, SelectControl } from '@wordpress/components';
4
5 export const edit = ( props ) => {
6 const blockProps = useBlockProps();
7 const mode = [
8 { label: 'Icon + Number + Text', value: '' },
9 { label: 'Icon + Number', value: 'text' },
10 { label: 'Number + Text', value: 'icon' },
11 ];
12
13 return (
14 <>
15 <InspectorControls>
16 <PanelBody title={ __( 'Settings', 'learnpress' ) }>
17 <SelectControl
18 label={ __( 'Display Modes', 'learnpress' ) }
19 value={ props.attributes.hidden }
20 options={ mode }
21 onChange={ ( value ) =>
22 props.setAttributes( {
23 hidden: value ? value : '',
24 } )
25 }
26 />
27 </PanelBody>
28 </InspectorControls>
29 <div { ...blockProps }>
30 <div className="wrapper-instructor-total-courses">
31 { props.attributes.hidden && props.attributes.hidden === 'icon' ? (
32 ''
33 ) : (
34 <span className="lp-ico lp-icon-courses"></span>
35 ) }
36 <span className="instructor-total-courses">{ '99' }</span>
37 { props.attributes.hidden && props.attributes.hidden === 'text' ? (
38 ''
39 ) : (
40 <span>{ ' Courses' }</span>
41 ) }
42 </div>
43 </div>
44 </>
45 );
46 };
47