Compare commits

...

13 Commits

Author SHA1 Message Date
AlasdairSwan
6db2d70e97 Merge pull request #37 from edx/alasdair/update-link-sections-to-accept-arrays
fix(linkprops): update link props
2019-06-04 09:03:27 -04:00
AlasdairSwan
3ab4adf10b fix(linkprops): update link props
BREAKING CHANGE move to link arrays and remove strings from component (and thus the need for i18n)
2019-06-03 15:57:30 -04:00
edX Transifex Bot
a482325eac fix(i18n): update translations 2019-06-02 17:33:12 -04:00
Douglas Hall
d919d1a577 Merge pull request #38 from edx/douglashall/finish_i18n_refactoring
fix: modify babelrc for i18n
2019-05-31 14:17:28 -04:00
Douglas Hall
4b3a91138d fix: modify babelrc for i18n 2019-05-31 14:11:48 -04:00
David Joy
7680ad3393 Merge pull request #36 from edx/djoy/is-es5
fix: adding es check
2019-05-28 13:33:09 -04:00
David Joy
061b41bee8 fix: adding es check 2019-05-28 09:42:04 -04:00
Douglas Hall
cacae4789f fix: move to @edx/frontend-i18n dependency (#35)
fix: move to @edx/frontend-i18n dependency
2019-05-24 14:20:22 -04:00
Douglas Hall
adceca6b53 fix: move to @edx/frontend-i18n dependency
BREAKING CHANGE: consumers will now be required to supply @edx/frontend-i18n instead of react-intl
2019-05-24 12:06:17 -04:00
Douglas Hall
ab61fd35eb Merge pull request #34 from edx/douglashall/reduce_bundle_size
fix: remove paragon from bundle
2019-05-23 14:34:38 -04:00
Douglas Hall
4d739f2962 fix: remove paragon from bundle
BREAKING CHANGE: Now requires containing app to provide `@edx/paragon`.
2019-05-23 14:28:28 -04:00
albemarle
28a6c85bc0 Merge pull request #30 from edx/aehsan/prod-277/update_the_edx_icp_license
Updated ICP license in footer
2019-05-22 14:01:36 -04:00
adeelehsan
6125988bbd Updated ICP license in footer 2019-05-22 00:33:19 +05:00
15 changed files with 6866 additions and 6573 deletions

View File

@@ -19,7 +19,8 @@
"i18n": {
"plugins": [
["react-intl", {
"messagesDir": "./temp"
"messagesDir": "./temp",
"moduleSourceName": "@edx/frontend-i18n"
}]
]
}

View File

@@ -11,6 +11,7 @@ script:
- npm run i18n_extract
- npm run test
- npm run build
- npm run is-es5
after_success:
- npm run travis-deploy-once "npm run semantic-release"
- npm run coveralls

View File

@@ -23,7 +23,7 @@ of how the SiteFooter component can be specified.
Requirements
------------
This component uses ``react-intl``. Any containing app must provide ``react-intl`` as a peer dependency, and be wrapped inside an ``IntlProvider`` element, whether or not your consuming application is actually localized. For a basic default locale (English) version, follow the ``IntlProvider`` example in the sample application in `src/index.jsx <src/index.jsx>`__.
This component uses ``@edx/frontend-i18n``. Any containing app must provide ``@edx/frontend-i18n`` as a peer dependency, and be wrapped inside an ``IntlProvider`` element, whether or not your consuming application is actually localized. For a basic default locale (English) version, follow the ``IntlProvider`` example in the sample application in `src/index.jsx <src/index.jsx>`__.
Development
-----------

View File

@@ -35,11 +35,17 @@ module.exports = Merge.smart(commonConfig, {
amd: 'ReactDOM',
root: 'ReactDOM',
},
'react-intl': {
commonjs: 'react-intl',
commonjs2: 'react-intl',
amd: 'ReactIntl',
root: 'ReactIntl',
'@edx/frontend-i18n': {
commonjs: '@edx/frontend-i18n',
commonjs2: '@edx/frontend-i18n',
amd: '@edx/frontend-i18n',
root: '@edx/frontend-i18n',
},
'@edx/frontend-logging': {
commonjs: '@edx/frontend-logging',
commonjs2: '@edx/frontend-logging',
amd: '@edx/frontend-logging',
root: '@edx/frontend-logging',
},
'@edx/paragon': {
commonjs: '@edx/paragon',

11583
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,7 @@
"gc": "commit",
"commitmsg": "commitlint -e $GIT_PARAMS",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"is-es5": "es-check es5 ./dist/*.js",
"i18n_extract": "BABEL_ENV=i18n babel src --quiet > /dev/null",
"lint": "eslint --ext .js --ext .jsx .",
"precommit": "npm run lint",
@@ -39,6 +40,10 @@
"@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",
"@fortawesome/fontawesome-svg-core": "^1.2.17",
"@fortawesome/free-brands-svg-icons": "^5.8.1",
"@fortawesome/free-regular-svg-icons": "^5.8.1",
@@ -57,6 +62,7 @@
"css-loader": "^0.28.9",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"es-check": "^5.0.0",
"eslint": "^5.2.0",
"eslint-config-edx": "^4.0.4",
"eslint-plugin-jsx-a11y": "^6.1.2",
@@ -67,7 +73,10 @@
"image-webpack-loader": "^4.2.0",
"jest": "23.6.0",
"node-sass": "^4.7.2",
"prop-types": "^15.5.10",
"react": "^16.4.2",
"react-dev-utils": "^5.0.0",
"react-dom": "^16.2.0",
"react-test-renderer": "^16.6.0",
"reactifex": "^1.1.1",
"sass-loader": "^6.0.6",
@@ -82,12 +91,15 @@
"webpack-merge": "^4.2.1"
},
"dependencies": {
"@edx/paragon": "^3.8.0",
"query-string": "^5.1.1"
},
"peerDependencies": {
"@edx/frontend-i18n": "^1.0.4",
"@edx/frontend-logging": "^2.0.2",
"@edx/paragon": "^4.2.4",
"prop-types": "^15.5.10",
"query-string": "^5.1.1",
"react": "^16.4.2",
"react-dom": "^16.2.0",
"react-intl": "2.x"
"react-dom": "^16.2.0"
},
"jest": {
"setupFiles": [

View File

@@ -18,7 +18,7 @@
"footer.site-footer.link.media-kit": "Media Kit",
"footer.site-footer.link.donate": "Donate",
"footer.site-footer.copyright-text": "{copyrightSymbol} {startDate}{endDate} {siteName} Inc.",
"footer.site-footer.trademark-text": "EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | {icpLicense}",
"footer.site-footer.trademark-text": "EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 深圳市恒宇博科技有限公司 {icpLicense}",
"footer.site-footer.site-logo.alt-text": "{siteName} logo",
"footer.site-footer.site-logo.aria-label": "{siteName} Home",
"footer.site-footer.facebook.title": "Facebook",

View File

@@ -18,7 +18,7 @@
"footer.site-footer.link.media-kit": "Media Kit",
"footer.site-footer.link.donate": "Donate",
"footer.site-footer.copyright-text": "{copyrightSymbol} {startDate}{endDate} {siteName} Inc.",
"footer.site-footer.trademark-text": "EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | {icpLicense}",
"footer.site-footer.trademark-text": "EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 深圳市恒宇博科技有限公司 {icpLicense}",
"footer.site-footer.site-logo.alt-text": "{siteName} logo",
"footer.site-footer.site-logo.aria-label": "{siteName} Home",
"footer.site-footer.facebook.title": "Facebook",

View File

@@ -18,7 +18,7 @@
"footer.site-footer.link.media-kit": "Media Kit",
"footer.site-footer.link.donate": "Donate",
"footer.site-footer.copyright-text": "{copyrightSymbol} {startDate}{endDate} {siteName} Inc.",
"footer.site-footer.trademark-text": "EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | {icpLicense}",
"footer.site-footer.trademark-text": "EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 深圳市恒宇博科技有限公司 {icpLicense}",
"footer.site-footer.site-logo.alt-text": "{siteName} logo",
"footer.site-footer.site-logo.aria-label": "{siteName} Home",
"footer.site-footer.facebook.title": "Facebook",

View File

@@ -18,7 +18,7 @@
"footer.site-footer.link.media-kit": "多媒体工具箱",
"footer.site-footer.link.donate": "捐献",
"footer.site-footer.copyright-text": "{copyrightSymbol} {startDate}{endDate} {siteName} Inc.",
"footer.site-footer.trademark-text": "EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | {icpLicense}",
"footer.site-footer.trademark-text": "EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 深圳市恒宇博科技有限公司 {icpLicense}",
"footer.site-footer.site-logo.alt-text": "{siteName} logo",
"footer.site-footer.site-logo.aria-label": "{siteName} 主页",
"footer.site-footer.facebook.title": "脸书",

View File

@@ -1,6 +1,5 @@
import React from 'react';
import { render } from 'react-dom';
import { IntlProvider } from 'react-intl';
/* eslint-disable import/no-extraneous-dependencies */
import {
@@ -8,7 +7,6 @@ import {
faTwitterSquare,
faYoutubeSquare,
faLinkedin,
faGooglePlusSquare,
faRedditSquare,
} from '@fortawesome/free-brands-svg-icons';
import { faLanguage } from '@fortawesome/free-solid-svg-icons';
@@ -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',
@@ -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',
@@ -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="© 20122019 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'));

View File

@@ -1,91 +0,0 @@
import { defineMessages } from 'react-intl';
const messages = defineMessages({
'footer.site-footer.site-logo.alt-text': {
id: 'footer.site-footer.site-logo.alt-text',
defaultMessage: '{siteName} logo',
description: 'The alt description of the site logo',
},
'footer.site-footer.site-logo.aria-label': {
id: 'footer.site-footer.site-logo.aria-label',
defaultMessage: '{siteName} Home',
description: 'Aria label for the site logo which goes to the marketing site',
},
'footer.site-footer.facebook.title': {
id: 'footer.site-footer.facebook.title',
defaultMessage: 'Facebook',
description: 'Facebook button title',
},
'footer.site-footer.facebook.screen-reader-text': {
id: 'footer.site-footer.facebook.screen-reader-text',
defaultMessage: 'Like {siteName} on Facebook',
description: 'Facebook button screen reader text',
},
'footer.site-footer.twitter.title': {
id: 'footer.site-footer.twitter.title',
defaultMessage: 'Twitter',
description: 'Twitter button title',
},
'footer.site-footer.twitter.screen-reader-text': {
id: 'footer.site-footer.twitter.screen-reader-text',
defaultMessage: 'Follow {siteName} on Twitter',
description: 'Twitter button screen reader text',
},
'footer.site-footer.youtube.title': {
id: 'footer.site-footer.youtube.title',
defaultMessage: 'Youtube',
description: 'Youtube button title',
},
'footer.site-footer.youtube.screen-reader-text': {
id: 'footer.site-footer.youtube.screen-reader-text',
defaultMessage: 'Subscribe to the {siteName} YouTube channel',
description: 'Youtube button screen reader text',
},
'footer.site-footer.linkedin.title': {
id: 'footer.site-footer.linkedin.title',
defaultMessage: 'LinkedIn',
description: 'LinkedIn button title',
},
'footer.site-footer.linkedin.screen-reader-text': {
id: 'footer.site-footer.linkedin.screen-reader-text',
defaultMessage: 'Follow {siteName} on LinkedIn',
description: 'LinkedIn button screen reader text',
},
'footer.site-footer.google-plus.title': {
id: 'footer.site-footer.google-plus.title',
defaultMessage: 'Google+',
description: 'Google+ button title',
},
'footer.site-footer.google-plus.screen-reader-text': {
id: 'footer.site-footer.google-plus.screen-reader-text',
defaultMessage: 'Follow {siteName} on Google+',
description: 'Google+ button screen reader text',
},
'footer.site-footer.reddit.title': {
id: 'footer.site-footer.reddit.title',
defaultMessage: 'Reddit',
description: 'Reddit button title',
},
'footer.site-footer.reddit.screen-reader-text': {
id: 'footer.site-footer.reddit.screen-reader-text',
defaultMessage: 'Subscribe to the {siteName} subreddit',
description: 'Reddit button screen reader text',
},
'footer.site-footer.apple-app-store.alt-text': {
id: 'footer.site-footer.apple-app-store.alt-text',
defaultMessage: 'Download the {siteName} mobile app from the Apple App Store',
description: 'Apple App Store button alt description',
},
'footer.site-footer.google-play.alt-text': {
id: 'footer.site-footer.google-play.alt-text',
defaultMessage: 'Download the {siteName} mobile app from Google Play',
description: 'Google Play button alt description',
},
'footer.site-footer.footer.aria-label': {
id: 'footer.site-footer.footer.aria-label',
defaultMessage: 'Page Footer',
description: 'Aria label for the footer',
},
});
export default messages;

View File

@@ -1,14 +1,12 @@
import React from 'react';
import renderer from 'react-test-renderer';
import { mount } from 'enzyme';
import { IntlProvider } from 'react-intl';
import {
faFacebookSquare,
faTwitterSquare,
faYoutubeSquare,
faLinkedin,
faGooglePlusSquare,
faRedditSquare,
} from '@fortawesome/free-brands-svg-icons';
import { faLanguage } from '@fortawesome/free-solid-svg-icons';
@@ -18,6 +16,80 @@ import FooterLogo from '../../../edx-footer.png';
import SiteFooter, { EVENT_NAMES } from './index';
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',
@@ -43,12 +115,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',
@@ -77,28 +143,43 @@ const languageForm = {
const completeSiteFooterComponent = mockHandleAllTrackEvents =>
(
<IntlProvider locale="en">
<SiteFooter
siteName="example"
siteLogo={FooterLogo}
marketingSiteBaseUrl="https://www.example.com"
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"
socialLinks={socialLinks}
appleAppStoreUrl="https://store.apple.com"
googlePlayUrl="https://play.google.com"
handleAllTrackEvents={mockHandleAllTrackEvents}
supportedLanguages={supportedLanguages}
languageForm={languageForm}
enterpriseMarketingLink={{
url: 'https://business.edx.org',
queryParams: { utm_test: 'utm_test_value' },
}}
/>
</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={mockHandleAllTrackEvents}
linkSectionOne={{
title: 'edX',
linkList: edXLinks,
}}
linkSectionTwo={{
title: 'Legal',
linkList: legalLinks,
}}
linkSectionThree={{
title: 'Connect',
linkList: connectLinks,
}}
socialLinks={socialLinks}
supportedLanguages={supportedLanguages}
languageForm={languageForm}
copyright="© 20122019 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>
)}
/>
);
describe('<SiteFooter />', () => {
@@ -114,27 +195,42 @@ describe('<SiteFooter />', () => {
it('does not render social links', () => {
const tree = renderer
.create((
<IntlProvider locale="en">
<SiteFooter
siteName="example"
siteLogo={FooterLogo}
marketingSiteBaseUrl="https://www.example.com"
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"
supportedLanguages={supportedLanguages}
languageForm={languageForm}
handleAllTrackEvents={jest.fn()}
enterpriseMarketingLink={{
url: 'https://business.edx.org',
queryParams: { utm_test: 'utm_test_value' },
}}
/>
</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={jest.fn()}
linkSectionOne={{
title: 'edX',
linkList: edXLinks,
}}
linkSectionTwo={{
title: 'Legal',
linkList: legalLinks,
}}
linkSectionThree={{
title: 'Connect',
linkList: connectLinks,
}}
supportedLanguages={supportedLanguages}
languageForm={languageForm}
copyright="© 20122019 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>
)}
/>
)).toJSON();
expect(tree).toMatchSnapshot();
});
@@ -142,25 +238,44 @@ describe('<SiteFooter />', () => {
it('does not render mobile links', () => {
const tree = renderer
.create((
<IntlProvider locale="en">
<SiteFooter
siteName="example"
siteLogo={FooterLogo}
marketingSiteBaseUrl="https://www.example.com"
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"
socialLinks={socialLinks}
appleAppStoreUrl="https://store.apple.com"
googlePlayUrl="https://play.google.com"
supportedLanguages={supportedLanguages}
languageForm={languageForm}
handleAllTrackEvents={jest.fn()}
showMobileLinks={false}
/>
</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={jest.fn()}
linkSectionOne={{
title: 'edX',
linkList: edXLinks,
}}
linkSectionTwo={{
title: 'Legal',
linkList: legalLinks,
}}
linkSectionThree={{
title: 'Connect',
linkList: connectLinks,
}}
socialLinks={socialLinks}
supportedLanguages={supportedLanguages}
languageForm={languageForm}
copyright="© 20122019 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>
)}
showMobileLinks={false}
/>
)).toJSON();
expect(tree).toMatchSnapshot();
});
@@ -168,43 +283,42 @@ describe('<SiteFooter />', () => {
it('does not render language selector', () => {
const tree = renderer
.create((
<IntlProvider locale="en">
<SiteFooter
siteName="example"
siteLogo={FooterLogo}
marketingSiteBaseUrl="https://www.example.com"
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={jest.fn()}
/>
</IntlProvider>
)).toJSON();
expect(tree).toMatchSnapshot();
});
it('does not render business links', () => {
const tree = renderer
.create((
<IntlProvider locale="en">
<SiteFooter
siteName="example"
siteLogo={FooterLogo}
marketingSiteBaseUrl="https://www.example.com"
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={jest.fn()}
/>
</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={jest.fn()}
linkSectionOne={{
title: 'edX',
linkList: edXLinks,
}}
linkSectionTwo={{
title: 'Legal',
linkList: legalLinks,
}}
linkSectionThree={{
title: 'Connect',
linkList: connectLinks,
}}
socialLinks={socialLinks}
supportedLanguages={supportedLanguages}
copyright="© 20122019 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>
)}
/>
)).toJSON();
expect(tree).toMatchSnapshot();
});
@@ -216,7 +330,8 @@ describe('<SiteFooter />', () => {
const footer = mount((completeSiteFooterComponent(mockHandleAllTrackEvents)));
const externalLinks = footer.find("a[target='_blank']");
expect(externalLinks).toHaveLength(8);
expect(externalLinks.length).toEqual(socialLinks.length + 2);
externalLinks.forEach((externalLink) => {
const callIndex = mockHandleAllTrackEvents.mock.calls.length;
externalLink.simulate('click');

View File

@@ -1,250 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<SiteFooter /> renders correctly does not render business links 1`] = `
<footer
aria-label="Page Footer"
className="footer d-flex justify-content-center border-top py-3 px-4"
role="contentinfo"
>
<div
className="max-width-1180 d-grid"
>
<div
className="area-1"
>
<a
aria-label="example Home"
href="https://www.example.com/"
onClick={[Function]}
target="_self"
>
<img
alt="example logo"
src="test-file-stub"
/>
</a>
</div>
<div
className="area-2"
>
<h2>
example
</h2>
<ul
className="list-unstyled p-0 m-0"
>
<li>
<a
href="https://www.example.com/about-us"
>
<span>
About
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/affiliate-program"
>
<span>
Affiliates
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/open"
>
<span>
Open example
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/careers"
>
<span>
Careers
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/news-announcements"
>
<span>
News
</span>
</a>
</li>
</ul>
</div>
<div
className="area-3"
>
<h2>
<span>
Legal
</span>
</h2>
<ul
className="list-unstyled p-0 m-0"
>
<li>
<a
href="https://www.example.com/terms-of-service"
>
<span>
Terms of Service & Honor Code
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/privacy-policy"
>
<span>
Privacy Policy
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/accessibility"
>
<span>
Accessibility Policy
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/trademarks"
>
<span>
Trademark Policy
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/sitemap"
>
<span>
Sitemap
</span>
</a>
</li>
</ul>
</div>
<div
className="area-4"
>
<h2>
<span>
Connect
</span>
</h2>
<ul
className="list-unstyled p-0 m-0"
>
<li>
<a
href="https://www.example.com/blog"
>
<span>
Blog
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/contact"
>
<span>
Contact Us
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/support"
>
<span>
Help Center
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/media-kit"
>
<span>
Media Kit
</span>
</a>
</li>
<li>
<a
href="https://www.example.com/donate"
>
<span>
Donate
</span>
</a>
</li>
</ul>
</div>
<div
className="area-5"
>
<ul
className="d-flex flex-row justify-content-between list-unstyled max-width-264 p-0 mb-5"
>
<li>
<a
href="https://store.apple.com"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
>
<img
alt="Download the example mobile app from the Apple App Store"
className="max-height-39"
src="https://prod-edxapp.edx-cdn.org/static/images/app/app_store_badge_135x40.d0558d910630.svg"
/>
</a>
</li>
<li>
<a
href="https://play.google.com"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
>
<img
alt="Download the example mobile app from Google Play"
className="max-height-39"
src="https://prod-edxapp.edx-cdn.org/static/images/app/google_play_badge_45.6ea466e328da.png"
/>
</a>
</li>
</ul>
<p>
<span>
© 20122019 example Inc.
</span>
<br />
<span>
EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 粤ICP备17044299号-2
</span>
</p>
</div>
</div>
</footer>
`;
exports[`<SiteFooter /> renders correctly does not render language selector 1`] = `
<footer
aria-label="Page Footer"
@@ -258,13 +13,13 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
className="area-1"
>
<a
aria-label="example Home"
href="https://www.example.com/"
aria-label="edX Home"
href="https://www.example.com"
onClick={[Function]}
target="_self"
>
<img
alt="example logo"
alt="edx Logo"
src="test-file-stub"
/>
</a>
@@ -273,7 +28,7 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
className="area-2"
>
<h2>
example
edX
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -282,45 +37,42 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
<a
href="https://www.example.com/about-us"
>
<span>
About
</span>
About
</a>
</li>
<li>
<a
href="https://business.edx.org/?utm_test=utm_test_value"
>
edX for Business
</a>
</li>
<li>
<a
href="https://www.example.com/affiliate-program"
>
<span>
Affiliates
</span>
Affiliates
</a>
</li>
<li>
<a
href="https://www.example.com/open"
>
<span>
Open example
</span>
Open edX
</a>
</li>
<li>
<a
href="https://www.example.com/careers"
>
<span>
Careers
</span>
Careers
</a>
</li>
<li>
<a
href="https://www.example.com/news-announcements"
>
<span>
News
</span>
News
</a>
</li>
</ul>
@@ -329,9 +81,7 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
className="area-3"
>
<h2>
<span>
Legal
</span>
Legal
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -340,45 +90,35 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
<a
href="https://www.example.com/terms-of-service"
>
<span>
Terms of Service & Honor Code
</span>
Terms of Service & Honor Code
</a>
</li>
<li>
<a
href="https://www.example.com/privacy-policy"
>
<span>
Privacy Policy
</span>
Privacy Policy
</a>
</li>
<li>
<a
href="https://www.example.com/accessibility"
>
<span>
Accessibility Policy
</span>
Accessibility Policy
</a>
</li>
<li>
<a
href="https://www.example.com/trademarks"
>
<span>
Trademark Policy
</span>
Trademark Policy
</a>
</li>
<li>
<a
href="https://www.example.com/sitemap"
>
<span>
Sitemap
</span>
Sitemap
</a>
</li>
</ul>
@@ -387,9 +127,7 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
className="area-4"
>
<h2>
<span>
Connect
</span>
Connect
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -398,45 +136,35 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
<a
href="https://www.example.com/blog"
>
<span>
Blog
</span>
Blog
</a>
</li>
<li>
<a
href="https://www.example.com/contact"
>
<span>
Contact Us
</span>
Contact Us
</a>
</li>
<li>
<a
href="https://www.example.com/support"
>
<span>
Help Center
</span>
Help Center
</a>
</li>
<li>
<a
href="https://www.example.com/media-kit"
>
<span>
Media Kit
</span>
Media Kit
</a>
</li>
<li>
<a
href="https://www.example.com/donate"
>
<span>
Donate
</span>
Donate
</a>
</li>
</ul>
@@ -444,6 +172,170 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
<div
className="area-5"
>
<ul
className="d-flex flex-row justify-content-between list-unstyled max-width-222 p-0 mb-4"
>
<li>
<a
href="https://www.facebook.com"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
title="Facebook"
>
<svg
aria-hidden="true"
className="svg-inline--fa fa-facebook-square fa-w-14 fa-2x social-icon"
data-icon="facebook-square"
data-prefix="fab"
focusable="false"
role="img"
style={Object {}}
viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M448 80v352c0 26.5-21.5 48-48 48h-85.3V302.8h60.6l8.7-67.6h-69.3V192c0-19.6 5.4-32.9 33.5-32.9H384V98.7c-6.2-.8-27.4-2.7-52.2-2.7-51.6 0-87 31.5-87 89.4v49.9H184v67.6h60.9V480H48c-26.5 0-48-21.5-48-48V80c0-26.5 21.5-48 48-48h352c26.5 0 48 21.5 48 48z"
fill="currentColor"
style={Object {}}
/>
</svg>
<span
className="sr-only"
>
Like edX on Facebook
</span>
</a>
</li>
<li>
<a
href="https://www.twitter.com"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
title="Twitter"
>
<svg
aria-hidden="true"
className="svg-inline--fa fa-twitter-square fa-w-14 fa-2x social-icon"
data-icon="twitter-square"
data-prefix="fab"
focusable="false"
role="img"
style={Object {}}
viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-48.9 158.8c.2 2.8.2 5.7.2 8.5 0 86.7-66 186.6-186.6 186.6-37.2 0-71.7-10.8-100.7-29.4 5.3.6 10.4.8 15.8.8 30.7 0 58.9-10.4 81.4-28-28.8-.6-53-19.5-61.3-45.5 10.1 1.5 19.2 1.5 29.6-1.2-30-6.1-52.5-32.5-52.5-64.4v-.8c8.7 4.9 18.9 7.9 29.6 8.3a65.447 65.447 0 0 1-29.2-54.6c0-12.2 3.2-23.4 8.9-33.1 32.3 39.8 80.8 65.8 135.2 68.6-9.3-44.5 24-80.6 64-80.6 18.9 0 35.9 7.9 47.9 20.7 14.8-2.8 29-8.3 41.6-15.8-4.9 15.2-15.2 28-28.8 36.1 13.2-1.4 26-5.1 37.8-10.2-8.9 13.1-20.1 24.7-32.9 34z"
fill="currentColor"
style={Object {}}
/>
</svg>
<span
className="sr-only"
>
Follow edX on Twitter
</span>
</a>
</li>
<li>
<a
href="https://www.youtube.com"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
title="Youtube"
>
<svg
aria-hidden="true"
className="svg-inline--fa fa-youtube-square fa-w-14 fa-2x social-icon"
data-icon="youtube-square"
data-prefix="fab"
focusable="false"
role="img"
style={Object {}}
viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M186.8 202.1l95.2 54.1-95.2 54.1V202.1zM448 80v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V80c0-26.5 21.5-48 48-48h352c26.5 0 48 21.5 48 48zm-42 176.3s0-59.6-7.6-88.2c-4.2-15.8-16.5-28.2-32.2-32.4C337.9 128 224 128 224 128s-113.9 0-142.2 7.7c-15.7 4.2-28 16.6-32.2 32.4-7.6 28.5-7.6 88.2-7.6 88.2s0 59.6 7.6 88.2c4.2 15.8 16.5 27.7 32.2 31.9C110.1 384 224 384 224 384s113.9 0 142.2-7.7c15.7-4.2 28-16.1 32.2-31.9 7.6-28.5 7.6-88.1 7.6-88.1z"
fill="currentColor"
style={Object {}}
/>
</svg>
<span
className="sr-only"
>
Subscribe to the edX YouTube channel
</span>
</a>
</li>
<li>
<a
href="https://www.linkedin.com"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
title="LinkedIn"
>
<svg
aria-hidden="true"
className="svg-inline--fa fa-linkedin fa-w-14 fa-2x social-icon"
data-icon="linkedin"
data-prefix="fab"
focusable="false"
role="img"
style={Object {}}
viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"
fill="currentColor"
style={Object {}}
/>
</svg>
<span
className="sr-only"
>
Follow edX on LinkedIn
</span>
</a>
</li>
<li>
<a
href="https://reddit.com"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
title="Reddit"
>
<svg
aria-hidden="true"
className="svg-inline--fa fa-reddit-square fa-w-14 fa-2x social-icon"
data-icon="reddit-square"
data-prefix="fab"
focusable="false"
role="img"
style={Object {}}
viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M283.2 345.5c2.7 2.7 2.7 6.8 0 9.2-24.5 24.5-93.8 24.6-118.4 0-2.7-2.4-2.7-6.5 0-9.2 2.4-2.4 6.5-2.4 8.9 0 18.7 19.2 81 19.6 100.5 0 2.4-2.3 6.6-2.3 9 0zm-91.3-53.8c0-14.9-11.9-26.8-26.5-26.8-14.9 0-26.8 11.9-26.8 26.8 0 14.6 11.9 26.5 26.8 26.5 14.6 0 26.5-11.9 26.5-26.5zm90.7-26.8c-14.6 0-26.5 11.9-26.5 26.8 0 14.6 11.9 26.5 26.5 26.5 14.9 0 26.8-11.9 26.8-26.5 0-14.9-11.9-26.8-26.8-26.8zM448 80v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V80c0-26.5 21.5-48 48-48h352c26.5 0 48 21.5 48 48zm-99.7 140.6c-10.1 0-19 4.2-25.6 10.7-24.1-16.7-56.5-27.4-92.5-28.6l18.7-84.2 59.5 13.4c0 14.6 11.9 26.5 26.5 26.5 14.9 0 26.8-12.2 26.8-26.8 0-14.6-11.9-26.8-26.8-26.8-10.4 0-19.3 6.2-23.8 14.9l-65.7-14.6c-3.3-.9-6.5 1.5-7.4 4.8l-20.5 92.8c-35.7 1.5-67.8 12.2-91.9 28.9-6.5-6.8-15.8-11-25.9-11-37.5 0-49.8 50.4-15.5 67.5-1.2 5.4-1.8 11-1.8 16.7 0 56.5 63.7 102.3 141.9 102.3 78.5 0 142.2-45.8 142.2-102.3 0-5.7-.6-11.6-2.1-17 33.6-17.2 21.2-67.2-16.1-67.2z"
fill="currentColor"
style={Object {}}
/>
</svg>
<span
className="sr-only"
>
Subscribe to the edX subreddit
</span>
</a>
</li>
</ul>
<ul
className="d-flex flex-row justify-content-between list-unstyled max-width-264 p-0 mb-5"
>
@@ -455,7 +347,7 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
target="_blank"
>
<img
alt="Download the example mobile app from the Apple App Store"
alt="Download the edX mobile app from the Apple App Store"
className="max-height-39"
src="https://prod-edxapp.edx-cdn.org/static/images/app/app_store_badge_135x40.d0558d910630.svg"
/>
@@ -469,7 +361,7 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
target="_blank"
>
<img
alt="Download the example mobile app from Google Play"
alt="Download the edX mobile app from Google Play"
className="max-height-39"
src="https://prod-edxapp.edx-cdn.org/static/images/app/google_play_badge_45.6ea466e328da.png"
/>
@@ -477,13 +369,14 @@ exports[`<SiteFooter /> renders correctly does not render language selector 1`]
</li>
</ul>
<p>
<span>
© 20122019 example Inc.
</span>
© 20122019 edX Inc.
<br />
<span>
EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 粤ICP备17044299号-2
</span>
EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 深圳市恒宇博科技有限公司
<a
href="http://www.beian.miit.gov.cn"
>
粤ICP备17044299号-2
</a>
</p>
</div>
</div>
@@ -503,13 +396,13 @@ exports[`<SiteFooter /> renders correctly does not render mobile links 1`] = `
className="area-1"
>
<a
aria-label="example Home"
href="https://www.example.com/"
aria-label="edX Home"
href="https://www.example.com"
onClick={[Function]}
target="_self"
>
<img
alt="example logo"
alt="edx Logo"
src="test-file-stub"
/>
</a>
@@ -576,7 +469,7 @@ exports[`<SiteFooter /> renders correctly does not render mobile links 1`] = `
className="area-2"
>
<h2>
example
edX
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -585,45 +478,42 @@ exports[`<SiteFooter /> renders correctly does not render mobile links 1`] = `
<a
href="https://www.example.com/about-us"
>
<span>
About
</span>
About
</a>
</li>
<li>
<a
href="https://business.edx.org/?utm_test=utm_test_value"
>
edX for Business
</a>
</li>
<li>
<a
href="https://www.example.com/affiliate-program"
>
<span>
Affiliates
</span>
Affiliates
</a>
</li>
<li>
<a
href="https://www.example.com/open"
>
<span>
Open example
</span>
Open edX
</a>
</li>
<li>
<a
href="https://www.example.com/careers"
>
<span>
Careers
</span>
Careers
</a>
</li>
<li>
<a
href="https://www.example.com/news-announcements"
>
<span>
News
</span>
News
</a>
</li>
</ul>
@@ -632,9 +522,7 @@ exports[`<SiteFooter /> renders correctly does not render mobile links 1`] = `
className="area-3"
>
<h2>
<span>
Legal
</span>
Legal
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -643,45 +531,35 @@ exports[`<SiteFooter /> renders correctly does not render mobile links 1`] = `
<a
href="https://www.example.com/terms-of-service"
>
<span>
Terms of Service & Honor Code
</span>
Terms of Service & Honor Code
</a>
</li>
<li>
<a
href="https://www.example.com/privacy-policy"
>
<span>
Privacy Policy
</span>
Privacy Policy
</a>
</li>
<li>
<a
href="https://www.example.com/accessibility"
>
<span>
Accessibility Policy
</span>
Accessibility Policy
</a>
</li>
<li>
<a
href="https://www.example.com/trademarks"
>
<span>
Trademark Policy
</span>
Trademark Policy
</a>
</li>
<li>
<a
href="https://www.example.com/sitemap"
>
<span>
Sitemap
</span>
Sitemap
</a>
</li>
</ul>
@@ -690,9 +568,7 @@ exports[`<SiteFooter /> renders correctly does not render mobile links 1`] = `
className="area-4"
>
<h2>
<span>
Connect
</span>
Connect
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -701,45 +577,35 @@ exports[`<SiteFooter /> renders correctly does not render mobile links 1`] = `
<a
href="https://www.example.com/blog"
>
<span>
Blog
</span>
Blog
</a>
</li>
<li>
<a
href="https://www.example.com/contact"
>
<span>
Contact Us
</span>
Contact Us
</a>
</li>
<li>
<a
href="https://www.example.com/support"
>
<span>
Help Center
</span>
Help Center
</a>
</li>
<li>
<a
href="https://www.example.com/media-kit"
>
<span>
Media Kit
</span>
Media Kit
</a>
</li>
<li>
<a
href="https://www.example.com/donate"
>
<span>
Donate
</span>
Donate
</a>
</li>
</ul>
@@ -878,38 +744,6 @@ exports[`<SiteFooter /> renders correctly does not render mobile links 1`] = `
</span>
</a>
</li>
<li>
<a
href="https://plus.google.com"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
title="Google+"
>
<svg
aria-hidden="true"
className="svg-inline--fa fa-google-plus-square fa-w-14 fa-2x social-icon"
data-icon="google-plus-square"
data-prefix="fab"
focusable="false"
role="img"
style={Object {}}
viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM164 356c-55.3 0-100-44.7-100-100s44.7-100 100-100c27 0 49.5 9.8 67 26.2l-27.1 26.1c-7.4-7.1-20.3-15.4-39.8-15.4-34.1 0-61.9 28.2-61.9 63.2 0 34.9 27.8 63.2 61.9 63.2 39.6 0 54.4-28.5 56.8-43.1H164v-34.4h94.4c1 5 1.6 10.1 1.6 16.6 0 57.1-38.3 97.6-96 97.6zm220-81.8h-29v29h-29.2v-29h-29V245h29v-29H355v29h29v29.2z"
fill="currentColor"
style={Object {}}
/>
</svg>
<span
className="sr-only"
>
Follow edX on Google+
</span>
</a>
</li>
<li>
<a
href="https://reddit.com"
@@ -944,13 +778,14 @@ exports[`<SiteFooter /> renders correctly does not render mobile links 1`] = `
</li>
</ul>
<p>
<span>
© 20122019 example Inc.
</span>
© 20122019 edX Inc.
<br />
<span>
EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 粤ICP备17044299号-2
</span>
EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 深圳市恒宇博科技有限公司
<a
href="http://www.beian.miit.gov.cn"
>
粤ICP备17044299号-2
</a>
</p>
</div>
</div>
@@ -970,13 +805,13 @@ exports[`<SiteFooter /> renders correctly does not render social links 1`] = `
className="area-1"
>
<a
aria-label="example Home"
href="https://www.example.com/"
aria-label="edX Home"
href="https://www.example.com"
onClick={[Function]}
target="_self"
>
<img
alt="example logo"
alt="edx Logo"
src="test-file-stub"
/>
</a>
@@ -1043,7 +878,7 @@ exports[`<SiteFooter /> renders correctly does not render social links 1`] = `
className="area-2"
>
<h2>
example
edX
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -1052,54 +887,42 @@ exports[`<SiteFooter /> renders correctly does not render social links 1`] = `
<a
href="https://www.example.com/about-us"
>
<span>
About
</span>
About
</a>
</li>
<li>
<a
href="https://business.edx.org/?utm_test=utm_test_value"
>
<span>
example for Business
</span>
edX for Business
</a>
</li>
<li>
<a
href="https://www.example.com/affiliate-program"
>
<span>
Affiliates
</span>
Affiliates
</a>
</li>
<li>
<a
href="https://www.example.com/open"
>
<span>
Open example
</span>
Open edX
</a>
</li>
<li>
<a
href="https://www.example.com/careers"
>
<span>
Careers
</span>
Careers
</a>
</li>
<li>
<a
href="https://www.example.com/news-announcements"
>
<span>
News
</span>
News
</a>
</li>
</ul>
@@ -1108,9 +931,7 @@ exports[`<SiteFooter /> renders correctly does not render social links 1`] = `
className="area-3"
>
<h2>
<span>
Legal
</span>
Legal
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -1119,45 +940,35 @@ exports[`<SiteFooter /> renders correctly does not render social links 1`] = `
<a
href="https://www.example.com/terms-of-service"
>
<span>
Terms of Service & Honor Code
</span>
Terms of Service & Honor Code
</a>
</li>
<li>
<a
href="https://www.example.com/privacy-policy"
>
<span>
Privacy Policy
</span>
Privacy Policy
</a>
</li>
<li>
<a
href="https://www.example.com/accessibility"
>
<span>
Accessibility Policy
</span>
Accessibility Policy
</a>
</li>
<li>
<a
href="https://www.example.com/trademarks"
>
<span>
Trademark Policy
</span>
Trademark Policy
</a>
</li>
<li>
<a
href="https://www.example.com/sitemap"
>
<span>
Sitemap
</span>
Sitemap
</a>
</li>
</ul>
@@ -1166,9 +977,7 @@ exports[`<SiteFooter /> renders correctly does not render social links 1`] = `
className="area-4"
>
<h2>
<span>
Connect
</span>
Connect
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -1177,45 +986,35 @@ exports[`<SiteFooter /> renders correctly does not render social links 1`] = `
<a
href="https://www.example.com/blog"
>
<span>
Blog
</span>
Blog
</a>
</li>
<li>
<a
href="https://www.example.com/contact"
>
<span>
Contact Us
</span>
Contact Us
</a>
</li>
<li>
<a
href="https://www.example.com/support"
>
<span>
Help Center
</span>
Help Center
</a>
</li>
<li>
<a
href="https://www.example.com/media-kit"
>
<span>
Media Kit
</span>
Media Kit
</a>
</li>
<li>
<a
href="https://www.example.com/donate"
>
<span>
Donate
</span>
Donate
</a>
</li>
</ul>
@@ -1234,7 +1033,7 @@ exports[`<SiteFooter /> renders correctly does not render social links 1`] = `
target="_blank"
>
<img
alt="Download the example mobile app from the Apple App Store"
alt="Download the edX mobile app from the Apple App Store"
className="max-height-39"
src="https://prod-edxapp.edx-cdn.org/static/images/app/app_store_badge_135x40.d0558d910630.svg"
/>
@@ -1248,7 +1047,7 @@ exports[`<SiteFooter /> renders correctly does not render social links 1`] = `
target="_blank"
>
<img
alt="Download the example mobile app from Google Play"
alt="Download the edX mobile app from Google Play"
className="max-height-39"
src="https://prod-edxapp.edx-cdn.org/static/images/app/google_play_badge_45.6ea466e328da.png"
/>
@@ -1256,13 +1055,14 @@ exports[`<SiteFooter /> renders correctly does not render social links 1`] = `
</li>
</ul>
<p>
<span>
© 20122019 example Inc.
</span>
© 20122019 edX Inc.
<br />
<span>
EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 粤ICP备17044299号-2
</span>
EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 深圳市恒宇博科技有限公司
<a
href="http://www.beian.miit.gov.cn"
>
粤ICP备17044299号-2
</a>
</p>
</div>
</div>
@@ -1282,13 +1082,13 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
className="area-1"
>
<a
aria-label="example Home"
href="https://www.example.com/"
aria-label="edX Home"
href="https://www.example.com"
onClick={[Function]}
target="_self"
>
<img
alt="example logo"
alt="edx Logo"
src="test-file-stub"
/>
</a>
@@ -1355,7 +1155,7 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
className="area-2"
>
<h2>
example
edX
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -1364,54 +1164,42 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
<a
href="https://www.example.com/about-us"
>
<span>
About
</span>
About
</a>
</li>
<li>
<a
href="https://business.edx.org/?utm_test=utm_test_value"
>
<span>
example for Business
</span>
edX for Business
</a>
</li>
<li>
<a
href="https://www.example.com/affiliate-program"
>
<span>
Affiliates
</span>
Affiliates
</a>
</li>
<li>
<a
href="https://www.example.com/open"
>
<span>
Open example
</span>
Open edX
</a>
</li>
<li>
<a
href="https://www.example.com/careers"
>
<span>
Careers
</span>
Careers
</a>
</li>
<li>
<a
href="https://www.example.com/news-announcements"
>
<span>
News
</span>
News
</a>
</li>
</ul>
@@ -1420,9 +1208,7 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
className="area-3"
>
<h2>
<span>
Legal
</span>
Legal
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -1431,45 +1217,35 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
<a
href="https://www.example.com/terms-of-service"
>
<span>
Terms of Service & Honor Code
</span>
Terms of Service & Honor Code
</a>
</li>
<li>
<a
href="https://www.example.com/privacy-policy"
>
<span>
Privacy Policy
</span>
Privacy Policy
</a>
</li>
<li>
<a
href="https://www.example.com/accessibility"
>
<span>
Accessibility Policy
</span>
Accessibility Policy
</a>
</li>
<li>
<a
href="https://www.example.com/trademarks"
>
<span>
Trademark Policy
</span>
Trademark Policy
</a>
</li>
<li>
<a
href="https://www.example.com/sitemap"
>
<span>
Sitemap
</span>
Sitemap
</a>
</li>
</ul>
@@ -1478,9 +1254,7 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
className="area-4"
>
<h2>
<span>
Connect
</span>
Connect
</h2>
<ul
className="list-unstyled p-0 m-0"
@@ -1489,45 +1263,35 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
<a
href="https://www.example.com/blog"
>
<span>
Blog
</span>
Blog
</a>
</li>
<li>
<a
href="https://www.example.com/contact"
>
<span>
Contact Us
</span>
Contact Us
</a>
</li>
<li>
<a
href="https://www.example.com/support"
>
<span>
Help Center
</span>
Help Center
</a>
</li>
<li>
<a
href="https://www.example.com/media-kit"
>
<span>
Media Kit
</span>
Media Kit
</a>
</li>
<li>
<a
href="https://www.example.com/donate"
>
<span>
Donate
</span>
Donate
</a>
</li>
</ul>
@@ -1666,38 +1430,6 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
</span>
</a>
</li>
<li>
<a
href="https://plus.google.com"
onClick={[Function]}
rel="noopener noreferrer"
target="_blank"
title="Google+"
>
<svg
aria-hidden="true"
className="svg-inline--fa fa-google-plus-square fa-w-14 fa-2x social-icon"
data-icon="google-plus-square"
data-prefix="fab"
focusable="false"
role="img"
style={Object {}}
viewBox="0 0 448 512"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM164 356c-55.3 0-100-44.7-100-100s44.7-100 100-100c27 0 49.5 9.8 67 26.2l-27.1 26.1c-7.4-7.1-20.3-15.4-39.8-15.4-34.1 0-61.9 28.2-61.9 63.2 0 34.9 27.8 63.2 61.9 63.2 39.6 0 54.4-28.5 56.8-43.1H164v-34.4h94.4c1 5 1.6 10.1 1.6 16.6 0 57.1-38.3 97.6-96 97.6zm220-81.8h-29v29h-29.2v-29h-29V245h29v-29H355v29h29v29.2z"
fill="currentColor"
style={Object {}}
/>
</svg>
<span
className="sr-only"
>
Follow edX on Google+
</span>
</a>
</li>
<li>
<a
href="https://reddit.com"
@@ -1742,7 +1474,7 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
target="_blank"
>
<img
alt="Download the example mobile app from the Apple App Store"
alt="Download the edX mobile app from the Apple App Store"
className="max-height-39"
src="https://prod-edxapp.edx-cdn.org/static/images/app/app_store_badge_135x40.d0558d910630.svg"
/>
@@ -1756,7 +1488,7 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
target="_blank"
>
<img
alt="Download the example mobile app from Google Play"
alt="Download the edX mobile app from Google Play"
className="max-height-39"
src="https://prod-edxapp.edx-cdn.org/static/images/app/google_play_badge_45.6ea466e328da.png"
/>
@@ -1764,13 +1496,14 @@ exports[`<SiteFooter /> renders correctly renders with social and mobile links 1
</li>
</ul>
<p>
<span>
© 20122019 example Inc.
</span>
© 20122019 edX Inc.
<br />
<span>
EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 粤ICP备17044299号-2
</span>
EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | 深圳市恒宇博科技有限公司
<a
href="http://www.beian.miit.gov.cn"
>
粤ICP备17044299号-2
</a>
</p>
</div>
</div>

View File

@@ -1,11 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
import { Hyperlink } from '@edx/paragon';
import qs from 'query-string';
import messages from './SiteFooter.messages';
const EVENT_NAMES = {
FOOTER_LINK: 'edx.bi.footer.link',
};
@@ -35,62 +32,57 @@ class SiteFooter extends React.Component {
this.props.handleAllTrackEvents(eventName, properties);
}
renderSiteLogo() {
return (
<img
src={this.props.siteLogo}
alt={this.props.intl.formatMessage(
messages['footer.site-footer.site-logo.alt-text'],
{ siteName: this.props.siteName },
)}
/>
);
}
renderMarketingSiteUrl(path) {
return `${this.props.marketingSiteBaseUrl}${path}`;
}
renderEnterpriseMarketingSiteUrl(enterpriseLinkData) {
formatUrl(linkData) {
const {
queryParams,
url,
} = enterpriseLinkData;
} = linkData;
return queryParams ? `${url}/?${qs.stringify(queryParams)}` : url;
}
renderLinkList({ title, linkList }) {
if (linkList.length > 0) {
return (
<React.Fragment>
<h2>{title}</h2>
<ul className="list-unstyled p-0 m-0">
{linkList.map(link => (
<li key={link.url}>
<a href={this.formatUrl(link)}>{link.title}</a>
</li>
))}
</ul>
</React.Fragment>
);
}
return null;
}
renderMobileLinks() {
const {
intl,
siteName,
showMobileLinks,
appleAppStoreUrl,
googlePlayUrl,
appleAppStore,
googlePlay,
} = this.props;
let mobileLinks = null;
if (showMobileLinks) {
mobileLinks = (
return (
<ul className="d-flex flex-row justify-content-between list-unstyled max-width-264 p-0 mb-5">
<li>
<a href={appleAppStoreUrl} rel="noopener noreferrer" target="_blank" onClick={this.externalLinkClickHandler}>
<a href={appleAppStore.url} rel="noopener noreferrer" target="_blank" onClick={this.externalLinkClickHandler}>
<img
className="max-height-39"
alt={intl.formatMessage(
messages['footer.site-footer.apple-app-store.alt-text'],
{ siteName },
)}
alt={appleAppStore.altText}
src="https://prod-edxapp.edx-cdn.org/static/images/app/app_store_badge_135x40.d0558d910630.svg"
/>
</a>
</li>
<li>
<a href={googlePlayUrl} rel="noopener noreferrer" target="_blank" onClick={this.externalLinkClickHandler}>
<a href={googlePlay.url} rel="noopener noreferrer" target="_blank" onClick={this.externalLinkClickHandler}>
<img
className="max-height-39"
alt={intl.formatMessage(
messages['footer.site-footer.google-play.alt-text'],
{ siteName },
)}
alt={googlePlay.altText}
src="https://prod-edxapp.edx-cdn.org/static/images/app/google_play_badge_45.6ea466e328da.png"
/>
</a>
@@ -98,55 +90,38 @@ class SiteFooter extends React.Component {
</ul>
);
}
return mobileLinks;
}
renderBusinessMarketingListItem() {
const { siteName, enterpriseMarketingLink } = this.props;
return enterpriseMarketingLink && (
<li>
<a href={this.renderEnterpriseMarketingSiteUrl(enterpriseMarketingLink)}>
<FormattedMessage
id="footer.site-footer.link.business"
defaultMessage="{siteName} for Business"
description="A link that points to a business marketing page for a specified website"
values={{ siteName }}
/>
</a>
</li>
);
return null;
}
render() {
const {
intl,
siteName,
openSourceUrl,
termsOfServiceUrl,
privacyPolicyUrl,
contactUrl,
supportUrl,
ariaLabel,
linkSectionOne,
linkSectionTwo,
linkSectionThree,
siteLogo,
socialLinks,
supportedLanguages,
languageForm,
marketingSiteBaseUrl,
copyright,
trademark,
} = this.props;
const showLanguageSelector = supportedLanguages.length > 0 &&
languageForm;
return (
<footer
role="contentinfo"
aria-label={intl.formatMessage(messages['footer.site-footer.footer.aria-label'])}
aria-label={ariaLabel}
className="footer d-flex justify-content-center border-top py-3 px-4"
>
<div className="max-width-1180 d-grid">
<div className="area-1">
<Hyperlink
destination={this.renderMarketingSiteUrl('/')}
content={this.renderSiteLogo()}
aria-label={intl.formatMessage(
messages['footer.site-footer.site-logo.aria-label'],
{ siteName },
)}
destination={marketingSiteBaseUrl}
content={<img src={siteLogo.src} alt={siteLogo.altText} />}
aria-label={siteLogo.ariaLabel}
/>
{showLanguageSelector &&
<div className="i18n d-flex mt-2">
@@ -173,156 +148,9 @@ class SiteFooter extends React.Component {
</div>
}
</div>
<div className="area-2">
<h2>{siteName}</h2>
<ul className="list-unstyled p-0 m-0">
<li>
<a href={this.renderMarketingSiteUrl('/about-us')}>
<FormattedMessage
id="footer.site-footer.link.about"
defaultMessage="About"
/>
</a>
</li>
{this.renderBusinessMarketingListItem()}
<li>
<a href={this.renderMarketingSiteUrl('/affiliate-program')}>
<FormattedMessage
id="footer.site-footer.link.affiliates"
defaultMessage="Affiliates"
/>
</a>
</li>
<li>
<a href={openSourceUrl}>
<FormattedMessage
id="footer.site-footer.link.open-source"
defaultMessage="Open {siteName}"
values={{ siteName }}
description="Open Source link text"
/>
</a>
</li>
<li>
<a href={this.renderMarketingSiteUrl('/careers')}>
<FormattedMessage
id="footer.site-footer.link.careers"
defaultMessage="Careers"
/>
</a>
</li>
<li>
<a href={this.renderMarketingSiteUrl('/news-announcements')}>
<FormattedMessage
id="footer.site-footer.link.news"
defaultMessage="News"
/>
</a>
</li>
</ul>
</div>
<div className="area-3">
<h2>
<FormattedMessage
id="footer.site-footer.link.header.legal"
defaultMessage="Legal"
description="Header for legal links"
/>
</h2>
<ul className="list-unstyled p-0 m-0">
<li>
<a href={termsOfServiceUrl}>
<FormattedMessage
id="footer.site-footer.link.terms-of-service"
defaultMessage="Terms of Service & Honor Code"
/>
</a>
</li>
<li>
<a href={privacyPolicyUrl}>
<FormattedMessage
id="footer.site-footer.link.privacy"
defaultMessage="Privacy Policy"
/>
</a>
</li>
<li>
<a href={this.renderMarketingSiteUrl('/accessibility')}>
<FormattedMessage
id="footer.site-footer.link.accessibility"
defaultMessage="Accessibility Policy"
/>
</a>
</li>
<li>
<a href={this.renderMarketingSiteUrl('/trademarks')}>
<FormattedMessage
id="footer.site-footer.link.trademark"
defaultMessage="Trademark Policy"
/>
</a>
</li>
<li>
<a href={this.renderMarketingSiteUrl('/sitemap')}>
<FormattedMessage
id="footer.site-footer.link.sitemap"
defaultMessage="Sitemap"
/>
</a>
</li>
</ul>
</div>
<div className="area-4">
<h2>
<FormattedMessage
id="footer.site-footer.link.header.connect"
defaultMessage="Connect"
description="Header for connect links"
/>
</h2>
<ul className="list-unstyled p-0 m-0">
<li>
<a href={this.renderMarketingSiteUrl('/blog')}>
<FormattedMessage
id="footer.site-footer.link.blog"
defaultMessage="Blog"
/>
</a>
</li>
<li>
<a href={contactUrl}>
<FormattedMessage
id="footer.site-footer.link.contact-us"
defaultMessage="Contact Us"
/>
</a>
</li>
<li>
<a href={supportUrl}>
<FormattedMessage
id="footer.site-footer.link.help-center"
defaultMessage="Help Center"
/>
</a>
</li>
<li>
<a href={this.renderMarketingSiteUrl('/media-kit')}>
<FormattedMessage
id="footer.site-footer.link.media-kit"
defaultMessage="Media Kit"
/>
</a>
</li>
<li>
<a href={this.renderMarketingSiteUrl('/donate')}>
<FormattedMessage
id="footer.site-footer.link.donate"
defaultMessage="Donate"
/>
</a>
</li>
</ul>
</div>
<div className="area-2">{this.renderLinkList(linkSectionOne)}</div>
<div className="area-3">{this.renderLinkList(linkSectionTwo)}</div>
<div className="area-4">{this.renderLinkList(linkSectionThree)}</div>
<div className="area-5">
{socialLinks.length > 0 &&
<ul className="d-flex flex-row justify-content-between list-unstyled max-width-222 p-0 mb-4">
@@ -344,24 +172,9 @@ class SiteFooter extends React.Component {
}
{this.renderMobileLinks()}
<p>
<FormattedMessage
id="footer.site-footer.copyright-text"
defaultMessage="{copyrightSymbol} {startDate}{endDate} {siteName} Inc."
values={{
copyrightSymbol: '©',
startDate: '2012',
endDate: `${new Date().getFullYear()}`,
siteName,
}}
description="Footer copyright text with copyright symbol and dates"
/>
{copyright}
<br />
<FormattedMessage
id="footer.site-footer.trademark-text"
defaultMessage="EdX, Open edX, and MicroMasters are registered trademarks of edX Inc. | {icpLicense}"
values={{ icpLicense: '粤ICP备17044299号-2' }}
description="Footer trademark text"
/>
{trademark}
</p>
</div>
</div>
@@ -370,19 +183,26 @@ class SiteFooter extends React.Component {
}
}
SiteFooter.propTypes = {
siteName: PropTypes.string,
siteLogo: PropTypes.node,
marketingSiteBaseUrl: PropTypes.string,
enterpriseMarketingLink: PropTypes.shape({
url: PropTypes.string,
const linkSectionShape = PropTypes.shape({
title: PropTypes.string,
linkList: PropTypes.arrayOf(PropTypes.shape({
title: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
queryParams: PropTypes.shape({}),
})),
});
SiteFooter.propTypes = {
ariaLabel: PropTypes.string.isRequired,
siteLogo: PropTypes.shape({
src: PropTypes.node,
altText: PropTypes.string,
ariaLabel: PropTypes.string,
}),
supportUrl: PropTypes.string,
contactUrl: PropTypes.string,
openSourceUrl: PropTypes.string,
termsOfServiceUrl: PropTypes.string,
privacyPolicyUrl: PropTypes.string,
marketingSiteBaseUrl: PropTypes.string,
linkSectionOne: linkSectionShape,
linkSectionTwo: linkSectionShape,
linkSectionThree: linkSectionShape,
socialLinks: PropTypes.arrayOf(PropTypes.shape({
title: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
@@ -390,8 +210,14 @@ SiteFooter.propTypes = {
screenReaderText: PropTypes.string.isRequired,
})),
showMobileLinks: PropTypes.bool,
appleAppStoreUrl: PropTypes.string,
googlePlayUrl: PropTypes.string,
appleAppStore: PropTypes.shape({
url: PropTypes.string,
altText: PropTypes.string,
}),
googlePlay: PropTypes.shape({
url: PropTypes.string,
altText: PropTypes.string,
}),
supportedLanguages: PropTypes.arrayOf(PropTypes.shape({
label: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
@@ -403,27 +229,37 @@ SiteFooter.propTypes = {
icon: PropTypes.node.isRequired,
activeLanguage: PropTypes.string,
}),
copyright: PropTypes.oneOfType([
PropTypes.string,
PropTypes.node,
]),
trademark: PropTypes.oneOfType([
PropTypes.string,
PropTypes.node,
]),
handleAllTrackEvents: PropTypes.func.isRequired,
intl: intlShape.isRequired,
};
const linkSectionDefault = {
title: null,
linkList: [],
};
SiteFooter.defaultProps = {
siteName: null,
siteLogo: null,
marketingSiteBaseUrl: null,
enterpriseMarketingLink: null,
supportUrl: null,
contactUrl: null,
openSourceUrl: null,
termsOfServiceUrl: null,
privacyPolicyUrl: null,
linkSectionOne: linkSectionDefault,
linkSectionTwo: linkSectionDefault,
linkSectionThree: linkSectionDefault,
socialLinks: [],
showMobileLinks: true,
appleAppStoreUrl: null,
googlePlayUrl: null,
appleAppStore: null,
googlePlay: null,
supportedLanguages: [],
languageForm: null,
copyright: null,
trademark: null,
};
export default injectIntl(SiteFooter);
export default SiteFooter;
export { EVENT_NAMES };