ide.tsx 1004 B

12345678910111213141516171819202122232425262728
  1. import '../utils/webpack-public-path' // configure dynamically loaded assets (via webpack) to be downloaded from CDN
  2. import '../infrastructure/error-reporter' // set up error reporting, including Sentry
  3. import '../infrastructure/hotjar' // set up Hotjar
  4. import '../infrastructure/mixpanel-autocapture' // set up mixpanel autocapture
  5. import { createRoot } from 'react-dom/client'
  6. import IdeRoot from '@/features/ide-react/components/ide-root'
  7. const container = document.getElementById('ide-root')
  8. if (container) {
  9. const root = createRoot(container)
  10. root.render(<IdeRoot />)
  11. }
  12. // work around Safari 15's incomplete support for dvh units
  13. // https://github.com/overleaf/internal/issues/18109
  14. try {
  15. if (
  16. document.body.parentElement &&
  17. document.body.parentElement?.clientHeight < document.body.clientHeight
  18. ) {
  19. const rootElement = document.querySelector<HTMLDivElement>('#ide-root')
  20. if (rootElement) {
  21. rootElement.style.height = '100vh'
  22. }
  23. }
  24. } catch {
  25. // ignore errors
  26. }