overleaf/services/web/frontend/js/shared/context/root-context.jsx
Tim Down 537673cdf6 Merge pull request #15415 from overleaf/td-scope-store-and-emitter-fixed
IDE scope store and emitter with fixed PDF URLs

GitOrigin-RevId: 9d33bad8a006bb55714878332f78932538dd8921
2023-10-25 08:05:07 +00:00

50 lines
1.8 KiB
JavaScript

import PropTypes from 'prop-types'
import createSharedContext from 'react2angular-shared-context'
import { UserProvider } from './user-context'
import { IdeAngularProvider } from './ide-angular-provider'
import { EditorProvider } from './editor-context'
import { LocalCompileProvider } from './local-compile-context'
import { DetachCompileProvider } from './detach-compile-context'
import { LayoutProvider } from './layout-context'
import { DetachProvider } from './detach-context'
import { ChatProvider } from '@/features/chat/context/chat-context'
import { ProjectProvider } from './project-context'
import { SplitTestProvider } from './split-test-context'
import { FileTreeDataProvider } from './file-tree-data-context'
import { ProjectSettingsProvider } from '@/features/editor-left-menu/context/project-settings-context'
export function ContextRoot({ children, ide }) {
return (
<SplitTestProvider>
<IdeAngularProvider ide={ide}>
<UserProvider>
<ProjectProvider>
<FileTreeDataProvider>
<DetachProvider>
<EditorProvider>
<ProjectSettingsProvider>
<LayoutProvider>
<LocalCompileProvider>
<DetachCompileProvider>
<ChatProvider>{children}</ChatProvider>
</DetachCompileProvider>
</LocalCompileProvider>
</LayoutProvider>
</ProjectSettingsProvider>
</EditorProvider>
</DetachProvider>
</FileTreeDataProvider>
</ProjectProvider>
</UserProvider>
</IdeAngularProvider>
</SplitTestProvider>
)
}
ContextRoot.propTypes = {
children: PropTypes.any,
ide: PropTypes.object,
}
export const rootContext = createSharedContext(ContextRoot)