From 39e2830e70347860915eb132e23de7057fe00feb Mon Sep 17 00:00:00 2001 From: Claudio Procida Date: Tue, 21 Dec 2021 17:09:14 +0100 Subject: [PATCH] Fixes missing EUI theme in context --- .../public/application/app.tsx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/app.tsx b/x-pack/plugins/triggers_actions_ui/public/application/app.tsx index 441a86ff491d4..504f9256d0283 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/app.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/app.tsx @@ -10,6 +10,7 @@ import { Switch, Route, Redirect, Router } from 'react-router-dom'; import { ChromeBreadcrumb, CoreStart, CoreTheme, ScopedHistory } from 'kibana/public'; import { render, unmountComponentAtNode } from 'react-dom'; import { I18nProvider } from '@kbn/i18n-react'; +import useObservable from 'react-use/lib/useObservable'; import { Observable } from 'rxjs'; import { KibanaFeature } from '../../../features/common'; import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; @@ -22,6 +23,7 @@ import type { SpacesPluginStart } from '../../../spaces/public'; import { suspendedComponentWithProps } from './lib/suspended_component_with_props'; import { Storage } from '../../../../../src/plugins/kibana_utils/public'; +import { EuiThemeProvider } from '../../../../../src/plugins/kibana_react/common'; import { setSavedObjectsClient } from '../common/lib/data_apis'; import { KibanaContextProvider } from '../common/lib/kibana'; @@ -56,20 +58,23 @@ export const renderApp = (deps: TriggersAndActionsUiServices) => { }; export const App = ({ deps }: { deps: TriggersAndActionsUiServices }) => { - const { savedObjects, theme$ } = deps; + const { savedObjects, uiSettings, theme$ } = deps; const sections: Section[] = ['rules', 'connectors']; + const isDarkMode = useObservable(uiSettings.get$('theme:darkMode')); const sectionsRegex = sections.join('|'); setSavedObjectsClient(savedObjects.client); return ( - - - - - - - + + + + + + + + + ); };