Skip to content

Commit

Permalink
feat: add header tooltip (#7556)
Browse files Browse the repository at this point in the history
* feat: add header tooltip (#7531)
  • Loading branch information
khtruong authored and xtinec committed May 20, 2019
1 parent dcafabd commit c79077d
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
SortIndicator,
} from 'react-virtualized';
import { getTextDimension } from '@superset-ui/dimension';
import TooltipWrapper from '../TooltipWrapper';

function getTextWidth(text, font = '12px Roboto') {
return getTextDimension({ text, style: { font } }).width;
Expand Down Expand Up @@ -138,12 +139,14 @@ export default class FilterableTable extends PureComponent {

headerRenderer({ dataKey, label, sortBy, sortDirection }) {
return (
<div className="header-style">
{label}
{sortBy === dataKey &&
<SortIndicator sortDirection={sortDirection} />
}
</div>
<TooltipWrapper label="header" tooltip={label}>
<div className="header-style">
{label}
{sortBy === dataKey &&
<SortIndicator sortDirection={sortDirection} />
}
</div>
</TooltipWrapper>
);
}

Expand Down

0 comments on commit c79077d

Please sign in to comment.