mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
fde4f72adf
[web] [cm6] Add a three-way switch for editor choice GitOrigin-RevId: fff788ddad8d10488e8446de7f1503702da0985f
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.exact({
|
|
id: PropTypes.string.isRequired,
|
|
text: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
placement: PropTypes.string,
|
|
className: PropTypes.string,
|
|
}),
|
|
url: PropTypes.string,
|
|
}
|