kibana/x-pack/plugins/searchprofiler/public/application/index.tsx
CJ Cenizal a83b8ffbb2
Conform Search Profiler application organization to other ES UI plugins (#82085)
* Add testing steps to README.
* Update Search Profiler application organization to conform to organization of other ES UI plugins.
* Organize styles to live alongside the components they decorate.
2020-11-02 12:01:27 -08:00

43 lines
1.2 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { HttpStart as Http, ToastsSetup } from 'kibana/public';
import { LicenseStatus } from '../../common';
import { App } from './app';
import { AppContextProvider } from './contexts/app_context';
import { ProfileContextProvider } from './contexts/profiler_context';
interface AppDependencies {
el: HTMLElement;
http: Http;
I18nContext: any;
notifications: ToastsSetup;
initialLicenseStatus: LicenseStatus;
}
export const renderApp = ({
el,
http,
I18nContext,
notifications,
initialLicenseStatus,
}: AppDependencies) => {
render(
<I18nContext>
<AppContextProvider args={{ initialLicenseStatus, notifications, http }}>
<ProfileContextProvider>
<App />
</ProfileContextProvider>
</AppContextProvider>
</I18nContext>,
el
);
return () => unmountComponentAtNode(el);
};