File tree Expand file tree Collapse file tree 2 files changed +32
-6
lines changed
src/pages/Campaign/widgets Expand file tree Collapse file tree 2 files changed +32
-6
lines changed Original file line number Diff line number Diff line change 11import { useTranslation } from 'react-i18next' ;
2+ import useWindowSize from 'src/hooks/useWindowSize' ;
23import FlipCard from '../widgetCards/FlipCard' ;
34import { ChartTotalBugsByDevice } from './ChartTotalBugsByDevice' ;
45import { ListTotalBugsByDevice } from './ListTotalBugsByDevice' ;
@@ -11,14 +12,26 @@ const TotalBugsByOsAndDevices = ({
1112 campaignId : number ;
1213} ) => {
1314 const { t } = useTranslation ( ) ;
15+ const { isMobile } = useWindowSize ( ) ;
16+
1417 return (
1518 < FlipCard height = { height } >
16- < FlipCard . Header >
19+ < FlipCard . Header hasBack = { ! isMobile } >
1720 { t ( '__CAMPAIGN_PAGE_WIDGET_BUGS_BY_OS_AND_DEVICE_CARD_TITLE' ) }
1821 </ FlipCard . Header >
1922 < FlipCard . Body
20- front = { < ChartTotalBugsByDevice campaignId = { campaignId } /> }
21- back = { < ListTotalBugsByDevice campaignId = { campaignId } /> }
23+ front = {
24+ isMobile ? (
25+ < ListTotalBugsByDevice campaignId = { campaignId } />
26+ ) : (
27+ < ChartTotalBugsByDevice campaignId = { campaignId } />
28+ )
29+ }
30+ back = {
31+ isMobile ? undefined : (
32+ < ListTotalBugsByDevice campaignId = { campaignId } />
33+ )
34+ }
2235 />
2336 </ FlipCard >
2437 ) ;
Original file line number Diff line number Diff line change 11import { useTranslation } from 'react-i18next' ;
22import { useParams } from 'react-router-dom' ;
3+ import useWindowSize from 'src/hooks/useWindowSize' ;
34import FlipCard from '../widgetCards/FlipCard' ;
45import { ChartUniqueBugs4UseCase } from './Chart' ;
56import { ListUniqueBugs4UseCase } from './List' ;
67
78const UniqueBugs4UseCase = ( { height } : { height : string } ) => {
89 const { t } = useTranslation ( ) ;
10+ const { isMobile } = useWindowSize ( ) ;
911 const { campaignId } = useParams ( ) ;
1012 if ( ! campaignId ) {
1113 return null ;
1214 }
15+
1316 return (
1417 < FlipCard height = { height } >
15- < FlipCard . Header >
18+ < FlipCard . Header hasBack = { ! isMobile } >
1619 { t ( '__CAMPAIGN_PAGE_WIDGET_BUGS_BY_USECASE_CARD_TITLE' ) }
1720 </ FlipCard . Header >
1821 < FlipCard . Body
19- front = { < ChartUniqueBugs4UseCase campaignId = { campaignId } /> }
20- back = { < ListUniqueBugs4UseCase campaignId = { campaignId } /> }
22+ front = {
23+ isMobile ? (
24+ < ListUniqueBugs4UseCase campaignId = { campaignId } />
25+ ) : (
26+ < ChartUniqueBugs4UseCase campaignId = { campaignId } />
27+ )
28+ }
29+ back = {
30+ isMobile ? undefined : (
31+ < ListUniqueBugs4UseCase campaignId = { campaignId } />
32+ )
33+ }
2134 />
2235 </ FlipCard >
2336 ) ;
You can’t perform that action at this time.
0 commit comments