Skip to content

Commit

Permalink
fix(packge.json): add MITX info
Browse files Browse the repository at this point in the history
  • Loading branch information
Wassaf-Shahzad committed Oct 27, 2021
1 parent dcb2b11 commit 2ed2992
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 30 deletions.
1 change: 0 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ SITE_URL=
LOGO_ALT_TEXT=
SHOW_LOGO=
SUPPORT_EMAIL=

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@edx/frontend-component-footer",
"name": "frontend-component-footer-mitol",
"version": "1.0.0-semantically-released",
"description": "Footer component for use when building Open edX frontend applications",
"description": "Footer component for use when building Open edX frontend applications for MITX",
"main": "dist/index.js",
"publishConfig": {
"access": "public"
Expand All @@ -25,14 +25,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/edx/frontend-component-footer.git"
"url": "git+https://github.com/mitodl/frontend-component-footer-mitol"
},
"author": "edX",
"license": "AGPL-3.0",
"bugs": {
"url": "https://github.com/edx/frontend-component-footer/issues"
"url": "https://github.com/mitodl/frontend-component-footer-mitol/issues"
},
"homepage": "https://github.com/edx/frontend-component-footer#readme",
"homepage": "https://github.com/mitodl/frontend-component-footer-mitol#readme",
"devDependencies": {
"@commitlint/cli": "13.2.0",
"@commitlint/config-angular": "13.2.0",
Expand Down
38 changes: 21 additions & 17 deletions src/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class SiteFooter extends React.Component {
sendTrackEvent(eventName, properties);
}

renderLinkIfExists(value,text){
return value && <li><a href={value}>{text}</a></li>
renderLinkIfExists(value, text) {
return value && <li><a href={value}>{text}</a></li>;
}

render() {
Expand All @@ -59,7 +59,8 @@ class SiteFooter extends React.Component {
className="footer d-flex border-top py-3 px-4"
>
<div className="container-fluid d-flex">
{ process.env.SHOW_LOGO &&
{ process.env.SHOW_LOGO
&& (
<a
className="d-block"
href={process.env.SITE_URL}
Expand All @@ -68,24 +69,27 @@ class SiteFooter extends React.Component {
<img
style={{ maxHeight: 45 }}
src={logo || config.LOGO_TRADEMARK_URL}
alt={ process.env.LOGO_ALT_TEXT || intl.formatMessage(messages['footer.logo.altText'])}
alt={process.env.LOGO_ALT_TEXT || intl.formatMessage(messages['footer.logo.altText'])}
/>
</a>
}
<div class="copyright-col">
{process.env.TRADEMARK_TEXT && <div class="text-gray-500 small">
{process.env.TRADEMARK_TEXT}
</div>}
)}
<div className="copyright-col">
{process.env.TRADEMARK_TEXT
&& (
<div className="text-gray-500 small">
{process.env.TRADEMARK_TEXT}
</div>
)}
<div>
<ul class="footer-sub-nav">
{this.renderLinkIfExists(process.env.ABOUT_US_URL,"About Us")}
{this.renderLinkIfExists(process.env.TERMS_OF_SERVICE_URL,"Terms of Service")}
{this.renderLinkIfExists(process.env.PRIVACY_POLICY_URL,"Privacy Policy")}
{this.renderLinkIfExists(process.env.HONOR_CODE_URL,"Honor Code")}
{this.renderLinkIfExists(process.env.Contact,"Contact")}
{this.renderLinkIfExists(process.env.SUPPORT_CENTER_URL,process.env.SUPPORT_CENTER_TEXT || "FAQ & Help")}
<ul className="footer-sub-nav">
{this.renderLinkIfExists(process.env.ABOUT_US_URL, 'About Us')}
{this.renderLinkIfExists(process.env.TERMS_OF_SERVICE_URL, 'Terms of Service')}
{this.renderLinkIfExists(process.env.PRIVACY_POLICY_URL, 'Privacy Policy')}
{this.renderLinkIfExists(process.env.HONOR_CODE_URL, 'Honor Code')}
{this.renderLinkIfExists(process.env.Contact, 'Contact')}
{this.renderLinkIfExists(process.env.SUPPORT_CENTER_URL, process.env.SUPPORT_CENTER_TEXT || 'FAQ & Help')}
</ul>
</div>
</div>
</div>
<div className="flex-grow-1" />
{showLanguageSelector && (
Expand Down
162 changes: 156 additions & 6 deletions src/components/__snapshots__/Footer.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ exports[`<Footer /> renders correctly renders with a language selector 1`] = `
<a
aria-label="edX Home"
className="d-block"
href="https://open.edx.org"
href="http://localhost:18000/"
>
<img
alt="Powered by Open edX"
alt="alt text"
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
style={
Object {
Expand All @@ -23,6 +23,56 @@ exports[`<Footer /> renders correctly renders with a language selector 1`] = `
}
/>
</a>
<div
className="copyright-col"
>
<div
className="text-gray-500 small"
>
Trade Mark text
</div>
<div>
<ul
className="footer-sub-nav"
>
<li>
<a
href="http://localhost:18000/about"
>
About Us
</a>
</li>
<li>
<a
href="http://localhost:18000/tos_and_honor"
>
Terms of Service
</a>
</li>
<li>
<a
href="http://localhost:18000/privacy"
>
Privacy Policy
</a>
</li>
<li>
<a
href="http://localhost:18000/tos_and_honor"
>
Honor Code
</a>
</li>
<li>
<a
href="http://localhost:18000/about"
>
SUPPORT CENTER
</a>
</li>
</ul>
</div>
</div>
<div
className="flex-grow-1"
/>
Expand Down Expand Up @@ -83,10 +133,10 @@ exports[`<Footer /> renders correctly renders without a language selector 1`] =
<a
aria-label="edX Home"
className="d-block"
href="https://open.edx.org"
href="http://localhost:18000/"
>
<img
alt="Powered by Open edX"
alt="alt text"
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
style={
Object {
Expand All @@ -95,6 +145,56 @@ exports[`<Footer /> renders correctly renders without a language selector 1`] =
}
/>
</a>
<div
className="copyright-col"
>
<div
className="text-gray-500 small"
>
Trade Mark text
</div>
<div>
<ul
className="footer-sub-nav"
>
<li>
<a
href="http://localhost:18000/about"
>
About Us
</a>
</li>
<li>
<a
href="http://localhost:18000/tos_and_honor"
>
Terms of Service
</a>
</li>
<li>
<a
href="http://localhost:18000/privacy"
>
Privacy Policy
</a>
</li>
<li>
<a
href="http://localhost:18000/tos_and_honor"
>
Honor Code
</a>
</li>
<li>
<a
href="http://localhost:18000/about"
>
SUPPORT CENTER
</a>
</li>
</ul>
</div>
</div>
<div
className="flex-grow-1"
/>
Expand All @@ -113,10 +213,10 @@ exports[`<Footer /> renders correctly renders without a language selector in es
<a
aria-label="edX Home"
className="d-block"
href="https://open.edx.org"
href="http://localhost:18000/"
>
<img
alt="Powered by Open edX"
alt="alt text"
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
style={
Object {
Expand All @@ -125,6 +225,56 @@ exports[`<Footer /> renders correctly renders without a language selector in es
}
/>
</a>
<div
className="copyright-col"
>
<div
className="text-gray-500 small"
>
Trade Mark text
</div>
<div>
<ul
className="footer-sub-nav"
>
<li>
<a
href="http://localhost:18000/about"
>
About Us
</a>
</li>
<li>
<a
href="http://localhost:18000/tos_and_honor"
>
Terms of Service
</a>
</li>
<li>
<a
href="http://localhost:18000/privacy"
>
Privacy Policy
</a>
</li>
<li>
<a
href="http://localhost:18000/tos_and_honor"
>
Honor Code
</a>
</li>
<li>
<a
href="http://localhost:18000/about"
>
SUPPORT CENTER
</a>
</li>
</ul>
</div>
</div>
<div
className="flex-grow-1"
/>
Expand Down
12 changes: 12 additions & 0 deletions src/setupTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,15 @@ process.env.LOGO_URL = 'https://edx-cdn.org/v3/default/logo.svg';
process.env.LOGO_TRADEMARK_URL = 'https://edx-cdn.org/v3/default/logo-trademark.svg';
process.env.LOGO_WHITE_URL = 'https://edx-cdn.org/v3/default/logo-white.svg';
process.env.FAVICON_URL = 'https://edx-cdn.org/v3/default/favicon.ico';
process.env.ABOUT_US_URL = 'http://localhost:18000/about';
process.env.PRIVACY_POLICY_URL = 'http://localhost:18000/privacy';
process.env.HONOR_CODE_URL = 'http://localhost:18000/tos_and_honor';
process.env.TERMS_OF_SERVICE_URL = 'http://localhost:18000/tos_and_honor';
process.env.CONTACT_URL = 'http://localhost:18000/about';
process.env.SUPPORT_CENTER_URL = 'http://localhost:18000/about';
process.env.SUPPORT_CENTER_TEXT = 'SUPPORT CENTER';
process.env.TRADEMARK_TEXT = 'Trade Mark text';
process.env.SITE_URL = 'http://localhost:18000/';
process.env.LOGO_ALT_TEXT = 'alt text';
process.env.SHOW_LOGO = true;
process.env.SUPPORT_EMAIL = '[email protected]';

0 comments on commit 2ed2992

Please sign in to comment.