mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 02:56:20 -05:00
Merge pull request #3581 from LLK/release/2019-12-04
[Develop] Release 2019 12 04
This commit is contained in:
commit
bbe8f9cfec
9 changed files with 121 additions and 8 deletions
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -15659,9 +15659,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scratch-gui": {
|
"scratch-gui": {
|
||||||
"version": "0.1.0-prerelease.20191204144806",
|
"version": "0.1.0-prerelease.20191205143447",
|
||||||
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191204144806.tgz",
|
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191205143447.tgz",
|
||||||
"integrity": "sha512-GwVOCJPPBaMsw0ulId/Dxv/vrJ1T4GCZZQk49hlN7gpZozM5HQAYkz9DzZCGnwrwTFFJhI0biqQ/SOLfpe5bTQ==",
|
"integrity": "sha512-dx2ssVXXmCIXEoWbhOp9DM7oAZ6Nd0BHBhMQrDtSy+G2smODMsTqx7xsvfuQ+4+xtd8Sru7qjWG2RxPrJ6Fdkw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"scratch-l10n": {
|
"scratch-l10n": {
|
||||||
|
|
|
@ -127,7 +127,7 @@
|
||||||
"redux-mock-store": "^1.2.3",
|
"redux-mock-store": "^1.2.3",
|
||||||
"redux-thunk": "2.0.1",
|
"redux-thunk": "2.0.1",
|
||||||
"sass-loader": "6.0.6",
|
"sass-loader": "6.0.6",
|
||||||
"scratch-gui": "0.1.0-prerelease.20191204144806",
|
"scratch-gui": "0.1.0-prerelease.20191205143447",
|
||||||
"scratch-l10n": "latest",
|
"scratch-l10n": "latest",
|
||||||
"selenium-webdriver": "3.6.0",
|
"selenium-webdriver": "3.6.0",
|
||||||
"slick-carousel": "1.6.0",
|
"slick-carousel": "1.6.0",
|
||||||
|
|
36
src/components/page/www/donor-recognition.jsx
Normal file
36
src/components/page/www/donor-recognition.jsx
Normal file
|
@ -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 = () => (
|
||||||
|
<div id="donor-text">
|
||||||
|
<div>
|
||||||
|
<FormattedMessage
|
||||||
|
id="footer.donorRecognition"
|
||||||
|
values={{
|
||||||
|
donorLink: (
|
||||||
|
<a
|
||||||
|
href="/credits#donors"
|
||||||
|
>
|
||||||
|
<FormattedMessage id="footer.donors" />
|
||||||
|
</a>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<FormattedMessage
|
||||||
|
id="footer.donorList"
|
||||||
|
values={{
|
||||||
|
donor1: 'Massachusetts Institute of Technology',
|
||||||
|
donor2: 'National Science Foundation',
|
||||||
|
donor3: 'Siegel Family Endowment'
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = injectIntl(DonorRecognition);
|
38
src/components/page/www/donor-recognition.scss
Normal file
38
src/components/page/www/donor-recognition.scss
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,11 +4,13 @@ const React = require('react');
|
||||||
|
|
||||||
const Navigation = require('../../navigation/www/navigation.jsx');
|
const Navigation = require('../../navigation/www/navigation.jsx');
|
||||||
const Footer = require('../../footer/www/footer.jsx');
|
const Footer = require('../../footer/www/footer.jsx');
|
||||||
|
const DonorRecognition = require('./donor-recognition.jsx');
|
||||||
const ErrorBoundary = require('../../errorboundary/errorboundary.jsx');
|
const ErrorBoundary = require('../../errorboundary/errorboundary.jsx');
|
||||||
|
|
||||||
const Page = ({
|
const Page = ({
|
||||||
children,
|
children,
|
||||||
className
|
className,
|
||||||
|
showDonorRecognition
|
||||||
}) => (
|
}) => (
|
||||||
<ErrorBoundary componentName="Page">
|
<ErrorBoundary componentName="Page">
|
||||||
<div className={classNames('page', className)}>
|
<div className={classNames('page', className)}>
|
||||||
|
@ -26,13 +28,19 @@ const Page = ({
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
|
{showDonorRecognition &&
|
||||||
|
<div id="donor">
|
||||||
|
<DonorRecognition />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
);
|
);
|
||||||
|
|
||||||
Page.propTypes = {
|
Page.propTypes = {
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
className: PropTypes.string
|
className: PropTypes.string,
|
||||||
|
showDonorRecognition: PropTypes.bool
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = Page;
|
module.exports = Page;
|
||||||
|
|
|
@ -122,6 +122,9 @@
|
||||||
|
|
||||||
"footer.discuss": "Discussion Forums",
|
"footer.discuss": "Discussion Forums",
|
||||||
"footer.scratchFamily": "Scratch Family",
|
"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",
|
"form.validationRequired": "This field is required",
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,10 @@ const Credits = () => (
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div className="supporters">
|
<div
|
||||||
|
className="supporters"
|
||||||
|
id="donors"
|
||||||
|
>
|
||||||
<div className="mid-header">
|
<div className="mid-header">
|
||||||
<h2>
|
<h2>
|
||||||
<FormattedMessage id="credits.currentSponsors" />
|
<FormattedMessage id="credits.currentSponsors" />
|
||||||
|
|
|
@ -271,7 +271,11 @@ const ConnectedSplash = connect(
|
||||||
)(Splash);
|
)(Splash);
|
||||||
|
|
||||||
render(
|
render(
|
||||||
<Page><ConnectedSplash /></Page>,
|
<Page
|
||||||
|
showDonorRecognition
|
||||||
|
>
|
||||||
|
<ConnectedSplash />
|
||||||
|
</Page>,
|
||||||
document.getElementById('app'),
|
document.getElementById('app'),
|
||||||
{splash: splashActions.splashReducer}
|
{splash: splashActions.splashReducer}
|
||||||
);
|
);
|
||||||
|
|
21
test/unit/components/page.test.jsx
Normal file
21
test/unit/components/page.test.jsx
Normal file
|
@ -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(
|
||||||
|
<Page />
|
||||||
|
);
|
||||||
|
expect(component.find('#donor')).toHaveLength(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Show donor recognition', () => {
|
||||||
|
const component = shallowWithIntl(
|
||||||
|
<Page
|
||||||
|
showDonorRecognition
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
expect(component.find('#donor')).toHaveLength(1);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in a new issue