screenRenderingLandingPage.tsx 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 {ReleaseComparisonSelector} from 'sentry/views/insights/common/components/releaseSelector';
  10. import useCrossPlatformProject from 'sentry/views/insights/mobile/common/queries/useCrossPlatformProject';
  11. import {PlatformSelector} from 'sentry/views/insights/mobile/screenload/components/platformSelector';
  12. import {ScreenRenderingContent} from 'sentry/views/insights/mobile/screenRendering/screenRenderingContent';
  13. import {MODULE_TITLE} from 'sentry/views/insights/mobile/screenRendering/settings';
  14. import {MobileHeader} from 'sentry/views/insights/pages/mobile/mobilePageHeader';
  15. import {MODULE_FEATURE_MAP} from 'sentry/views/insights/settings';
  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. <Layout.Body>
  28. <Layout.Main fullWidth>
  29. <Container>
  30. <ModulePageFilterBar
  31. moduleName={ModuleName.SCREEN_LOAD}
  32. extraFilters={<ReleaseComparisonSelector />}
  33. />
  34. </Container>
  35. <PageAlert />
  36. <ErrorBoundary mini>
  37. <ModulesOnboarding moduleName={ModuleName.SCREEN_RENDERING}>
  38. <ScreenRenderingContent />
  39. </ModulesOnboarding>
  40. </ErrorBoundary>
  41. </Layout.Main>
  42. </Layout.Body>
  43. </PageAlertProvider>
  44. </Layout.Page>
  45. );
  46. }
  47. function PageWithProviders() {
  48. return (
  49. <ModulePageProviders
  50. moduleName="screen_load"
  51. features={MODULE_FEATURE_MAP[ModuleName.SCREEN_RENDERING]}
  52. analyticEventName="insight.page_loads.screen_load"
  53. >
  54. <ScreenRenderingModule />
  55. </ModulePageProviders>
  56. );
  57. }
  58. export default PageWithProviders;
  59. const Container = styled('div')`
  60. display: grid;
  61. grid-template-rows: auto auto auto;
  62. gap: ${space(2)};
  63. margin-bottom: ${space(2)};
  64. @media (min-width: ${p => p.theme.breakpoints.large}) {
  65. grid-template-rows: auto;
  66. grid-template-columns: auto 1fr auto;
  67. }
  68. `;