PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9 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 All 140 releases
← All changes | assets/src/apps/js/blocks/course-elements/course-capacity/edit.js +59 -59 4.3.8 → 4.4.9 View file →
@@ -1,59 +1,59 @@
1 -import { __ } from '@wordpress/i18n';
2 -import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
3 -import { PanelBody, ToggleControl } from '@wordpress/components';
4 -import { useState, useEffect } from '@wordpress/element';
5 -
6 -const Edit = ( props ) => {
7 - const blockProps = useBlockProps();
8 - const { attributes, setAttributes, context } = props;
9 - const { lpCourseData } = context;
10 - const courseCapacity = '<span class="course-capacity">Unlimited</span>';
11 -
12 - return (
13 - <>
14 - <InspectorControls>
15 - <PanelBody title={ __( 'Settings', 'learnpress' ) }>
16 - <ToggleControl
17 - label={ __( 'Show Label', 'learnpress' ) }
18 - checked={ attributes.showLabel }
19 - onChange={ ( value ) => {
20 - setAttributes( {
21 - showLabel: value,
22 - } );
23 - } }
24 - />
25 - <ToggleControl
26 - label={ __( 'Show Icon', 'learnpress' ) }
27 - checked={ attributes.showIcon }
28 - onChange={ ( value ) => {
29 - setAttributes( {
30 - showIcon: value,
31 - } );
32 - } }
33 - />
34 - </PanelBody>
35 - </InspectorControls>
36 -
37 - <div { ...blockProps }>
38 - <div className="info-meta-item">
39 - <span className="info-meta-left">
40 - { attributes.showIcon && (
41 - <span
42 - dangerouslySetInnerHTML={ { __html: '<i class="lp-icon-students"></i>' } }
43 - />
44 - ) }
45 - { attributes.showLabel ? __( 'Capacity:', 'learnpress' ) : '' }
46 - </span>
47 - <span
48 - className="info-meta-right"
49 - dangerouslySetInnerHTML={ {
50 - __html: courseCapacity,
51 - } }
52 - ></span>
53 - </div>
54 - </div>
55 - </>
56 - );
57 -};
58 -
59 -export default Edit;
1 +import { __ } from '@wordpress/i18n';
2 +import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
3 +import { PanelBody, ToggleControl } from '@wordpress/components';
4 +import { useState, useEffect } from '@wordpress/element';
5 +
6 +const Edit = ( props ) => {
7 + const blockProps = useBlockProps();
8 + const { attributes, setAttributes, context } = props;
9 + const { lpCourseData } = context;
10 + const courseCapacity = '<span class="course-capacity">Unlimited</span>';
11 +
12 + return (
13 + <>
14 + <InspectorControls>
15 + <PanelBody title={ __( 'Settings', 'learnpress' ) }>
16 + <ToggleControl
17 + label={ __( 'Show Label', 'learnpress' ) }
18 + checked={ attributes.showLabel }
19 + onChange={ ( value ) => {
20 + setAttributes( {
21 + showLabel: value,
22 + } );
23 + } }
24 + />
25 + <ToggleControl
26 + label={ __( 'Show Icon', 'learnpress' ) }
27 + checked={ attributes.showIcon }
28 + onChange={ ( value ) => {
29 + setAttributes( {
30 + showIcon: value,
31 + } );
32 + } }
33 + />
34 + </PanelBody>
35 + </InspectorControls>
36 +
37 + <div { ...blockProps }>
38 + <div className="info-meta-item">
39 + <span className="info-meta-left">
40 + { attributes.showIcon && (
41 + <span
42 + dangerouslySetInnerHTML={ { __html: '<i class="lp-icon-students"></i>' } }
43 + />
44 + ) }
45 + { attributes.showLabel ? __( 'Capacity:', 'learnpress' ) : '' }
46 + </span>
47 + <span
48 + className="info-meta-right"
49 + dangerouslySetInnerHTML={ {
50 + __html: courseCapacity,
51 + } }
52 + ></span>
53 + </div>
54 + </div>
55 + </>
56 + );
57 +};
58 +
59 +export default Edit;