PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.6.9.2
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.6.9.2
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 / template / edit.js

edit.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.6.9.2, at assets/src/apps/js/blocks/template/edit.js

43 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1
2 import { useBlockProps } from '@wordpress/block-editor';
3 import { Placeholder } from '@wordpress/components';
4 import { __, sprintf } from '@wordpress/i18n';
5 import { page } from '@wordpress/icons';
6
7 const TEMPLATES = {
8 'single-course': {
9 title: __( 'LearnPress Single Course Template', 'learnpress' ),
10 placeholder: 'single-course',
11 },
12 'archive-course': {
13 title: __( 'LearnPress Course Archive Template', 'learnpress' ),
14 placeholder: 'archive-course',
15 },
16 };
17
18 export default function Edit( { attributes } ) {
19 const blockProps = useBlockProps();
20 const templateTitle = TEMPLATES[ attributes.template ]?.title ?? attributes.template;
21
22 return (
23 <div { ...blockProps }>
24 <Placeholder
25 icon={ page }
26 label={ templateTitle }
27 className="wp-block-learnpress-template__placeholder"
28 >
29 <div className="wp-block-learnpress-template__placeholder-inner">
30 { sprintf(
31 /* translators: %s is the template title */
32 __(
33 'This is an editor placeholder for the %s. On your store this will be replaced by the template and display with your course image(s), title, price, etc. You can move this placeholder around and add further blocks around it to extend the template.',
34 'learnpress'
35 ),
36 templateTitle
37 ) }
38 </div>
39 </Placeholder>
40 </div>
41 );
42 }
43