overleaf/services/web/frontend/js/features/editor-navigation-toolbar/components/back-to-projects-button.tsx
Jimmy Domagala-Tang b2e74464a2 Merge pull request #14207 from overleaf/jdt-editor-events
editor events

GitOrigin-RevId: 8d74576d4f8117ecca47402afcc9cee229dd0dca
2023-08-23 08:05:23 +00:00

34 lines
883 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"
href="/project"
onClick={() => {
eventTracking.sendMB('navigation-clicked-home')
}}
>
<Icon
type="home"
fw
accessibilityLabel={t('back_to_your_projects')}
/>
</a>
</div>
</Tooltip>
)
}
export default BackToProjectsButton