File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
src/plugin-slots/CourseCardActionSlot Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -16,29 +16,49 @@ The following `env.config.jsx` will render the `cardId` of the course as `<p>` e
1616
1717``` js
1818import { DIRECT_PLUGIN , PLUGIN_OPERATIONS } from ' @openedx/frontend-plugin-framework' ;
19+ import ActionButton from ' containers/CourseCard/components/CourseCardActions/ActionButton' ;
1920
2021const config = {
2122 pluginSlots: {
2223 course_card_action_slot: {
2324 keepDefault: false ,
2425 plugins: [
2526 {
26- // Insert custom content after course card buttons
27+ // Insert Custom Button in Course Card
2728 op: PLUGIN_OPERATIONS .Insert ,
2829 widget: {
2930 id: ' custom_course_card_action' ,
31+ priority: 60 ,
3032 type: DIRECT_PLUGIN ,
3133 RenderWidget : ({cardId}) => (
32- < div>
33- < p> 📚: {cardId}< / p>
34- < / div>
34+ < ActionButton
35+ variant= " outline-primary"
36+ >
37+ Custom Button
38+ < / ActionButton>
3539 ),
3640 },
3741 },
42+ {
43+ // Insert Another Button in Course Card
44+ op: PLUGIN_OPERATIONS .Insert ,
45+ widget: {
46+ id: ' another_custom_course_card_action' ,
47+ priority: 70 ,
48+ type: DIRECT_PLUGIN ,
49+ RenderWidget : ({cardId}) => (
50+ < ActionButton
51+ variant= " outline-primary"
52+ >
53+ 📚: {cardId}
54+ < / ActionButton>
55+ ),
56+ },
57+ },
3858 ]
3959 }
4060 },
4161}
4262
4363export default config ;
44- ```
64+ ```
You can’t perform that action at this time.
0 commit comments