screenRenderingLandingPage.tsx 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import styled from '@emotion/styled';
  2. import ErrorBoundary from 'sentry/components/errorBoundary';
  3. import * as Layout from 'sentry/components/layouts/thirds';
  4. import {space} from 'sentry/styles/space';
  5. import {PageAlert, PageAlertProvider} from 'sentry/utils/performance/contexts/pageAlert';
  6. import {ModulePageFilterBar} from 'sentry/views/insights/common/components/modulePageFilterBar';
  7. import {ModulePageProviders} from 'sentry/views/insights/common/components/modulePageProviders';
  8. import {ModulesOnboarding} from 'sentry/views/insights/common/components/modulesOnboarding';
  9. import {ModuleBodyUpsellHook} from 'sentry/views/insights/common/components/moduleUpsellHookWrapper';
  10. import {ReleaseComparisonSelector} from 'sentry/views/insights/common/components/releaseSelector';
  11. import useCrossPlatformProject from 'sentry/views/insights/mobile/common/queries/useCrossPlatformProject';
  12. import {PlatformSelector} from 'sentry/views/insights/mobile/screenload/components/platformSelector';
  13. import {ScreenRenderingContent} from 'sentry/views/insights/mobile/screenRendering/screenRenderingContent';
  14. import {MODULE_TITLE} from 'sentry/views/insights/mobile/screenRendering/settings';
  15. import {MobileHeader} from 'sentry/views/insights/pages/mobile/mobilePageHeader';
  16. import {MODULE_FEATURE_MAP} from 'sentry/views/insights/settings';
  17. import {ModuleName} from 'sentry/views/insights/types';
  18. export function ScreenRenderingModule() {
  19. const {isProjectCrossPlatform} = useCrossPlatformProject();
  20. return (
  21. <Layout.Page>
  22. <PageAlertProvider>
  23. <MobileHeader
  24. module={ModuleName.SCREEN_RENDERING}
  25. headerTitle={MODULE_TITLE}
  26. headerActions={isProjectCrossPlatform && <PlatformSelector />}
  27. />
  28. <ModuleBodyUpsellHook moduleName={ModuleName.SCREEN_RENDERING}>
  29. <Layout.Body>
  30. <Layout.Main fullWidth>
  31. <Container>
  32. <ModulePageFilterBar
  33. moduleName={ModuleName.SCREEN_LOAD}
  34. extraFilters={<ReleaseComparisonSelector />}
  35. />
  36. </Container>
  37. <PageAlert />
  38. <ErrorBoundary mini>
  39. <ModulesOnboarding moduleName={ModuleName.SCREEN_RENDERING}>
  40. <ScreenRenderingContent />
  41. </ModulesOnboarding>
  42. </ErrorBoundary>
  43. </Layout.Main>
  44. </Layout.Body>
  45. </ModuleBodyUpsellHook>
  46. </PageAlertProvider>
  47. </Layout.Page>
  48. );
  49. }
  50. function PageWithProviders() {
  51. return (
  52. <ModulePageProviders
  53. moduleName="screen_load"
  54. features={MODULE_FEATURE_MAP[ModuleName.SCREEN_RENDERING]}
  55. analyticEventName="insight.page_loads.screen_rendering"
  56. >
  57. <ScreenRenderingModule />
  58. </ModulePageProviders>
  59. );
  60. }
  61. export default PageWithProviders;
  62. const Container = styled('div')`
  63. display: grid;
  64. grid-template-rows: auto auto auto;
  65. gap: ${space(2)};
  66. margin-bottom: ${space(2)};
  67. @media (min-width: ${p => p.theme.breakpoints.large}) {
  68. grid-template-rows: auto;
  69. grid-template-columns: auto 1fr auto;
  70. }
  71. `;