mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-14 23:30:53 -05:00
f8efc3e2ae
[web] Implement the editor's left menu in Offcanvas GitOrigin-RevId: 999e995d664b1dc958f56643f05e95b8aa2d6290
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { useTranslation } from 'react-i18next'
|
|
import { useProjectContext } from '../../../shared/context/project-context'
|
|
import Icon from '../../../shared/components/icon'
|
|
import * as eventTracking from '../../../infrastructure/event-tracking'
|
|
import { isSmallDevice } from '../../../infrastructure/event-tracking'
|
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
|
|
export default function DownloadSource() {
|
|
const { t } = useTranslation()
|
|
const { _id: projectId } = useProjectContext()
|
|
|
|
function sendDownloadEvent() {
|
|
eventTracking.sendMB('download-zip-button-click', {
|
|
projectId,
|
|
location: 'left-menu',
|
|
isSmallDevice,
|
|
})
|
|
}
|
|
|
|
return (
|
|
<a
|
|
href={`/project/${projectId}/download/zip`}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
onClick={sendDownloadEvent}
|
|
>
|
|
<BootstrapVersionSwitcher
|
|
bs3={<Icon type="file-archive-o" modifier="2x" />}
|
|
bs5={<MaterialIcon type="folder_zip" size="2x" />}
|
|
/>
|
|
<br />
|
|
{t('source')}
|
|
</a>
|
|
)
|
|
}
|