From c45bca6ce9559b3914c336c0d7ca43c3cbff055d Mon Sep 17 00:00:00 2001
From: David <33458145+davidmcpowell@users.noreply.github.com>
Date: Wed, 21 May 2025 09:47:18 +0100
Subject: [PATCH] Merge pull request #25780 from
overleaf/dp-equation-preview-copy
Update copy in equation preview disable modal for new editor
GitOrigin-RevId: 51f1c00764ed3cb8f48448846e575ca738f71238
---
.../web/frontend/extracted-translations.json | 1 +
.../components/math-preview-tooltip.tsx | 18 ++++++++++++++----
services/web/locales/en.json | 1 +
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json
index 36e66feed7..d8f23bd45f 100644
--- a/services/web/frontend/extracted-translations.json
+++ b/services/web/frontend/extracted-translations.json
@@ -399,6 +399,7 @@
"disable_equation_preview": "",
"disable_equation_preview_confirm": "",
"disable_equation_preview_enable": "",
+ "disable_equation_preview_enable_in_settings": "",
"disable_single_sign_on": "",
"disable_sso": "",
"disable_stop_on_first_error": "",
diff --git a/services/web/frontend/js/features/source-editor/components/math-preview-tooltip.tsx b/services/web/frontend/js/features/source-editor/components/math-preview-tooltip.tsx
index 4e2a200f44..60d9c430e2 100644
--- a/services/web/frontend/js/features/source-editor/components/math-preview-tooltip.tsx
+++ b/services/web/frontend/js/features/source-editor/components/math-preview-tooltip.tsx
@@ -23,6 +23,7 @@ import { mathPreviewStateField } from '../extensions/math-preview'
import { getTooltip } from '@codemirror/view'
import ReactDOM from 'react-dom'
import OLDropdownMenuItem from '@/features/ui/components/ol/ol-dropdown-menu-item'
+import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils'
const MathPreviewTooltipContainer: FC = () => {
const state = useCodeMirrorStateContext()
@@ -57,6 +58,8 @@ const MathPreviewTooltip: FC<{ mathContent: HTMLDivElement }> = ({
}) => {
const { t } = useTranslation()
+ const newEditor = useIsNewEditorEnabled()
+
const [showDisableModal, setShowDisableModal] = useState(false)
const { setMathPreview } = useProjectSettingsContext()
const openDisableModal = useCallback(() => setShowDisableModal(true), [])
@@ -133,10 +136,17 @@ const MathPreviewTooltip: FC<{ mathContent: HTMLDivElement }> = ({
{t('disable_equation_preview_confirm')}
- }}
- />
+ {newEditor ? (
+ }}
+ />
+ ) : (
+ }}
+ />
+ )}
diff --git a/services/web/locales/en.json b/services/web/locales/en.json
index 21ee0fd735..08f22483a7 100644
--- a/services/web/locales/en.json
+++ b/services/web/locales/en.json
@@ -521,6 +521,7 @@
"disable_equation_preview": "Disable equation preview",
"disable_equation_preview_confirm": "This will disable equation preview for you in all projects.",
"disable_equation_preview_enable": "You can enable it again from the Menu.",
+ "disable_equation_preview_enable_in_settings": "You can enable it again in Settings.",
"disable_single_sign_on": "Disable single sign-on",
"disable_sso": "Disable SSO",
"disable_stop_on_first_error": "Disable “Stop on first error”",