@@ -9,6 +9,8 @@ import { getConfig } from '@edx/frontend-platform';
99
1010import messages from './Footer.messages' ;
1111import LanguageSelector from './LanguageSelector' ;
12+ import UISlot , { DefaultUISlot , defaultRender , UiPluginsContext } from '../plugin-template' ;
13+ import { getInjectedPlugins } from '../utils' ;
1214
1315ensureConfig ( [
1416 'LMS_BASE_URL' ,
@@ -35,6 +37,12 @@ class SiteFooter extends React.Component {
3537 sendTrackEvent ( eventName , properties ) ;
3638 }
3739
40+ async componentDidMount ( ) {
41+ console . log ( '============component did mount============' ) ;
42+ const uploadedPlugin = await getInjectedPlugins ( ) ;
43+ console . log ( '-----------uploaded Plugin-----------' , uploadedPlugin ) ;
44+ }
45+
3846 render ( ) {
3947 const {
4048 supportedLanguages,
@@ -45,44 +53,91 @@ class SiteFooter extends React.Component {
4553 const showLanguageSelector = supportedLanguages . length > 0 && onLanguageSelected ;
4654 const config = getConfig ( ) ;
4755
48- return (
49- < div className = "wrapper wrapper-footer" >
50- < footer id = "footer" className = "tutor-container" >
51- < div className = "footer-top" >
52- < div className = "powered-area" >
53- < ul className = "logo-list" >
54- < li > { intl . formatMessage ( messages [ 'footer.poweredby.text' ] ) } </ li >
56+ const FooterTopSection = (
57+ < div className = "footer-top" >
58+ < div className = "powered-area" >
59+ < ul className = "logo-list" >
60+ < DefaultUISlot slotId = "powered-by-text" > < li > { intl . formatMessage ( messages [ 'footer.poweredby.text' ] ) } </ li > </ DefaultUISlot >
61+ < UISlot
62+ slotId = "logos"
63+ defaultContents = { [
64+ {
65+ id : 'tutor-logo' ,
66+ priority : 1 ,
67+ content : {
68+ link : 'https://docs.tutor.overhang.io' ,
69+ srcUrl : `${ config . LMS_BASE_URL } /static/indigo/images/tutor-logo.png` ,
70+ altText : intl . formatMessage ( messages [ 'footer.tutorlogo.altText' ] ) ,
71+ width : 57 ,
72+ } ,
73+ } ,
74+ {
75+ id : 'openedx-logo' ,
76+ priority : 50 ,
77+ content : {
78+ link : 'https://open.edx.org' ,
79+ srcUrl : logo || `${ config . LMS_BASE_URL } /static/indigo/images/openedx-logo.png` ,
80+ altText : intl . formatMessage ( messages [ 'footer.logo.altText' ] ) ,
81+ width : 79 ,
82+ } ,
83+ } ,
84+ ] }
85+ renderWidget = { content => (
5586 < li >
56- < a href = "https://docs.tutor.overhang.io" rel = "noreferrer" target = "_blank" >
87+ < a href = { content . link } rel = "noreferrer" target = "_blank" >
5788 < Image
58- src = { ` ${ config . LMS_BASE_URL } /static/indigo/images/tutor-logo.png` }
59- alt = { intl . formatMessage ( messages [ 'footer.tutorlogo. altText' ] ) }
60- width = "57"
89+ src = { content . srcUrl }
90+ alt = { content . altText }
91+ width = { content . width }
6192 />
6293 </ a >
6394 </ li >
64- < li >
65- < a href = "https://open.edx.org" rel = "noreferrer" target = "_blank" >
66- < Image
67- src = { logo || `${ config . LMS_BASE_URL } /static/indigo/images/openedx-logo.png` }
68- alt = { intl . formatMessage ( messages [ 'footer.logo.altText' ] ) }
69- width = "79"
70- />
71- </ a >
72- </ li >
73- </ ul >
74- </ div >
75- </ div >
76- < span className = "copyright-site" > { intl . formatMessage ( messages [ 'footer.copyright.text' ] ) } </ span >
77- { showLanguageSelector && (
78- < LanguageSelector
79- options = { supportedLanguages }
80- onSubmit = { onLanguageSelected }
95+ ) }
8196 />
82- ) }
83- </ footer >
97+ </ ul >
98+ </ div >
8499 </ div >
85100 ) ;
101+
102+ const footerContents = [
103+ {
104+ id : 'footer-top' ,
105+ priority : 1 ,
106+ content : FooterTopSection ,
107+ } ,
108+ {
109+ id : 'copyright-site' ,
110+ priority : 3 ,
111+ content : < span className = "copyright-site" > { intl . formatMessage ( messages [ 'footer.copyright.text' ] ) } </ span > ,
112+ } ,
113+ {
114+ id : 'language-selector' ,
115+ priority : 5 ,
116+ content : < LanguageSelector
117+ options = { supportedLanguages }
118+ onSubmit = { onLanguageSelected }
119+ /> ,
120+ hidden : showLanguageSelector ,
121+ } ,
122+ ] ;
123+
124+ return (
125+ < UiPluginsContext . Provider value = { [ ] } >
126+ < div className = "wrapper wrapper-footer" >
127+ < UISlot
128+ slotId = "footer"
129+ defaultContents = { [
130+ {
131+ id : 'footer-container' ,
132+ priority : 1 ,
133+ content : < UISlot slotId = "footer-contents" defaultContents = { footerContents } renderWidget = { defaultRender } /> ,
134+ } ] }
135+ renderWidget = { ( widget ) => < footer id = "footer" className = "tutor-container" > { widget . content } </ footer > }
136+ />
137+
138+ </ div >
139+ </ UiPluginsContext . Provider >
140+ ) ;
86141 }
87142}
88143
0 commit comments