rowBar.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import styled from '@emotion/styled';
  2. import {
  3. ROW_HEIGHT,
  4. ROW_PADDING,
  5. SpanBarHatch,
  6. } from 'sentry/components/performance/waterfall/constants';
  7. import {DurationDisplay} from 'sentry/components/performance/waterfall/types';
  8. import {
  9. getDurationPillAlignment,
  10. getDurationPillColour,
  11. getHatchPattern,
  12. } from 'sentry/components/performance/waterfall/utils';
  13. export const RowRectangle = styled('div')<{
  14. spanBarHatch?: SpanBarHatch;
  15. }>`
  16. position: absolute;
  17. height: ${ROW_HEIGHT - 2 * ROW_PADDING}px;
  18. left: 0;
  19. min-width: 1px;
  20. user-select: none;
  21. transition: border-color 0.15s ease-in-out;
  22. ${p => getHatchPattern(p.spanBarHatch)}
  23. `;
  24. export const DurationPill = styled('div')<{
  25. durationDisplay: DurationDisplay;
  26. showDetail: boolean;
  27. spanBarHatch?: SpanBarHatch;
  28. }>`
  29. position: absolute;
  30. top: 50%;
  31. display: flex;
  32. align-items: center;
  33. transform: translateY(-50%);
  34. white-space: nowrap;
  35. font-size: ${p => p.theme.fontSizeExtraSmall};
  36. font-variant-numeric: tabular-nums;
  37. line-height: 1;
  38. ${getDurationPillAlignment}
  39. ${getDurationPillColour}
  40. @media (max-width: ${p => p.theme.breakpoints.medium}) {
  41. font-size: 10px;
  42. }
  43. `;