From 43db3c12e5ce22d11b500f92bd37634c34f4a5f0 Mon Sep 17 00:00:00 2001 From: picklesrus Date: Thu, 13 Dec 2018 14:10:47 -0500 Subject: [PATCH] Add proper links to cards and guides instead of hard coding them. --- src/views/teachers/landing/l10n-static.json | 4 +++ src/views/teachers/landing/landing.jsx | 31 +++++++++++++++++---- 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 src/views/teachers/landing/l10n-static.json diff --git a/src/views/teachers/landing/l10n-static.json b/src/views/teachers/landing/l10n-static.json new file mode 100644 index 000000000..30a965a9a --- /dev/null +++ b/src/views/teachers/landing/l10n-static.json @@ -0,0 +1,4 @@ +{ + "cards.scratch-cards-allLink": "https://resources.scratch.mit.edu/www/cards/en/scratch-cards-all.pdf", + "guides.EducatorGuidesAllLink": "https://resources.scratch.mit.edu/www/guides/en/EducatorGuidesAll.pdf" +} diff --git a/src/views/teachers/landing/landing.jsx b/src/views/teachers/landing/landing.jsx index 2867421fa..74dc74339 100644 --- a/src/views/teachers/landing/landing.jsx +++ b/src/views/teachers/landing/landing.jsx @@ -1,5 +1,8 @@ const FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage; const FormattedMessage = require('react-intl').FormattedMessage; +const injectIntl = require('react-intl').injectIntl; +const intlShape = require('react-intl').intlShape; + const React = require('react'); const FlexRow = require('../../../components/flex-row/flex-row.jsx'); @@ -11,7 +14,8 @@ const render = require('../../../lib/render.jsx'); require('./landing.scss'); -const Landing = () => ( +const Landing = props => ( +
@@ -73,7 +77,11 @@ const Landing = () => ( id="teacherlanding.educatorGuides" values={{ educatorLink: ( - + ) @@ -122,7 +130,11 @@ const Landing = () => (

- + cards icon ( id="teacherlanding.codingCardResources" values={{ codingCardLink: ( - + ) @@ -304,4 +320,9 @@ const Landing = () => (
); -render(, document.getElementById('app')); +Landing.propTypes = { + intl: intlShape +}; +const WrappedLanding = injectIntl(Landing); + +render(, document.getElementById('app'));