overleaf/services/web/frontend/js/features/editor-navigation-toolbar/components/back-to-projects-button.tsx
Jimmy Domagala-Tang 3aa6346ab3 Merge pull request #14674 from overleaf/jdt-prevent-menu-item-drags
feat: force all menuitems to be undraggable, and make home button und…
GitOrigin-RevId: 5b04a07aaca43b1eff8b50958d74356663b6d416
2023-09-13 08:04:01 +00:00

35 lines
911 B
TypeScript

import { useTranslation } from 'react-i18next'
import Tooltip from '../../../shared/components/tooltip'
import Icon from '../../../shared/components/icon'
import * as eventTracking from '../../../infrastructure/event-tracking'
function BackToProjectsButton() {
const { t } = useTranslation()
return (
<Tooltip
id="back-to-projects"
description={t('back_to_your_projects')}
overlayProps={{ placement: 'right' }}
>
<div className="toolbar-item">
<a
className="btn btn-full-height"
draggable="false"
href="/project"
onClick={() => {
eventTracking.sendMB('navigation-clicked-home')
}}
>
<Icon
type="home"
fw
accessibilityLabel={t('back_to_your_projects')}
/>
</a>
</div>
</Tooltip>
)
}
export default BackToProjectsButton