screenRenderingLandingPage.tsx 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 {ModuleName} from 'sentry/views/insights/types';
  17. export function ScreenRenderingModule() {
  18. const {isProjectCrossPlatform} = useCrossPlatformProject();
  19. return (
  20. <Layout.Page>
  21. <PageAlertProvider>
  22. <MobileHeader
  23. module={ModuleName.SCREEN_RENDERING}
  24. headerTitle={MODULE_TITLE}
  25. headerActions={isProjectCrossPlatform && <PlatformSelector />}
  26. />
  27. <ModuleBodyUpsellHook moduleName={ModuleName.SCREEN_RENDERING}>
  28. <Layout.Body>
  29. <Layout.Main fullWidth>
  30. <Container>
  31. <ModulePageFilterBar
  32. moduleName={ModuleName.SCREEN_LOAD}
  33. extraFilters={<ReleaseComparisonSelector />}
  34. />
  35. </Container>
  36. <PageAlert />
  37. <ErrorBoundary mini>
  38. <ModulesOnboarding moduleName={ModuleName.SCREEN_RENDERING}>
  39. <ScreenRenderingContent />
  40. </ModulesOnboarding>
  41. </ErrorBoundary>
  42. </Layout.Main>
  43. </Layout.Body>
  44. </ModuleBodyUpsellHook>
  45. </PageAlertProvider>
  46. </Layout.Page>
  47. );
  48. }
  49. function PageWithProviders() {
  50. return (
  51. <ModulePageProviders
  52. moduleName="screen_load"
  53. analyticEventName="insight.page_loads.screen_rendering"
  54. >
  55. <ScreenRenderingModule />
  56. </ModulePageProviders>
  57. );
  58. }
  59. export default PageWithProviders;
  60. const Container = styled('div')`
  61. display: grid;
  62. grid-template-rows: auto auto auto;
  63. gap: ${space(2)};
  64. margin-bottom: ${space(2)};
  65. @media (min-width: ${p => p.theme.breakpoints.large}) {
  66. grid-template-rows: auto;
  67. grid-template-columns: auto 1fr auto;
  68. }
  69. `;