Explore: use GrafanaTheme2 (#37305)

* Explore: refactor to use GrafanaTheme2

* Explore: change style values

* Explore: change styles

* Explore: change last style values to the correct ones

* Explore: remove stylesFactory

* Update public/app/features/explore/Logs.tsx

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* Update public/app/features/explore/Logs.tsx

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* Update public/app/features/explore/Logs.tsx

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
pull/37407/head
Olof Bourghardt 4 years ago committed by GitHub
parent e5f52a05f2
commit bc6e7d32e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      public/app/features/explore/Logs.tsx

@ -16,9 +16,9 @@ import {
LogsSortOrder, LogsSortOrder,
LinkModel, LinkModel,
Field, Field,
GrafanaTheme,
DataQuery, DataQuery,
DataFrame, DataFrame,
GrafanaTheme2,
} from '@grafana/data'; } from '@grafana/data';
import { import {
RadioButtonGroup, RadioButtonGroup,
@ -27,9 +27,9 @@ import {
InlineField, InlineField,
InlineFieldRow, InlineFieldRow,
InlineSwitch, InlineSwitch,
withTheme, withTheme2,
stylesFactory,
TooltipDisplayMode, TooltipDisplayMode,
Themeable2,
} from '@grafana/ui'; } from '@grafana/ui';
import store from 'app/core/store'; import store from 'app/core/store';
import { dedupLogRows, filterLogLevels } from 'app/core/logs_model'; import { dedupLogRows, filterLogLevels } from 'app/core/logs_model';
@ -45,14 +45,14 @@ const SETTINGS_KEYS = {
prettifyLogMessage: 'grafana.explore.logs.prettifyLogMessage', prettifyLogMessage: 'grafana.explore.logs.prettifyLogMessage',
}; };
interface Props { interface Props extends Themeable2 {
width: number; width: number;
logRows: LogRowModel[]; logRows: LogRowModel[];
logsMeta?: LogsMetaItem[]; logsMeta?: LogsMetaItem[];
logsSeries?: DataFrame[]; logsSeries?: DataFrame[];
logsQueries?: DataQuery[]; logsQueries?: DataQuery[];
visibleRange?: AbsoluteTimeRange; visibleRange?: AbsoluteTimeRange;
theme: GrafanaTheme; theme: GrafanaTheme2;
highlighterExpressions?: string[]; highlighterExpressions?: string[];
loading: boolean; loading: boolean;
absoluteRange: AbsoluteTimeRange; absoluteRange: AbsoluteTimeRange;
@ -418,9 +418,9 @@ export class UnthemedLogs extends PureComponent<Props, State> {
} }
} }
export const Logs = withTheme(UnthemedLogs); export const Logs = withTheme2(UnthemedLogs);
const getStyles = stylesFactory((theme: GrafanaTheme) => { const getStyles = (theme: GrafanaTheme2) => {
return { return {
noData: css` noData: css`
> * { > * {
@ -432,17 +432,17 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
justify-content: space-between; justify-content: space-between;
align-items: baseline; align-items: baseline;
flex-wrap: wrap; flex-wrap: wrap;
background-color: ${theme.colors.bg1}; background-color: ${theme.colors.background.primary};
padding: ${theme.spacing.sm} ${theme.spacing.md}; padding: ${theme.spacing(1, 2)};
border-radius: ${theme.border.radius.md}; border-radius: ${theme.shape.borderRadius()};
margin: ${theme.spacing.md} 0 ${theme.spacing.sm}; margin: ${theme.spacing(2, 0, 1)};
border: 1px solid ${theme.colors.border2}; border: 1px solid ${theme.colors.border.medium};
`, `,
flipButton: css` flipButton: css`
margin: ${theme.spacing.xs} 0 0 ${theme.spacing.sm}; margin: ${theme.spacing(0.5, 0, 0, 1)};
`, `,
radioButtons: css` radioButtons: css`
margin: 0 ${theme.spacing.sm}; margin: 0 ${theme.spacing(1)};
`, `,
logsSection: css` logsSection: css`
display: flex; display: flex;
@ -455,7 +455,7 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
`, `,
infoText: css` infoText: css`
font-size: ${theme.typography.size.sm}; font-size: ${theme.typography.size.sm};
color: ${theme.colors.textWeak}; color: ${theme.colors.text.secondary};
`, `,
}; };
}); };

Loading…
Cancel
Save