Skip to content

Commit 81cbc25

Browse files
authored
Merge branch 'layer5io:master' into master
2 parents dd74d2d + bf2512e commit 81cbc25

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

src/custom/CatalogFilterSection/FilterSection.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ const FilterSection: React.FC<FilterSectionProps> = ({
7676
sx={{
7777
overflowY: 'auto',
7878
maxHeight: '25rem',
79-
backgroundColor: styleProps.backgroundColor
79+
backgroundColor: styleProps.backgroundColor,
80+
'&::-webkit-scrollbar': {
81+
width: '6px'
82+
}
8083
}}
8184
>
8285
{showSearch && (

src/custom/CatalogFilterSection/style.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ export const FiltersCardDiv = styled(Box)<{ styleProps: StyleProps }>(({ stylePr
1616
['@media (max-width:900px)']: {
1717
display: 'none'
1818
},
19-
fontFamily: styleProps.fontFamily
19+
fontFamily: styleProps.fontFamily,
20+
'&::-webkit-scrollbar': {
21+
width: '6px'
22+
}
2023
}));
2124

2225
export const FilterDrawerDiv = styled('div')(() => ({

src/custom/PerformersSection/PerformersSection.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ interface BaseQueryParams {
4848

4949
interface StatCardProps {
5050
label: string;
51+
countKey: string;
5152
count: number;
5253
patternName: string;
5354
pattern: Pattern;
@@ -57,7 +58,7 @@ interface StatCardProps {
5758
status: string;
5859
id: string;
5960
onCardClick: (pattern: Pattern) => void;
60-
onIconClick: () => void;
61+
onIconClick: (sortOrder: string) => void;
6162
onAuthorClick: (userId: string) => void;
6263
onStatusClick: (status: string) => void;
6364
}
@@ -121,6 +122,7 @@ const createQueryParams = (metric: MetricType): BaseQueryParams => ({
121122

122123
const StatCardComponent: React.FC<StatCardProps> = ({
123124
label,
125+
countKey,
124126
count,
125127
patternName,
126128
pattern,
@@ -138,9 +140,9 @@ const StatCardComponent: React.FC<StatCardProps> = ({
138140
onCardClick(pattern);
139141
};
140142

141-
const handleIconClick = (e: React.MouseEvent) => {
143+
const handleIconClick = (e: React.MouseEvent, sortOrder: string) => {
142144
e.stopPropagation();
143-
onIconClick();
145+
onIconClick(sortOrder);
144146
};
145147

146148
const handleAuthorClick = (e: React.MouseEvent) => {
@@ -158,7 +160,7 @@ const StatCardComponent: React.FC<StatCardProps> = ({
158160
<ContentWrapper cardId={id}>
159161
<HeaderSection>
160162
<HeaderTitle>{label}</HeaderTitle>
161-
<IconContainer onClick={handleIconClick}>
163+
<IconContainer onClick={(e) => handleIconClick(e, `${countKey}+desc`)}>
162164
<Icon className={id} />
163165
</IconContainer>
164166
</HeaderSection>
@@ -238,6 +240,7 @@ const processQueryData = (
238240

239241
return {
240242
label: config.label,
243+
countKey: config.countKey,
241244
count: pattern[config.countKey],
242245
patternName: pattern.name || 'Unknown',
243246
pattern: pattern,

src/custom/PerformersSection/styles.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export const MainContainer = styled(Box)(({ theme }) => ({
7373
: theme.palette.background.secondary,
7474
paddingTop: theme.spacing(2),
7575
borderRadius: '1rem',
76-
marginBottom: theme.spacing(4),
7776
display: 'flex',
7877
alignItems: 'center',
7978
flexDirection: 'column'
@@ -137,22 +136,21 @@ export const IconContainer = styled(Box)(() => ({
137136
}
138137
}));
139138

140-
export const ContentWrapper = styled(CardContent)<ContentWrapperProps>(({ cardId, theme }) => ({
139+
export const ContentWrapper = styled(CardContent)<ContentWrapperProps>(() => ({
141140
height: '100%',
142141
display: 'flex',
143142
flexDirection: 'column',
144-
padding: theme.spacing(2),
145-
paddingInline: cardId === 'download-icon' ? '12px' : theme.spacing(2),
143+
padding: '12px',
146144
'&:last-child': {
147-
paddingBottom: theme.spacing(2)
145+
paddingBottom: '12px'
148146
}
149147
}));
150148

151149
export const HeaderSection = styled(Box)({
152150
display: 'flex',
153151
justifyContent: 'space-between',
154152
alignItems: 'flex-start',
155-
marginBottom: '1rem',
153+
marginBottom: '0.5rem',
156154
gap: '0.6rem'
157155
});
158156

@@ -163,7 +161,14 @@ export const HeaderTitle = styled(Typography)(({ theme }) => ({
163161
lineHeight: 1.2,
164162
marginTop: '4px',
165163
textTransform: 'uppercase',
166-
letterSpacing: '0.5px'
164+
letterSpacing: '0.5px',
165+
display: '-webkit-box',
166+
WebkitLineClamp: 2,
167+
WebkitBoxOrient: 'vertical',
168+
overflow: 'hidden',
169+
textOverflow: 'clip',
170+
maxWidth: '70%',
171+
height: '2.4em'
167172
}));
168173

169174
export const StatsValue = styled(Typography)(({ theme }) => ({
@@ -175,7 +180,7 @@ export const StatsValue = styled(Typography)(({ theme }) => ({
175180
}));
176181

177182
export const RepoSection = styled(Box)(({ theme }) => ({
178-
marginBlock: '.35rem',
183+
marginBottom: '1rem',
179184
padding: '8px',
180185
borderRadius: '8px',
181186
background: theme.palette.mode === 'light' ? '#f8fafc' : DARK_TEAL,
@@ -197,7 +202,8 @@ export const RepoTitle = styled(Typography)(({ theme }) => ({
197202
WebkitBoxOrient: 'vertical',
198203
overflow: 'hidden',
199204
textOverflow: 'ellipsis',
200-
height: '2.6em'
205+
minHeight: 'fit-content',
206+
maxHeight: '2.6em'
201207
}));
202208

203209
export const UserNameText = styled(Typography)(({ theme }) => ({

0 commit comments

Comments
 (0)