overleaf/services/web/frontend/js/shared/context/root-context.js
Alf Eaton 2340b1b25e Add "[PDF]" prefix to detached window title (#8039)
* Move DetachProvider outside EditorProvider
* Add "[PDF]" prefix to detached window title

GitOrigin-RevId: 7d09f4053069b20d55a2a04a8f29f90b973e50b9
2022-05-23 08:03:36 +00:00

48 lines
1.7 KiB
JavaScript

import PropTypes from 'prop-types'
import createSharedContext from 'react2angular-shared-context'
import { UserProvider } from './user-context'
import { IdeProvider } from './ide-context'
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'
export function ContextRoot({ children, ide, settings }) {
return (
<SplitTestProvider>
<IdeProvider ide={ide}>
<UserProvider>
<ProjectProvider>
<FileTreeDataProvider>
<DetachProvider>
<EditorProvider settings={settings}>
<LayoutProvider>
<LocalCompileProvider>
<DetachCompileProvider>
<ChatProvider>{children}</ChatProvider>
</DetachCompileProvider>
</LocalCompileProvider>
</LayoutProvider>
</EditorProvider>
</DetachProvider>
</FileTreeDataProvider>
</ProjectProvider>
</UserProvider>
</IdeProvider>
</SplitTestProvider>
)
}
ContextRoot.propTypes = {
children: PropTypes.any,
ide: PropTypes.object,
settings: PropTypes.object,
}
export const rootContext = createSharedContext(ContextRoot)