mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
use appropriate elements when rendering bargauge
This commit is contained in:
parent
ac31a3eac1
commit
d04e5b94ba
@ -83,19 +83,25 @@ export class BarGauge extends PureComponent<Props> {
|
||||
const { title } = this.props.value;
|
||||
const styles = getTitleStyles(this.props);
|
||||
|
||||
if (!title) {
|
||||
if (onClick) {
|
||||
return (
|
||||
<button style={styles.wrapper} onClick={onClick} className={cx(clearButtonStyles(theme), className)}>
|
||||
<button
|
||||
type="button"
|
||||
style={styles.wrapper}
|
||||
onClick={onClick}
|
||||
className={cx(clearButtonStyles(theme), className)}
|
||||
>
|
||||
<div style={styles.title}>{title}</div>
|
||||
{this.renderBarAndValue()}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<button style={styles.wrapper} onClick={onClick} className={cx(clearButtonStyles(theme), className)}>
|
||||
<div style={styles.title}>{title}</div>
|
||||
<div style={styles.wrapper} className={className}>
|
||||
{title && <div style={styles.title}>{title}</div>}
|
||||
{this.renderBarAndValue()}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user