headerItemPosition.tsx 787 B

123456789101112131415161718192021222324252627282930313233343536
  1. import {css} from '@emotion/react';
  2. import styled from '@emotion/styled';
  3. import {AutoCompleteRoot} from 'sentry/components/dropdownAutoComplete/menu';
  4. import {TimeRangeRoot} from 'sentry/components/organizations/timeRangeSelector/index';
  5. import {Theme} from 'sentry/utils/theme';
  6. type Props = {
  7. isSpacer?: boolean;
  8. };
  9. function getMediaQueryForSpacer(p: Props & {theme: Theme}) {
  10. return p.isSpacer
  11. ? css`
  12. @media (max-width: ${p.theme.breakpoints.medium}) {
  13. display: none;
  14. }
  15. `
  16. : '';
  17. }
  18. const HeaderItemPosition = styled('div')<Props>`
  19. display: flex;
  20. flex: 1;
  21. min-width: 0;
  22. height: 100%;
  23. ${getMediaQueryForSpacer}
  24. ${AutoCompleteRoot}, ${TimeRangeRoot} {
  25. flex: 1;
  26. min-width: 0;
  27. }
  28. `;
  29. export default HeaderItemPosition;