mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
a555f0d309
* 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
27 lines
871 B
JavaScript
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)
|