From 06a38ca247d3d2fce2d05fb0a1642886ac18b1a8 Mon Sep 17 00:00:00 2001 From: Kenny2github Date: Tue, 4 Dec 2018 10:47:14 +0800 Subject: [PATCH] Redirect /info/cards route to /ideas --- src/routes.json | 13 +- src/views/cards/cards.jsx | 480 ------------------------------- src/views/cards/cards.scss | 47 --- src/views/cards/l10n-static.json | 15 - src/views/cards/l10n.json | 19 -- 5 files changed, 6 insertions(+), 568 deletions(-) delete mode 100644 src/views/cards/cards.jsx delete mode 100644 src/views/cards/cards.scss delete mode 100644 src/views/cards/l10n-static.json delete mode 100644 src/views/cards/l10n.json diff --git a/src/routes.json b/src/routes.json index 3a58d04a2..1377fa8a0 100644 --- a/src/routes.json +++ b/src/routes.json @@ -13,13 +13,6 @@ "view": "camp/camp", "title": "Down Deep" }, - { - "name": "cards", - "pattern": "^/info/cards/?$", - "routeAlias": "/info/(cards|communityblocks-interviews|credits|faq)/?$", - "view": "cards/cards", - "title": "Cards" - }, { "name": "communityblocks-interviews", "pattern": "^/info/communityblocks-interviews/?$", @@ -372,6 +365,12 @@ "routeAlias": "/explore(?!/ajax)", "redirect": "/explore/studios/all" }, + { + "name": "info-cards-redirect", + "pattern": "^/info/cards/?$", + "routeAlias": "/info/(cards|communityblocks-interviews|credits|faq)/?$", + "redirect": "/ideas" + }, { "name": "help-redirect", "pattern": "^/help/?(\\?.*)?$", diff --git a/src/views/cards/cards.jsx b/src/views/cards/cards.jsx deleted file mode 100644 index c18da2497..000000000 --- a/src/views/cards/cards.jsx +++ /dev/null @@ -1,480 +0,0 @@ -const bindAll = require('lodash.bindall'); -const injectIntl = require('react-intl').injectIntl; -const intlShape = require('react-intl').intlShape; -const FormattedMessage = require('react-intl').FormattedMessage; -const React = require('react'); -const render = require('../../lib/render.jsx'); - -const Box = require('../../components/box/box.jsx'); -const FlexRow = require('../../components/flex-row/flex-row.jsx'); -const Page = require('../../components/page/www/page.jsx'); - -require('./cards.scss'); - -class Cards extends React.Component { - constructor (props) { - super(props); - bindAll([ - 'pdfLocaleMismatch' - ]); - } - pdfLocaleMismatch (locale, pdf, englishPdf) { - if (pdf === englishPdf && locale.indexOf('en') !== 0) { - return true; - } - return false; - } - render () { - const locale = this.props.intl.locale || 'en'; - const formatMessage = this.props.intl.formatMessage; - const englishLinks = { - 'cards.starterLink': 'https://resources.scratch.mit.edu/www/cards/en/Scratch2Cards.pdf', - 'cards.nameLink': 'https://resources.scratch.mit.edu/www/cards/en/nameCards.pdf', - 'cards.flyLink': 'https://resources.scratch.mit.edu/www/cards/en/flyCards.pdf', - 'cards.raceLink': 'https://resources.scratch.mit.edu/www/cards/en/raceCards.pdf', - 'cards.musicLink': 'https://resources.scratch.mit.edu/www/cards/en/musicCards.pdf', - 'cards.hideLink': 'https://resources.scratch.mit.edu/www/cards/en/hide-seekCards.pdf', - 'cards.storyLink': 'https://resources.scratch.mit.edu/www/cards/en/storyCards.pdf', - 'cards.dressupLink': 'https://resources.scratch.mit.edu/www/cards/en/fashionCards.pdf', - 'cards.pongLink': 'https://resources.scratch.mit.edu/www/cards/en/pongCards.pdf', - 'cards.danceLink': 'https://resources.scratch.mit.edu/www/cards/en/danceCards.pdf', - 'cards.catchLink': 'https://resources.scratch.mit.edu/www/cards/en/catchCards.pdf', - 'cards.petLink': 'https://resources.scratch.mit.edu/www/cards/en/petCards.pdf' - }; - const formattedLinks = { - 'cards.starterLink': formatMessage({id: 'cards.Scratch2CardsLink'}), - 'cards.nameLink': formatMessage({id: 'cards.nameCardsLink'}), - 'cards.flyLink': formatMessage({id: 'cards.flyCardsLink'}), - 'cards.raceLink': formatMessage({id: 'cards.raceCardsLink'}), - 'cards.musicLink': formatMessage({id: 'cards.musicCardsLink'}), - 'cards.hideLink': formatMessage({id: 'cards.hide-seekCardsLink'}), - 'cards.storyLink': formatMessage({id: 'cards.storyCardsLink'}), - 'cards.dressupLink': formatMessage({id: 'cards.fashionCardsLink'}), - 'cards.pongLink': formatMessage({id: 'cards.pongCardsLink'}), - 'cards.danceLink': formatMessage({id: 'cards.danceCardsLink'}), - 'cards.catchLink': formatMessage({id: 'cards.catchCardsLink'}), - 'cards.petLink': formatMessage({id: 'cards.petCardsLink'}) - }; - - /* eslint-disable indent */ - return ( -
-
-
-

- -

-

- -

-
- Card Use Explanation -
-
- - - - - - - - - - - - - - - - -
-
- ); - } -} - -Cards.propTypes = { - intl: intlShape -}; - -const LocalizedCards = injectIntl(Cards); - -render(, document.getElementById('app')); diff --git a/src/views/cards/cards.scss b/src/views/cards/cards.scss deleted file mode 100644 index 1b73a83fc..000000000 --- a/src/views/cards/cards.scss +++ /dev/null @@ -1,47 +0,0 @@ -@import "../../colors"; -@import "../../frameless"; - -// Page header -.cards-intro { - display: flex; - margin: 1rem 0; - align-items: center; - justify-content: space-between; -} - -.cards-intro-content { - float: left; - width: 45%; -} - -.cards-intro-content-header { - margin: .75rem 0 .5rem; -} - -.cards-intro-content-body { - margin: .25rem 0 1rem; -} - -.cards-intro-img { - width: 45%; -} - -// Cards and Card Container -.cards-container { - text-align: center; -} - -.flex-row-card { - margin: 1.5rem 0; - padding: .5rem; -} - -.flex-row-card-link { - display: block; - margin-top: .5rem; -} - -.flex-row-card-link-icon { - margin-right: .2rem; - width: 1rem; -} diff --git a/src/views/cards/l10n-static.json b/src/views/cards/l10n-static.json deleted file mode 100644 index fc062b007..000000000 --- a/src/views/cards/l10n-static.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/en/Scratch2Cards.pdf", - "cards.catchCardsLink": "https://resources.scratch.mit.edu/www/cards/en/catchCards.pdf", - "cards.danceCardsLink": "https://resources.scratch.mit.edu/www/cards/en/danceCards.pdf", - "cards.dressupCardsLink": "https://resources.scratch.mit.edu/www/cards/en/dressupCards.pdf", - "cards.fashionCardsLink": "https://resources.scratch.mit.edu/www/cards/en/fashionCards.pdf", - "cards.flyCardsLink": "https://resources.scratch.mit.edu/www/cards/en/flyCards.pdf", - "cards.hide-seekCardsLink": "https://resources.scratch.mit.edu/www/cards/en/hide-seekCards.pdf", - "cards.musicCardsLink": "https://resources.scratch.mit.edu/www/cards/en/musicCards.pdf", - "cards.nameCardsLink": "https://resources.scratch.mit.edu/www/cards/en/nameCards.pdf", - "cards.petCardsLink": "https://resources.scratch.mit.edu/www/cards/en/petCards.pdf", - "cards.pongCardsLink": "https://resources.scratch.mit.edu/www/cards/en/pongCards.pdf", - "cards.raceCardsLink": "https://resources.scratch.mit.edu/www/cards/en/raceCards.pdf", - "cards.storyCardsLink": "https://resources.scratch.mit.edu/www/cards/en/storyCards.pdf" -} \ No newline at end of file diff --git a/src/views/cards/l10n.json b/src/views/cards/l10n.json deleted file mode 100644 index c3c44bfc1..000000000 --- a/src/views/cards/l10n.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "cards.introHeader": "Scratch Cards", - "cards.introContent": "Scratch cards provide a quick way to learn new Scratch code.", - "cards.english": "English", - "cards.introWikiSupport": "Looking for Scratch Cards in your language? Check Scratch Wiki.", - "cards.viewCard": "View Cards", - "cards.starter": "Starter Cards", - "cards.name": "Animate Your Name", - "cards.fly": "Make It Fly", - "cards.race": "Race to the Finish", - "cards.music": "Make Music", - "cards.hide": "Hide and Seek", - "cards.story": "Create a Story", - "cards.dressup": "Fashion Game", - "cards.pong": "Pong Game", - "cards.dance": "Let's Dance", - "cards.catch": "Catch Game", - "cards.pet": "Virtual Pet" -}