groupListHeader.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import styled from '@emotion/styled';
  2. import {PanelHeader} from 'sentry/components/panels';
  3. import {t} from 'sentry/locale';
  4. import space from 'sentry/styles/space';
  5. type Props = {
  6. withChart: boolean;
  7. narrowGroups?: boolean;
  8. };
  9. const GroupListHeader = ({withChart = true, narrowGroups = false}: Props) => (
  10. <PanelHeader disablePadding>
  11. <IssueWrapper>{t('Issue')}</IssueWrapper>
  12. {withChart && (
  13. <ChartWrapper className={`hidden-xs hidden-sm ${narrowGroups ? 'hidden-md' : ''}`}>
  14. {t('Graph')}
  15. </ChartWrapper>
  16. )}
  17. <EventUserWrapper>{t('events')}</EventUserWrapper>
  18. <EventUserWrapper>{t('users')}</EventUserWrapper>
  19. <AssigneeWrapper className="hidden-xs hidden-sm toolbar-header">
  20. {t('Assignee')}
  21. </AssigneeWrapper>
  22. </PanelHeader>
  23. );
  24. export default GroupListHeader;
  25. const Heading = styled('div')`
  26. display: flex;
  27. align-self: center;
  28. margin: 0 ${space(2)};
  29. color: ${p => p.theme.subText};
  30. `;
  31. const IssueWrapper = styled(Heading)`
  32. flex: 1;
  33. width: 66.66%;
  34. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  35. width: 50%;
  36. }
  37. `;
  38. const EventUserWrapper = styled(Heading)`
  39. justify-content: flex-end;
  40. width: 60px;
  41. @media (min-width: ${p => p.theme.breakpoints.xlarge}) {
  42. width: 80px;
  43. }
  44. `;
  45. const ChartWrapper = styled(Heading)`
  46. justify-content: space-between;
  47. width: 160px;
  48. `;
  49. const AssigneeWrapper = styled(Heading)`
  50. justify-content: flex-end;
  51. width: 80px;
  52. `;