rowBar.tsx 1.1 KB

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