mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
5e9af2c15c
GitOrigin-RevId: f373f4215e5f25d14256008cf5f6582eb3124431
35 lines
905 B
JavaScript
35 lines
905 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} className={tooltip.className}>
|
|
{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.shape({
|
|
id: PropTypes.string.isRequired,
|
|
text: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
placement: PropTypes.string,
|
|
className: PropTypes.string,
|
|
}),
|
|
url: PropTypes.string,
|
|
}
|