2020-12-14 06:44:10 -05:00
|
|
|
import React from 'react'
|
2021-01-27 05:30:55 -05:00
|
|
|
import PropTypes from 'prop-types'
|
2020-12-14 06:44:10 -05:00
|
|
|
import { ApplicationProvider } from './application-context'
|
|
|
|
import { EditorProvider } from './editor-context'
|
|
|
|
import createSharedContext from 'react2angular-shared-context'
|
2021-02-09 10:37:48 -05:00
|
|
|
import { ChatProvider } from '../../features/chat/context/chat-context'
|
2021-02-23 05:17:41 -05:00
|
|
|
import { LayoutProvider } from './layout-context'
|
2020-12-14 06:44:10 -05:00
|
|
|
|
2021-03-10 07:19:54 -05:00
|
|
|
export function ContextRoot({ children, ide, settings }) {
|
2020-12-14 06:44:10 -05:00
|
|
|
return (
|
|
|
|
<ApplicationProvider>
|
2021-03-10 07:19:54 -05:00
|
|
|
<EditorProvider ide={ide} settings={settings}>
|
2021-02-23 05:17:41 -05:00
|
|
|
<LayoutProvider $scope={ide.$scope}>
|
|
|
|
<ChatProvider>{children}</ChatProvider>
|
|
|
|
</LayoutProvider>
|
2021-02-09 10:37:48 -05:00
|
|
|
</EditorProvider>
|
2020-12-14 06:44:10 -05:00
|
|
|
</ApplicationProvider>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-01-27 05:30:55 -05:00
|
|
|
ContextRoot.propTypes = {
|
|
|
|
children: PropTypes.any,
|
2021-03-10 07:19:54 -05:00
|
|
|
ide: PropTypes.any.isRequired,
|
|
|
|
settings: PropTypes.any.isRequired
|
2021-01-27 05:30:55 -05:00
|
|
|
}
|
|
|
|
|
2020-12-14 06:44:10 -05:00
|
|
|
export const rootContext = createSharedContext(ContextRoot)
|