|
@@ -1,3 +1,4 @@
|
|
|
|
|
+import { lazy, Suspense } from 'react'
|
|
|
import { Alerts } from '@/features/ide-react/components/alerts/alerts'
|
|
import { Alerts } from '@/features/ide-react/components/alerts/alerts'
|
|
|
import { MainLayout } from '@/features/ide-react/components/layout/main-layout'
|
|
import { MainLayout } from '@/features/ide-react/components/layout/main-layout'
|
|
|
import EditorLeftMenu from '@/features/editor-left-menu/components/editor-left-menu'
|
|
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 { Modals } from '@/features/ide-react/components/modals/modals'
|
|
|
import { GlobalAlertsProvider } from '@/features/ide-react/context/global-alerts-context'
|
|
import { GlobalAlertsProvider } from '@/features/ide-react/context/global-alerts-context'
|
|
|
import { GlobalToasts } from '../global-toasts'
|
|
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() {
|
|
export default function IdePage() {
|
|
|
useLayoutEventTracking() // sent event when the layout changes
|
|
useLayoutEventTracking() // sent event when the layout changes
|
|
@@ -19,12 +25,22 @@ export default function IdePage() {
|
|
|
useHasLintingError() // pass editor:lint hasLintingError to the compiler
|
|
useHasLintingError() // pass editor:lint hasLintingError to the compiler
|
|
|
useOpenFile() // create ide.binaryFilesManager (TODO: move to the history file restore component)
|
|
useOpenFile() // create ide.binaryFilesManager (TODO: move to the history file restore component)
|
|
|
|
|
|
|
|
|
|
+ const newEditor = useFeatureFlag('editor-redesign')
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<GlobalAlertsProvider>
|
|
<GlobalAlertsProvider>
|
|
|
<Alerts />
|
|
<Alerts />
|
|
|
<Modals />
|
|
<Modals />
|
|
|
- <EditorLeftMenu />
|
|
|
|
|
- <MainLayout />
|
|
|
|
|
|
|
+ {newEditor ? (
|
|
|
|
|
+ <Suspense fallback={null}>
|
|
|
|
|
+ <MainLayoutNew />
|
|
|
|
|
+ </Suspense>
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <>
|
|
|
|
|
+ <EditorLeftMenu />
|
|
|
|
|
+ <MainLayout />
|
|
|
|
|
+ </>
|
|
|
|
|
+ )}
|
|
|
<GlobalToasts />
|
|
<GlobalToasts />
|
|
|
</GlobalAlertsProvider>
|
|
</GlobalAlertsProvider>
|
|
|
)
|
|
)
|