feat: replace StudioFooter with StudioFooterSlot (#1729)

This commit is contained in:
Muhammad Anas
2025-04-11 22:29:41 +05:00
committed by GitHub
parent e00a4c4d03
commit 01365d080e
14 changed files with 86 additions and 16 deletions

View File

@@ -9,3 +9,6 @@
## Course Unit page
* [`course_unit_header_actions_slot`](./CourseUnitHeaderActionsSlot/)
## Footer Slot
* [`studio_footer_slot`](./StudioFooterSlot/)

View File

@@ -0,0 +1,50 @@
# Studio Footer Slot
### Slot ID: `studio_footer_slot`
## Description
This slot is used to replace/modify/hide the footer.
The implementation of the `StudioFooterSlot` component lives in [the `frontend-slot-footer` repository](https://github.com/openedx/frontend-slot-footer/).
## Example
The following `env.config.jsx` will replace the default footer.
![Screenshot of Default Studio Footer](./images/default_studio_footer.png)
with a simple custom footer
![Screenshot of Custom Footer](./images/custom_footer.png)
```jsx
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
const config = {
pluginSlots: {
studio_footer_slot: {
plugins: [
{
// Hide the default footer
op: PLUGIN_OPERATIONS.Hide,
widgetId: 'default_contents',
},
{
// Insert a custom footer
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'custom_footer',
type: DIRECT_PLUGIN,
RenderWidget: () => (
<h1 style={{textAlign: 'center'}}>🦶</h1>
),
},
},
]
}
},
}
export default config;
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB