From 0ac514f81bfae7162a1b471e9a90a2974585cb29 Mon Sep 17 00:00:00 2001 From: Jimmy Domagala-Tang Date: Fri, 15 Dec 2023 16:50:24 -0500 Subject: [PATCH] Merge pull request #16293 from overleaf/jdt-grammarly-perm-advert Grammarly Permanent Collaboration GitOrigin-RevId: 0ef47cb7dcb4b175c4d5f3a3c2dbe2e6590a69de --- .../components/grammarly-advert.tsx | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx b/services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx index c66cac0827..67608144f5 100644 --- a/services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx +++ b/services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx @@ -13,12 +13,9 @@ export default function GrammarlyAdvert() { const hasDismissedGrammarlyAdvert = customLocalStorage.getItem( 'editor.has_dismissed_grammarly_advert' ) - // promotion ends on december 16th, 2023 at 00:00 UTC - const promotionEnded = - new Date() > new Date(Date.UTC(2023, 11, 16, 0, 0, 0)) const showGrammarlyAdvert = - grammarlyInstalled && !hasDismissedGrammarlyAdvert && !promotionEnded + grammarlyInstalled && !hasDismissedGrammarlyAdvert if (showGrammarlyAdvert) { eventTracking.sendMB('grammarly-advert-shown') @@ -35,8 +32,36 @@ export default function GrammarlyAdvert() { if (!show) { return null } + // promotion ends on december 16th, 2023 at 00:00 UTC + const promotionEnded = new Date() > new Date(Date.UTC(2023, 11, 16, 0, 0, 0)) - return ( + const permanentOffer = ( +
+
+
+

+ Love Grammarly? Then you're in luck! Get 25% off Grammarly Premium + with this exclusive offer for Overleaf users. +

+ eventTracking.sendMB('grammarly-advert-clicked')} + href="https://grammarly.go2cloud.org/aff_c?offer_id=373&aff_id=142242" + target="_blank" + rel="noopener" + > + Claim my discount + +
+
+ +
+
+
+ ) + const promoOffer = (
@@ -62,4 +87,5 @@ export default function GrammarlyAdvert() {
) + return promotionEnded ? permanentOffer : promoOffer }