replayView.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. showAddressBar?: boolean;
  13. };
  14. function ReplayView({toggleFullscreen, showAddressBar = true}: Props) {
  15. return (
  16. <Fragment>
  17. {showAddressBar && <ReplayCurrentUrl />}
  18. <PlayerContainer>
  19. <Panel>
  20. <ReplayPlayer />
  21. </Panel>
  22. <ScrubberMouseTracking>
  23. <PlayerScrubber />
  24. </ScrubberMouseTracking>
  25. </PlayerContainer>
  26. <ReplayController toggleFullscreen={toggleFullscreen} />
  27. </Fragment>
  28. );
  29. }
  30. const PlayerContainer = styled(FluidHeight)`
  31. padding-bottom: ${space(1)};
  32. margin-bottom: -${space(1)};
  33. `;
  34. const Panel = styled(FluidHeight)`
  35. background: ${p => p.theme.background};
  36. border-radius: ${p => p.theme.borderRadiusTop};
  37. border: 1px solid ${p => p.theme.border};
  38. border-bottom: none;
  39. box-shadow: ${p => p.theme.dropShadowLight};
  40. `;
  41. export default ReplayView;