page.tsx 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import {ReactNode} from 'react';
  2. import styled from '@emotion/styled';
  3. import {FeatureFeedback} from 'sentry/components/featureFeedback';
  4. import * as Layout from 'sentry/components/layouts/thirds';
  5. import DetailsPageBreadcrumbs from 'sentry/components/replays/header/detailsPageBreadcrumbs';
  6. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  7. import space from 'sentry/styles/space';
  8. import {Event} from 'sentry/types/event';
  9. type Props = {
  10. children: ReactNode;
  11. eventSlug: string;
  12. orgId: string;
  13. event?: Event;
  14. };
  15. function Page({children, event, orgId, eventSlug}: Props) {
  16. const title = event ? `${event.id} - Replays - ${orgId}` : `Replays - ${orgId}`;
  17. return (
  18. <SentryDocumentTitle title={title}>
  19. <FullViewport>
  20. <Layout.Header>
  21. <Layout.HeaderContent>
  22. <DetailsPageBreadcrumbs orgId={orgId} event={event} eventSlug={eventSlug} />
  23. </Layout.HeaderContent>
  24. <ButtonActionsWrapper>
  25. <FeatureFeedback featureName="replay" buttonProps={{size: 'sm'}} />
  26. </ButtonActionsWrapper>
  27. </Layout.Header>
  28. <FullViewportContent>{children}</FullViewportContent>
  29. </FullViewport>
  30. </SentryDocumentTitle>
  31. );
  32. }
  33. // TODO(replay); This could make a lot of sense to put inside HeaderActions by default
  34. const ButtonActionsWrapper = styled(Layout.HeaderActions)`
  35. display: grid;
  36. grid-template-columns: repeat(2, max-content);
  37. justify-content: flex-end;
  38. gap: ${space(1)};
  39. `;
  40. const FullViewport = styled('div')`
  41. height: 100vh;
  42. width: 100%;
  43. display: flex;
  44. flex-flow: nowrap column;
  45. flex-direction: column;
  46. overflow: hidden;
  47. /*
  48. * The footer component is a sibling of this div.
  49. * Remove it so the replay can take up the
  50. * entire screen.
  51. */
  52. ~ footer {
  53. display: none;
  54. }
  55. `;
  56. const FullViewportContent = styled('section')`
  57. flex-grow: 1;
  58. background: ${p => p.theme.background};
  59. `;
  60. export default Page;