back-to-projects-button.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { useTranslation } from 'react-i18next'
  2. import Icon from '../../../shared/components/icon'
  3. import * as eventTracking from '../../../infrastructure/event-tracking'
  4. import OLTooltip from '@/features/ui/components/ol/ol-tooltip'
  5. import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
  6. import MaterialIcon from '@/shared/components/material-icon'
  7. function BackToProjectsButton() {
  8. const { t } = useTranslation()
  9. return (
  10. <OLTooltip
  11. id="back-to-projects"
  12. description={t('back_to_your_projects')}
  13. overlayProps={{ placement: 'right' }}
  14. >
  15. <div className="toolbar-item">
  16. <a
  17. className="btn btn-full-height"
  18. draggable="false"
  19. href="/project"
  20. onClick={() => {
  21. eventTracking.sendMB('navigation-clicked-home')
  22. }}
  23. >
  24. <BootstrapVersionSwitcher
  25. bs3={
  26. <Icon
  27. type="home"
  28. fw
  29. accessibilityLabel={t('back_to_your_projects')}
  30. />
  31. }
  32. bs5={
  33. <MaterialIcon
  34. type="home"
  35. className="align-text-bottom"
  36. accessibilityLabel={t('back_to_your_projects')}
  37. />
  38. }
  39. />
  40. </a>
  41. </div>
  42. </OLTooltip>
  43. )
  44. }
  45. export default BackToProjectsButton