Fix building after update to Grafana 8 components
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { FC } from 'react';
|
||||
import { cx, css } from 'emotion';
|
||||
import { cx, css } from '@emotion/css';
|
||||
import { stylesFactory, useTheme } from '@grafana/ui';
|
||||
import { GrafanaTheme, GrafanaThemeType } from '@grafana/data';
|
||||
import { FAIcon } from '../FAIcon/FAIcon';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { config, GrafanaBootConfig } from '@grafana/runtime';
|
||||
import { ThemeContext, getTheme } from '@grafana/ui';
|
||||
import { GrafanaThemeType } from '@grafana/data';
|
||||
import { ThemeContext } from '@grafana/ui';
|
||||
import { createTheme } from '@grafana/data';
|
||||
|
||||
export const ConfigContext = React.createContext<GrafanaBootConfig>(config);
|
||||
export const ConfigConsumer = ConfigContext.Consumer;
|
||||
@@ -14,10 +14,11 @@ export const provideConfig = (component: React.ComponentType<any>) => {
|
||||
return ConfigProvider;
|
||||
};
|
||||
|
||||
export const getCurrentThemeName = () =>
|
||||
config.bootData.user.lightTheme ? GrafanaThemeType.Light : GrafanaThemeType.Dark;
|
||||
|
||||
export const getCurrentTheme = () => getTheme(getCurrentThemeName());
|
||||
export const getCurrentTheme = () => createTheme({
|
||||
colors: {
|
||||
mode: config.bootData.user.lightTheme ? 'light' : 'dark',
|
||||
},
|
||||
});
|
||||
|
||||
export const ThemeProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { FC } from 'react';
|
||||
import { cx } from 'emotion';
|
||||
import { cx } from '@emotion/css';
|
||||
|
||||
interface Props {
|
||||
icon: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { FC } from 'react';
|
||||
import { cx } from 'emotion';
|
||||
import { cx } from '@emotion/css';
|
||||
|
||||
interface Props {
|
||||
status: 'critical' | 'warning' | 'online' | 'ok' | 'problem';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { FC } from 'react';
|
||||
import { cx, css } from 'emotion';
|
||||
import { cx, css } from '@emotion/css';
|
||||
import { Manager, Popper as ReactPopper, Reference } from 'react-popper';
|
||||
import Transition from 'react-transition-group/Transition';
|
||||
import { stylesFactory } from '@grafana/ui';
|
||||
|
||||
Reference in New Issue
Block a user