Skip to content

Commit f250efb

Browse files
committed
docs: improve the image example for course card slot
1 parent c144c04 commit f250efb

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

src/plugin-slots/CourseCardActionSlot/README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,49 @@ The following `env.config.jsx` will render the `cardId` of the course as `<p>` e
1616

1717
```js
1818
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
19+
import ActionButton from 'containers/CourseCard/components/CourseCardActions/ActionButton';
1920

2021
const 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

4363
export default config;
44-
```
64+
```
-8.28 KB
Loading

0 commit comments

Comments
 (0)