constants.tsx 977 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import {Theme} from 'sentry/utils/theme';
  2. export const ROW_HEIGHT = 24;
  3. export const ROW_PADDING = 4;
  4. export enum SpanBarType {
  5. GAP = 'gap',
  6. AFFECTED = 'affected',
  7. AUTOGROUPED = 'autogrouped',
  8. }
  9. type SpanBarColours = {
  10. alternate: string;
  11. insetTextColour: string;
  12. primary: string;
  13. };
  14. // TODO: Need to eventually add dark mode colours as well
  15. export function getSpanBarColours(
  16. spanBarType: SpanBarType | undefined,
  17. theme: Theme
  18. ): SpanBarColours {
  19. switch (spanBarType) {
  20. case SpanBarType.GAP:
  21. return {primary: '#dedae3', alternate: '#f4f2f7', insetTextColour: theme.gray300};
  22. case SpanBarType.AFFECTED:
  23. return {primary: '#f55459', alternate: '#faa9ac', insetTextColour: theme.white};
  24. case SpanBarType.AUTOGROUPED:
  25. return {
  26. primary: theme.blue300,
  27. alternate: '#d1dff9',
  28. insetTextColour: theme.gray300,
  29. };
  30. default:
  31. return {primary: '', alternate: '', insetTextColour: theme.white};
  32. }
  33. }