Skip to content

Commit ffcd816

Browse files
committed
Fix: Catalog Btns Fix
Signed-off-by: vr-varad <[email protected]>
1 parent 6ceb4bf commit ffcd816

File tree

2 files changed

+33
-26
lines changed

2 files changed

+33
-26
lines changed

src/custom/PerformersSection/PerformersSection.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { memo, useMemo } from 'react';
33
import { Box, Button } from '../../base';
44
import { iconXSmall } from '../../constants/iconsSizes';
55
import { LeaderBoardIcon, TropyIcon } from '../../icons';
6-
import { useTheme } from '../../theme';
6+
import { useMediaQuery, useTheme } from '../../theme';
77
import { Carousel } from '../Carousel';
88
import { Pattern } from '../CustomCatalog/CustomCard';
99
import { ErrorBoundary } from '../ErrorBoundary';
10-
import { StateCardSekeleton } from './PerformersToogleButton';
10+
import { OpenLeaderBoardButton, StateCardSekeleton } from './PerformersToogleButton';
1111
import {
1212
CardsContainer,
1313
ContentWrapper,
@@ -228,6 +228,7 @@ const PerformersSection: React.FC<PerformersSectionProps> = ({
228228
}) => {
229229
const theme = useTheme();
230230
const { queries, isLoading, hasError } = useMetricQueries(useGetCatalogFilters);
231+
const smallScreen = useMediaQuery(theme.breakpoints.down('sm'));
231232

232233
const stats = useMemo(
233234
() =>
@@ -265,20 +266,24 @@ const PerformersSection: React.FC<PerformersSectionProps> = ({
265266
style={{
266267
height: '2rem',
267268
width: '2rem',
268-
color: theme.palette.icon.secondary
269+
color: theme.palette.icon.secondary,
270+
display: smallScreen ? 'none' : 'inline-flex'
269271
}}
270272
/>
271273
</Box>
272274
{onOpenLeaderboard && (
273-
<Button
274-
variant="contained"
275-
onClick={() => onOpenLeaderboard()}
276-
sx={{
277-
display: { xs: 'none', md: 'inline-flex' }
278-
}}
279-
>
280-
Open Leaderboard
281-
</Button>
275+
<div>
276+
<Button
277+
variant="contained"
278+
onClick={() => onOpenLeaderboard()}
279+
sx={{
280+
display: { xs: 'none', sm: 'inline-flex' }
281+
}}
282+
>
283+
Open Leaderboard
284+
</Button>
285+
<OpenLeaderBoardButton handleClick={onOpenLeaderboard} />
286+
</div>
282287
)}
283288
</TitleBox>
284289
<CardsContainer>

src/custom/PerformersSection/PerformersToogleButton.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ interface PerformersSectionButtonProps {
1010
handleClick: () => void;
1111
}
1212

13+
interface OpenLeaderBoardButtonProps {
14+
handleClick: () => void;
15+
}
16+
1317
const PerformersSectionButton: React.FC<PerformersSectionButtonProps> = ({ open, handleClick }) => {
1418
const theme = useTheme();
1519

@@ -35,22 +39,20 @@ const PerformersSectionButton: React.FC<PerformersSectionButtonProps> = ({ open,
3539
);
3640
};
3741

38-
const OpenLeaderBoardButton: React.FC<PerformersSectionButtonProps> = ({ handleClick }) => {
42+
const OpenLeaderBoardButton: React.FC<OpenLeaderBoardButtonProps> = ({ handleClick }) => {
3943
return (
4044
<CustomTooltip title={'Open Leaderboard'} placement="bottom">
41-
<span>
42-
<Button
43-
variant="contained"
44-
onClick={handleClick}
45-
sx={{
46-
height: '3.7rem',
47-
padding: '0.3rem',
48-
display: { xs: 'inline-flex', md: 'none' }
49-
}}
50-
>
51-
<TropyIcon style={{ height: '2rem', width: '2rem' }} />
52-
</Button>
53-
</span>
45+
<Button
46+
variant="contained"
47+
onClick={handleClick}
48+
sx={{
49+
height: '3.7rem',
50+
padding: '0.3rem',
51+
display: { xs: 'inline-flex', sm: 'none' }
52+
}}
53+
>
54+
<TropyIcon style={{ height: '2rem', width: '2rem' }} />
55+
</Button>
5456
</CustomTooltip>
5557
);
5658
};

0 commit comments

Comments
 (0)