Commit 5448b72f by Hugo Häggmark

Passed the theme to Gauge

parent 8ccf212f
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { PanelProps, NullValueMode, Gauge } from '@grafana/ui'; import { PanelProps, NullValueMode, Gauge, Themes } from '@grafana/ui';
import { getTimeSeriesVMs } from './timeSeries'; import { getTimeSeriesVMs } from './timeSeries';
import { GaugeOptions } from './types'; import { GaugeOptions } from './types';
import { contextSrv } from 'app/core/core';
interface Props extends PanelProps<GaugeOptions> {} interface Props extends PanelProps<GaugeOptions> {}
export class GaugePanel extends PureComponent<Props> { export class GaugePanel extends PureComponent<Props> {
getTheme() {
return contextSrv.user.lightTheme ? Themes.Light : Themes.Dark;
}
render() { render() {
const { timeSeries, width, height, onInterpolate, options } = this.props; const { timeSeries, width, height, onInterpolate, options } = this.props;
...@@ -26,6 +31,7 @@ export class GaugePanel extends PureComponent<Props> { ...@@ -26,6 +31,7 @@ export class GaugePanel extends PureComponent<Props> {
height={height} height={height}
prefix={prefix} prefix={prefix}
suffix={suffix} suffix={suffix}
theme={this.getTheme()}
/> />
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment