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) { ...@@ -68,6 +68,8 @@ export default function withPopper(WrappedComponent) {
render() { render() {
const { show, placement } = this.state; const { show, placement } = this.state;
const className = this.props.className || '';
return ( return (
<WrappedComponent <WrappedComponent
{...this.props} {...this.props}
...@@ -76,6 +78,7 @@ export default function withPopper(WrappedComponent) { ...@@ -76,6 +78,7 @@ export default function withPopper(WrappedComponent) {
renderContent={this.renderContent} renderContent={this.renderContent}
show={show} show={show}
placement={placement} placement={placement}
className={className}
/> />
); );
} }
......
...@@ -42,15 +42,16 @@ export class PanelHeader extends PureComponent<Props, State> { ...@@ -42,15 +42,16 @@ export class PanelHeader extends PureComponent<Props, State> {
const isLoading = false; const isLoading = false;
const panelHeaderClass = classNames({ 'panel-header': true, 'grid-drag-handle': !isFullscreen }); const panelHeaderClass = classNames({ 'panel-header': true, 'grid-drag-handle': !isFullscreen });
const { panel, dashboard, timeInfo } = this.props; const { panel, dashboard, timeInfo } = this.props;
const cornerCssClass = panel.description ? 'panel-info-corner--info' : '';
return ( return (
<div className={panelHeaderClass}> <div className={panelHeaderClass}>
<Tooltip content="hello world"> {panel.description && (
<span className={`panel-info-corner ${cornerCssClass}`}> <Tooltip content={panel.description}>
<i className="fa" /> <span className="panel-info-corner panel-info-corner--info">
<span className="panel-info-corner-inner" /> <i className="fa" />
</span> <span className="panel-info-corner-inner" />
</Tooltip> </span>
</Tooltip>
)}
{isLoading && ( {isLoading && (
<span className="panel-loading"> <span className="panel-loading">
<i className="fa fa-spinner fa-spin" /> <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