1- import React , { useContext , useState } from 'react' ;
2- import _ from 'lodash' ;
3- import { intlShape , injectIntl , FormattedMessage } from '@edx/frontend-platform/i18n' ;
1+ import React , { useContext } from 'react' ;
2+ import { useIntl } from '@edx/frontend-platform/i18n' ;
43import { ensureConfig } from '@edx/frontend-platform' ;
54import { AppContext } from '@edx/frontend-platform/react' ;
65import {
7- ActionRow ,
8- Button ,
96 Container ,
107 Hyperlink ,
118 Image ,
12- TransitionReplace ,
9+ MailtoLink ,
1310} from '@openedx/paragon' ;
14- import { ExpandLess , ExpandMore , Help } from '@openedx/paragon/icons ';
11+ import './StudioFooter.css ';
1512import messages from './messages' ;
1613
1714ensureConfig ( [
@@ -22,125 +19,69 @@ ensureConfig([
2219 'SUPPORT_EMAIL' ,
2320 'SITE_NAME' ,
2421 'STUDIO_BASE_URL' ,
25- 'SHOW_ACCESSIBILITY_PAGE ' ,
22+ 'LOGO_URL ' ,
2623] , 'Studio Footer component' ) ;
2724
28- const StudioFooter = ( {
29- // injected
30- intl,
31- } ) => {
32- const [ isOpen , setIsOpen ] = useState ( false ) ;
25+ const StudioFooter = ( ) => {
26+ const intl = useIntl ( ) ;
3327 const { config } = useContext ( AppContext ) ;
3428
3529 return (
36- < >
37- < div className = "m-0 mt-6 row align-items-center justify-content-center" >
38- < div className = "col border-top mr-2" />
39- < Button
40- data-testid = "helpToggleButton"
41- variant = "outline-primary"
42- onClick = { ( ) => setIsOpen ( ! isOpen ) }
43- iconBefore = { Help }
44- iconAfter = { isOpen ? ExpandLess : ExpandMore }
45- size = "sm"
46- >
47- { isOpen ? intl . formatMessage ( messages . closeHelpButtonLabel )
48- : intl . formatMessage ( messages . openHelpButtonLabel ) }
49- </ Button >
50- < div className = "col border-top ml-2" />
30+ < footer
31+ role = "contentinfo"
32+ aria-label = { intl . formatMessage ( messages . footerLabel ) }
33+ className = "border-top shadow"
34+ style = { { background : '#FFF' } }
35+ >
36+ < div >
37+ < Container size = "xl" className = "p-4" >
38+ < div className = "footer-links-row text-muted" >
39+ < Hyperlink className = "footer-link footer-link-color" destination = { `${ config . BASE_URL } /home` } > { intl . formatMessage ( messages . studioLinkLabel ) } </ Hyperlink >
40+ < Hyperlink data-testid = "LMS" className = "footer-link footer-link-color" destination = { config . LMS_BASE_URL } > { intl . formatMessage ( messages . lmsLinkLabel ) } </ Hyperlink >
41+ < Hyperlink className = "footer-link footer-link-color" destination = { `${ config . BASE_URL } /release-notes` } > { intl . formatMessage ( messages . releaseNotesLinkLabel ) } </ Hyperlink >
42+ < Hyperlink className = "footer-link footer-link-color" destination = "https://docs.edx.org/" > { intl . formatMessage ( messages . edxDocumentationLinkLabel ) } </ Hyperlink >
43+ < MailtoLink className = "footer-link footer-link-color" to = { config . SUPPORT_EMAIL } > { intl . formatMessage ( messages . contactUsLinkLabel ) } </ MailtoLink >
44+ </ div >
45+ </ Container >
46+ < div className = "border-top" />
47+ < Container size = "xl" className = "p-4" >
48+ < div className = "footer-bottom-row" >
49+ < div className = "footer-bottom-columns" >
50+ < div className = "footer-bottom-col text-muted" >
51+ < div className = "footer-links-row" >
52+ < span className = "footer-link footer-muted-text-color" > © { new Date ( ) . getFullYear ( ) } < Hyperlink className = "footer-link footer-link-color" destination = { config . MARKETING_SITE_BASE_URL } > { config . SITE_NAME } </ Hyperlink > .</ span >
53+ < Hyperlink data-testid = "termsOfService" className = "footer-link footer-link-color" destination = { config . TERMS_OF_SERVICE_URL } > { intl . formatMessage ( messages . termsOfServiceLinkLabel ) } </ Hyperlink >
54+ < Hyperlink className = "footer-link footer-link-color" destination = { config . PRIVACY_POLICY_URL } > { intl . formatMessage ( messages . privacyPolicyLinkLabel ) } </ Hyperlink >
55+ < Hyperlink className = "footer-link footer-link-color" destination = { `${ config . STUDIO_BASE_URL } /accessibility` } >
56+ { intl . formatMessage ( messages . accessibilityRequestLinkLabel ) }
57+ </ Hyperlink >
58+ </ div >
59+ < div >
60+ { /*
61+ Site operators: Please do not remove this paragraph! this attributes back to edX and
62+ makes your acknowledgement of edX's trademarks clear.
63+ Translators: 'edX' and 'Open edX' are trademarks of 'edX Inc.'. Please do not translate
64+ any of these trademarks and company names.
65+ */ }
66+ < span className = "footer-link footer-muted-text-color" > { intl . formatMessage ( messages . trademarkMessage ) } < Hyperlink className = "footer-link footer-link-color" destination = "https://www.edx.org" > edX Inc</ Hyperlink > .</ span >
67+ </ div >
68+ </ div >
69+ </ div >
70+ < div className = "" >
71+ < Hyperlink destination = { config . MARKETING_SITE_BASE_URL } >
72+ < Image
73+ src = { config . LOGO_URL }
74+ alt = "edX logo"
75+ height = { 32 }
76+ className = "footer-logo"
77+ />
78+ </ Hyperlink >
79+ </ div >
80+ </ div >
81+ </ Container >
5182 </ div >
52- < Container size = "xl" className = "px-4" >
53- < TransitionReplace >
54- { isOpen ? (
55- < ActionRow key = "help-link-button-row" className = "py-4" data-testid = "helpButtonRow" >
56- < ActionRow . Spacer />
57- < Button as = "a" href = "https://docs.edx.org/" size = "sm" >
58- < FormattedMessage { ...messages . edxDocumentationButtonLabel } />
59- </ Button >
60- < Button
61- as = "a"
62- href = "https://partners.edx.org/"
63- size = "sm"
64- data-testid = "edXPortalButton"
65- >
66- < FormattedMessage { ...messages . parnterPortalButtonLabel } />
67- </ Button >
68- < Button
69- as = "a"
70- href = "https://www.edx.org/course/edx101-overview-of-creating-an-edx-course#.VO4eaLPF-n1"
71- size = "sm"
72- >
73- < FormattedMessage { ...messages . edx101ButtonLabel } />
74- </ Button >
75- < Button
76- as = "a"
77- href = "https://www.edx.org/course/studiox-creating-a-course-with-edx-studio"
78- size = "sm"
79- >
80- < FormattedMessage { ...messages . studioXButtonLabel } />
81- </ Button >
82- { ! _ . isEmpty ( config . SUPPORT_EMAIL ) && (
83- < Button
84- as = "a"
85- href = { `mailto:${ config . SUPPORT_EMAIL } ` }
86- size = "sm"
87- data-testid = "contactUsButton"
88- >
89- < FormattedMessage { ...messages . contactUsButtonLabel } />
90- </ Button >
91- ) }
92- < ActionRow . Spacer />
93- </ ActionRow >
94- ) : null }
95- </ TransitionReplace >
96- < ActionRow className = "pt-3 m-0 x-small" >
97- © { new Date ( ) . getFullYear ( ) } < Hyperlink destination = { config . MARKETING_BASE_URL } target = "_blank" className = "ml-2" > { config . SITE_NAME } </ Hyperlink >
98- < ActionRow . Spacer />
99- { ! _ . isEmpty ( config . TERMS_OF_SERVICE_URL ) && (
100- < Hyperlink destination = { config . TERMS_OF_SERVICE_URL } data-testid = "termsOfService" >
101- { intl . formatMessage ( messages . termsOfServiceLinkLabel ) }
102- </ Hyperlink >
103- ) } { ! _ . isEmpty ( config . PRIVACY_POLICY_URL ) && (
104- < Hyperlink destination = { config . PRIVACY_POLICY_URL } data-testid = "privacyPolicy" >
105- { intl . formatMessage ( messages . privacyPolicyLinkLabel ) }
106- </ Hyperlink >
107- ) }
108- { config . SHOW_ACCESSIBILITY_PAGE === 'true' && (
109- < Hyperlink
110- destination = { `${ config . STUDIO_BASE_URL } /accessibility` }
111- data-testid = "accessibilityRequest"
112- >
113- { intl . formatMessage ( messages . accessibilityRequestLinkLabel ) }
114- </ Hyperlink >
115- ) }
116- < Hyperlink destination = { config . LMS_BASE_URL } > LMS</ Hyperlink >
117- </ ActionRow >
118- < ActionRow className = "mt-3 pb-4 x-small" >
119- { /*
120- Site operators: Please do not remove this paragraph! this attributes back to edX and
121- makes your acknowledgement of edX's trademarks clear.
122- Translators: 'edX' and 'Open edX' are trademarks of 'edX Inc.'. Please do not translate
123- any of these trademarks and company names.
124- */ }
125- < FormattedMessage { ...messages . trademarkMessage } />
126- < Hyperlink className = "ml-1" destination = "https://www.edx.org" > edX Inc</ Hyperlink > .
127- < ActionRow . Spacer />
128- < Hyperlink destination = "https://open.edx.org" className = "float-right" >
129- < Image
130- width = "120px"
131- alt = "Powered by Open edX"
132- src = "https://logos.openedx.org/open-edx-logo-tag.png"
133- />
134- </ Hyperlink >
135- </ ActionRow >
136- </ Container >
137- </ >
83+ </ footer >
13884 ) ;
13985} ;
14086
141- StudioFooter . propTypes = {
142- // injected
143- intl : intlShape . isRequired ,
144- } ;
145-
146- export default injectIntl ( StudioFooter ) ;
87+ export default StudioFooter ;
0 commit comments