mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
Explore: updates live button to responsive button
This commit is contained in:
parent
8d9197bed2
commit
f0264ebe43
@ -304,6 +304,7 @@ export class UnConnectedExploreToolbar extends PureComponent<Props, {}> {
|
||||
<LiveTailControls exploreId={exploreId}>
|
||||
{controls => (
|
||||
<LiveTailButton
|
||||
splitted={splitted}
|
||||
isLive={isLive}
|
||||
isPaused={isPaused}
|
||||
start={controls.start}
|
||||
|
@ -4,6 +4,7 @@ import { css } from 'emotion';
|
||||
import memoizeOne from 'memoize-one';
|
||||
import tinycolor from 'tinycolor2';
|
||||
import { CSSTransition } from 'react-transition-group';
|
||||
import { ResponsiveButton } from './ResponsiveButton';
|
||||
|
||||
import { GrafanaTheme, useTheme, Tooltip } from '@grafana/ui';
|
||||
|
||||
@ -96,6 +97,7 @@ const defaultLiveTooltip = () => {
|
||||
};
|
||||
|
||||
type LiveTailButtonProps = {
|
||||
splitted: boolean;
|
||||
start: () => void;
|
||||
stop: () => void;
|
||||
pause: () => void;
|
||||
@ -104,7 +106,7 @@ type LiveTailButtonProps = {
|
||||
isPaused: boolean;
|
||||
};
|
||||
export function LiveTailButton(props: LiveTailButtonProps) {
|
||||
const { start, pause, resume, isLive, isPaused, stop } = props;
|
||||
const { start, pause, resume, isLive, isPaused, stop, splitted } = props;
|
||||
const theme = useTheme();
|
||||
const styles = getStyles(theme);
|
||||
|
||||
@ -113,17 +115,17 @@ export function LiveTailButton(props: LiveTailButtonProps) {
|
||||
return (
|
||||
<>
|
||||
<Tooltip content={defaultLiveTooltip} placement="bottom">
|
||||
<button
|
||||
className={classNames('btn navbar-button', styles.liveButton, {
|
||||
<ResponsiveButton
|
||||
splitted={splitted}
|
||||
buttonClassName={classNames('btn navbar-button', styles.liveButton, {
|
||||
[`btn--radius-right-0 ${styles.noRightBorderStyle}`]: isLive,
|
||||
[styles.isLive]: isLive && !isPaused,
|
||||
[styles.isPaused]: isLive && isPaused,
|
||||
})}
|
||||
iconClassName={classNames('fa', isPaused || !isLive ? 'fa-play' : 'fa-pause')}
|
||||
onClick={onClickMain}
|
||||
>
|
||||
<i className={classNames('fa', isPaused || !isLive ? 'fa-play' : 'fa-pause')} />
|
||||
<span> Live</span>
|
||||
</button>
|
||||
title={'\xa0Live'}
|
||||
/>
|
||||
</Tooltip>
|
||||
<CSSTransition
|
||||
mountOnEnter={true}
|
||||
|
Loading…
Reference in New Issue
Block a user