mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 10:10:08 +02:00
Change Redundant Layout Controls GitOrigin-RevId: b50d71b1f75d202334442b3f6cb5037ed0d8a411
37 lines
754 B
JavaScript
37 lines
754 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="default"
|
|
bsSize="xs"
|
|
onClick={handleClick}
|
|
className="toolbar-item"
|
|
>
|
|
<Icon type="file-pdf-o" className="me-1" />
|
|
{t('switch_to_pdf')}
|
|
</Button>
|
|
)
|
|
}
|
|
|
|
export default SwitchToPDFButton
|