Skip to content

Commit 16c2684

Browse files
authored
Merge pull request #1090 from vr-varad/fix/catalog_btns_2
Fix: Catalog Btns Fix
2 parents 77983b2 + 9b13e14 commit 16c2684

File tree

2 files changed

+39
-25
lines changed

2 files changed

+39
-25
lines changed

src/custom/PerformersSection/PerformersSection.tsx

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ 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';
@@ -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,31 @@ 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 variant="contained" onClick={() => onOpenLeaderboard()}>
277+
<TropyIcon
278+
style={{
279+
height: '2rem',
280+
width: '2rem',
281+
display: smallScreen ? 'inline-flex' : 'none'
282+
}}
283+
/>
284+
<p
285+
style={{
286+
margin: 0,
287+
display: smallScreen ? 'none' : 'inline-flex'
288+
}}
289+
>
290+
Open Leaderboard
291+
</p>
292+
</Button>
293+
</div>
282294
)}
283295
</TitleBox>
284296
<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)