mirror of
https://github.com/apache/superset.git
synced 2026-04-10 20:06:13 +00:00
* Fixing PropTypes warning message React recently started warning on the upcoming deprecation of React.PropTypes, the new approach is to use the `prop-types` npm package instead. * Fixing the tests
23 lines
601 B
JavaScript
23 lines
601 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { Tooltip, OverlayTrigger } from 'react-bootstrap';
|
|
import { slugify } from '../modules/utils';
|
|
|
|
const propTypes = {
|
|
label: PropTypes.string.isRequired,
|
|
tooltip: PropTypes.string.isRequired,
|
|
};
|
|
|
|
export default function InfoTooltipWithTrigger({ label, tooltip }) {
|
|
return (
|
|
<OverlayTrigger
|
|
placement="right"
|
|
overlay={<Tooltip id={`${slugify(label)}-tooltip`}>{tooltip}</Tooltip>}
|
|
>
|
|
<i className="fa fa-question-circle-o" />
|
|
</OverlayTrigger>
|
|
);
|
|
}
|
|
|
|
InfoTooltipWithTrigger.propTypes = propTypes;
|