docs: improve the image example for course card slot

This commit is contained in:
Jason Wesson
2024-09-26 22:59:42 +00:00
committed by Jason Wesson
parent c144c04aee
commit f250efb660
2 changed files with 25 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ The following `env.config.jsx` will render the `cardId` of the course as `<p>` e
```js
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
import ActionButton from 'containers/CourseCard/components/CourseCardActions/ActionButton';
const config = {
pluginSlots: {
@@ -23,22 +24,41 @@ const config = {
keepDefault: false,
plugins: [
{
// Insert custom content after course card buttons
// Insert Custom Button in Course Card
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'custom_course_card_action',
priority: 60,
type: DIRECT_PLUGIN,
RenderWidget: ({cardId}) => (
<div>
<p>📚: {cardId}</p>
</div>
<ActionButton
variant="outline-primary"
>
Custom Button
</ ActionButton>
),
},
},
{
// Insert Another Button in Course Card
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'another_custom_course_card_action',
priority: 70,
type: DIRECT_PLUGIN,
RenderWidget: ({cardId}) => (
<ActionButton
variant="outline-primary"
>
📚: {cardId}
</ ActionButton>
),
},
},
]
}
},
}
export default config;
```
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 KiB

After

Width:  |  Height:  |  Size: 603 KiB