Commit 0a5f920b by Johannes Schill

panel-header: Avoid undefined classNames and use the real panel description

parent af859b2f
......@@ -68,6 +68,8 @@ export default function withPopper(WrappedComponent) {
render() {
const { show, placement } = this.state;
const className = this.props.className || '';
return (
<WrappedComponent
{...this.props}
......@@ -76,6 +78,7 @@ export default function withPopper(WrappedComponent) {
renderContent={this.renderContent}
show={show}
placement={placement}
className={className}
/>
);
}
......
......@@ -42,15 +42,16 @@ export class PanelHeader extends PureComponent<Props, State> {
const isLoading = false;
const panelHeaderClass = classNames({ 'panel-header': true, 'grid-drag-handle': !isFullscreen });
const { panel, dashboard, timeInfo } = this.props;
const cornerCssClass = panel.description ? 'panel-info-corner--info' : '';
return (
<div className={panelHeaderClass}>
<Tooltip content="hello world">
<span className={`panel-info-corner ${cornerCssClass}`}>
<i className="fa" />
<span className="panel-info-corner-inner" />
</span>
</Tooltip>
{panel.description && (
<Tooltip content={panel.description}>
<span className="panel-info-corner panel-info-corner--info">
<i className="fa" />
<span className="panel-info-corner-inner" />
</span>
</Tooltip>
)}
{isLoading && (
<span className="panel-loading">
<i className="fa fa-spinner fa-spin" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment