pageload.tsx 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import styled from '@emotion/styled';
  2. import ErrorBoundary from 'sentry/components/errorBoundary';
  3. import FloatingFeedbackWidget from 'sentry/components/feedback/widget/floatingFeedbackWidget';
  4. import * as Layout from 'sentry/components/layouts/thirds';
  5. import {DatePageFilter} from 'sentry/components/organizations/datePageFilter';
  6. import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
  7. import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
  8. import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
  9. import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
  10. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  11. import {t} from 'sentry/locale';
  12. import {space} from 'sentry/styles/space';
  13. import {
  14. PageErrorAlert,
  15. PageErrorProvider,
  16. } from 'sentry/utils/performance/contexts/pageError';
  17. import useOrganization from 'sentry/utils/useOrganization';
  18. import {useOnboardingProject} from 'sentry/views/performance/browser/webVitals/utils/useOnboardingProject';
  19. import Onboarding from 'sentry/views/performance/onboarding';
  20. import {ReleaseComparisonSelector} from 'sentry/views/starfish/components/releaseSelector';
  21. import {ScreensView, YAxis} from 'sentry/views/starfish/views/screens';
  22. export default function PageloadModule() {
  23. const organization = useOrganization();
  24. const onboardingProject = useOnboardingProject();
  25. return (
  26. <SentryDocumentTitle title={t('Mobile')} orgSlug={organization.slug}>
  27. <Layout.Page>
  28. <PageErrorProvider>
  29. <Layout.Header>
  30. <Layout.HeaderContent>
  31. <Layout.Title>{t('Mobile')}</Layout.Title>
  32. </Layout.HeaderContent>
  33. </Layout.Header>
  34. <Layout.Body>
  35. <FloatingFeedbackWidget />
  36. <Layout.Main fullWidth>
  37. <PageErrorAlert />
  38. <PageFiltersContainer>
  39. <Container>
  40. <PageFilterBar condensed>
  41. <ProjectPageFilter />
  42. <EnvironmentPageFilter />
  43. <DatePageFilter />
  44. </PageFilterBar>
  45. <ReleaseComparisonSelector />
  46. </Container>
  47. <ErrorBoundary mini>
  48. {onboardingProject && (
  49. <OnboardingContainer>
  50. <Onboarding
  51. organization={organization}
  52. project={onboardingProject}
  53. />
  54. </OnboardingContainer>
  55. )}
  56. {!onboardingProject && (
  57. <ScreensView yAxes={[YAxis.TTID, YAxis.TTFD]} chartHeight={240} />
  58. )}
  59. </ErrorBoundary>
  60. </PageFiltersContainer>
  61. </Layout.Main>
  62. </Layout.Body>
  63. </PageErrorProvider>
  64. </Layout.Page>
  65. </SentryDocumentTitle>
  66. );
  67. }
  68. const Container = styled('div')`
  69. display: grid;
  70. grid-template-rows: auto auto auto;
  71. gap: ${space(2)};
  72. margin-bottom: ${space(2)};
  73. @media (min-width: ${p => p.theme.breakpoints.large}) {
  74. grid-template-rows: auto;
  75. grid-template-columns: auto 1fr auto;
  76. }
  77. `;
  78. const OnboardingContainer = styled('div')`
  79. margin-top: ${space(2)};
  80. `;