Merge pull request #21722 from overleaf/dp-revert-badge-changes

Revert "Merge pull request #21687 from overleaf/dp-eq-preview-beta-ba…

GitOrigin-RevId: 8347b1bc3b02194bf5c2c657fc85ebefb3b0cf3a
This commit is contained in:
David 2024-11-07 14:15:14 +00:00 committed by Copybot
parent a0a164c4d0
commit 637185025f

View file

@ -12,6 +12,7 @@ import OLModal, {
OLModalTitle, OLModalTitle,
} from '@/features/ui/components/ol/ol-modal' } from '@/features/ui/components/ol/ol-modal'
import MaterialIcon from '@/shared/components/material-icon' import MaterialIcon from '@/shared/components/material-icon'
import SplitTestBadge from '@/shared/components/split-test-badge'
import useEventListener from '@/shared/hooks/use-event-listener' import useEventListener from '@/shared/hooks/use-event-listener'
import { FC, useCallback, useEffect, useRef, useState } from 'react' import { FC, useCallback, useEffect, useRef, useState } from 'react'
import { Trans, useTranslation } from 'react-i18next' import { Trans, useTranslation } from 'react-i18next'
@ -29,7 +30,6 @@ import {
Dropdown as BS3Dropdown, Dropdown as BS3Dropdown,
MenuItem as BS3MenuItem, MenuItem as BS3MenuItem,
} from 'react-bootstrap' } from 'react-bootstrap'
import { useSplitTestContext } from '@/shared/context/split-test-context'
const MathPreviewTooltipContainer: FC = () => { const MathPreviewTooltipContainer: FC = () => {
const state = useCodeMirrorStateContext() const state = useCodeMirrorStateContext()
@ -96,8 +96,10 @@ const MathPreviewTooltip: FC<{ mathContent: HTMLDivElement }> = ({
<> <>
<div className="ol-cm-math-tooltip"> <div className="ol-cm-math-tooltip">
<span ref={mathRef} /> <span ref={mathRef} />
<CustomSplitTestBadge /> <SplitTestBadge
displayOnVariants={['enabled']}
splitTestName="math-preview"
/>
<BootstrapVersionSwitcher <BootstrapVersionSwitcher
bs5={ bs5={
<Dropdown align="end"> <Dropdown align="end">
@ -215,28 +217,4 @@ const MathPreviewTooltip: FC<{ mathContent: HTMLDivElement }> = ({
) )
} }
// Temporary SplitTest badge for just this component that always shows
// as in beta and doesn't have a tooltip
const CustomSplitTestBadge: FC = () => {
const { splitTestVariants } = useSplitTestContext()
const variant = splitTestVariants['math-preview']
if (!variant || variant !== 'enabled') {
return null
}
return (
<a
href="https://forms.gle/uDVGSqnBBJQ8fUPt5"
target="_blank"
rel="noopener noreferrer"
>
<BootstrapVersionSwitcher
bs3={<span className="badge beta-badge" />}
bs5={<MaterialIcon type="info" className="align-middle beta-badge" />}
/>
</a>
)
}
export default MathPreviewTooltipContainer export default MathPreviewTooltipContainer