Skip to content

Commit

Permalink
feat: add option to configure link container classnames
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Jul 6, 2023
1 parent d1e6938 commit 0ae617e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ Other than the environment variables listed above, it is also possible to custom
{"url": "https://openedx.org/code-of-conduct/", "text": "Code of conduct"},
{"url": "https://openedx.org/privacy-policy/", "text": "Privacy Policy"},
],
# Update link container classes
"FOOTER_LINKS_CONTAINER_CLASSNAMES": "flex-wrap",
# Update link styling
"FOOTER_LINKS_CLASSNAMES": "text-dark font-weight-bold",
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SiteFooter extends React.Component {
</a>
<div className="flex-grow-1" />
{Array.isArray(config.FOOTER_LINKS) && (
<div className="d-flex align-items-center justify-content-center">
<div className={`d-flex align-items-center justify-content-center ${config.FOOTER_LINKS_CONTAINER_CLASSNAMES || ''}`}>
{config.FOOTER_LINKS.map(element => (
<a
key={element.url}
Expand Down
1 change: 1 addition & 0 deletions src/components/Footer.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const FooterWithContext = ({ locale = 'es' }) => {
{ url: 'https://openedx.org/code-of-conduct/', text: 'Code of conduct' },
{ url: 'https://openedx.org/privacy-policy/', text: 'Privacy Policy' },
],
FOOTER_LINKS_CONTAINER_CLASSNAMES: 'flex-wrap',
FOOTER_LINKS_CLASSNAMES: 'text-dark font-weight-bold',
},
}), []);
Expand Down
4 changes: 2 additions & 2 deletions src/components/__snapshots__/Footer.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ exports[`<Footer /> renders correctly renders without a language selector 1`] =
className="flex-grow-1"
/>
<div
className="d-flex align-items-center justify-content-center"
className="d-flex align-items-center justify-content-center flex-wrap"
>
<a
className="px-3 text-dark font-weight-bold"
Expand Down Expand Up @@ -153,7 +153,7 @@ exports[`<Footer /> renders correctly renders without a language selector in es
className="flex-grow-1"
/>
<div
className="d-flex align-items-center justify-content-center"
className="d-flex align-items-center justify-content-center flex-wrap"
>
<a
className="px-3 text-dark font-weight-bold"
Expand Down

0 comments on commit 0ae617e

Please sign in to comment.