Skip to content

Commit

Permalink
feat: import FooterSlot from frontend-slot-footer package
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-smith-tcril authored and arbrandes committed May 17, 2024
1 parent 4de1011 commit 50948ac
Show file tree
Hide file tree
Showing 8 changed files with 7,370 additions and 4,882 deletions.
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ Cloning and Startup

The dev server is running at `http://localhost:2002 <http://localhost:2002>`_.

Plugins
=======
This MFE can be customized using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework>`_.

The parts of this MFE that can be customized in that manner are documented `here </src/plugin-slots>`_.

Getting Help
============
Please tag **@openedx/edx-infinity ** on any PRs or issues. Thanks.
Expand Down
12,185 changes: 7,307 additions & 4,878 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
},
"dependencies": {
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/frontend-component-footer": "^13.0.2",
"@edx/frontend-component-header": "^5.0.2",
"@edx/frontend-platform": "^7.1.0",
"@edx/openedx-atlas": "^0.6.0",
"@openedx/frontend-slot-footer": "^1.0.2",
"@openedx/paragon": "^22.1.1",
"@reduxjs/toolkit": "1.9.7",
"@tinymce/tinymce-react": "3.13.1",
Expand All @@ -63,8 +63,8 @@
},
"devDependencies": {
"@edx/browserslist-config": "1.2.0",
"@openedx/frontend-build": "^13.0.28",
"@edx/reactifex": "1.1.0",
"@openedx/frontend-build": "^13.0.28",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "12.1.5",
"@testing-library/user-event": "13.5.0",
Expand Down
4 changes: 2 additions & 2 deletions src/discussions/discussions-home/DiscussionsHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { selectPostEditorVisible } from '../posts/data/selectors';
import { isCourseStatusValid } from '../utils';
import useFeedbackWrapper from './FeedbackWrapper';

const Footer = lazy(() => import('@edx/frontend-component-footer'));
const FooterSlot = lazy(() => import('@openedx/frontend-slot-footer'));
const PostActionsBar = lazy(() => import('../posts/post-actions-bar/PostActionsBar'));
const CourseTabsNavigation = lazy(() => import('../../components/NavigationBar/CourseTabsNavigation'));
const LegacyBreadcrumbMenu = lazy(() => import('../navigation/breadcrumb-menu/LegacyBreadcrumbMenu'));
Expand Down Expand Up @@ -175,7 +175,7 @@ const DiscussionsHome = () => {
)}
{!enableInContextSidebar && isEnrolled && (<DiscussionsProductTour />)}
</main>
{!enableInContextSidebar && <Footer />}
{!enableInContextSidebar && <FooterSlot />}
</DiscussionContext.Provider>
</Suspense>
);
Expand Down
50 changes: 50 additions & 0 deletions src/plugin-slots/FooterSlot/README.md
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;
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/plugin-slots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `frontend-app-discussions` Plugin Slots

* [`footer_slot`](./FooterSlot/)

0 comments on commit 50948ac

Please sign in to comment.