2021-03-31 06:46:04 -04:00
|
|
|
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
|
2021-06-17 11:37:48 -04:00
|
|
|
export default function BetaBadge({ tooltip, url = '/beta/participate' }) {
|
2021-03-31 06:46:04 -04:00
|
|
|
return (
|
|
|
|
<OverlayTrigger
|
2021-05-25 05:58:54 -04:00
|
|
|
placement={tooltip.placement || 'bottom'}
|
2022-02-21 06:16:49 -05:00
|
|
|
overlay={
|
|
|
|
<Tooltip id={tooltip.id} className={tooltip.className}>
|
|
|
|
{tooltip.text}
|
|
|
|
</Tooltip>
|
|
|
|
}
|
2021-03-31 06:46:04 -04:00
|
|
|
delayHide={100}
|
|
|
|
>
|
|
|
|
<a
|
2021-06-17 11:37:48 -04:00
|
|
|
href={url}
|
2021-03-31 06:46:04 -04:00
|
|
|
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,
|
2022-02-21 06:16:49 -05:00
|
|
|
text: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
2021-05-25 05:58:54 -04:00
|
|
|
placement: PropTypes.string,
|
2022-02-21 06:16:49 -05:00
|
|
|
className: PropTypes.string,
|
2021-04-27 03:52:58 -04:00
|
|
|
}),
|
2021-06-17 11:37:48 -04:00
|
|
|
url: PropTypes.string,
|
2021-03-31 06:46:04 -04:00
|
|
|
}
|