From b89fe1a985d5e9873f59361da7168271c9ffc616 Mon Sep 17 00:00:00 2001 From: picklesrus Date: Wed, 4 Dec 2019 16:28:23 -0500 Subject: [PATCH 1/6] Add recognition text and links to the bottom of the page. Adds a prop to the Page component so each page can say whether or not it wants them to appear. --- src/components/page/www/donor-recognition.jsx | 36 ++++++++++++++++++ .../page/www/donor-recognition.scss | 38 +++++++++++++++++++ src/components/page/www/page.jsx | 12 +++++- src/l10n.json | 3 ++ src/views/credits/credits.jsx | 5 ++- src/views/splash/splash.jsx | 6 ++- test/unit/components/page.test.jsx | 21 ++++++++++ 7 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 src/components/page/www/donor-recognition.jsx create mode 100644 src/components/page/www/donor-recognition.scss create mode 100644 test/unit/components/page.test.jsx diff --git a/src/components/page/www/donor-recognition.jsx b/src/components/page/www/donor-recognition.jsx new file mode 100644 index 000000000..033e8c3fe --- /dev/null +++ b/src/components/page/www/donor-recognition.jsx @@ -0,0 +1,36 @@ +const FormattedMessage = require('react-intl').FormattedMessage; +const injectIntl = require('react-intl').injectIntl; +const React = require('react'); + +require('./donor-recognition.scss'); + +const DonorRecognition = () => ( +
+
+ + + + ) + }} + /> +
+
+ +
+
+); + +module.exports = injectIntl(DonorRecognition); diff --git a/src/components/page/www/donor-recognition.scss b/src/components/page/www/donor-recognition.scss new file mode 100644 index 000000000..99e5bb87b --- /dev/null +++ b/src/components/page/www/donor-recognition.scss @@ -0,0 +1,38 @@ +@import "../../../colors"; +@import "../../../frameless"; + +#donor { + color: $type-gray; + font-size: .875rem; + line-height: 1.5em; + background-color: $ui-gray; + padding-bottom: 2.5rem; + padding-top: 1rem; + #donor-text { + text-align: center; + width: $cols12; + margin: 0 auto; + } +} + +@media only screen and (min-width: $tabletPortrait) and (max-width: $desktop) { + #donor { + #donor-text { + width: $cols11; + } + } +} +@media only screen and (min-width: $mobile) and (max-width: $tabletPortrait) { + #donor { + #donor-text { + width: $cols6; + } + } +} +@media only screen and (max-width: $mobile) { + #donor { + #donor-text { + width: $cols4; + } + } +} diff --git a/src/components/page/www/page.jsx b/src/components/page/www/page.jsx index 77f3712ba..23676a325 100644 --- a/src/components/page/www/page.jsx +++ b/src/components/page/www/page.jsx @@ -4,11 +4,13 @@ const React = require('react'); const Navigation = require('../../navigation/www/navigation.jsx'); const Footer = require('../../footer/www/footer.jsx'); +const DonorRecognition = require('./donor-recognition.jsx'); const ErrorBoundary = require('../../errorboundary/errorboundary.jsx'); const Page = ({ children, - className + className, + showDonorRecognition }) => (
@@ -26,13 +28,19 @@ const Page = ({ + {showDonorRecognition && +
+ +
+ }
); Page.propTypes = { children: PropTypes.node, - className: PropTypes.string + className: PropTypes.string, + showDonorRecognition: PropTypes.bool }; module.exports = Page; diff --git a/src/l10n.json b/src/l10n.json index 840295d2c..a1a17c168 100644 --- a/src/l10n.json +++ b/src/l10n.json @@ -122,6 +122,9 @@ "footer.discuss": "Discussion Forums", "footer.scratchFamily": "Scratch Family", + "footer.donorRecognition": "Scratch is available for free, thanks to generous support from our {donorLink}. We are grateful to our Founding Partners:", + "footer.donors": "donors", + "footer.donorList": "{donor1}, {donor2}, and {donor3}", "form.validationRequired": "This field is required", diff --git a/src/views/credits/credits.jsx b/src/views/credits/credits.jsx index 5aa272cbe..05d7abe08 100644 --- a/src/views/credits/credits.jsx +++ b/src/views/credits/credits.jsx @@ -46,7 +46,10 @@ const Credits = () => ( ))} -
+

diff --git a/src/views/splash/splash.jsx b/src/views/splash/splash.jsx index 8910c0ce2..2c92600b6 100644 --- a/src/views/splash/splash.jsx +++ b/src/views/splash/splash.jsx @@ -271,7 +271,11 @@ const ConnectedSplash = connect( )(Splash); render( - , + + + , document.getElementById('app'), {splash: splashActions.splashReducer} ); diff --git a/test/unit/components/page.test.jsx b/test/unit/components/page.test.jsx new file mode 100644 index 000000000..1fecbf52e --- /dev/null +++ b/test/unit/components/page.test.jsx @@ -0,0 +1,21 @@ +const React = require('react'); +const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx'); +const Page = require('../../../src/components/page/www/page.jsx'); + +describe('Page', () => { + test('Do not show donor recognition', () => { + const component = shallowWithIntl( + + ); + expect(component.find('#donor')).toHaveLength(0); + }); + + test('Show donor recognition', () => { + const component = shallowWithIntl( + + ); + expect(component.find('#donor')).toHaveLength(1); + }); +}); From 8f01525c321d345adea50cd2c928c3a04cc5a90e Mon Sep 17 00:00:00 2001 From: picklesrus Date: Thu, 5 Dec 2019 08:32:55 -0500 Subject: [PATCH 2/6] Add missing . --- src/l10n.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/l10n.json b/src/l10n.json index a1a17c168..5ec674823 100644 --- a/src/l10n.json +++ b/src/l10n.json @@ -124,7 +124,7 @@ "footer.scratchFamily": "Scratch Family", "footer.donorRecognition": "Scratch is available for free, thanks to generous support from our {donorLink}. We are grateful to our Founding Partners:", "footer.donors": "donors", - "footer.donorList": "{donor1}, {donor2}, and {donor3}", + "footer.donorList": "{donor1}, {donor2}, and {donor3}.", "form.validationRequired": "This field is required", From 1d8ba39f8f3dbd42e03deb7549f545901db5ce8e Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2019 14:45:51 +0000 Subject: [PATCH 3/6] chore(package): update scratch-gui to version 0.1.0-prerelease.20191205143447 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 767a53624..fcf1a976b 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "redux-mock-store": "^1.2.3", "redux-thunk": "2.0.1", "sass-loader": "6.0.6", - "scratch-gui": "0.1.0-prerelease.20191204144806", + "scratch-gui": "0.1.0-prerelease.20191205143447", "scratch-l10n": "latest", "selenium-webdriver": "3.6.0", "slick-carousel": "1.6.0", From a0810f085204b1f1f9d4bede8e8387df69bc8e5f Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2019 14:45:56 +0000 Subject: [PATCH 4/6] chore(package): update lockfile package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 54e6bae4c..ccc456877 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15659,9 +15659,9 @@ } }, "scratch-gui": { - "version": "0.1.0-prerelease.20191204144806", - "resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191204144806.tgz", - "integrity": "sha512-GwVOCJPPBaMsw0ulId/Dxv/vrJ1T4GCZZQk49hlN7gpZozM5HQAYkz9DzZCGnwrwTFFJhI0biqQ/SOLfpe5bTQ==", + "version": "0.1.0-prerelease.20191205143447", + "resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191205143447.tgz", + "integrity": "sha512-dx2ssVXXmCIXEoWbhOp9DM7oAZ6Nd0BHBhMQrDtSy+G2smODMsTqx7xsvfuQ+4+xtd8Sru7qjWG2RxPrJ6Fdkw==", "dev": true }, "scratch-l10n": { From c306b92d7873be0c7985a46ea03754136a4b17af Mon Sep 17 00:00:00 2001 From: picklesrus Date: Thu, 5 Dec 2019 09:47:12 -0500 Subject: [PATCH 5/6] add a missing t. --- src/components/page/www/donor-recognition.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/page/www/donor-recognition.jsx b/src/components/page/www/donor-recognition.jsx index 033e8c3fe..5fc28eb70 100644 --- a/src/components/page/www/donor-recognition.jsx +++ b/src/components/page/www/donor-recognition.jsx @@ -24,7 +24,7 @@ const DonorRecognition = () => ( Date: Thu, 5 Dec 2019 09:58:15 -0500 Subject: [PATCH 6/6] Remove an extra comma. --- src/l10n.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/l10n.json b/src/l10n.json index 5ec674823..58cf33a74 100644 --- a/src/l10n.json +++ b/src/l10n.json @@ -122,7 +122,7 @@ "footer.discuss": "Discussion Forums", "footer.scratchFamily": "Scratch Family", - "footer.donorRecognition": "Scratch is available for free, thanks to generous support from our {donorLink}. We are grateful to our Founding Partners:", + "footer.donorRecognition": "Scratch is available for free thanks to generous support from our {donorLink}. We are grateful to our Founding Partners:", "footer.donors": "donors", "footer.donorList": "{donor1}, {donor2}, and {donor3}.",