Files
Verso/services/web/frontend/js/features/source-editor/components/switch-to-pdf-button.tsx
T
claudeandClaude Sonnet 4.6 11227d59e3
Build and Deploy Verso / deploy (push) Successful in 14m3s
Editor mobile ergonomics: vertical split layout on phones and as desktop option
On mobile (< 768 px) the existing side-by-side layout automatically switches
to a vertical stack (editor on top, PDF/presentation on bottom) without
changing the stored layout preference.

A new "Top / bottom split" option is added to the layout menu so desktop
users can choose the same vertical split explicitly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 09:25:15 +00:00

32 lines
757 B
TypeScript

import { useTranslation } from 'react-i18next'
import MaterialIcon from '@/shared/components/material-icon'
import OLButton from '@/shared/components/ol/ol-button'
import { useLayoutContext } from '../../../shared/context/layout-context'
function SwitchToPDFButton() {
const { pdfLayout, setView, detachRole } = useLayoutContext()
const { t } = useTranslation()
if (detachRole) {
return null
}
if (pdfLayout === 'sideBySide' || pdfLayout === 'verticalSplit') {
return null
}
function handleClick() {
setView('pdf')
}
return (
<OLButton variant="secondary" size="sm" onClick={handleClick}>
<MaterialIcon type="picture_as_pdf" />
{t('switch_to_pdf')}
</OLButton>
)
}
export default SwitchToPDFButton