1717 * under the License.
1818 */
1919import React , { FC , useEffect , useMemo , useRef } from 'react' ;
20+ import { Global } from '@emotion/react' ;
2021import { useHistory } from 'react-router-dom' ;
2122import {
2223 CategoricalColorNamespace ,
@@ -25,6 +26,7 @@ import {
2526 isFeatureEnabled ,
2627 SharedLabelColorSource ,
2728 t ,
29+ useTheme ,
2830} from '@superset-ui/core' ;
2931import pick from 'lodash/pick' ;
3032import { useDispatch , useSelector } from 'react-redux' ;
@@ -57,6 +59,7 @@ import { DashboardContextForExplore } from 'src/types/DashboardContextForExplore
5759import shortid from 'shortid' ;
5860import { RootState } from '../types' ;
5961import { getActiveFilters } from '../util/activeDashboardFilters' ;
62+ import { filterCardPopoverStyle , headerStyles } from '../styles' ;
6063
6164export const DashboardPageIdContext = React . createContext ( '' ) ;
6265
@@ -140,6 +143,7 @@ const useSyncDashboardStateWithLocalStorage = () => {
140143} ;
141144
142145export const DashboardPage : FC < PageProps > = ( { idOrSlug } : PageProps ) => {
146+ const theme = useTheme ( ) ;
143147 const dispatch = useDispatch ( ) ;
144148 const history = useHistory ( ) ;
145149 const dashboardPageId = useSyncDashboardStateWithLocalStorage ( ) ;
@@ -274,9 +278,12 @@ export const DashboardPage: FC<PageProps> = ({ idOrSlug }: PageProps) => {
274278 if ( ! readyToRender ) return < Loading /> ;
275279
276280 return (
277- < DashboardPageIdContext . Provider value = { dashboardPageId } >
278- < DashboardContainer />
279- </ DashboardPageIdContext . Provider >
281+ < >
282+ < Global styles = { [ filterCardPopoverStyle ( theme ) , headerStyles ( theme ) ] } />
283+ < DashboardPageIdContext . Provider value = { dashboardPageId } >
284+ < DashboardContainer />
285+ </ DashboardPageIdContext . Provider >
286+ </ >
280287 ) ;
281288} ;
282289
0 commit comments