index.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import styled from '@emotion/styled';
  2. import ExternalLink from 'sentry/components/links/externalLink';
  3. import List from 'sentry/components/list';
  4. import {t, tct} from 'sentry/locale';
  5. import {space} from 'sentry/styles/space';
  6. import ModalManager from '../modalManager';
  7. import Item from './item';
  8. import Terminal from './terminal';
  9. class Add extends ModalManager {
  10. getTitle() {
  11. return t('Register Key');
  12. }
  13. getBtnSaveLabel() {
  14. return t('Register');
  15. }
  16. getData() {
  17. const {savedRelays} = this.props;
  18. const trustedRelays = [...savedRelays, this.state.values];
  19. return {trustedRelays};
  20. }
  21. getContent() {
  22. return (
  23. <StyledList symbol="colored-numeric">
  24. <Item
  25. title={tct('Initialize the configuration. [link: Learn how]', {
  26. link: (
  27. <ExternalLink href="https://docs.sentry.io/product/relay/getting-started/#initializing-configuration" />
  28. ),
  29. })}
  30. subtitle={t('Within your terminal:')}
  31. >
  32. <Terminal command="relay config init" />
  33. </Item>
  34. <Item
  35. title={tct(
  36. 'Go to the file [jsonFile: credentials.json] to find the public key and enter it below.',
  37. {
  38. jsonFile: (
  39. <ExternalLink href="https://docs.sentry.io/product/relay/getting-started/#registering-relay-with-sentry" />
  40. ),
  41. }
  42. )}
  43. >
  44. {super.getForm()}
  45. </Item>
  46. </StyledList>
  47. );
  48. }
  49. }
  50. export default Add;
  51. const StyledList = styled(List)`
  52. display: grid;
  53. gap: ${space(3)};
  54. `;