File tree Expand file tree Collapse file tree 4 files changed +56
-2
lines changed
courseware/course/course-exit
plugin-slots/CourseRecommendationsSlot Expand file tree Collapse file tree 4 files changed +56
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ import UpgradeFootnote from './UpgradeFootnote';
32
32
import SocialIcons from '../../social-share/SocialIcons' ;
33
33
import { logClick , logVisit } from './utils' ;
34
34
import { DashboardLink , IdVerificationSupportLink , ProfileLink } from '../../../shared/links' ;
35
- import CourseRecommendations from './CourseRecommendations ' ;
35
+ import CourseRecommendationsSlot from '../../../plugin-slots/CourseRecommendationsSlot ' ;
36
36
37
37
const LINKEDIN_BLUE = '#2867B2' ;
38
38
@@ -357,7 +357,7 @@ const CourseCelebration = ({ intl }) => {
357
357
/>
358
358
) ) }
359
359
{ footnote }
360
- < CourseRecommendations variant = { visitEvent } />
360
+ < CourseRecommendationsSlot variant = { visitEvent } />
361
361
</ div >
362
362
</ div >
363
363
</ >
Original file line number Diff line number Diff line change
1
+ # Unit Title Slot
2
+
3
+ ### Slot ID: ` course_recommendations_slot `
4
+ ### Props:
5
+ * ` variant `
6
+
7
+ ## Description
8
+
9
+ This slot is used for modifying the course end recommendation
10
+
11
+ ## Example
12
+
13
+ The following ` env.config.jsx ` will replace the course recommendations with a thumbs up
14
+
15
+ ![ Screenshot of modified course celebration] ( ./screenshot_custom.png )
16
+
17
+ ``` js
18
+ import { DIRECT_PLUGIN , PLUGIN_OPERATIONS } from ' @openedx/frontend-plugin-framework' ;
19
+
20
+ const config = {
21
+ pluginSlots: {
22
+ course_recommendations_slot: {
23
+ plugins: [
24
+ {
25
+ op: PLUGIN_OPERATIONS .Insert ,
26
+ widget: {
27
+ id: ' inserted_direct_plugin' ,
28
+ type: DIRECT_PLUGIN ,
29
+ priority: 10 ,
30
+ RenderWidget : () => (< div > 👍< / div> ),
31
+ },
32
+ },
33
+ ]
34
+ },
35
+ },
36
+ }
37
+
38
+ export default config ;
39
+ ```
Original file line number Diff line number Diff line change
1
+ import PropTypes from 'prop-types' ;
2
+ import { PluginSlot } from '@openedx/frontend-plugin-framework' ;
3
+ import CourseRecommendations from '../../courseware/course/course-exit/CourseRecommendations' ;
4
+
5
+ const CourseRecommendationsSlot = ( { variant } ) => (
6
+ < PluginSlot id = "course_recommendations_slot" >
7
+ < CourseRecommendations variant = { variant } />
8
+ </ PluginSlot >
9
+ ) ;
10
+
11
+ CourseRecommendationsSlot . propTypes = {
12
+ variant : PropTypes . string . isRequired ,
13
+ } ;
14
+
15
+ export default CourseRecommendationsSlot ;
You can’t perform that action at this time.
0 commit comments