Skip to content

Commit

Permalink
Update theme provider
Browse files Browse the repository at this point in the history
  • Loading branch information
fkanout committed Dec 27, 2024
1 parent b9500b4 commit 293c1d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ReactDOM from 'react-dom';
import { i18n } from '@kbn/i18n';
import { Router, Routes, Route } from '@kbn/shared-ux-router';
import { AppMountParameters, APP_WRAPPER_CLASS, CoreStart } from '@kbn/core/public';
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
import { EuiThemeProvider } from '@elastic/eui';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app';
Expand Down Expand Up @@ -53,7 +53,6 @@ export const renderApp = ({
isDev?: boolean;
}) => {
const { element, history } = appMountParameters;
const isDarkMode = core.theme.getTheme().darkMode;

core.chrome.setHelpExtension({
appName: i18n.translate('xpack.exploratoryView.feedbackMenu.appName', {
Expand Down Expand Up @@ -85,7 +84,7 @@ export const renderApp = ({
}}
>
<Router history={history}>
<EuiThemeProvider darkMode={isDarkMode}>
<EuiThemeProvider>
<div className={APP_WRAPPER_CLASS} data-test-subj="exploratoryViewMainContainer">
<RedirectAppLinks
coreStart={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React, { useCallback, useMemo, useState, useEffect } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui';
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
import { EuiThemeProvider } from '@elastic/eui';
import type { AnalyticsServiceSetup, CoreStart } from '@kbn/core/public';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { EuiErrorBoundary } from '@elastic/eui';
Expand Down Expand Up @@ -71,8 +71,6 @@ export function getExploratoryViewEmbeddable(

const series = attributes[0];

const isDarkMode = theme?.getTheme().darkMode ?? false;

const { data: lensHelper, loading: lensLoading } = useFetcher(async () => {
if (lenStateHelperPromise) {
return lenStateHelperPromise;
Expand Down Expand Up @@ -132,7 +130,7 @@ export function getExploratoryViewEmbeddable(

return (
<EuiErrorBoundary>
<EuiThemeProvider darkMode={isDarkMode}>
<EuiThemeProvider>
<KibanaContextProvider services={services}>
<Wrapper customHeight={props.customHeight} data-test-subj={props.dataTestSubj}>
<ExploratoryViewEmbeddable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { CoreStart } from '@kbn/core/public';
import { I18nProvider } from '@kbn/i18n-react';
import { coreMock, themeServiceMock } from '@kbn/core/public/mocks';
import { KibanaContextProvider, KibanaServices } from '@kbn/kibana-react-plugin/public';
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
import { EuiThemeProvider } from '@elastic/eui';
import { lensPluginMock } from '@kbn/lens-plugin/public/mocks';
import { setIndexPatterns } from '@kbn/unified-search-plugin/public/services';
import type { DataView, DataViewsContract } from '@kbn/data-views-plugin/public';
Expand Down Expand Up @@ -159,7 +159,7 @@ export function MockKibanaProvider<ExtraCore extends Partial<CoreStart>>({

return (
<KibanaContextProvider services={{ ...core }} {...kibanaProps}>
<EuiThemeProvider darkMode={false}>
<EuiThemeProvider>
<I18nProvider>
<DataViewContextProvider>{children}</DataViewContextProvider>
</I18nProvider>
Expand Down

0 comments on commit 293c1d0

Please sign in to comment.