Epxplore: use GrafanaTheme (SecondaryActions component) (#37543)

This commit is contained in:
Olof Bourghardt 2021-08-09 08:47:47 +02:00 committed by GitHub
parent ff1837a768
commit e300696792
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { css, cx } from '@emotion/css'; import { css, cx } from '@emotion/css';
import { GrafanaTheme } from '@grafana/data'; import { GrafanaTheme2 } from '@grafana/data';
import { stylesFactory, Button, HorizontalGroup, useTheme } from '@grafana/ui'; import { Button, HorizontalGroup, useTheme2 } from '@grafana/ui';
type Props = { type Props = {
addQueryRowButtonDisabled?: boolean; addQueryRowButtonDisabled?: boolean;
@ -14,15 +14,15 @@ type Props = {
onClickQueryInspectorButton: () => void; onClickQueryInspectorButton: () => void;
}; };
const getStyles = stylesFactory((theme: GrafanaTheme) => { const getStyles = (theme: GrafanaTheme2) => {
return { return {
containerMargin: css` containerMargin: css`
margin-top: ${theme.spacing.md}; margin-top: ${theme.spacing(2)};
`, `,
}; };
}); };
export function SecondaryActions(props: Props) { export function SecondaryActions(props: Props) {
const theme = useTheme(); const theme = useTheme2();
const styles = getStyles(theme); const styles = getStyles(theme);
return ( return (
<div className={styles.containerMargin}> <div className={styles.containerMargin}>