overleaf/services/web/frontend/js/shared/context/root-context.js
Miguel Serrano d55e46d3c0 Merge pull request #3642 from overleaf/msm-history-track-changes-toggles
[ReactNavToolbar] Track changes and History toggle buttons.

GitOrigin-RevId: a67a9a488c0960dba3f3d374cde4db0080ed2952
2021-02-24 03:04:17 +00:00

26 lines
813 B
JavaScript

import React from 'react'
import PropTypes from 'prop-types'
import { ApplicationProvider } from './application-context'
import { EditorProvider } from './editor-context'
import createSharedContext from 'react2angular-shared-context'
import { ChatProvider } from '../../features/chat/context/chat-context'
import { LayoutProvider } from './layout-context'
export function ContextRoot({ children, ide }) {
return (
<ApplicationProvider>
<EditorProvider $scope={ide.$scope}>
<LayoutProvider $scope={ide.$scope}>
<ChatProvider>{children}</ChatProvider>
</LayoutProvider>
</EditorProvider>
</ApplicationProvider>
)
}
ContextRoot.propTypes = {
children: PropTypes.any,
ide: PropTypes.any.isRequired
}
export const rootContext = createSharedContext(ContextRoot)