invite.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { useTranslation } 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 InviteProps = {
  8. projectName: string
  9. email: string
  10. submitHandler: () => void
  11. isLoading?: boolean
  12. }
  13. function Invite({ projectName, email, submitHandler, isLoading }: InviteProps) {
  14. const { t } = useTranslation()
  15. const { appName } = getMeta('ol-ExposedSettings')
  16. return (
  17. <div className="container">
  18. <OLRow>
  19. <OLCol lg={{ span: 6, offset: 3 }}>
  20. <div className="project-join-container">
  21. <img src={overleafLogo} alt={appName} />
  22. <h1 className="h4 mb-2">
  23. {t('youre_joining_x_as_y', { projectName, email })}
  24. </h1>
  25. <div className="mb-4">
  26. {t(
  27. 'your_name_and_email_address_will_be_visible_to_project_editors'
  28. )}
  29. </div>
  30. <OLButton
  31. variant="primary"
  32. size="lg"
  33. disabled={isLoading}
  34. isLoading={isLoading}
  35. loadingLabel={`${t('joining')}…`}
  36. onClick={submitHandler}
  37. >
  38. {t('join_project_lowercase')}
  39. </OLButton>
  40. </div>
  41. </OLCol>
  42. </OLRow>
  43. </div>
  44. )
  45. }
  46. export default Invite