Merge pull request #19030 from overleaf/dp-presentation-mode-flag

Add separate feature flag for presentation mode

GitOrigin-RevId: a996fa313c101dd822ad83109ba77fa95f99f644
This commit is contained in:
David 2024-06-21 09:39:50 +01:00 committed by Copybot
parent 3d5418611b
commit a8cb423078
2 changed files with 8 additions and 2 deletions

View file

@ -327,6 +327,7 @@ const _ProjectController = {
'pdf-caching-prefetch-large',
'pdf-caching-prefetching',
'pdf-controls',
'pdf-presentation-mode',
'pdfjs-40',
'personal-access-token',
'revert-file',

View file

@ -3,6 +3,7 @@ import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import ControlledDropdown from '@/shared/components/controlled-dropdown'
import classNames from 'classnames'
import { useFeatureFlag } from '@/shared/context/split-test-context'
const isMac = /Mac/.test(window.navigator?.platform)
@ -37,6 +38,8 @@ function PdfZoomDropdown({
}: PdfZoomDropdownProps) {
const { t } = useTranslation()
const enablePresentationMode = useFeatureFlag('pdf-presentation-mode')
const [customZoomValue, setCustomZoomValue] = useState<string>(
rawScaleToPercentage(rawScale)
)
@ -45,6 +48,8 @@ function PdfZoomDropdown({
setCustomZoomValue(rawScaleToPercentage(rawScale))
}, [rawScale])
const showPresentOption = enablePresentationMode && document.fullscreenEnabled
return (
<ControlledDropdown
id="pdf-zoom-dropdown"
@ -116,8 +121,8 @@ function PdfZoomDropdown({
<MenuItem draggable={false} key="page-height" eventKey="page-height">
{t('fit_to_height')}
</MenuItem>
{document.fullscreenEnabled && <MenuItem divider />}
{document.fullscreenEnabled && (
{showPresentOption && <MenuItem divider />}
{showPresentOption && (
<MenuItem draggable={false} key="present" eventKey="present">
{t('presentation_mode')}
</MenuItem>