mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-17 20:51:13 -05:00
4af5ed24ad
Remove PDF Detach Safari Warning GitOrigin-RevId: 80f17660d81dc3812fab74c5e2ea4ff23cd7f1d0
25 lines
595 B
JavaScript
25 lines
595 B
JavaScript
import ReactDOM from 'react-dom'
|
|
import PdfPreview from './pdf-preview'
|
|
import { ContextRoot } from '../../../shared/context/root-context'
|
|
import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n'
|
|
|
|
function PdfPreviewDetachedRoot() {
|
|
const { isReady } = useWaitForI18n()
|
|
|
|
if (!isReady) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<ContextRoot>
|
|
<PdfPreview />
|
|
</ContextRoot>
|
|
)
|
|
}
|
|
|
|
export default PdfPreviewDetachedRoot // for testing
|
|
|
|
const element = document.getElementById('pdf-preview-detached-root')
|
|
if (element) {
|
|
ReactDOM.render(<PdfPreviewDetachedRoot />, element)
|
|
}
|