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
36 lines
947 B
JavaScript
36 lines
947 B
JavaScript
import { useTranslation } from 'react-i18next'
|
|
import { Button, OverlayTrigger, Tooltip } from 'react-bootstrap'
|
|
import Icon from '../../../shared/components/icon'
|
|
import { memo } from 'react'
|
|
import { useCompileContext } from '../../../shared/context/compile-context'
|
|
|
|
function PdfHybridDownloadButton() {
|
|
const { pdfDownloadUrl } = useCompileContext()
|
|
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<OverlayTrigger
|
|
placement="bottom"
|
|
overlay={
|
|
<Tooltip id="tooltip-logs-toggle">
|
|
{pdfDownloadUrl
|
|
? t('download_pdf')
|
|
: t('please_compile_pdf_before_download')}
|
|
</Tooltip>
|
|
}
|
|
>
|
|
<Button
|
|
bsStyle="link"
|
|
disabled={!pdfDownloadUrl}
|
|
download
|
|
href={pdfDownloadUrl || '#'}
|
|
target="_blank"
|
|
>
|
|
<Icon type="download" modifier="fw" />
|
|
</Button>
|
|
</OverlayTrigger>
|
|
)
|
|
}
|
|
|
|
export default memo(PdfHybridDownloadButton)
|