mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
719da5fbd8
IDE page: connection manager and loading screen GitOrigin-RevId: 2cbc8c09aeb36a14eae66da78b267c7a830fb71a
30 lines
1,007 B
TypeScript
30 lines
1,007 B
TypeScript
import LayoutWithPlaceholders from '@/features/ide-react/components/layout/layout-with-placeholders'
|
|
import { useConnectionContext } from '@/features/ide-react/context/connection-context'
|
|
import useEventListener from '@/shared/hooks/use-event-listener'
|
|
import { useCallback, useEffect } from 'react'
|
|
|
|
// This is filled with placeholder content while the real content is migrated
|
|
// away from Angular
|
|
export default function IdePage() {
|
|
const { registerUserActivity } = useConnectionContext()
|
|
|
|
// Inform the connection manager when the user is active
|
|
const listener = useCallback(
|
|
() => registerUserActivity(),
|
|
[registerUserActivity]
|
|
)
|
|
|
|
useEventListener('cursor:editor:update', listener)
|
|
|
|
useEffect(() => {
|
|
document.body.addEventListener('click', listener)
|
|
return () => document.body.removeEventListener('click', listener)
|
|
}, [listener])
|
|
|
|
return (
|
|
<>
|
|
{/* TODO: Alerts and left menu will go here */}
|
|
<LayoutWithPlaceholders shouldPersistLayout />
|
|
</>
|
|
)
|
|
}
|