twoFactorRequired.tsx 847 B

1234567891011121314151617181920212223242526
  1. import styled from '@emotion/styled';
  2. import {Alert} from 'sentry/components/alert';
  3. import ExternalLink from 'sentry/components/links/externalLink';
  4. import {tct} from 'sentry/locale';
  5. import {space} from 'sentry/styles/space';
  6. import getPendingInvite from 'sentry/utils/getPendingInvite';
  7. function TwoFactorRequired() {
  8. return !getPendingInvite() ? null : (
  9. <StyledAlert data-test-id="require-2fa" type="error" showIcon>
  10. {tct(
  11. 'You have been invited to an organization that requires [link:two-factor authentication]. Setup two-factor authentication below to join your organization.',
  12. {
  13. link: <ExternalLink href="https://docs.sentry.io/accounts/require-2fa/" />,
  14. }
  15. )}
  16. </StyledAlert>
  17. );
  18. }
  19. const StyledAlert = styled(Alert)`
  20. margin: ${space(3)} 0;
  21. `;
  22. export default TwoFactorRequired;