overleaf/services/web/frontend/js/shared/components/beta-badge.js
Alf Eaton d5f7b1169f Add info link to symbol palette (#4086)
GitOrigin-RevId: 4950dd1a7b15e965ffc4d2651017f491ce9ecf99
2021-05-26 02:05:23 +00:00

30 lines
753 B
JavaScript

import React from 'react'
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
import PropTypes from 'prop-types'
export default function BetaBadge({ tooltip }) {
return (
<OverlayTrigger
placement={tooltip.placement || 'bottom'}
overlay={<Tooltip id={tooltip.id}>{tooltip.text}</Tooltip>}
delayHide={100}
>
<a
href="/beta/participate"
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,
}),
}