invite-not-valid.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { useTranslation, Trans } from 'react-i18next'
  2. import OLRow from '@/shared/components/ol/ol-row'
  3. import OLCol from '@/shared/components/ol/ol-col'
  4. import OLButton from '@/shared/components/ol/ol-button'
  5. import overleafLogo from '@/shared/svgs/overleaf-logo.svg'
  6. import getMeta from '@/utils/meta'
  7. type InviteNotValidProps = {
  8. email?: string
  9. }
  10. function InviteNotValid({ email }: InviteNotValidProps) {
  11. const { t } = useTranslation()
  12. const { appName } = getMeta('ol-ExposedSettings')
  13. return (
  14. <div className="container">
  15. <OLRow>
  16. <OLCol lg={{ span: 6, offset: 3 }}>
  17. <div className="project-join-container">
  18. <img src={overleafLogo} alt={appName} />
  19. <h1 className="h4 mb-2">
  20. {t('sorry_this_project_is_not_available')}
  21. </h1>
  22. <div className="mb-4">
  23. {t('the_link_may_be_broken_or_you_may_not_have_access_rights')}
  24. </div>
  25. {email && (
  26. <>
  27. <OLButton
  28. variant="primary"
  29. size="lg"
  30. href="/project"
  31. className="mb-4"
  32. >
  33. {t('back_to_my_projects')}
  34. </OLButton>
  35. <div>
  36. <small>
  37. <Trans
  38. i18nKey="you_are_currently_logged_in_as_x_you_might_need_to_log_in_with_different_email"
  39. components={[<b />]} // eslint-disable-line react/jsx-key
  40. values={{ email }}
  41. shouldUnescape
  42. tOptions={{ interpolation: { escapeValue: true } }}
  43. />
  44. </small>
  45. </div>
  46. </>
  47. )}
  48. </div>
  49. </OLCol>
  50. </OLRow>
  51. </div>
  52. )
  53. }
  54. export default InviteNotValid