mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: use GrafanaTheme2 (LiveTailButton component) (#37516)
* Explore: use GrafanaTheme2 in LiveTailsButton * Remove unused theme
This commit is contained in:
parent
d43d9207ee
commit
28cf93e42c
@ -1,8 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { css } from '@emotion/css';
|
import { css } from '@emotion/css';
|
||||||
import { CSSTransition } from 'react-transition-group';
|
import { CSSTransition } from 'react-transition-group';
|
||||||
import { useTheme, Tooltip, stylesFactory, ButtonGroup, ToolbarButton } from '@grafana/ui';
|
import { Tooltip, ButtonGroup, ToolbarButton } from '@grafana/ui';
|
||||||
import { GrafanaTheme } from '@grafana/data';
|
|
||||||
|
|
||||||
type LiveTailButtonProps = {
|
type LiveTailButtonProps = {
|
||||||
splitted: boolean;
|
splitted: boolean;
|
||||||
@ -16,8 +15,6 @@ type LiveTailButtonProps = {
|
|||||||
|
|
||||||
export function LiveTailButton(props: LiveTailButtonProps) {
|
export function LiveTailButton(props: LiveTailButtonProps) {
|
||||||
const { start, pause, resume, isLive, isPaused, stop, splitted } = props;
|
const { start, pause, resume, isLive, isPaused, stop, splitted } = props;
|
||||||
const theme = useTheme();
|
|
||||||
const styles = getStyles(theme);
|
|
||||||
const buttonVariant = isLive && !isPaused ? 'active' : 'default';
|
const buttonVariant = isLive && !isPaused ? 'active' : 'default';
|
||||||
const onClickMain = isLive ? (isPaused ? resume : pause) : start;
|
const onClickMain = isLive ? (isPaused ? resume : pause) : start;
|
||||||
|
|
||||||
@ -57,8 +54,7 @@ export function LiveTailButton(props: LiveTailButtonProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const getStyles = stylesFactory((theme: GrafanaTheme) => {
|
const styles = {
|
||||||
return {
|
|
||||||
stopButtonEnter: css`
|
stopButtonEnter: css`
|
||||||
label: stopButtonEnter;
|
label: stopButtonEnter;
|
||||||
width: 0;
|
width: 0;
|
||||||
@ -82,4 +78,3 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
|
|||||||
width: 0;
|
width: 0;
|
||||||
`,
|
`,
|
||||||
};
|
};
|
||||||
});
|
|
||||||
|
Loading…
Reference in New Issue
Block a user