diff --git a/src/courseware/course/course-exit/CourseCelebration.jsx b/src/courseware/course/course-exit/CourseCelebration.jsx index 0cdf4abd..8de5cb2b 100644 --- a/src/courseware/course/course-exit/CourseCelebration.jsx +++ b/src/courseware/course/course-exit/CourseCelebration.jsx @@ -32,7 +32,7 @@ import UpgradeFootnote from './UpgradeFootnote'; import SocialIcons from '../../social-share/SocialIcons'; import { logClick, logVisit } from './utils'; import { DashboardLink, IdVerificationSupportLink, ProfileLink } from '../../../shared/links'; -import CourseRecommendations from './CourseRecommendations'; +import CourseRecommendationsSlot from '../../../plugin-slots/CourseRecommendationsSlot'; const LINKEDIN_BLUE = '#2867B2'; @@ -357,7 +357,7 @@ const CourseCelebration = ({ intl }) => { /> ))} {footnote} - + diff --git a/src/plugin-slots/CourseRecommendationsSlot/README.md b/src/plugin-slots/CourseRecommendationsSlot/README.md new file mode 100644 index 00000000..efaf5528 --- /dev/null +++ b/src/plugin-slots/CourseRecommendationsSlot/README.md @@ -0,0 +1,39 @@ +# Unit Title Slot + +### Slot ID: `course_recommendations_slot` +### Props: +* `variant` + +## Description + +This slot is used for modifying the course end recommendation + +## Example + +The following `env.config.jsx` will replace the course recommendations with a thumbs up + +![Screenshot of modified course celebration](./screenshot_custom.png) + +```js +import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework'; + +const config = { + pluginSlots: { + course_recommendations_slot: { + plugins: [ + { + op: PLUGIN_OPERATIONS.Insert, + widget: { + id: 'inserted_direct_plugin', + type: DIRECT_PLUGIN, + priority: 10, + RenderWidget: () => (
👍
), + }, + }, + ] + }, + }, +} + +export default config; +``` diff --git a/src/plugin-slots/CourseRecommendationsSlot/index.jsx b/src/plugin-slots/CourseRecommendationsSlot/index.jsx new file mode 100644 index 00000000..040af6fa --- /dev/null +++ b/src/plugin-slots/CourseRecommendationsSlot/index.jsx @@ -0,0 +1,15 @@ +import PropTypes from 'prop-types'; +import { PluginSlot } from '@openedx/frontend-plugin-framework'; +import CourseRecommendations from '../../courseware/course/course-exit/CourseRecommendations'; + +const CourseRecommendationsSlot = ({ variant }) => ( + + + +); + +CourseRecommendationsSlot.propTypes = { + variant: PropTypes.string.isRequired, +}; + +export default CourseRecommendationsSlot; diff --git a/src/plugin-slots/CourseRecommendationsSlot/screenshot_custom.png b/src/plugin-slots/CourseRecommendationsSlot/screenshot_custom.png new file mode 100644 index 00000000..ea1dceec Binary files /dev/null and b/src/plugin-slots/CourseRecommendationsSlot/screenshot_custom.png differ