index.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React from 'react';
  2. import {Params} from 'react-router/lib/Router';
  3. import styled from '@emotion/styled';
  4. import {Location} from 'history';
  5. import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage';
  6. import SentryDocumentTitle from 'app/components/sentryDocumentTitle';
  7. import {t} from 'app/locale';
  8. import {PageContent} from 'app/styles/organization';
  9. import {Organization} from 'app/types';
  10. import withOrganization from 'app/utils/withOrganization';
  11. import EventDetailsContent from './content';
  12. type Props = {
  13. organization: Organization;
  14. location: Location;
  15. params: Params;
  16. };
  17. class EventDetails extends React.Component<Props> {
  18. getEventSlug = (): string => {
  19. const {eventSlug} = this.props.params;
  20. return typeof eventSlug === 'string' ? eventSlug.trim() : '';
  21. };
  22. render() {
  23. const {organization, location, params} = this.props;
  24. const documentTitle = t('Performance Details');
  25. const eventSlug = this.getEventSlug();
  26. const projectSlug = eventSlug.split(':')[0];
  27. return (
  28. <SentryDocumentTitle
  29. title={documentTitle}
  30. orgSlug={organization.slug}
  31. projectSlug={projectSlug}
  32. >
  33. <StyledPageContent>
  34. <LightWeightNoProjectMessage organization={organization}>
  35. <EventDetailsContent
  36. organization={organization}
  37. location={location}
  38. params={params}
  39. eventSlug={eventSlug}
  40. />
  41. </LightWeightNoProjectMessage>
  42. </StyledPageContent>
  43. </SentryDocumentTitle>
  44. );
  45. }
  46. }
  47. export default withOrganization(EventDetails);
  48. const StyledPageContent = styled(PageContent)`
  49. padding: 0;
  50. `;