Files
overleaf-cep/services/web/frontend/js/shared/context/root-context.js
Miguel Serrano 260b878b7d [ReactNavToolbar] Chat Toggle Button + chat-context (#3625)
* Added toggle chat button to navigation header

* new `useBrowserWindow` hook to work with browser title and focus

* react2angular chat toggle button plumbing

GitOrigin-RevId: 4380f1db9c7cc9a25bfb8d7a33e18d61b1d32993
2021-02-10 03:04:39 +00:00

35 lines
954 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'
export function ContextRoot({
children,
editorLoading,
chatIsOpenAngular,
setChatIsOpenAngular
}) {
return (
<ApplicationProvider>
<EditorProvider
loading={editorLoading}
chatIsOpenAngular={chatIsOpenAngular}
setChatIsOpenAngular={setChatIsOpenAngular}
>
<ChatProvider>{children}</ChatProvider>
</EditorProvider>
</ApplicationProvider>
)
}
ContextRoot.propTypes = {
children: PropTypes.any,
editorLoading: PropTypes.bool,
chatIsOpenAngular: PropTypes.bool,
setChatIsOpenAngular: PropTypes.func.isRequired
}
export const rootContext = createSharedContext(ContextRoot)