mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
f7ef2532e0
* Only hide the compile logs pane when toggled off * Handle PDF preview on toggle between split and full-width views GitOrigin-RevId: 9ceca8a06a22abfa78f245e1ae5d24af98215906
33 lines
946 B
JavaScript
33 lines
946 B
JavaScript
import { Dropdown } from 'react-bootstrap'
|
|
import PdfFileList from './pdf-file-list'
|
|
import ControlledDropdown from '../../../shared/components/controlled-dropdown'
|
|
import { memo } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useCompileContext } from '../../../shared/context/compile-context'
|
|
|
|
function PdfDownloadFilesButton() {
|
|
const { compiling, fileList } = useCompileContext()
|
|
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<ControlledDropdown
|
|
id="dropdown-files-logs-pane"
|
|
dropup
|
|
pullRight
|
|
disabled={compiling || !fileList}
|
|
>
|
|
<Dropdown.Toggle
|
|
className="dropdown-toggle"
|
|
title={t('other_logs_and_files')}
|
|
bsSize="small"
|
|
bsStyle="info"
|
|
/>
|
|
<Dropdown.Menu id="dropdown-files-logs-pane-list">
|
|
<PdfFileList fileList={fileList} />
|
|
</Dropdown.Menu>
|
|
</ControlledDropdown>
|
|
)
|
|
}
|
|
|
|
export default memo(PdfDownloadFilesButton)
|