overleaf/services/web/frontend/js/shared/context/root-context.js
Miguel Serrano a555f0d309 [ReactNavToolbar] Project name + pdf and share project buttons (#3709)
* Added project name, pdf toggle and share project buttons to navigation toolbar

* Added PropTypes check to `useChatContext()`

* React context updates for project name/rename, pdf view and share moda

* Hide PDF button when pdfLayout != 'flat'

GitOrigin-RevId: 3f4a1b072259df7148d3417cd22116702bdd79ac
2021-03-11 03:05:33 +00:00

27 lines
871 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, settings }) {
return (
<ApplicationProvider>
<EditorProvider ide={ide} settings={settings}>
<LayoutProvider $scope={ide.$scope}>
<ChatProvider>{children}</ChatProvider>
</LayoutProvider>
</EditorProvider>
</ApplicationProvider>
)
}
ContextRoot.propTypes = {
children: PropTypes.any,
ide: PropTypes.any.isRequired,
settings: PropTypes.any.isRequired
}
export const rootContext = createSharedContext(ContextRoot)