-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use frontend-plugin-framework to provide a FooterSlot #331
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; | |
import { connect } from 'react-redux'; | ||
import { BrowserRouter as Router } from 'react-router-dom'; | ||
|
||
import Footer from '@edx/frontend-component-footer'; | ||
import FooterSlot from '@openedx/frontend-slot-footer'; | ||
import { LearningHeader as Header } from '@edx/frontend-component-header'; | ||
|
||
import { selectors } from 'data/redux'; | ||
|
@@ -32,7 +32,7 @@ export const App = ({ courseMetadata, isEnabled }) => ( | |
<main data-testid="main"> | ||
<ListView /> | ||
</main> | ||
<Footer logo={process.env.LOGO_POWERED_BY_OPEN_EDX_URL_SVG} data-testid="footer" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As with the other MFEs, can you please remove the var from .env.development and .env.test as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<FooterSlot /> | ||
</div> | ||
</Router> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Footer Slot | ||
|
||
### Slot ID: `footer_slot` | ||
|
||
## Description | ||
|
||
This slot is used to replace/modify/hide the footer. | ||
|
||
The implementation of the `FooterSlot` 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 Footer](./images/default_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: { | ||
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; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# `frontend-app-ora-grading` Plugin Slots | ||
|
||
* [`footer_slot`](./FooterSlot/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On all the other MFEs we're adding (or keeping) the explicit FPF dependency. Shouldn't we do the same here?