releaseDisplayOptions.tsx 804 B

123456789101112131415161718192021222324252627282930313233343536
  1. import styled from '@emotion/styled';
  2. import {t} from 'app/locale';
  3. import ReleaseListDropdown from './releaseListDropdown';
  4. import {DisplayOption} from './utils';
  5. const displayOptions = {
  6. [DisplayOption.SESSIONS]: {label: t('Sessions')},
  7. [DisplayOption.USERS]: {label: t('Users')},
  8. };
  9. type Props = {
  10. selected: DisplayOption;
  11. onSelect: (key: string) => void;
  12. };
  13. function ReleaseListDisplayOptions({selected, onSelect}: Props) {
  14. return (
  15. <StyledReleaseListDropdown
  16. label={t('Display')}
  17. options={displayOptions}
  18. selected={selected}
  19. onSelect={onSelect}
  20. />
  21. );
  22. }
  23. export default ReleaseListDisplayOptions;
  24. const StyledReleaseListDropdown = styled(ReleaseListDropdown)`
  25. z-index: 1;
  26. @media (max-width: ${p => p.theme.breakpoints[2]}) {
  27. order: 3;
  28. }
  29. `;