Merge pull request #8995 from overleaf/ab-dictionary-editor-split-test-badge

[web] Use the SplitTestBadge for dictionary-editor test

GitOrigin-RevId: 5a5a646dd852f53603423ec2fe3d473593281dad
This commit is contained in:
Alexandre Bourdin 2022-07-25 15:26:03 +02:00 committed by Copybot
parent e9e36737e6
commit 5f7cb3a0dc

View file

@ -1,12 +1,12 @@
import { useCallback, useMemo } from 'react' import { useCallback } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { Alert, Button, Modal } from 'react-bootstrap' import { Alert, Button, Modal } from 'react-bootstrap'
import Icon from '../../../shared/components/icon' import Icon from '../../../shared/components/icon'
import SplitTestBadge from '../../../shared/components/split-test-badge'
import Tooltip from '../../../shared/components/tooltip' import Tooltip from '../../../shared/components/tooltip'
import useAsync from '../../../shared/hooks/use-async' import useAsync from '../../../shared/hooks/use-async'
import { postJSON } from '../../../infrastructure/fetch-json' import { postJSON } from '../../../infrastructure/fetch-json'
import ignoredWords from '../ignored-words' import ignoredWords from '../ignored-words'
import BetaBadge from '../../../shared/components/beta-badge'
type DictionaryModalContentProps = { type DictionaryModalContentProps = {
handleHide: () => void handleHide: () => void
@ -35,30 +35,18 @@ export default function DictionaryModalContent({
[runAsync] [runAsync]
) )
const betaBadgeTooltipProps = useMemo(() => {
return {
id: 'dictionary-modal-tooltip',
placement: 'bottom',
className: 'tooltip-wide',
text: (
<>
We are testing the dictionary manager.
<br />
Click to give feedback
</>
),
}
}, [])
return ( return (
<> <>
<Modal.Header closeButton> <Modal.Header closeButton>
<Modal.Title> <Modal.Title>
{t('edit_dictionary')}{' '} {t('edit_dictionary')}{' '}
<BetaBadge <SplitTestBadge
tooltip={betaBadgeTooltipProps} splitTestName="dictionary-editor"
url="https://forms.gle/8cLBEW6HU9mDKBPX9" displayOnVariants={['enabled']}
phase="release" tooltip={{
placement: 'bottom',
className: 'tooltip-wide',
}}
/> />
</Modal.Title> </Modal.Title>
</Modal.Header> </Modal.Header>