Merge pull request #20226 from overleaf/mj-restore-file-badge

[web] Add split test badge for file restore

GitOrigin-RevId: 59bbdd4cc5b76141a8bae06c2e7181e5a5c5ccc0
This commit is contained in:
Mathias Jakobsen 2024-09-04 09:55:09 +01:00 committed by Copybot
parent 2d9e4965f7
commit 5d57571e96

View file

@ -7,6 +7,7 @@ import ToolbarRestoreFileButton from './toolbar-restore-file-button'
import { isFileRemoved } from '../../../utils/file-diff'
import ToolbarRestoreFileToVersionButton from './toolbar-restore-file-to-version-button'
import { useFeatureFlag } from '@/shared/context/split-test-context'
import SplitTestBadge from '@/shared/components/split-test-badge'
type ToolbarProps = {
diff: Nullable<Diff>
@ -34,7 +35,13 @@ export default function Toolbar({ diff, selection }: ToolbarProps) {
<ToolbarRestoreFileButton selection={selection} />
) : null}
{showRestoreFileToVersionButton ? (
<ToolbarRestoreFileToVersionButton selection={selection} />
<>
<ToolbarRestoreFileToVersionButton selection={selection} />
<SplitTestBadge
splitTestName="revert-file"
displayOnVariants={['enabled']}
/>
</>
) : null}
</div>
)