Merge pull request #30393 from overleaf/dp-test-revert-2

Revert "Merge pull request #29916 from overleaf/dp-cleanup-editor-red…

GitOrigin-RevId: c2f14fb55e74a1fcb026e37822774724c36bc0dc
This commit is contained in:
David
2025-12-17 09:07:15 +00:00
committed by Copybot
parent 9aa7a36721
commit bf384683f0
13 changed files with 396 additions and 38 deletions
@@ -4,12 +4,14 @@ import { useTranslation } from 'react-i18next'
import { useSwitchEnableNewEditorState } from '../ide-redesign/hooks/use-switch-enable-new-editor-state'
import MaterialIcon from '@/shared/components/material-icon'
import { useEditorAnalytics } from '@/shared/hooks/use-editor-analytics'
import { useFeatureFlag } from '@/shared/context/split-test-context'
import OldEditorWarningTooltip from '../ide-redesign/components/old-editor-warning-tooltip'
const TryNewEditorButton = () => {
const { t } = useTranslation()
const { loading, setEditorRedesignStatus } = useSwitchEnableNewEditorState()
const { sendEvent } = useEditorAnalytics()
const isNewEditorOptOutStage = useFeatureFlag('editor-redesign-opt-out')
const [buttonElt, setButtonElt] = useState<HTMLButtonElement | null>(null)
const buttonRef = useCallback((node: HTMLButtonElement) => {
if (node !== null) {
@@ -35,9 +37,11 @@ const TryNewEditorButton = () => {
ref={buttonRef}
>
<MaterialIcon type="fiber_new" />
{t('switch_to_new_look')}
{isNewEditorOptOutStage
? t('switch_to_new_look')
: t('try_the_new_editor_design')}
</OLButton>
<OldEditorWarningTooltip target={buttonElt} />
{isNewEditorOptOutStage && <OldEditorWarningTooltip target={buttonElt} />}
</div>
)
}