docs: improve the image example for course card slot
This commit is contained in:
committed by
Jason Wesson
parent
c144c04aee
commit
f250efb660
@@ -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 |
Reference in New Issue
Block a user