2021-03-10 07:19:54 -05:00
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
|
|
|
|
import classNames from 'classnames'
|
|
|
|
import Icon from '../../../shared/components/icon'
|
|
|
|
|
|
|
|
function PdfToggleButton({ onClick, pdfViewIsOpen }) {
|
|
|
|
const classes = classNames(
|
|
|
|
'btn',
|
|
|
|
'btn-full-height',
|
|
|
|
'btn-full-height-no-border',
|
|
|
|
{
|
2021-04-27 03:52:58 -04:00
|
|
|
active: pdfViewIsOpen,
|
2021-03-10 07:19:54 -05:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
return (
|
|
|
|
<OverlayTrigger
|
|
|
|
placement="bottom"
|
|
|
|
trigger={['hover', 'focus']}
|
|
|
|
overlay={<Tooltip id="tooltip-online-user">PDF</Tooltip>}
|
|
|
|
>
|
|
|
|
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid,jsx-a11y/click-events-have-key-events,jsx-a11y/interactive-supports-focus */}
|
|
|
|
<a role="button" className={classes} onClick={onClick}>
|
2021-05-31 04:27:23 -04:00
|
|
|
<Icon type="file-pdf-o" modifier="fw" accessibilityLabel="PDF" />
|
2021-03-10 07:19:54 -05:00
|
|
|
</a>
|
|
|
|
</OverlayTrigger>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
PdfToggleButton.propTypes = {
|
|
|
|
onClick: PropTypes.func.isRequired,
|
2021-04-27 03:52:58 -04:00
|
|
|
pdfViewIsOpen: PropTypes.bool,
|
2021-03-10 07:19:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export default PdfToggleButton
|