overleaf/services/web/frontend/js/shared/components/beta-badge.js
Alf Eaton 7c97f8ab6e Switch to new JSX runtime (#4225)
* Use new JSX runtime and update Babel Node target
* Update .eslintrc
* Remove React imports

GitOrigin-RevId: 559de0267f8f2934c56a860ea8701bb522aa861a
2021-06-24 02:06:59 +00:00

30 lines
765 B
JavaScript

import { OverlayTrigger, Tooltip } from 'react-bootstrap'
import PropTypes from 'prop-types'
export default function BetaBadge({ tooltip, url = '/beta/participate' }) {
return (
<OverlayTrigger
placement={tooltip.placement || 'bottom'}
overlay={<Tooltip id={tooltip.id}>{tooltip.text}</Tooltip>}
delayHide={100}
>
<a
href={url}
target="_blank"
rel="noopener noreferrer"
className="badge beta-badge"
>
<span className="sr-only">{tooltip.text}</span>
</a>
</OverlayTrigger>
)
}
BetaBadge.propTypes = {
tooltip: PropTypes.exact({
id: PropTypes.string.isRequired,
text: PropTypes.string.isRequired,
placement: PropTypes.string,
}),
url: PropTypes.string,
}