overleaf/services/web/frontend/js/pages/ide.tsx
Alf Eaton b5015b82c2 Move Hotjar to the editor page (#21132)
GitOrigin-RevId: efb2c7841af76084566341b6c5f0afac9a965331
2024-10-18 08:05:43 +00:00

23 lines
841 B
TypeScript

import '../utils/webpack-public-path' // configure dynamically loaded assets (via webpack) to be downloaded from CDN
import '../infrastructure/error-reporter' // set up error reporting, including Sentry
import '../infrastructure/hotjar' // set up Hotjar
import ReactDOM from 'react-dom'
import IdeRoot from '@/features/ide-react/components/ide-root'
ReactDOM.render(<IdeRoot />, document.getElementById('ide-root'))
// work around Safari 15's incomplete support for dvh units
// https://github.com/overleaf/internal/issues/18109
try {
if (
document.body.parentElement &&
document.body.parentElement?.clientHeight < document.body.clientHeight
) {
const rootElement = document.querySelector<HTMLDivElement>('#ide-root')
if (rootElement) {
rootElement.style.height = '100vh'
}
}
} catch {
// ignore errors
}