overleaf/services/web/frontend/js/shared/components/beta-badge.js
Alf Eaton 1be43911b4 Merge pull request #3942 from overleaf/prettier-trailing-comma
Set Prettier's "trailingComma" setting to "es5"

GitOrigin-RevId: 9f14150511929a855b27467ad17be6ab262fe5d5
2021-04-28 02:10:01 +00:00

29 lines
697 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="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,
}),
}