Skip to content

Commit e7ee58a

Browse files
committed
fix:ribbion-overlaps
Signed-off-by: TheFaheem <[email protected]>
1 parent 12b96ca commit e7ee58a

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

src/custom/CustomCatalog/CustomCard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ const CustomCatalogCard: React.FC<CatalogCardProps> = ({
175175
<>
176176
<ClassWrap catalogClassName={pattern?.catalog_data?.content_class ?? ''} />
177177
<DesignType>{patternType}</DesignType>
178-
<DesignName>{pattern.name}</DesignName>
178+
<DesignName hasRibbon={!!pattern?.catalog_data?.content_class}>
179+
{pattern.name}
180+
</DesignName>
179181
</>
180182
)}
181183
<DesignDetailsDiv>

src/custom/CustomCatalog/style.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export const StyledClassWrapper = styled('div')(() => ({
2626
overflow: 'hidden',
2727
position: 'absolute',
2828
top: '-3px',
29-
left: '-3px'
29+
left: '-3px',
30+
zIndex: 10
3031
}));
3132

3233
export const TechnologyText = styled('div')(() => ({
@@ -126,7 +127,8 @@ export const DesignType = styled('span')(({ theme }) => ({
126127
textTransform: 'capitalize',
127128
background: theme.palette.background.brand?.default,
128129
color: theme.palette.background.constant?.white,
129-
borderRadius: '0 1rem 0 2rem'
130+
borderRadius: '0 1rem 0 2rem',
131+
zIndex: 5
130132
}));
131133
export const MetricsCount = styled('p')(({ theme }) => ({
132134
fontSize: '1rem',
@@ -137,21 +139,27 @@ export const MetricsCount = styled('p')(({ theme }) => ({
137139
color: theme.palette.mode === 'light' ? DARK_TEAL : SNOW_WHITE,
138140
fontWeight: '600'
139141
}));
140-
export const DesignName = styled(Typography)(({ theme }) => ({
142+
type DesignNameProps = {
143+
hasRibbon?: boolean;
144+
};
145+
146+
export const DesignName = styled(Typography)<DesignNameProps>(({ theme, hasRibbon }) => ({
141147
fontWeight: 'bold',
142148
textTransform: 'capitalize',
143149
color: theme.palette.text.default,
144150
fontSize: '1.125rem',
145-
marginTop: '2rem',
146151
padding: '0rem 1rem',
147152
position: 'relative',
148153
overflow: 'hidden',
149154
whiteSpace: 'nowrap',
150155
textOverflow: 'ellipsis',
151156
textAlign: 'center',
152157
width: '100%',
153-
margin: '2rem 0 1.59rem 0',
154-
fontFamily: 'inherit'
158+
margin: hasRibbon ? '3.5rem 0 1.59rem 0' : '2rem 0 1.59rem 0',
159+
fontFamily: 'inherit',
160+
...(hasRibbon && {
161+
paddingLeft: '1.5rem'
162+
})
155163
}));
156164

157165
export const MetricsContainerFront = styled('div')<MetricsProps>(({ isDetailed, theme }) => ({
@@ -361,6 +369,8 @@ export const CardFront = styled('div')<DesignCardDivProps>(({ shouldFlip, isDeta
361369
const boxShadow = `2px 2px 3px 0px ${theme.palette.background.brand?.default}`;
362370

363371
return {
372+
position: 'relative',
373+
zIndex: 1,
364374
...(shouldFlip && {
365375
position: 'absolute',
366376
boxShadow,

0 commit comments

Comments
 (0)