From b16a9eedec2fb9cef39ac085847e7611e15bcb11 Mon Sep 17 00:00:00 2001 From: Christiane Heiligers Date: Fri, 19 Nov 2021 16:52:56 -0700 Subject: [PATCH] Adds KibanaThemeProvider to Home app --- .../home/public/application/application.tsx | 18 +++++++++++++----- src/plugins/home/public/plugin.ts | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/plugins/home/public/application/application.tsx b/src/plugins/home/public/application/application.tsx index 18f3089c14d11..b5a340fafacc0 100644 --- a/src/plugins/home/public/application/application.tsx +++ b/src/plugins/home/public/application/application.tsx @@ -9,8 +9,13 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { ScopedHistory, CoreStart } from 'kibana/public'; -import { KibanaContextProvider, RedirectAppLinks } from '../../../kibana_react/public'; +import { ScopedHistory, CoreStart, CoreTheme } from 'kibana/public'; +import { Observable } from 'rxjs'; +import { + KibanaContextProvider, + KibanaThemeProvider, + RedirectAppLinks, +} from '../../../kibana_react/public'; // @ts-ignore import { HomeApp } from './components/home_app'; import { getServices } from './kibana_services'; @@ -19,6 +24,7 @@ import './index.scss'; export const renderApp = async ( element: HTMLElement, + theme$: Observable, coreStart: CoreStart, history: ScopedHistory ) => { @@ -45,9 +51,11 @@ export const renderApp = async ( render( - - - + + + + + , element ); diff --git a/src/plugins/home/public/plugin.ts b/src/plugins/home/public/plugin.ts index 7d0af7415640e..ac680c78f31eb 100644 --- a/src/plugins/home/public/plugin.ts +++ b/src/plugins/home/public/plugin.ts @@ -105,7 +105,7 @@ export class HomePublicPlugin i18n.translate('home.pageTitle', { defaultMessage: 'Home' }) ); const { renderApp } = await import('./application'); - return await renderApp(params.element, coreStart, params.history); + return await renderApp(params.element, params.theme$, coreStart, params.history); }, }); urlForwarding.forwardApp('home', 'home');