Skip to content

Commit 7224e57

Browse files
committed
fix: some of the styling in custom catalog card
Signed-off-by: Amit Amrutiya <amitamrutiya2210@gmail.com>
1 parent 8895222 commit 7224e57

2 files changed

Lines changed: 43 additions & 7 deletions

File tree

src/custom/CustomCatalog/custom-card.tsx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import CalendarMonthIcon from '@mui/icons-material/CalendarMonth';
2-
import { Avatar, Typography, styled } from '@mui/material';
2+
import { Avatar, styled } from '@mui/material';
33
import React, { useEffect, useState } from 'react';
44
import { Grid } from '../../base';
55
import { CloneIcon, CommunityClassIcon, OfficialClassIcon, OpenIcon, ShareIcon } from '../../icons';
@@ -27,7 +27,8 @@ import {
2727
StyledInnerClassWrapper,
2828
TechnologiesSection,
2929
TechnologyText,
30-
VersionTag
30+
VersionDiv,
31+
VersionText
3132
} from './style';
3233

3334
export const DesignCardUrl = styled('a')(() => ({
@@ -166,6 +167,18 @@ const CustomCatalogCard: React.FC<CatalogCardProps> = ({
166167
// eslint-disable-next-line react-hooks/exhaustive-deps
167168
}, []);
168169

170+
if (!shouldFlip) {
171+
return (
172+
<DesignCard shouldFlip={shouldFlip} isDetailed={isDetailed} outerStyles={outerStyles}>
173+
<DesignInnerCard shouldFlip={shouldFlip} className="innerCard">
174+
<CardFront shouldFlip={shouldFlip} isDetailed={isDetailed}>
175+
{children}
176+
</CardFront>
177+
</DesignInnerCard>
178+
</DesignCard>
179+
);
180+
}
181+
169182
return (
170183
<DesignCardUrl href={cardLink} target="_blank" rel="noreferrer">
171184
<DesignCard shouldFlip={shouldFlip} isDetailed={isDetailed} outerStyles={outerStyles}>
@@ -329,11 +342,10 @@ const CustomCatalogCard: React.FC<CatalogCardProps> = ({
329342
</Grid>
330343
</DesignDetailsDiv>
331344
)}
332-
333345
{cardVersion && (
334-
<VersionTag>
335-
<Typography variant="body2">v{cardVersion}</Typography>
336-
</VersionTag>
346+
<VersionDiv>
347+
<VersionText>v{cardVersion}</VersionText>
348+
</VersionDiv>
337349
)}
338350
</CardBack>
339351
)}

src/custom/CustomCatalog/style.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,31 @@ export const VersionTag = styled('div')(({ theme }) => ({
212212
maxWidth: 'fit-content'
213213
}));
214214

215+
export const VersionDiv = styled('div')(({ theme }) => ({
216+
display: 'flex',
217+
alignItems: 'center',
218+
gap: '4px',
219+
fontSize: '0.75',
220+
color: theme.palette.text.constant?.white,
221+
position: 'absolute',
222+
bottom: '16px',
223+
left: '16px',
224+
borderRadius: '4px',
225+
background: theme.palette.background.supplementary,
226+
justifyContent: 'center'
227+
}));
228+
229+
export const VersionText = styled('p')(({ theme }) => ({
230+
fontSize: '0.75rem',
231+
margin: '0',
232+
padding: '0.25rem .5rem',
233+
lineHeight: '1.5',
234+
textTransform: 'lowercase',
235+
fontWeight: '600',
236+
borderRadius: '4.05px',
237+
color: theme.palette.text.constant?.white
238+
}));
239+
215240
export const FlipCard = styled('div')(() => ({
216241
perspective: '1000px',
217242
'&:hover .flipper': {
@@ -281,7 +306,6 @@ export const ProfileSection = styled('div')({
281306
});
282307

283308
export const TechnologiesSection = styled('div')(() => ({
284-
marginBottom: '16px',
285309
display: 'flex',
286310
flexDirection: 'column',
287311
justifyContent: 'center',

0 commit comments

Comments
 (0)