deprecated-browser.tsx 849 B

12345678910111213141516171819202122232425262728293031
  1. import { FC } from 'react'
  2. import Notification from '@/shared/components/notification'
  3. import { Trans, useTranslation } from 'react-i18next'
  4. import Bowser from 'bowser'
  5. export const isDeprecatedBrowser = () => {
  6. const parser = Bowser.getParser(window.navigator.userAgent)
  7. return parser.satisfies({
  8. safari: '~15',
  9. })
  10. }
  11. export const DeprecatedBrowser: FC = () => {
  12. const { t } = useTranslation()
  13. return (
  14. <Notification
  15. type="warning"
  16. title={t('support_for_your_browser_is_ending_soon')}
  17. content={
  18. <Trans
  19. i18nKey="to_continue_using_upgrade_or_change_your_browser"
  20. components={[
  21. // eslint-disable-next-line jsx-a11y/anchor-has-content,react/jsx-key
  22. <a href="/learn/how-to/Which_browsers_does_Overleaf_support%3F" />,
  23. ]}
  24. />
  25. }
  26. />
  27. )
  28. }