Skip to content

Commit e220ad2

Browse files
zubairshakoorarbisoftZubair Shakoorarbirali
authored
feat: add navigation links to make footer consistent (#13)
* fix: made footer consistent where using custom footer * fix: added LMS footer navlinks * fix: linting error fixed and removed unecessary vars * fix: code refactoring * fix: code refactoring * fix: code clean * fix: snapshot updated * fix: redundant images removed after conflict resolution * fix: conflict resolved and snapshot updated * fix: updated footer links according legacy pages * fix: code ckean * fix: code clean * fix: code clean * fix: lint errors fixed * fix: fixed typo * test: update the test coverage for the footer nav --------- Co-authored-by: Zubair Shakoor <zubair.shakoor@A006-00863.local> Co-authored-by: arbirali <rahat.ali@arbisoft.com>
1 parent a2d63c4 commit e220ad2

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

src/components/Footer.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import LanguageSelector from './LanguageSelector';
1111
ensureConfig([
1212
'LMS_BASE_URL',
1313
'LOGO_TRADEMARK_URL',
14+
'INDIGO_FOOTER_NAV_LINKS',
1415
], 'Footer component');
1516

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

4648
return (
4749
<div className="wrapper wrapper-footer">
@@ -70,6 +72,15 @@ class SiteFooter extends React.Component {
7072
</li>
7173
</ul>
7274
</div>
75+
<nav className="nav-colophon">
76+
<ol>
77+
{indigoFooterNavLinks.map((link) => (
78+
<li key={link.url}>
79+
<a href={`${config.LMS_BASE_URL}${link.url}`}>{link.title}</a>
80+
</li>
81+
))}
82+
</ol>
83+
</nav>
7384
</div>
7485
<span className="copyright-site">{intl.formatMessage(messages['footer.copyright.text'])}</span>
7586
{showLanguageSelector && (

src/components/Footer.test.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ import { AppContext } from '@edx/frontend-platform/react';
77

88
import Footer from './Footer';
99

10+
jest.mock('@edx/frontend-platform', () => ({
11+
...jest.requireActual('@edx/frontend-platform'),
12+
getConfig: () => ({
13+
LMS_BASE_URL: process.env.LMS_BASE_URL,
14+
INDIGO_FOOTER_NAV_LINKS: [
15+
{ title: 'About Us', url: '/about' },
16+
{ title: 'Contact', url: '/contact' },
17+
],
18+
}),
19+
}));
20+
1021
const FooterWithContext = ({ locale = 'es' }) => {
1122
const contextValue = useMemo(() => ({
1223
authenticatedUser: null,

src/components/__snapshots__/Footer.test.jsx.snap

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,26 @@ exports[`<Footer /> renders correctly renders with a language selector 1`] = `
4848
</li>
4949
</ul>
5050
</div>
51+
<nav
52+
className="nav-colophon"
53+
>
54+
<ol>
55+
<li>
56+
<a
57+
href="http://localhost:18000/about"
58+
>
59+
About Us
60+
</a>
61+
</li>
62+
<li>
63+
<a
64+
href="http://localhost:18000/contact"
65+
>
66+
Contact
67+
</a>
68+
</li>
69+
</ol>
70+
</nav>
5171
</div>
5272
<span
5373
className="copyright-site"
@@ -145,6 +165,26 @@ exports[`<Footer /> renders correctly renders without a language selector 1`] =
145165
</li>
146166
</ul>
147167
</div>
168+
<nav
169+
className="nav-colophon"
170+
>
171+
<ol>
172+
<li>
173+
<a
174+
href="http://localhost:18000/about"
175+
>
176+
About Us
177+
</a>
178+
</li>
179+
<li>
180+
<a
181+
href="http://localhost:18000/contact"
182+
>
183+
Contact
184+
</a>
185+
</li>
186+
</ol>
187+
</nav>
148188
</div>
149189
<span
150190
className="copyright-site"
@@ -203,6 +243,26 @@ exports[`<Footer /> renders correctly renders without a language selector in es
203243
</li>
204244
</ul>
205245
</div>
246+
<nav
247+
className="nav-colophon"
248+
>
249+
<ol>
250+
<li>
251+
<a
252+
href="http://localhost:18000/about"
253+
>
254+
About Us
255+
</a>
256+
</li>
257+
<li>
258+
<a
259+
href="http://localhost:18000/contact"
260+
>
261+
Contact
262+
</a>
263+
</li>
264+
</ol>
265+
</nav>
206266
</div>
207267
<span
208268
className="copyright-site"

0 commit comments

Comments
 (0)