mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 21:04:49 -05:00
6470afaec3
[web] change isMobileDevice segmentation to isSmallDevice GitOrigin-RevId: 1fcaf6ececc1fa75fd681ef2497bfa5e5567143d
31 lines
864 B
TypeScript
31 lines
864 B
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'
|
|
|
|
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}
|
|
>
|
|
<Icon type="file-archive-o" modifier="2x" />
|
|
<br />
|
|
{t('source')}
|
|
</a>
|
|
)
|
|
}
|