mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -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 { css } from '@emotion/css';
|
||||
import { CSSTransition } from 'react-transition-group';
|
||||
import { useTheme, Tooltip, stylesFactory, ButtonGroup, ToolbarButton } from '@grafana/ui';
|
||||
import { GrafanaTheme } from '@grafana/data';
|
||||
import { Tooltip, ButtonGroup, ToolbarButton } from '@grafana/ui';
|
||||
|
||||
type LiveTailButtonProps = {
|
||||
splitted: boolean;
|
||||
@ -16,8 +15,6 @@ type LiveTailButtonProps = {
|
||||
|
||||
export function LiveTailButton(props: LiveTailButtonProps) {
|
||||
const { start, pause, resume, isLive, isPaused, stop, splitted } = props;
|
||||
const theme = useTheme();
|
||||
const styles = getStyles(theme);
|
||||
const buttonVariant = isLive && !isPaused ? 'active' : 'default';
|
||||
const onClickMain = isLive ? (isPaused ? resume : pause) : start;
|
||||
|
||||
@ -57,29 +54,27 @@ export function LiveTailButton(props: LiveTailButtonProps) {
|
||||
);
|
||||
}
|
||||
|
||||
const getStyles = stylesFactory((theme: GrafanaTheme) => {
|
||||
return {
|
||||
stopButtonEnter: css`
|
||||
label: stopButtonEnter;
|
||||
width: 0;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
`,
|
||||
stopButtonEnterActive: css`
|
||||
label: stopButtonEnterActive;
|
||||
opacity: 1;
|
||||
width: 32px;
|
||||
`,
|
||||
stopButtonExit: css`
|
||||
label: stopButtonExit;
|
||||
width: 32px;
|
||||
opacity: 1;
|
||||
overflow: hidden;
|
||||
`,
|
||||
stopButtonExitActive: css`
|
||||
label: stopButtonExitActive;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
`,
|
||||
};
|
||||
});
|
||||
const styles = {
|
||||
stopButtonEnter: css`
|
||||
label: stopButtonEnter;
|
||||
width: 0;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
`,
|
||||
stopButtonEnterActive: css`
|
||||
label: stopButtonEnterActive;
|
||||
opacity: 1;
|
||||
width: 32px;
|
||||
`,
|
||||
stopButtonExit: css`
|
||||
label: stopButtonExit;
|
||||
width: 32px;
|
||||
opacity: 1;
|
||||
overflow: hidden;
|
||||
`,
|
||||
stopButtonExitActive: css`
|
||||
label: stopButtonExitActive;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
`,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user