mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 05:11:34 +02:00
* 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
35 lines
954 B
JavaScript
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)
|