Skip to content

Commit

Permalink
docs: improve the image example for course card slot
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnwesson committed Sep 27, 2024
1 parent 22b7f9d commit c9aadd5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions src/plugin-slots/CourseCardActionSlot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,49 @@ 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: {
course_card_action_slot: {
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;
```
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c9aadd5

Please sign in to comment.