diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index d174fc8665..9f19d5b2be 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -163,7 +163,6 @@ "checking_project_github_status": "", "choose_a_custom_color": "", "choose_from_group_members": "", - "claim_discount": "", "clear_cached_files": "", "clear_search": "", "click_here_to_view_sl_in_lng": "", 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 deleted file mode 100644 index 6cb4a750d3..0000000000 --- a/services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import { useCallback, useEffect, useState } from 'react' -import { Button } from 'react-bootstrap' -import { useTranslation } from 'react-i18next' -import Notification from '@/shared/components/notification' -import useRemindMeLater from '@/shared/hooks/use-remind-me-later' -import GrammarlyLogo from '@/shared/svgs/grammarly-logo' -import * as eventTracking from '../../../infrastructure/event-tracking' -import useWaitForGrammarlyCheck from '@/shared/hooks/use-wait-for-grammarly-check' -import getMeta from '@/utils/meta' - -export default function GrammarlyAdvert() { - const { isOverleaf } = getMeta('ol-ExposedSettings') - - const [show, setShow] = useState(false) - const { t } = useTranslation() - - // grammarly can take some time to load, we should assume its installed and hide until we know for sure - const grammarlyInstalled = useWaitForGrammarlyCheck({ initialState: false }) - - const { stillDissmissed, remindThemLater, saveDismissed } = - useRemindMeLater('grammarly_advert') - - useEffect(() => { - const showGrammarlyAdvert = grammarlyInstalled && !stillDissmissed - - if (showGrammarlyAdvert) { - eventTracking.sendMB('grammarly-advert-shown') - setShow(true) - } - }, [stillDissmissed, grammarlyInstalled, setShow]) - - const handleDismiss = useCallback(() => { - setShow(false) - saveDismissed() - eventTracking.sendMB('grammarly-advert-dismissed') - }, [saveDismissed]) - - const handleClickClaim = useCallback(() => { - eventTracking.sendMB('promo-click', { - location: 'notification', - name: 'grammarly-advert', - type: 'click', - }) - - saveDismissed() - setShow(false) - - window.open( - 'https://grammarly.go2cloud.org/aff_c?offer_id=373&aff_id=142242' - ) - }, [saveDismissed]) - - const handleLater = useCallback(() => { - eventTracking.sendMB('promo-click', { - location: 'notification', - name: 'grammarly-advert', - type: 'pause', - }) - setShow(false) - remindThemLater() - }, [remindThemLater]) - - if (!isOverleaf || !show) { - return null - } - - const actions = ( -
- Get 25% off Grammarly Premium with this exclusive offer for Overleaf - users. -
- - } - customIcon={ -