Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import LanguageSelector from './LanguageSelector';
ensureConfig([
'LMS_BASE_URL',
'LOGO_TRADEMARK_URL',
'INDIGO_FOOTER_NAV_LINKS',
], 'Footer component');

const EVENT_NAMES = {
Expand Down Expand Up @@ -42,6 +43,7 @@ class SiteFooter extends React.Component {
} = this.props;
const showLanguageSelector = supportedLanguages.length > 0 && onLanguageSelected;
const config = getConfig();
const indigoFooterNavLinks = config.INDIGO_FOOTER_NAV_LINKS || [];

return (
<div className="wrapper wrapper-footer">
Expand Down Expand Up @@ -70,6 +72,15 @@ class SiteFooter extends React.Component {
</li>
</ul>
</div>
<nav className="nav-colophon">
<ol>
{indigoFooterNavLinks.map((link) => (
<li key={link.url}>
<a href={`${config.LMS_BASE_URL}${link.url}`}>{link.title}</a>
</li>
))}
</ol>
</nav>
</div>
<span className="copyright-site">{intl.formatMessage(messages['footer.copyright.text'])}</span>
{showLanguageSelector && (
Expand Down
11 changes: 11 additions & 0 deletions src/components/Footer.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ import { AppContext } from '@edx/frontend-platform/react';

import Footer from './Footer';

jest.mock('@edx/frontend-platform', () => ({
...jest.requireActual('@edx/frontend-platform'),
getConfig: () => ({
LMS_BASE_URL: process.env.LMS_BASE_URL,
INDIGO_FOOTER_NAV_LINKS: [
{ title: 'About Us', url: '/about' },
{ title: 'Contact', url: '/contact' },
],
}),
}));

const FooterWithContext = ({ locale = 'es' }) => {
const contextValue = useMemo(() => ({
authenticatedUser: null,
Expand Down
60 changes: 60 additions & 0 deletions src/components/__snapshots__/Footer.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,26 @@ exports[`<Footer /> renders correctly renders with a language selector 1`] = `
</li>
</ul>
</div>
<nav
className="nav-colophon"
>
<ol>
<li>
<a
href="http://localhost:18000/about"
>
About Us
</a>
</li>
<li>
<a
href="http://localhost:18000/contact"
>
Contact
</a>
</li>
</ol>
</nav>
</div>
<span
className="copyright-site"
Expand Down Expand Up @@ -145,6 +165,26 @@ exports[`<Footer /> renders correctly renders without a language selector 1`] =
</li>
</ul>
</div>
<nav
className="nav-colophon"
>
<ol>
<li>
<a
href="http://localhost:18000/about"
>
About Us
</a>
</li>
<li>
<a
href="http://localhost:18000/contact"
>
Contact
</a>
</li>
</ol>
</nav>
</div>
<span
className="copyright-site"
Expand Down Expand Up @@ -203,6 +243,26 @@ exports[`<Footer /> renders correctly renders without a language selector in es
</li>
</ul>
</div>
<nav
className="nav-colophon"
>
<ol>
<li>
<a
href="http://localhost:18000/about"
>
About Us
</a>
</li>
<li>
<a
href="http://localhost:18000/contact"
>
Contact
</a>
</li>
</ol>
</nav>
</div>
<span
className="copyright-site"
Expand Down