dashboardBanner.tsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import styled from '@emotion/styled';
  2. import DashLeft from 'getsentry-images/dashboards-banner-left.svg';
  3. import DashRight from 'getsentry-images/dashboards-banner-right.svg';
  4. import Banner from 'sentry/components/banner';
  5. import {LinkButton} from 'sentry/components/core/button';
  6. import {t} from 'sentry/locale';
  7. import type {Organization} from 'sentry/types/organization';
  8. import UpsellButton from 'getsentry/components/upsellButton';
  9. type Props = {
  10. organization: Organization;
  11. };
  12. function DashboardBanner({organization}: Props) {
  13. // No upsell if the user can edit dashboards
  14. if (organization.features.includes('organizations:dashboards-edit')) {
  15. return null;
  16. }
  17. return (
  18. <StyledBanner
  19. title={t('Customize Dashboards')}
  20. subtitle={t('Build your own widgets and manage multiple dashboards')}
  21. backgroundComponent={<DashboardBackground />}
  22. dismissKey="dashboards"
  23. >
  24. <UpsellButton source="custom-dashboards" priority="primary" />
  25. <LinkButton href="https://docs.sentry.io/product/dashboards/" external>
  26. {t('Read the docs')}
  27. </LinkButton>
  28. </StyledBanner>
  29. );
  30. }
  31. const StyledBanner = styled(Banner)`
  32. background-color: ${p => p.theme.purple100};
  33. color: ${p => p.theme.textColor};
  34. `;
  35. const DashboardBackground = styled('div')`
  36. @media (min-width: ${p => p.theme.breakpoints.small}) {
  37. background-image: url(${DashLeft}), url(${DashRight});
  38. background-position:
  39. left center,
  40. right center;
  41. background-repeat: no-repeat, no-repeat;
  42. background-size:
  43. 20% 100%,
  44. 20% 100%;
  45. height: 95%;
  46. width: 95%;
  47. }
  48. `;
  49. export default DashboardBanner;