mergedSidebarSection.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import styled from '@emotion/styled';
  2. import {LinkButton} from 'sentry/components/button';
  3. import {Flex} from 'sentry/components/container/flex';
  4. import {t} from 'sentry/locale';
  5. import {useLocation} from 'sentry/utils/useLocation';
  6. import {SidebarSectionTitle} from 'sentry/views/issueDetails/streamline/sidebar';
  7. import {Tab, TabPaths} from 'sentry/views/issueDetails/types';
  8. import {useGroupDetailsRoute} from 'sentry/views/issueDetails/useGroupDetailsRoute';
  9. export function MergedIssuesSidebarSection() {
  10. const {baseUrl} = useGroupDetailsRoute();
  11. const location = useLocation();
  12. return (
  13. <Flex justify="space-between" align="center">
  14. <SidebarSectionTitle style={{margin: 0}}>{t('Merged Issues')}</SidebarSectionTitle>
  15. <SectionButton
  16. aria-label={t('View Merged Issues')}
  17. priority="link"
  18. size="zero"
  19. to={{
  20. pathname: `${baseUrl}${TabPaths[Tab.MERGED]}`,
  21. query: location.query,
  22. replace: true,
  23. }}
  24. >
  25. {t('View')}
  26. </SectionButton>
  27. </Flex>
  28. );
  29. }
  30. const SectionButton = styled(LinkButton)`
  31. color: ${p => p.theme.subText};
  32. line-height: 1;
  33. `;