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, SortIndicator,
} from 'react-virtualized'; } from 'react-virtualized';
import { getTextDimension } from '@superset-ui/dimension'; import { getTextDimension } from '@superset-ui/dimension';
import TooltipWrapper from '../TooltipWrapper';
function getTextWidth(text, font = '12px Roboto') { function getTextWidth(text, font = '12px Roboto') {
return getTextDimension({ text, style: { font } }).width; return getTextDimension({ text, style: { font } }).width;
@ -138,12 +139,14 @@ export default class FilterableTable extends PureComponent {
headerRenderer({ dataKey, label, sortBy, sortDirection }) { headerRenderer({ dataKey, label, sortBy, sortDirection }) {
return ( return (
<div className="header-style"> <TooltipWrapper label="header" tooltip={label}>
{label} <div className="header-style">
{sortBy === dataKey && {label}
<SortIndicator sortDirection={sortDirection} /> {sortBy === dataKey &&
} <SortIndicator sortDirection={sortDirection} />
</div> }
</div>
</TooltipWrapper>
); );
} }