File tree 8 files changed +7372
-4930
lines changed
discussions/discussions-home
8 files changed +7372
-4930
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ Cloning and Startup
52
52
53
53
The dev server is running at `http://localhost:2002 <http://localhost:2002 >`_.
54
54
55
+ Plugins
56
+ =======
57
+ This MFE can be customized using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework >`_.
58
+
59
+ The parts of this MFE that can be customized in that manner are documented `here </src/plugin-slots >`_.
60
+
55
61
Getting Help
56
62
============
57
63
Please tag **@openedx/edx-infinity ** on any PRs or issues. Thanks.
Original file line number Diff line number Diff line change 34
34
},
35
35
"dependencies" : {
36
36
"@edx/brand" : " npm:@openedx/brand-openedx@^1.2.2" ,
37
- "@edx/frontend-component-footer" : " ^13.0.2 " ,
37
+ "@edx/frontend-component-footer" : " ^13.2.0 " ,
38
38
"@edx/frontend-component-header" : " ^5.0.2" ,
39
39
"@edx/frontend-platform" : " ^7.1.0" ,
40
40
"@edx/openedx-atlas" : " ^0.6.0" ,
41
+ "@openedx/frontend-plugin-framework" : " ^1.1.2" ,
41
42
"@openedx/paragon" : " ^22.1.1" ,
42
43
"@reduxjs/toolkit" : " 1.9.7" ,
43
44
"@tinymce/tinymce-react" : " 3.13.1" ,
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import { selectPostEditorVisible } from '../posts/data/selectors';
27
27
import { isCourseStatusValid } from '../utils' ;
28
28
import useFeedbackWrapper from './FeedbackWrapper' ;
29
29
30
- const Footer = lazy ( ( ) => import ( '@edx/frontend-component-footer' ) ) ;
30
+ const FooterSlot = lazy ( ( ) => import ( '@edx/frontend-component-footer' ) . then ( module => ( { default : module . FooterSlot } ) ) ) ;
31
31
const PostActionsBar = lazy ( ( ) => import ( '../posts/post-actions-bar/PostActionsBar' ) ) ;
32
32
const CourseTabsNavigation = lazy ( ( ) => import ( '../../components/NavigationBar/CourseTabsNavigation' ) ) ;
33
33
const LegacyBreadcrumbMenu = lazy ( ( ) => import ( '../navigation/breadcrumb-menu/LegacyBreadcrumbMenu' ) ) ;
@@ -175,7 +175,7 @@ const DiscussionsHome = () => {
175
175
) }
176
176
{ ! enableInContextSidebar && isEnrolled && ( < DiscussionsProductTour /> ) }
177
177
</ main >
178
- { ! enableInContextSidebar && < Footer /> }
178
+ { ! enableInContextSidebar && < FooterSlot /> }
179
179
</ DiscussionContext . Provider >
180
180
</ Suspense >
181
181
) ;
Original file line number Diff line number Diff line change
1
+ # Footer Slot
2
+
3
+ ### Slot ID: ` footer_slot `
4
+
5
+ ## Description
6
+
7
+ This slot is used to replace/modify/hide the footer.
8
+
9
+ The implementation of the ` FooterSlot ` component lives in [ the ` frontend-component-footer ` repository] ( https://github.com/openedx/frontend-component-footer/tree/master/src/components/footer-slot ) .
10
+
11
+ ## Example
12
+
13
+ The following ` env.config.jsx ` will replace the default footer.
14
+
15
+ ![ Screenshot of Default Footer] ( ./images/default_footer.png )
16
+
17
+ with a simple custom footer
18
+
19
+ ![ Screenshot of Custom Footer] ( ./images/custom_footer.png )
20
+
21
+ ``` js
22
+ import { DIRECT_PLUGIN , PLUGIN_OPERATIONS } from ' @openedx/frontend-plugin-framework' ;
23
+
24
+ const config = {
25
+ pluginSlots: {
26
+ footer_slot: {
27
+ plugins: [
28
+ {
29
+ // Hide the default footer
30
+ op: PLUGIN_OPERATIONS .Hide ,
31
+ widgetId: ' default_contents' ,
32
+ },
33
+ {
34
+ // Insert a custom footer
35
+ op: PLUGIN_OPERATIONS .Insert ,
36
+ widget: {
37
+ id: ' custom_footer' ,
38
+ type: DIRECT_PLUGIN ,
39
+ RenderWidget : () => (
40
+ < h1 style= {{textAlign: ' center' }}> 🦶< / h1>
41
+ ),
42
+ },
43
+ },
44
+ ]
45
+ }
46
+ },
47
+ }
48
+
49
+ export default config ;
50
+ ```
Original file line number Diff line number Diff line change
1
+ # ` frontend-app-discussions ` Plugin Slots
2
+
3
+ * [ ` footer_slot ` ] ( ./FooterSlot/ )
You can’t perform that action at this time.
0 commit comments