demoSignUp.tsx 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. import {css} from '@emotion/react';
  2. import styled from '@emotion/styled';
  3. import habitsSuccessfulCustomer from 'sentry-images/spot/habitsSuccessfulCustomer.jpg';
  4. import {ModalRenderProps} from 'sentry/actionCreators/modal';
  5. import {Button} from 'sentry/components/button';
  6. import ButtonBar from 'sentry/components/buttonBar';
  7. import HighlightCornerContainer from 'sentry/components/highlightCornerModal';
  8. import {IconClose} from 'sentry/icons';
  9. import {t} from 'sentry/locale';
  10. import {space} from 'sentry/styles/space';
  11. import {trackAnalytics} from 'sentry/utils/analytics';
  12. import {extraQueryParameter, urlAttachQueryParams} from 'sentry/utils/demoMode';
  13. type Props = ModalRenderProps;
  14. function DemoSignUpModal({closeModal}: Props) {
  15. const signupUrl = urlAttachQueryParams(
  16. 'https://sentry.io/signup/',
  17. extraQueryParameter()
  18. );
  19. const demoUrl = urlAttachQueryParams(
  20. 'https://sentry.io/_/demo/',
  21. extraQueryParameter()
  22. );
  23. return (
  24. <HighlightCornerContainer>
  25. <CloseButton
  26. icon={<IconClose size="xs" />}
  27. size="xs"
  28. aria-label={t('Close')}
  29. onClick={() => {
  30. trackAnalytics('growth.demo_modal_clicked_close', {
  31. organization: null,
  32. });
  33. closeModal();
  34. }}
  35. />
  36. <div>
  37. <TrialCheckInfo>
  38. <Subheader>{t('Sign Up')}</Subheader>
  39. <h2>{t('Hey, like what you see?')}</h2>
  40. <p>
  41. {t(
  42. "Start your free trial, and create your first project to see what's broken in your code and how to fix it."
  43. )}
  44. </p>
  45. </TrialCheckInfo>
  46. <StyledButtonBar gap={1}>
  47. <Button
  48. priority="primary"
  49. href={signupUrl}
  50. onClick={() =>
  51. trackAnalytics('growth.demo_modal_clicked_signup', {
  52. organization: null,
  53. })
  54. }
  55. >
  56. {t('Start free trial')}
  57. </Button>
  58. <Button
  59. priority="default"
  60. href={demoUrl}
  61. onClick={() =>
  62. trackAnalytics('growth.demo_modal_clicked_demo', {
  63. organization: null,
  64. })
  65. }
  66. >
  67. {t('Request a demo')}
  68. </Button>
  69. </StyledButtonBar>
  70. </div>
  71. <ImagePosition>
  72. <PositionRight src={habitsSuccessfulCustomer} />
  73. </ImagePosition>
  74. </HighlightCornerContainer>
  75. );
  76. }
  77. const TrialCheckInfo = styled('div')`
  78. padding: ${space(3)} 0;
  79. p {
  80. font-size: ${p => p.theme.fontSizeLarge};
  81. margin: 0;
  82. }
  83. h2 {
  84. font-size: 2em;
  85. }
  86. `;
  87. export const modalCss = css`
  88. width: 100%;
  89. max-width: 1000px;
  90. [role='document'] {
  91. position: relative;
  92. padding: 70px 80px;
  93. overflow: visible;
  94. display: flex;
  95. gap: 30px;
  96. }
  97. `;
  98. const Subheader = styled('h4')`
  99. margin-bottom: ${space(2)};
  100. text-transform: uppercase;
  101. font-weight: bold;
  102. color: ${p => p.theme.activeText};
  103. font-size: ${p => p.theme.fontSizeMedium};
  104. `;
  105. const StyledButtonBar = styled(ButtonBar)`
  106. margin-top: ${space(2)};
  107. max-width: 250px;
  108. `;
  109. const ImagePosition = styled('div')`
  110. max-width: 360px;
  111. margin: auto;
  112. `;
  113. const PositionRight = styled('img')`
  114. border-radius: 0.5rem;
  115. pointer-events: none;
  116. `;
  117. const CloseButton = styled(Button)`
  118. position: absolute;
  119. top: -15px;
  120. right: -15px;
  121. height: 30px;
  122. width: 30px;
  123. border-radius: 50%;
  124. background: ${p => p.theme.background};
  125. color: ${p => p.theme.textColor};
  126. `;
  127. export default DemoSignUpModal;