@@ -6,14 +6,15 @@ import pick from 'lodash/pick';
66import * as qs from 'query-string' ;
77
88import { Client } from 'sentry/api' ;
9- import { Button , ButtonLabel } from 'sentry/components/button' ;
9+ import { Button } from 'sentry/components/button' ;
1010import ButtonBar from 'sentry/components/buttonBar' ;
1111import DiscoverButton from 'sentry/components/discoverButton' ;
1212import GroupList from 'sentry/components/issues/groupList' ;
1313import { normalizeDateTimeParams } from 'sentry/components/organizations/pageFilters/parse' ;
1414import Pagination from 'sentry/components/pagination' ;
1515import { Panel , PanelBody } from 'sentry/components/panels' ;
1616import QueryCount from 'sentry/components/queryCount' ;
17+ import { SegmentedControl } from 'sentry/components/segmentedControl' ;
1718import { DEFAULT_RELATIVE_PERIODS , DEFAULT_STATS_PERIOD } from 'sentry/constants' ;
1819import { URL_PARAM } from 'sentry/constants/pageFilters' ;
1920import { t , tct } from 'sentry/locale' ;
@@ -59,8 +60,8 @@ type Props = {
5960function ProjectIssues ( { organization, location, projectId, query, api} : Props ) {
6061 const [ pageLinks , setPageLinks ] = useState < string | undefined > ( ) ;
6162 const [ onCursor , setOnCursor ] = useState < ( ( ) => void ) | undefined > ( ) ;
62- const [ issuesType , setIssuesType ] = useState < IssuesType | string > (
63- ( location . query . issuesType as string ) || IssuesType . UNHANDLED
63+ const [ issuesType , setIssuesType ] = useState < IssuesType > (
64+ ( location . query . issuesType as IssuesType ) || IssuesType . UNHANDLED
6465 ) ;
6566 const [ issuesCount , setIssuesCount ] = useState < Count > ( {
6667 all : 0 ,
@@ -241,20 +242,19 @@ function ProjectIssues({organization, location, projectId, query, api}: Props) {
241242 return (
242243 < Fragment >
243244 < ControlsWrapper >
244- < StyledButtonBar active = { issuesType } merged >
245+ < SegmentedControl
246+ aria-label = { t ( 'Issue type' ) }
247+ value = { issuesType }
248+ onChange = { value => handleIssuesTypeSelection ( value ) }
249+ size = "xs"
250+ >
245251 { issuesTypes . map ( ( { value, label, issueCount} ) => (
246- < Button
247- key = { value }
248- barId = { value }
249- size = "xs"
250- onClick = { ( ) => handleIssuesTypeSelection ( value ) }
251- data-test-id = { `filter-${ value } ` }
252- >
253- { label }
252+ < SegmentedControl . Item key = { value } textValue = { label } >
253+ { label }
254254 < QueryCount count = { issueCount } max = { 99 } hideParens hideIfEmpty = { false } />
255- </ Button >
255+ </ SegmentedControl . Item >
256256 ) ) }
257- </ StyledButtonBar >
257+ </ SegmentedControl >
258258 < OpenInButtonBar gap = { 1 } >
259259 < Button
260260 data-test-id = "issues-open"
@@ -297,31 +297,14 @@ const ControlsWrapper = styled('div')`
297297 justify-content: space-between;
298298 margin-bottom: ${ space ( 1 ) } ;
299299 flex-wrap: wrap;
300- @media (max-width: ${ p => p . theme . breakpoints . small } ) {
301- display: block;
302- }
303- ` ;
304-
305- const StyledButtonBar = styled ( ButtonBar ) `
306- grid-template-columns: repeat(4, 1fr);
307- ${ ButtonLabel } {
308- white-space: nowrap;
309- gap: ${ space ( 0.5 ) } ;
310- span:last-child {
311- color: ${ p => p . theme . buttonCount } ;
312- }
313- }
314- .active {
315- ${ ButtonLabel } {
316- span:last-child {
317- color: ${ p => p . theme . buttonCountActive } ;
318- }
319- }
320- }
321300` ;
322301
323302const OpenInButtonBar = styled ( ButtonBar ) `
324303 margin-top: ${ space ( 1 ) } ;
304+
305+ @media (max-width: ${ p => p . theme . breakpoints . small } ) {
306+ width: 100%;
307+ }
325308` ;
326309
327310const StyledPagination = styled ( Pagination ) `
0 commit comments