mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
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:
parent
3d5418611b
commit
a8cb423078
2 changed files with 8 additions and 2 deletions
|
@ -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',
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue