From e59bacfad1b5bf4e591bd86205888a558778c356 Mon Sep 17 00:00:00 2001 From: rishabhsharma1997 Date: Fri, 28 Jun 2024 02:58:24 +0530 Subject: [PATCH] feat: added catalog card and icons fix 2 Signed-off-by: rishabhsharma1997 --- src/custom/CatalogCard/CatalogCard.tsx | 21 ++++--------- src/custom/CatalogCard/style.tsx | 42 +++++++++----------------- 2 files changed, 21 insertions(+), 42 deletions(-) diff --git a/src/custom/CatalogCard/CatalogCard.tsx b/src/custom/CatalogCard/CatalogCard.tsx index 1fac9cde6..2b2383376 100644 --- a/src/custom/CatalogCard/CatalogCard.tsx +++ b/src/custom/CatalogCard/CatalogCard.tsx @@ -17,6 +17,7 @@ import { DesignInnerCard, DesignName, DesignType, + ImageWrapper, MetricsContainerFront, MetricsCount, MetricsDiv, @@ -32,7 +33,7 @@ type CatalogCardProps = { // eslint-disable-next-line @typescript-eslint/no-explicit-any pattern: any; patternType: string; - url: string; + cardLink: string; cardHeight: string; cardWidth: string; cardStyles: React.CSSProperties; @@ -62,7 +63,7 @@ const CatalogCard: React.FC = ({ cardHeight, cardWidth, cardStyles, - url + cardLink }) => { const outerStyles = { height: cardHeight, @@ -70,7 +71,7 @@ const CatalogCard: React.FC = ({ ...cardStyles }; return ( - + @@ -84,19 +85,9 @@ const CatalogCard: React.FC = ({ > {pattern.name} -
+ -
+ diff --git a/src/custom/CatalogCard/style.tsx b/src/custom/CatalogCard/style.tsx index c969a80f5..9fcf7d779 100644 --- a/src/custom/CatalogCard/style.tsx +++ b/src/custom/CatalogCard/style.tsx @@ -16,13 +16,12 @@ export const StyledClassWrapper = styled('div')(() => ({ })); export const StyledInnerClassWrapper = styled('div')(({ - catalogClassName, - theme + catalogClassName }) => { const mapToColor: Record = { - community: theme.palette.icon.secondary, - official: theme.palette.background.cta?.default || '#EBC017', - verified: theme.palette.background.brand?.default || '' + community: 'rgba(122,132,142,.8)', + official: '#EBC017', + verified: '#00B39F' }; return { font: 'bold 10px sans-serif', @@ -67,10 +66,7 @@ export const DesignInnerCard = styled('div')(({ theme }) => ({ height: '100%', textAlign: 'center', transition: 'transform 0.6s', - boxShadow: - theme.palette.mode === 'dark' - ? '0 4px 8px 0 rgba(255, 255, 255, 0.1)' - : '0 4px 8px 0 rgba(0,0,0,0.2)', + boxShadow: `2px 2px 3px 0px ${theme.palette.background.brand?.default}`, borderRadius: '0.9375rem' })); export const DesignType = styled('span')(({ theme }) => ({ @@ -105,17 +101,8 @@ export const DesignName = styled(Typography)(({ theme }) => ({ overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', - // textAlign: "center", - textAlign: 'left', - '& :after': { - content: "''", - textAlign: 'right', - position: 'absolute', - bottom: '0', - right: '0', - width: '70%', - background: 'linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 50%)' - } + textAlign: 'center', + width: '100%' })); export const MetricsContainerFront = styled('div')(({ theme }) => ({ display: 'flex', @@ -153,12 +140,13 @@ export const DesignDetailsDiv = styled('div')(() => ({ height: 'max-content' } })); -export const CardFront = styled('div')(({ theme }) => ({ - boxShadow: `2px 2px 3px 0px ${theme.palette.background.brand?.default}`, - background: `linear-gradient(to left bottom, #EBEFF1,#f4f5f7, #f7f7f9, #fff, #fff, #fff,#fff,#fff, #fff, #f7f7f9, #f4f5f7, #EBEFF1)`, + +export const ImageWrapper = styled('div')(({ theme }) => ({ + background: theme.palette.mode === 'light' ? 'rgba(231, 239, 243, 0.40)' : '#212121', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + padding: '0.5rem', width: '100%', - height: '100%', - WebkitBackfaceVisibility: 'hidden', - borderRadius: '0.9375rem', - backfaceVisibility: 'hidden' + borderRadius: '0.5rem' }));