mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
d6b39c4bb3
Replacing `btn-default` with `btn-secondary` in the editor GitOrigin-RevId: 46aa8c92c9981eb2f253828ee65424bfb7217fb2
36 lines
774 B
JavaScript
36 lines
774 B
JavaScript
import { useTranslation } from 'react-i18next'
|
|
import { Button } from 'react-bootstrap'
|
|
import Icon from '../../../shared/components/icon'
|
|
import { useLayoutContext } from '../../../shared/context/layout-context'
|
|
|
|
function SwitchToPDFButton() {
|
|
const { pdfLayout, setView, detachRole } = useLayoutContext()
|
|
|
|
const { t } = useTranslation()
|
|
|
|
if (detachRole) {
|
|
return null
|
|
}
|
|
|
|
if (pdfLayout === 'sideBySide') {
|
|
return null
|
|
}
|
|
|
|
function handleClick() {
|
|
setView('pdf')
|
|
}
|
|
|
|
return (
|
|
<Button
|
|
bsStyle={null}
|
|
bsSize="xs"
|
|
onClick={handleClick}
|
|
className="toolbar-btn-secondary btn-secondary"
|
|
>
|
|
<Icon type="file-pdf-o" className="me-1" />
|
|
{t('switch_to_pdf')}
|
|
</Button>
|
|
)
|
|
}
|
|
|
|
export default SwitchToPDFButton
|