mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
d78644e02c
[ReactNavToolbar] Collaborators widget GitOrigin-RevId: 65f2484962591103f02eb7624a974d0806b1abf0
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
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,
|
|
openDoc,
|
|
onlineUsersArray
|
|
}) {
|
|
return (
|
|
<ApplicationProvider>
|
|
<EditorProvider
|
|
loading={editorLoading}
|
|
chatIsOpenAngular={chatIsOpenAngular}
|
|
setChatIsOpenAngular={setChatIsOpenAngular}
|
|
openDoc={openDoc}
|
|
onlineUsersArray={onlineUsersArray}
|
|
>
|
|
<ChatProvider>{children}</ChatProvider>
|
|
</EditorProvider>
|
|
</ApplicationProvider>
|
|
)
|
|
}
|
|
|
|
ContextRoot.propTypes = {
|
|
children: PropTypes.any,
|
|
editorLoading: PropTypes.bool,
|
|
chatIsOpenAngular: PropTypes.bool,
|
|
setChatIsOpenAngular: PropTypes.func.isRequired,
|
|
openDoc: PropTypes.func.isRequired,
|
|
onlineUsersArray: PropTypes.array.isRequired
|
|
}
|
|
|
|
export const rootContext = createSharedContext(ContextRoot)
|