emailVerificationModal.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {Fragment} from 'react';
  2. // eslint-disable-next-line no-restricted-imports
  3. import {withRouter, WithRouterProps} from 'react-router';
  4. import {ModalRenderProps} from 'sentry/actionCreators/modal';
  5. import {Client} from 'sentry/api';
  6. import Link from 'sentry/components/links/link';
  7. import {t, tct} from 'sentry/locale';
  8. import withApi from 'sentry/utils/withApi';
  9. import {EmailAddresses} from 'sentry/views/settings/account/accountEmails';
  10. import TextBlock from 'sentry/views/settings/components/text/textBlock';
  11. type Props = WithRouterProps &
  12. Pick<ModalRenderProps, 'Body' | 'Header'> & {
  13. api: Client;
  14. actionMessage?: string;
  15. };
  16. function EmailVerificationModal({
  17. Header,
  18. Body,
  19. actionMessage = 'taking this action',
  20. }: Props) {
  21. return (
  22. <Fragment>
  23. <Header closeButton>{t('Action Required')}</Header>
  24. <Body>
  25. <TextBlock>
  26. {tct('Please verify your email before [actionMessage], or [link].', {
  27. actionMessage,
  28. link: (
  29. <Link to="/settings/account/emails/" data-test-id="email-settings-link">
  30. {t('go to your email settings')}
  31. </Link>
  32. ),
  33. })}
  34. </TextBlock>
  35. <EmailAddresses />
  36. </Body>
  37. </Fragment>
  38. );
  39. }
  40. export default withRouter(withApi(EmailVerificationModal));
  41. export {EmailVerificationModal};