Merge pull request #22720 from overleaf/dp-editor-redesign

Editor redesign skeleton page

GitOrigin-RevId: 966c88ac3714e4cc7de3e21951e4e1641bfd6852
This commit is contained in:
David
2025-01-09 09:05:43 +00:00
committed by Copybot
parent 70185ad8a1
commit e9e59bbcc9
5 changed files with 95 additions and 2 deletions
@@ -1,3 +1,4 @@
import { lazy, Suspense } from 'react'
import { Alerts } from '@/features/ide-react/components/alerts/alerts'
import { MainLayout } from '@/features/ide-react/components/layout/main-layout'
import EditorLeftMenu from '@/features/editor-left-menu/components/editor-left-menu'
@@ -10,6 +11,11 @@ import { useHasLintingError } from '@/features/ide-react/hooks/use-has-linting-e
import { Modals } from '@/features/ide-react/components/modals/modals'
import { GlobalAlertsProvider } from '@/features/ide-react/context/global-alerts-context'
import { GlobalToasts } from '../global-toasts'
import { useFeatureFlag } from '@/shared/context/split-test-context'
const MainLayoutNew = lazy(
() => import('@/features/ide-redesign/components/main-layout')
)
export default function IdePage() {
useLayoutEventTracking() // sent event when the layout changes
@@ -19,12 +25,22 @@ export default function IdePage() {
useHasLintingError() // pass editor:lint hasLintingError to the compiler
useOpenFile() // create ide.binaryFilesManager (TODO: move to the history file restore component)
const newEditor = useFeatureFlag('editor-redesign')
return (
<GlobalAlertsProvider>
<Alerts />
<Modals />
<EditorLeftMenu />
<MainLayout />
{newEditor ? (
<Suspense fallback={null}>
<MainLayoutNew />
</Suspense>
) : (
<>
<EditorLeftMenu />
<MainLayout />
</>
)}
<GlobalToasts />
</GlobalAlertsProvider>
)