From bf2b49085560ffc339aef66fbc29fb53f2321575 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Wed, 30 Aug 2023 14:37:16 -0400 Subject: [PATCH] [8.10] [Fleet] Fix user dark mode for integration app (#164882) (#165257) # Backport This will backport the following commits from `main` to `8.10`: - [[Fleet] Fix user dark mode for integration app (#164882)](https://github.com/elastic/kibana/pull/164882) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) --- x-pack/plugins/fleet/public/applications/fleet/app.tsx | 2 +- x-pack/plugins/fleet/public/applications/integrations/app.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/fleet/public/applications/fleet/app.tsx b/x-pack/plugins/fleet/public/applications/fleet/app.tsx index d7b8172e70c3e..e7a513e113c4f 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/app.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/app.tsx @@ -255,7 +255,7 @@ export const FleetAppContext: React.FC<{ theme$, fleetStatus, }) => { - const darkModeObservable = useObservable(startServices.theme.theme$); + const darkModeObservable = useObservable(theme$); const isDarkMode = darkModeObservable && darkModeObservable.darkMode; return ( diff --git a/x-pack/plugins/fleet/public/applications/integrations/app.tsx b/x-pack/plugins/fleet/public/applications/integrations/app.tsx index 6212a1dffdb7b..83b57093a95c7 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/app.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/app.tsx @@ -75,7 +75,9 @@ export const IntegrationsAppContext: React.FC<{ theme$, fleetStatus, }) => { - const isDarkMode = useObservable(startServices.uiSettings.get$('theme:darkMode')); + const theme = useObservable(theme$); + const isDarkMode = theme && theme.darkMode; + const CloudContext = startServices.cloud?.CloudContextProvider || EmptyContext; return (