mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 05:21:35 -05:00
a70a3fc77e
Add hover state to pdf toolbar buttons GitOrigin-RevId: d58ad739e6454b9e0cdbdbb93c55e58785a9d672
45 lines
946 B
TypeScript
45 lines
946 B
TypeScript
import Button from 'react-bootstrap/lib/Button'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
import Tooltip from '@/shared/components/tooltip'
|
|
|
|
type PDFToolbarButtonProps = {
|
|
tooltipId: string
|
|
icon: string
|
|
label: string
|
|
onClick: () => void
|
|
shortcut?: string
|
|
disabled?: boolean
|
|
}
|
|
|
|
export default function PDFToolbarButton({
|
|
tooltipId,
|
|
disabled,
|
|
label,
|
|
icon,
|
|
onClick,
|
|
shortcut,
|
|
}: PDFToolbarButtonProps) {
|
|
return (
|
|
<Tooltip
|
|
id={tooltipId}
|
|
description={
|
|
<>
|
|
<div>{label}</div>
|
|
{shortcut && <div>{shortcut}</div>}
|
|
</>
|
|
}
|
|
overlayProps={{ placement: 'bottom' }}
|
|
>
|
|
<Button
|
|
aria-label={label}
|
|
bsSize="large"
|
|
bsStyle={null}
|
|
className="pdf-toolbar-btn pdfjs-toolbar-button"
|
|
disabled={disabled}
|
|
onClick={onClick}
|
|
>
|
|
<MaterialIcon type={icon} />
|
|
</Button>
|
|
</Tooltip>
|
|
)
|
|
}
|