overleaf/services/web/frontend/js/features/pdf-preview/components/pdf-preview.js
Alf Eaton 65b0fd73ea Improve "compile" keyboard shortcut handling (#10624)
* Improve "compile" keypress handling
* Remove "compile" keypress handling from PDF preview
* Remove compile shortcuts from CM6
* Use an event for Vim keybindings
* Remove event handlers from Angular/Ace
* Move useCompileTriggers into DetachCompileProvider

GitOrigin-RevId: 7f0e667b5106a849458e06ebb0f7a413d5d63430
2022-11-29 09:04:04 +00:00

15 lines
566 B
JavaScript

import PdfPreviewPane from './pdf-preview-pane'
import { memo } from 'react'
import withErrorBoundary from '../../../infrastructure/error-boundary'
import PdfPreviewErrorBoundaryFallback from './pdf-preview-error-boundary-fallback'
import { useLayoutContext } from '../../../shared/context/layout-context'
function PdfPreview() {
const { detachRole } = useLayoutContext()
if (detachRole === 'detacher') return null
return <PdfPreviewPane />
}
export default withErrorBoundary(memo(PdfPreview), () => (
<PdfPreviewErrorBoundaryFallback type="preview" />
))