mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
import type { DiContainerForInjection } from "@ogre-tools/injectable";
|
|
import { computedInjectManyInjectable } from "@ogre-tools/injectable-extension-for-mobx";
|
|
import { DiContextProvider } from "@ogre-tools/injectable-react";
|
|
import { flow, identity } from "lodash/fp";
|
|
import { observer } from "mobx-react";
|
|
import React from "react";
|
|
import { reactApplicationWrapperInjectionToken } from "./react-application-wrapper-injection-token";
|
|
|
|
import { ReactApplicationContent } from "./react-application-content";
|
|
|
|
interface ReactApplicationProps {
|
|
di: DiContainerForInjection;
|
|
}
|
|
|
|
export const ReactApplication = observer(({ di }: ReactApplicationProps) => {
|
|
const computedInjectMany = di.inject(computedInjectManyInjectable);
|
|
|
|
const wrappers = computedInjectMany(reactApplicationWrapperInjectionToken);
|
|
|
|
const ContentWithWrappers = flow(identity, ...wrappers.get())(ReactApplicationContent);
|
|
|
|
return (
|
|
<DiContextProvider value={{ di }}>
|
|
<ContentWithWrappers />
|
|
</DiContextProvider>
|
|
);
|
|
});
|