replayView.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import {PlayerScrubber} from 'sentry/components/replays/player/scrubber';
  4. import ScrubberMouseTracking from 'sentry/components/replays/player/scrubberMouseTracking';
  5. import ReplayController from 'sentry/components/replays/replayController';
  6. import ReplayCurrentUrl from 'sentry/components/replays/replayCurrentUrl';
  7. import ReplayPlayer from 'sentry/components/replays/replayPlayer';
  8. import space from 'sentry/styles/space';
  9. import FluidHeight from 'sentry/views/replays/detail/layout/fluidHeight';
  10. type Props = {
  11. toggleFullscreen: () => void;
  12. };
  13. function ReplayView({toggleFullscreen}: Props) {
  14. return (
  15. <Fragment>
  16. <ReplayCurrentUrl />
  17. <PlayerContainer>
  18. <Panel>
  19. <ReplayPlayer />
  20. </Panel>
  21. <ScrubberMouseTracking>
  22. <PlayerScrubber />
  23. </ScrubberMouseTracking>
  24. </PlayerContainer>
  25. <ReplayController toggleFullscreen={toggleFullscreen} />
  26. </Fragment>
  27. );
  28. }
  29. // Adjust the bottom spacing so that <PlayerScrubber> does not overflow outside
  30. // of <FluidHeight>
  31. const PlayerContainer = styled(FluidHeight)`
  32. padding-bottom: ${space(1)};
  33. margin-bottom: -${space(1)};
  34. `;
  35. const Panel = styled(FluidHeight)`
  36. background: ${p => p.theme.background};
  37. border-radius: ${p => p.theme.borderRadiusTop};
  38. border: 1px solid ${p => p.theme.border};
  39. border-bottom: none;
  40. box-shadow: ${p => p.theme.dropShadowLight};
  41. `;
  42. export default ReplayView;