releasesDisplayOptions.tsx 857 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import styled from '@emotion/styled';
  2. import {t} from 'sentry/locale';
  3. import ReleasesDropdown from './releasesDropdown';
  4. export enum ReleasesDisplayOption {
  5. USERS = 'users',
  6. SESSIONS = 'sessions',
  7. }
  8. const displayOptions = {
  9. [ReleasesDisplayOption.SESSIONS]: {label: t('Sessions')},
  10. [ReleasesDisplayOption.USERS]: {label: t('Users')},
  11. };
  12. type Props = {
  13. onSelect: (key: string) => void;
  14. selected: ReleasesDisplayOption;
  15. };
  16. function ReleasesDisplayOptions({selected, onSelect}: Props) {
  17. return (
  18. <StyledReleasesDropdown
  19. label={t('Display')}
  20. options={displayOptions}
  21. selected={selected}
  22. onSelect={onSelect}
  23. />
  24. );
  25. }
  26. export default ReleasesDisplayOptions;
  27. const StyledReleasesDropdown = styled(ReleasesDropdown)`
  28. z-index: 1;
  29. @media (max-width: ${p => p.theme.breakpoints.large}) {
  30. order: 3;
  31. }
  32. `;