feat: add header tooltip (#7556)

* feat: add header tooltip (#7531)
This commit is contained in:
Kim Truong 2019-05-20 12:04:42 -07:00 committed by Christine Chambers
parent dcafabd183
commit c79077d85d
1 changed files with 9 additions and 6 deletions

View File

@ -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;
@ -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>
);
}