Compare commits

...

8 Commits

Author SHA1 Message Date
edX Transifex Bot
a8f57aa553 fix(i18n): update translations 2019-06-09 16:32:55 -04:00
David Joy
f32b0c8dcf Merge pull request #40 from edx/djoy/upgrade_i18n
fix: upgrade frontend-i18n library
2019-06-07 11:12:41 -04:00
David Joy
fb1f5c2d50 fix: delete old i18n concat file 2019-06-07 10:53:50 -04:00
David Joy
1a51d992cd Update .gitignore 2019-06-07 10:07:30 -04:00
David Joy
e9c28163d9 fix: upgrade frontend-i18n library 2019-06-07 08:58:38 -04:00
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
25 changed files with 843 additions and 1348 deletions

View File

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

1
.gitignore vendored
View File

@@ -6,3 +6,4 @@ temp
.idea/
src/i18n/transifex_input.json
temp/babel-plugin-react-intl

View File

@@ -1,41 +1,46 @@
transifex_resource = frontend-component-footer
transifex_langs = "ar,fr,es_419,zh_CN"
transifex_utils = ./node_modules/.bin/transifex-utils.js
transifex_input = ./src/i18n/transifex_input.json
tx_url1 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/translation/en/strings/
tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/source/
# this directory must match .babelrc
transifex_temp = ./temp/babel-plugin-react-intl
requirements:
npm install
i18n.extract:
# Pulling display strings from .jsx files into .json files...
# Pulling display strings from .jsx files into .json files...
rm -rf $(transifex_temp)
npm run-script i18n_extract
i18n.concat:
# Gathering JSON messages into one file...
./src/i18n/i18n-concat.js ./temp/src ./src/i18n/transifex_input.json
# The following make targets are required by our tooling scripts found in:
# - https://github.com/edx/ecommerce-scripts/tree/master/transifex
# Gathering JSON messages into one file...
$(transifex_utils) $(transifex_temp) $(transifex_input)
extract_translations: | requirements i18n.extract i18n.concat
detect_changed_source_translations:
git diff --exit-code ./src/i18n/transifex_input.json
tx_url1 = https://www.transifex.com/api/2/project/edx-platform/resource/frontend-component-footer/translation/en/strings/
tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/frontend-component-footer/source/
# push translations to Transifex, doing magic so we can include the translator comments
# Note: extract_translations is a prereq that our translation script calls separately.
push_translations:
tx push -s
# Adding translator comments...
# Fetching strings from Transifex...
./node_modules/reactifex/bash_scripts/get_hashed_strings.sh $(tx_url1)
# Writing out comments to file...
./src/i18n/i18n-concat.js ./temp/src --comments
# Adding comments to Transifex...
./node_modules/reactifex/bash_scripts/put_comments.sh $(tx_url2)
# pull translations from Transifex
pull_translations: ## must be exactly this name for edx tooling support, see ecommerce-scripts/transifex/pull.py
tx pull -f --mode reviewed --language="ar,fr,es_419,zh_CN"
# Checking for changed translations...
git diff --exit-code $(transifex_input)
validate-no-uncommitted-package-lock-changes:
# Checking for package-lock.json changes...
git diff --exit-code package-lock.json
# Push translations to Transifex. Run make extract_translations first.
push_translations:
# Pushing strings to Transifex...
tx push -s
# Fetching hashes from Transifex...
./node_modules/reactifex/bash_scripts/get_hashed_strings.sh $(tx_url1)
# Writing out comments to file...
$(transifex_utils) $(transifex_temp) --comments
# Pushing comments to Transifex...
./node_modules/reactifex/bash_scripts/put_comments.sh $(tx_url2)
# Pull translations from Transifex
pull_translations:
tx pull -f --mode reviewed --language=$(transifex_langs)

27
package-lock.json generated
View File

@@ -1424,10 +1424,19 @@
"integrity": "sha512-APBpZvdQrC1MJWMzk33V7FR2RhBRtnH2QPLqZzS+qia7PixwgWNlnX7UfHjhx+YWkM53GdsZKs40EBkSwADuMA==",
"dev": true
},
"@edx/edx-bootstrap": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@edx/edx-bootstrap/-/edx-bootstrap-2.2.1.tgz",
"integrity": "sha512-HkQ45u46ejX7WYwJX6ar/0FGBjx4F7bZvt3Dd4A677st0ic/47X5vQlqMqmK/M08C+GXaunNbZdbyF/ROrmwxw==",
"dev": true,
"requires": {
"bootstrap": "^4.3.1"
}
},
"@edx/frontend-i18n": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@edx/frontend-i18n/-/frontend-i18n-1.1.0.tgz",
"integrity": "sha512-bTS/zGYupas/xbgAV4XKF43b+eQwNfd2Ffhzw4V7L0LUiMm9ULkISHJIhPu3co0Veu/T+sjZn3wkLee/TNk6JQ==",
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@edx/frontend-i18n/-/frontend-i18n-2.1.1.tgz",
"integrity": "sha512-1uPagQWBfnZn6EFjJmu+igfEG4F8GFxYx+piLsyPsq/vZs6G1qJPa6hM4Aipx+JIEAUr72l7sExgCPBj+G/71g==",
"dev": true,
"requires": {
"@cospired/i18n-iso-languages": "^2.0.2",
@@ -4230,6 +4239,12 @@
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
"dev": true
},
"bootstrap": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.3.1.tgz",
"integrity": "sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag==",
"dev": true
},
"bottleneck": {
"version": "2.15.0",
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.15.0.tgz",
@@ -11350,9 +11365,9 @@
"dev": true
},
"intl-format-cache": {
"version": "2.2.6",
"resolved": "https://registry.npmjs.org/intl-format-cache/-/intl-format-cache-2.2.6.tgz",
"integrity": "sha512-8adofiGDGj6Zo9WswzRtQojtKDSLeiZz6r8dMnttM3MYwcqVhkBBvAJ0TxOHQol4VV5PFoFirMg5Xi43Y3AMIA==",
"version": "2.2.9",
"resolved": "https://registry.npmjs.org/intl-format-cache/-/intl-format-cache-2.2.9.tgz",
"integrity": "sha512-Zv/u8wRpekckv0cLkwpVdABYST4hZNTDaX7reFetrYTJwxExR2VyTqQm+l0WmL0Qo8Mjb9Tf33qnfj0T7pjxdQ==",
"dev": true
},
"intl-messageformat": {

View File

@@ -40,7 +40,8 @@
"@commitlint/config-angular": "^6.0.2",
"@commitlint/prompt": "^6.0.2",
"@commitlint/prompt-cli": "^6.0.2",
"@edx/frontend-i18n": "^1.0.4",
"@edx/edx-bootstrap": "^2.2.1",
"@edx/frontend-i18n": "^2.1.0",
"@edx/frontend-logging": "^2.0.2",
"@edx/paragon": "^4.2.4",
"@fortawesome/fontawesome-svg-core": "^1.2.17",
@@ -93,7 +94,7 @@
"query-string": "^5.1.1"
},
"peerDependencies": {
"@edx/frontend-i18n": "^1.0.4",
"@edx/frontend-i18n": "^2.1.0",
"@edx/frontend-logging": "^2.0.2",
"@edx/paragon": "^4.2.4",
"prop-types": "^15.5.10",

View File

@@ -1,65 +0,0 @@
#!/usr/bin/env node
/**
* See the Makefile for how the required hash file is downloaded from Transifex.
*/
// NOTE: This script is called from Jenkins using devDependencies, so eslint is being
// disabled so it doesn't force you to make these real dependencies.
const fs = require('fs'); // eslint-disable-line import/no-extraneous-dependencies
const glob = require('glob'); // eslint-disable-line import/no-extraneous-dependencies
const path = require('path'); // eslint-disable-line import/no-extraneous-dependencies
// Expected input: a directory, possibly containing subdirectories, with .json files. Each .json
// file is an array of translation triplets (id, description, defaultMessage).
function gatherJson(dir) {
const ret = [];
const files = glob.sync(`${dir}/**/*.json`);
files.forEach((filename) => {
const messages = JSON.parse(fs.readFileSync(filename));
ret.push(...messages);
});
return ret;
}
// the hash file returns ids whose periods are "escaped" (sort of), like this:
// "key": "profile\\.sociallinks\\.social\\.links"
// so our regular messageIds won't match them out of the box
function escapeDots(messageId) {
return messageId.replace(/\./g, '\\.');
}
const jsonDir = process.argv[2];
const messageObjects = gatherJson(jsonDir);
if (process.argv[3] === '--comments') { // prepare to handle the translator notes
const loggingPrefix = path.basename(`${__filename}`); // the name of this JS file
const bashScriptsPath = './node_modules/reactifex/bash_scripts';
const hashFile = `${bashScriptsPath}/hashmap.json`;
process.stdout.write(`${loggingPrefix}: reading hash file ${hashFile}\n`);
const messageInfo = JSON.parse(fs.readFileSync(hashFile));
const outputFile = `${bashScriptsPath}/hashed_data.txt`;
process.stdout.write(`${loggingPrefix}: writing to output file ${outputFile}\n`);
fs.writeFileSync(outputFile, '');
messageObjects.forEach((message) => {
const transifexFormatId = escapeDots(message.id);
const info = messageInfo.find(mi => mi.key === transifexFormatId);
if (info) {
fs.appendFileSync(outputFile, `${info.string_hash}|${message.description}\n`);
} else {
process.stdout.write(`${loggingPrefix}: string ${message.id} does not yet exist on transifex!\n`);
}
});
} else {
const output = {};
messageObjects.forEach((message) => {
output[message.id] = message.defaultMessage;
});
fs.writeFileSync(process.argv[3], JSON.stringify(output, null, 2));
}

32
src/i18n/index.js Normal file
View File

@@ -0,0 +1,32 @@
import arMessages from './messages/ar.json';
import caMessages from './messages/ca.json';
// no need to import en messages-- they are in the defaultMessage field
import es419Messages from './messages/es_419.json';
import frMessages from './messages/fr.json';
import zhcnMessages from './messages/zh_CN.json';
import heMessages from './messages/he.json';
import idMessages from './messages/id.json';
import kokrMessages from './messages/ko_kr.json';
import plMessages from './messages/pl.json';
import ptbrMessages from './messages/pt_br.json';
import ruMessages from './messages/ru.json';
import thMessages from './messages/th.json';
import ukMessages from './messages/uk.json';
const messages = {
ar: arMessages,
'es-419': es419Messages,
fr: frMessages,
'zh-cn': zhcnMessages,
ca: caMessages,
he: heMessages,
id: idMessages,
'ko-kr': kokrMessages,
pl: plMessages,
'pt-br': ptbrMessages,
ru: ruMessages,
th: thMessages,
uk: ukMessages,
};
export default messages;

View File

@@ -1,39 +1 @@
{
"footer.site-footer.link.business": "{siteName} for Business",
"footer.site-footer.link.about": "About",
"footer.site-footer.link.affiliates": "Affiliates",
"footer.site-footer.link.open-source": "Open {siteName}",
"footer.site-footer.link.careers": "Careers",
"footer.site-footer.link.news": "News",
"footer.site-footer.link.header.legal": "Legal",
"footer.site-footer.link.terms-of-service": "Terms of Service & Honor Code",
"footer.site-footer.link.privacy": "Privacy Policy",
"footer.site-footer.link.accessibility": "Accessibility Policy",
"footer.site-footer.link.trademark": "Trademark Policy",
"footer.site-footer.link.sitemap": "Sitemap",
"footer.site-footer.link.header.connect": "Connect",
"footer.site-footer.link.blog": "Blog",
"footer.site-footer.link.contact-us": "Contact Us",
"footer.site-footer.link.help-center": "Help Center",
"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.site-logo.alt-text": "{siteName} logo",
"footer.site-footer.site-logo.aria-label": "{siteName} Home",
"footer.site-footer.facebook.title": "Facebook",
"footer.site-footer.facebook.screen-reader-text": "Like {siteName} on Facebook",
"footer.site-footer.twitter.title": "Twitter",
"footer.site-footer.twitter.screen-reader-text": "Follow {siteName} on Twitter",
"footer.site-footer.youtube.title": "Youtube",
"footer.site-footer.youtube.screen-reader-text": "Subscribe to the {siteName} YouTube channel",
"footer.site-footer.linkedin.title": "LinkedIn",
"footer.site-footer.linkedin.screen-reader-text": "Follow {siteName} on LinkedIn",
"footer.site-footer.google-plus.title": "Google+",
"footer.site-footer.google-plus.screen-reader-text": "Follow {siteName} on Google+",
"footer.site-footer.reddit.title": "Reddit",
"footer.site-footer.reddit.screen-reader-text": "Subscribe to the {siteName} subreddit",
"footer.site-footer.apple-app-store.alt-text": "Download the {siteName} mobile app from the Apple App Store",
"footer.site-footer.google-play.alt-text": "Download the {siteName} mobile app from Google Play",
"footer.site-footer.footer.aria-label": "Page Footer"
}
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -1,39 +1 @@
{
"footer.site-footer.link.business": "{siteName} for Business",
"footer.site-footer.link.about": "About",
"footer.site-footer.link.affiliates": "Affiliates",
"footer.site-footer.link.open-source": "Open {siteName}",
"footer.site-footer.link.careers": "Careers",
"footer.site-footer.link.news": "News",
"footer.site-footer.link.header.legal": "Legal",
"footer.site-footer.link.terms-of-service": "Terms of Service & Honor Code",
"footer.site-footer.link.privacy": "Privacy Policy",
"footer.site-footer.link.accessibility": "Accessibility Policy",
"footer.site-footer.link.trademark": "Trademark Policy",
"footer.site-footer.link.sitemap": "Sitemap",
"footer.site-footer.link.header.connect": "Connect",
"footer.site-footer.link.blog": "Blog",
"footer.site-footer.link.contact-us": "Contact Us",
"footer.site-footer.link.help-center": "Help Center",
"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.site-logo.alt-text": "{siteName} logo",
"footer.site-footer.site-logo.aria-label": "{siteName} Home",
"footer.site-footer.facebook.title": "Facebook",
"footer.site-footer.facebook.screen-reader-text": "Like {siteName} on Facebook",
"footer.site-footer.twitter.title": "Twitter",
"footer.site-footer.twitter.screen-reader-text": "Follow {siteName} on Twitter",
"footer.site-footer.youtube.title": "Youtube",
"footer.site-footer.youtube.screen-reader-text": "Subscribe to the {siteName} YouTube channel",
"footer.site-footer.linkedin.title": "LinkedIn",
"footer.site-footer.linkedin.screen-reader-text": "Follow {siteName} on LinkedIn",
"footer.site-footer.google-plus.title": "Google+",
"footer.site-footer.google-plus.screen-reader-text": "Follow {siteName} on Google+",
"footer.site-footer.reddit.title": "Reddit",
"footer.site-footer.reddit.screen-reader-text": "Subscribe to the {siteName} subreddit",
"footer.site-footer.apple-app-store.alt-text": "Download the {siteName} mobile app from the Apple App Store",
"footer.site-footer.google-play.alt-text": "Download the {siteName} mobile app from Google Play",
"footer.site-footer.footer.aria-label": "Page Footer"
}
{}

View File

@@ -1,39 +1 @@
{
"footer.site-footer.link.business": "{siteName} for Business",
"footer.site-footer.link.about": "About",
"footer.site-footer.link.affiliates": "Affiliates",
"footer.site-footer.link.open-source": "Open {siteName}",
"footer.site-footer.link.careers": "Careers",
"footer.site-footer.link.news": "News",
"footer.site-footer.link.header.legal": "Legal",
"footer.site-footer.link.terms-of-service": "Terms of Service & Honor Code",
"footer.site-footer.link.privacy": "Privacy Policy",
"footer.site-footer.link.accessibility": "Accessibility Policy",
"footer.site-footer.link.trademark": "Trademark Policy",
"footer.site-footer.link.sitemap": "Sitemap",
"footer.site-footer.link.header.connect": "Connect",
"footer.site-footer.link.blog": "Blog",
"footer.site-footer.link.contact-us": "Contact Us",
"footer.site-footer.link.help-center": "Help Center",
"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.site-logo.alt-text": "{siteName} logo",
"footer.site-footer.site-logo.aria-label": "{siteName} Home",
"footer.site-footer.facebook.title": "Facebook",
"footer.site-footer.facebook.screen-reader-text": "Like {siteName} on Facebook",
"footer.site-footer.twitter.title": "Twitter",
"footer.site-footer.twitter.screen-reader-text": "Follow {siteName} on Twitter",
"footer.site-footer.youtube.title": "Youtube",
"footer.site-footer.youtube.screen-reader-text": "Subscribe to the {siteName} YouTube channel",
"footer.site-footer.linkedin.title": "LinkedIn",
"footer.site-footer.linkedin.screen-reader-text": "Follow {siteName} on LinkedIn",
"footer.site-footer.google-plus.title": "Google+",
"footer.site-footer.google-plus.screen-reader-text": "Follow {siteName} on Google+",
"footer.site-footer.reddit.title": "Reddit",
"footer.site-footer.reddit.screen-reader-text": "Subscribe to the {siteName} subreddit",
"footer.site-footer.apple-app-store.alt-text": "Download the {siteName} mobile app from the Apple App Store",
"footer.site-footer.google-play.alt-text": "Download the {siteName} mobile app from Google Play",
"footer.site-footer.footer.aria-label": "Page Footer"
}
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{}

View File

@@ -1,39 +1 @@
{
"footer.site-footer.link.business": "商用{siteName} ",
"footer.site-footer.link.about": "关于",
"footer.site-footer.link.affiliates": "附属机构",
"footer.site-footer.link.open-source": "打开{siteName}",
"footer.site-footer.link.careers": "招才纳贤",
"footer.site-footer.link.news": "新闻",
"footer.site-footer.link.header.legal": "法律条款",
"footer.site-footer.link.terms-of-service": "服务条款 & 荣誉准则",
"footer.site-footer.link.privacy": "隐私政策",
"footer.site-footer.link.accessibility": "可访问策略",
"footer.site-footer.link.trademark": "商标政策",
"footer.site-footer.link.sitemap": "网站导航",
"footer.site-footer.link.header.connect": "连接",
"footer.site-footer.link.blog": "博客",
"footer.site-footer.link.contact-us": "联系我们",
"footer.site-footer.link.help-center": "帮助中心",
"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.site-logo.alt-text": "{siteName} logo",
"footer.site-footer.site-logo.aria-label": "{siteName} 主页",
"footer.site-footer.facebook.title": "脸书",
"footer.site-footer.facebook.screen-reader-text": "在Facebook上为 {siteName}点赞",
"footer.site-footer.twitter.title": "推特",
"footer.site-footer.twitter.screen-reader-text": "在Twitter上关注 {siteName}",
"footer.site-footer.youtube.title": "Youtube",
"footer.site-footer.youtube.screen-reader-text": "订阅{siteName} YouTube频道",
"footer.site-footer.linkedin.title": "LinkedIn",
"footer.site-footer.linkedin.screen-reader-text": "在LinkedIn上关注{siteName}",
"footer.site-footer.google-plus.title": "Google+",
"footer.site-footer.google-plus.screen-reader-text": "在Google+上关注{siteName} ",
"footer.site-footer.reddit.title": "Reddit",
"footer.site-footer.reddit.screen-reader-text": "订阅{siteName} subreddit",
"footer.site-footer.apple-app-store.alt-text": "从Apple App Store下载 {siteName} 的移动客户端",
"footer.site-footer.google-play.alt-text": "从Google Play下载 {siteName} 的移动客户端",
"footer.site-footer.footer.aria-label": "页脚"
}
{}

View File

@@ -1,6 +1,5 @@
import React from 'react';
import { render } from 'react-dom';
import { IntlProvider } from '@edx/frontend-i18n';
/* 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 '@edx/frontend-i18n';
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 '@edx/frontend-i18n';
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,255 +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. | 深圳市恒宇博科技有限公司
<a
href="http://www.beian.miit.gov.cn"
>
粤ICP备17044299号-2
</a>
</span>
</p>
</div>
</div>
</footer>
`;
exports[`<SiteFooter /> renders correctly does not render language selector 1`] = `
<footer
aria-label="Page Footer"
@@ -263,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>
@@ -278,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"
@@ -287,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>
@@ -334,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"
@@ -345,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>
@@ -392,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"
@@ -403,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>
@@ -449,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"
>
@@ -460,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"
/>
@@ -474,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"
/>
@@ -482,18 +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. | 深圳市恒宇博科技有限公司
<a
href="http://www.beian.miit.gov.cn"
>
粤ICP备17044299号-2
</a>
</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>
@@ -513,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>
@@ -586,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"
@@ -595,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>
@@ -642,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"
@@ -653,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>
@@ -700,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"
@@ -711,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>
@@ -888,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"
@@ -954,18 +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. | 深圳市恒宇博科技有限公司
<a
href="http://www.beian.miit.gov.cn"
>
粤ICP备17044299号-2
</a>
</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>
@@ -985,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>
@@ -1058,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"
@@ -1067,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>
@@ -1123,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"
@@ -1134,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>
@@ -1181,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"
@@ -1192,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>
@@ -1249,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"
/>
@@ -1263,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"
/>
@@ -1271,18 +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. | 深圳市恒宇博科技有限公司
<a
href="http://www.beian.miit.gov.cn"
>
粤ICP备17044299号-2
</a>
</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>
@@ -1302,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>
@@ -1375,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"
@@ -1384,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>
@@ -1440,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"
@@ -1451,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>
@@ -1498,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"
@@ -1509,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>
@@ -1686,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"
@@ -1762,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"
/>
@@ -1776,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"
/>
@@ -1784,18 +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. | 深圳市恒宇博科技有限公司
<a
href="http://www.beian.miit.gov.cn"
>
粤ICP备17044299号-2
</a>
</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 '@edx/frontend-i18n';
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: <a href="http://www.beian.miit.gov.cn">粤ICP备17044299号-2</a> }}
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 };