Skip to content

Commit 4f6de14

Browse files
committed
feat: add LeaderBoardIcon and integrate into PerformersSection
Signed-off-by: Amit Amrutiya <amitamrutiya2210@gmail.com>
1 parent a5856a0 commit 4f6de14

3 files changed

Lines changed: 26 additions & 39 deletions

File tree

src/custom/Carousel/style.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ export const CarouselContainer = styled('div')({
3737
scrollBehavior: 'smooth',
3838
scrollSnapType: 'x mandatory',
3939
gap: '1rem',
40-
padding: '1rem 0',
40+
paddingBottom: '1rem',
4141
width: '100%',
42+
msOverflowStyle: 'none',
43+
scrollbarWidth: 'none',
4244
'&::-webkit-scrollbar': {
4345
display: 'none'
4446
},

src/custom/PerformersSection/PerformersSection.tsx

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import { memo, useMemo } from 'react';
3-
import {
4-
CloneIcon,
5-
DeploymentsIcon,
6-
DownloadIcon,
7-
OpenIcon,
8-
ShareIcon,
9-
TropyIcon
10-
} from '../../icons';
3+
import { Box } from '../../base';
4+
import { iconXSmall } from '../../constants/iconsSizes';
5+
import { LeaderBoardIcon, TropyIcon } from '../../icons';
116
import { useTheme } from '../../theme';
127
import { Carousel } from '../Carousel';
138
import { Pattern } from '../CustomCatalog/CustomCard';
@@ -21,7 +16,6 @@ import {
2116
HeaderTitle,
2217
IconContainer,
2318
MainContainer,
24-
RepoSection,
2519
RepoTitle,
2620
StatsValue,
2721
StatusLabel,
@@ -32,7 +26,6 @@ import {
3226

3327
interface MetricConfig {
3428
label: string;
35-
icon: React.ComponentType<any>;
3629
id: string;
3730
countKey: keyof Pattern;
3831
}
@@ -55,7 +48,6 @@ interface StatCardProps {
5548
pattern: Pattern;
5649
userName: string;
5750
userid: string;
58-
icon: React.ComponentType<any>;
5951
status: string;
6052
id: string;
6153
onCardClick: (pattern: Pattern) => void;
@@ -86,32 +78,27 @@ const BASE_QUERY_PARAMS: BaseQueryParams = {
8678
const METRICS: Record<MetricType, MetricConfig> = {
8779
view: {
8880
label: 'Most Opens',
89-
icon: OpenIcon,
90-
id: 'open-icon',
81+
id: 'open',
9182
countKey: 'view_count'
9283
},
9384
clone: {
9485
label: 'Most Clones',
95-
icon: CloneIcon,
96-
id: 'clone-icon',
86+
id: 'clone',
9787
countKey: 'clone_count'
9888
},
9989
download: {
10090
label: 'Most Downloads',
101-
icon: DownloadIcon,
102-
id: 'download-icon',
91+
id: 'download',
10392
countKey: 'download_count'
10493
},
10594
deployment: {
10695
label: 'Most Deploys',
107-
icon: DeploymentsIcon,
108-
id: 'deployments-icon',
96+
id: 'deployments',
10997
countKey: 'deployment_count'
11098
},
11199
share: {
112100
label: 'Most Shares',
113-
icon: ShareIcon,
114-
id: 'share-icon',
101+
id: 'share',
115102
countKey: 'share_count'
116103
}
117104
};
@@ -129,7 +116,6 @@ const StatCardComponent: React.FC<StatCardProps> = ({
129116
pattern,
130117
userName,
131118
userid,
132-
icon: Icon,
133119
status,
134120
id,
135121
onCardClick,
@@ -162,16 +148,16 @@ const StatCardComponent: React.FC<StatCardProps> = ({
162148
<HeaderSection>
163149
<HeaderTitle>{label}</HeaderTitle>
164150
<IconContainer onClick={(e) => handleIconClick(e, `${countKey}+desc`)}>
165-
<Icon className={id} />
151+
<LeaderBoardIcon {...iconXSmall} />
166152
</IconContainer>
167153
</HeaderSection>
168154

169155
<StatsValue>{count}</StatsValue>
170156

171-
<RepoSection>
157+
<Box>
172158
<RepoTitle>{patternName}</RepoTitle>
173159
<UserNameText onClick={handleAuthorClick}>by {userName}</UserNameText>
174-
</RepoSection>
160+
</Box>
175161
</ContentWrapper>
176162
<StatusLabel labelType={status} onClick={handleStatusClick}>
177163
{status}
@@ -247,7 +233,6 @@ const processQueryData = (
247233
pattern: pattern,
248234
userName: pattern.user?.first_name || 'Unknown',
249235
userid: pattern.user?.id,
250-
icon: config.icon,
251236
id: config.id,
252237
status: pattern?.catalog_data?.content_class
253238
};

src/custom/PerformersSection/styles.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const Title = styled(Typography)(({ theme }) => ({
9090
}));
9191

9292
export const StyledCard = styled(Card)<StyledCardProps>(({ theme }) => ({
93-
width: '200px',
93+
width: '10rem',
9494
borderRadius: '16px',
9595
position: 'relative',
9696
overflow: 'hidden',
@@ -205,19 +205,19 @@ export const RepoTitle = styled(Typography)(({ theme }) => ({
205205
maxHeight: '2.6em'
206206
}));
207207

208-
export const UserNameText = styled(Typography)(({ theme }) => ({
208+
export const UserNameText = styled(Typography)({
209209
fontSize: '0.75rem',
210-
color:
211-
theme.palette.mode === 'light'
212-
? theme.palette.text.constant?.disabled
213-
: theme.palette.text.disabled,
214-
marginBottom: '8px',
215-
transition: 'color 0.3s ease',
210+
// color:
211+
// theme.palette.mode === 'light'
212+
// ? theme.palette.text.constant?.disabled
213+
// : theme.palette.text.disabled,
214+
marginBottom: '8px'
215+
// transition: 'color 0.3s ease',
216216

217-
'&:hover': {
218-
color: theme.palette.text.brand
219-
}
220-
}));
217+
// '&:hover': {
218+
// color: theme.palette.text.brand
219+
// }
220+
});
221221

222222
export const CardsContainer = styled(Box)(({ theme }) => ({
223223
display: 'flex',

0 commit comments

Comments
 (0)