logos.tsx 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import OLTooltip from '@/shared/components/ol/ol-tooltip'
  2. import MaterialIcon from '@/shared/components/material-icon'
  3. import { useTranslation } from 'react-i18next'
  4. import { Cobranding } from '../../../../../../types/cobranding'
  5. type ToolbarLogosProps = {
  6. cobranding?: Cobranding
  7. }
  8. export const ToolbarLogos = ({ cobranding }: ToolbarLogosProps) => {
  9. const { t } = useTranslation()
  10. return (
  11. <div className="ide-redesign-toolbar-logos">
  12. <OLTooltip
  13. id="tooltip-home-button"
  14. description={t('back_to_your_projects')}
  15. overlayProps={{ delay: 0, placement: 'bottom' }}
  16. >
  17. <div className="ide-redesign-toolbar-home-button">
  18. <a href="/project" className="ide-redesign-toolbar-home-link">
  19. <span className="toolbar-ol-logo" aria-label={t('overleaf_logo')} />
  20. <MaterialIcon type="home" className="toolbar-ol-home-button" />
  21. </a>
  22. </div>
  23. </OLTooltip>
  24. {cobranding && cobranding.logoImgUrl && (
  25. <>
  26. <span className="ide-redesign-toolbar-cobranding-separator" />
  27. <a
  28. className="ide-redesign-toolbar-cobranding-link"
  29. href={cobranding.brandVariationHomeUrl}
  30. target="_blank"
  31. rel="noreferrer noopener"
  32. >
  33. <img
  34. src={cobranding.logoImgUrl}
  35. className="ide-redesign-toolbar-cobranding-logo"
  36. alt={cobranding.brandVariationName}
  37. />
  38. </a>
  39. </>
  40. )}
  41. </div>
  42. )
  43. }