mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 13:43:41 +01:00
This reverts commit 6de05eb695579dc08cb5ee6ddf30c243cc2ff86a. GitOrigin-RevId: 1fe00bd95b2ce437f91b38667e4d787d49c36902
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { ElementType, FC, PropsWithChildren } from 'react'
|
||||
import React, { FC, PropsWithChildren } from 'react'
|
||||
import { ChatProvider } from '@/features/chat/context/chat-context'
|
||||
import { ConnectionProvider } from './connection-context'
|
||||
import { DetachCompileProvider } from '@/shared/context/detach-compile-context'
|
||||
@@ -30,12 +30,6 @@ import { UserFeaturesProvider } from '@/shared/context/user-features-context'
|
||||
import { UserSettingsProvider } from '@/shared/context/user-settings-context'
|
||||
import { IdeRedesignSwitcherProvider } from './ide-redesign-switcher-context'
|
||||
import { CommandRegistryProvider } from './command-registry-context'
|
||||
import importOverleafModules from '../../../../macros/import-overleaf-module.macro'
|
||||
|
||||
const rootContextProviders = importOverleafModules('rootContextProviders') as {
|
||||
import: { default: ElementType }
|
||||
path: string
|
||||
}[]
|
||||
|
||||
export const ReactContextRoot: FC<
|
||||
React.PropsWithChildren<{
|
||||
@@ -77,18 +71,6 @@ export const ReactContextRoot: FC<
|
||||
...providers,
|
||||
}
|
||||
|
||||
// Extract dynamic providers from modules
|
||||
const dynamicProviders = rootContextProviders.map(
|
||||
module => module.import.default
|
||||
)
|
||||
|
||||
// Wrap children with all dynamic providers from outside to inside
|
||||
const childrenWrappedWithDynamicProviders =
|
||||
dynamicProviders.reduceRight<React.ReactElement>(
|
||||
(acc, Provider) => <Provider>{acc}</Provider>,
|
||||
<>{children}</>
|
||||
)
|
||||
|
||||
return (
|
||||
<Providers.SplitTestProvider>
|
||||
<Providers.ModalsContextProvider>
|
||||
@@ -121,9 +103,7 @@ export const ReactContextRoot: FC<
|
||||
<Providers.OutlineProvider>
|
||||
<Providers.IdeRedesignSwitcherProvider>
|
||||
<Providers.CommandRegistryProvider>
|
||||
{
|
||||
childrenWrappedWithDynamicProviders
|
||||
}
|
||||
{children}
|
||||
</Providers.CommandRegistryProvider>
|
||||
</Providers.IdeRedesignSwitcherProvider>
|
||||
</Providers.OutlineProvider>
|
||||
|
||||
Reference in New Issue
Block a user