Skip to content

Commit

Permalink
fix(linkprops): update link props
Browse files Browse the repository at this point in the history
BREAKING CHANGE move to link arrays and remove strings from component (and thus the need for i18n)
  • Loading branch information
AlasdairSwan committed Jun 3, 2019
1 parent a482325 commit 3f0e082
Show file tree
Hide file tree
Showing 8 changed files with 6,187 additions and 6,541 deletions.
10,968 changes: 5,482 additions & 5,486 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@commitlint/config-angular": "^6.0.2",
"@commitlint/prompt": "^6.0.2",
"@commitlint/prompt-cli": "^6.0.2",
"@edx/edx-bootstrap": "^2.2.1",
"@edx/frontend-i18n": "^1.0.4",
"@edx/frontend-logging": "^2.0.2",
"@edx/paragon": "^4.2.4",
Expand Down
169 changes: 125 additions & 44 deletions src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React from 'react';
import { render } from 'react-dom';
import { IntlProvider } from '@edx/frontend-i18n';

/* eslint-disable import/no-extraneous-dependencies */
import {
faFacebookSquare,
faTwitterSquare,
faYoutubeSquare,
faLinkedin,
faGooglePlusSquare,
faRedditSquare,
} from '@fortawesome/free-brands-svg-icons';
import { faLanguage } from '@fortawesome/free-solid-svg-icons';
Expand All @@ -20,6 +18,80 @@ import './index.scss';
import FooterLogo from './edx-footer.png';


const edXLinks = [
{
title: 'About',
url: 'https://www.example.com/about-us',
},
{
title: 'edX for Business',
url: 'https://business.edx.org',
queryParams: { utm_test: 'utm_test_value' },
},
{
title: 'Affiliates',
url: 'https://www.example.com/affiliate-program',
},
{
title: 'Open edX',
url: 'https://www.example.com/open',
},
{
title: 'Careers',
url: 'https://www.example.com/careers',
},
{
title: 'News',
url: 'https://www.example.com/news-announcements',
},
];

const legalLinks = [
{
title: 'Terms of Service & Honor Code',
url: 'https://www.example.com/terms-of-service',
},
{
title: 'Privacy Policy',
url: 'https://www.example.com/privacy-policy',
},
{
title: 'Accessibility Policy',
url: 'https://www.example.com/accessibility',
},
{
title: 'Trademark Policy',
url: 'https://www.example.com/trademarks',
},
{
title: 'Sitemap',
url: 'https://www.example.com/sitemap',
},
];

const connectLinks = [
{
title: 'Blog',
url: 'https://www.example.com/blog',
},
{
title: 'Contact Us',
url: 'https://www.example.com/contact',
},
{
title: 'Help Center',
url: 'https://www.example.com/support',
},
{
title: 'Media Kit',
url: 'https://www.example.com/media-kit',
},
{
title: 'Donate',
url: 'https://www.example.com/donate',
},
];

const socialLinks = [
{
title: 'Facebook',
Expand All @@ -45,12 +117,6 @@ const socialLinks = [
icon: <FontAwesomeIcon icon={faLinkedin} className="social-icon" size="2x" />,
screenReaderText: 'Follow edX on LinkedIn',
},
{
title: 'Google+',
url: 'https://plus.google.com',
icon: <FontAwesomeIcon icon={faGooglePlusSquare} className="social-icon" size="2x" />,
screenReaderText: 'Follow edX on Google+',
},
{
title: 'Reddit',
url: 'https://reddit.com',
Expand All @@ -61,42 +127,57 @@ const socialLinks = [


const App = () => (
<IntlProvider locale="en">
<SiteFooter
siteName="edX"
siteLogo={FooterLogo}
marketingSiteBaseUrl="https://www.example.com"
enterpriseMarketingLink={{
url: 'https://business.edx.org',
queryParams: { utm_test: 'utm_test_value' },
}}
supportUrl="https://www.example.com/support"
contactUrl="https://www.example.com/contact"
openSourceUrl="https://www.example.com/open"
termsOfServiceUrl="https://www.example.com/terms-of-service"
privacyPolicyUrl="https://www.example.com/privacy-policy"
appleAppStoreUrl="https://store.apple.com"
googlePlayUrl="https://play.google.com"
handleAllTrackEvents={() => {}}
socialLinks={socialLinks}
supportedLanguages={[
{
label: 'English',
value: 'en',
}, {
label: 'español',
value: 'es-419',
},
]}
languageForm={{
activeLanguage: 'en',
screenReaderLabel: 'Choose Language',
submitLabel: 'Apply',
icon: <FontAwesomeIcon icon={faLanguage} size="2x" className="text-primary" />,
onLanguageSelected: () => {},
}}
/>
</IntlProvider>
<SiteFooter
siteLogo={{
src: FooterLogo,
altText: 'edx Logo',
ariaLabel: 'edX Home',
}}
ariaLabel="Page Footer"
marketingSiteBaseUrl="https://www.example.com"
appleAppStore={{
url: 'https://store.apple.com',
altText: 'Download the edX mobile app from the Apple App Store',
}}
googlePlay={{
url: 'https://play.google.com',
altText: 'Download the edX mobile app from Google Play',
}}
handleAllTrackEvents={() => {}}
linkSectionOne={{
title: 'edX',
linkList: edXLinks,
}}
linkSectionTwo={{
title: 'Legal',
linkList: legalLinks,
}}
linkSectionThree={{
title: 'Connect',
linkList: connectLinks,
}}
socialLinks={socialLinks}
supportedLanguages={[
{
label: 'English',
value: 'en',
}, {
label: 'español',
value: 'es-419',
},
]}
languageForm={{
activeLanguage: 'en',
screenReaderLabel: 'Choose Language',
submitLabel: 'Apply',
icon: <FontAwesomeIcon icon={faLanguage} size="2x" className="text-primary" />,
onLanguageSelected: () => {},
}}
copyright="© 2012–2019 edX Inc."
trademark={(
<React.Fragment>EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 深圳市恒宇博科技有限公司 <a href="http://www.beian.miit.gov.cn">粤ICP备17044299号-2</a></React.Fragment>
)}
/>
);

render(<App />, document.getElementById('root'));
2 changes: 1 addition & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~@edx/edx-bootstrap/sass/edx/theme";
/*@import "~@edx/edx-bootstrap/sass/edx/theme";*/
@import "~bootstrap/scss/bootstrap";

@import './lib/scss/_site-footer.scss';
91 changes: 0 additions & 91 deletions src/lib/components/SiteFooter/SiteFooter.messages.js

This file was deleted.

Loading

0 comments on commit 3f0e082

Please # to comment.