diff --git a/package-lock.json b/package-lock.json index af798c21b88..7f156fb857e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -112,7 +112,7 @@ "sass": "1.80.6", "sass-loader": "10.5.2", "scratch-gui": "4.1.2", - "scratch-l10n": "4.0.24", + "scratch-l10n": "5.0.3", "selenium-webdriver": "4.26.0", "slick-carousel": "1.8.1", "stream-browserify": "3.0.0", @@ -22460,12 +22460,26 @@ "react": "^16.0.0" } }, + "node_modules/scratch-gui/node_modules/scratch-l10n": { + "version": "4.0.46", + "resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-4.0.46.tgz", + "integrity": "sha512-L+5eTrFe7qYUt0aK005qf20kg5Nm1gny2wDwpP1eI0Sk5Of6qGUyG7dr/FtAw5OHzbZENbYoT9tNWBf/swJ2gQ==", + "dev": true, + "dependencies": { + "@transifex/api": "4.3.0", + "download": "8.0.0", + "transifex": "1.6.6" + }, + "bin": { + "build-i18n-src": "scripts/build-i18n-src.js", + "tx-push-src": "scripts/tx-push-src.js" + } + }, "node_modules/scratch-l10n": { - "version": "4.0.24", - "resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-4.0.24.tgz", - "integrity": "sha512-8HoTKkTWGCUiXvYJmhdsEEei6PJ50Ffll3vgc5shSCgYhR1asSMRp1nYq80o7BJyT+0/FOXfPCheMv4+gPjBvw==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-5.0.3.tgz", + "integrity": "sha512-k6aS1F2aRYCvd2CtuvkIwshug5abZOxRExziWEAfdYcRzxj+Kn9kj4xeqmOMBAcPK4XmteZtsq4qJeflcocs2g==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@transifex/api": "4.3.0", "download": "8.0.0", diff --git a/package.json b/package.json index 04ff696dbb3..eae1752bfde 100644 --- a/package.json +++ b/package.json @@ -147,7 +147,7 @@ "sass": "1.80.6", "sass-loader": "10.5.2", "scratch-gui": "4.1.2", - "scratch-l10n": "4.0.24", + "scratch-l10n": "5.0.3", "selenium-webdriver": "4.26.0", "slick-carousel": "1.8.1", "stream-browserify": "3.0.0", diff --git a/src/views/splash/donate/donate-banner.jsx b/src/views/splash/donate/donate-banner.jsx index f659a94206c..402cc1383d6 100644 --- a/src/views/splash/donate/donate-banner.jsx +++ b/src/views/splash/donate/donate-banner.jsx @@ -8,14 +8,27 @@ const Button = require('../../../components/forms/button.jsx'); require('./donate-banner.scss'); -const donateURL = 'https://www.scratchfoundation.org/donate'; +const SCRATCH_CAMPAIGN_BANNER_END_TIME = new Date(2025, 0, 9).getTime(); // January 9, 2025 (months are zero indexed) + +// This must be dynamic for our tests to work correctly +const isCampaignActive = () => Date.now() < SCRATCH_CAMPAIGN_BANNER_END_TIME; + +const getDonateInfo = () => (isCampaignActive() ? { + bannerText: , + buttonLink: 'https://www.scratchfoundation.org/donate?utm_source=SCRATCH&utm_medium=BANNER&utm_campaign=EOY_GIVING' +} : { + bannerText: , + buttonLink: 'https://www.scratchfoundation.org/donate' +}); const navigateToDonatePage = () => { - window.location = donateURL; + window.location = getDonateInfo().buttonLink; }; -const SCRATCH_CELBRATION_BANNER_END_TIME = new Date(2022, 4, 21).getTime(); // May 21 2022 (months are zero indexed) - // track clicks going out to the donate page from this banner const captureOutboundLinkToDonate = () => { window.dataLayer = window.dataLayer || []; @@ -36,28 +49,11 @@ const DonateTopBanner = ({ src="/images/ideas/try-it-icon.svg" />
- {(Date.now() < SCRATCH_CELBRATION_BANNER_END_TIME) ? - ( -

- - - - ) - }} - /> -

- ) : ( -

- -

- )} +

+ {getDonateInfo().bannerText} +