emailVerificationModal.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import * as React from 'react';
  2. import {withRouter} from 'react-router';
  3. import {WithRouterProps} from 'react-router/lib/withRouter';
  4. import {ModalRenderProps} from 'app/actionCreators/modal';
  5. import {Client} from 'app/api';
  6. import Link from 'app/components/links/link';
  7. import {t, tct} from 'app/locale';
  8. import withApi from 'app/utils/withApi';
  9. import {EmailAddresses} from 'app/views/settings/account/accountEmails';
  10. import TextBlock from 'app/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. <React.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. </React.Fragment>
  38. );
  39. }
  40. export default withRouter(withApi(EmailVerificationModal));
  41. export {EmailVerificationModal};