mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
f7ef2532e0
* Only hide the compile logs pane when toggled off * Handle PDF preview on toggle between split and full-width views GitOrigin-RevId: 9ceca8a06a22abfa78f245e1ae5d24af98215906
34 lines
926 B
JavaScript
34 lines
926 B
JavaScript
import { memo, Suspense } from 'react'
|
|
import PdfLogsViewer from './pdf-logs-viewer'
|
|
import PdfViewer from './pdf-viewer'
|
|
import LoadingSpinner from '../../../shared/components/loading-spinner'
|
|
import PdfHybridPreviewToolbar from './pdf-preview-hybrid-toolbar'
|
|
import PdfPreviewToolbar from './pdf-preview-toolbar'
|
|
|
|
const newPreviewToolbar = new URLSearchParams(window.location.search).has(
|
|
'new_preview_toolbar'
|
|
)
|
|
|
|
function PdfPreviewPane() {
|
|
return (
|
|
<div className="pdf full-size">
|
|
{newPreviewToolbar ? <PdfPreviewToolbar /> : <PdfHybridPreviewToolbar />}
|
|
<Suspense fallback={<LoadingPreview />}>
|
|
<div className="pdf-viewer">
|
|
<PdfViewer />
|
|
</div>
|
|
</Suspense>
|
|
<PdfLogsViewer />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
function LoadingPreview() {
|
|
return (
|
|
<div className="pdf-loading-spinner-container">
|
|
<LoadingSpinner />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default memo(PdfPreviewPane)
|