11import { styled , Typography } from '@mui/material' ;
2+ import { accentGrey , DARK_PRIMARY_COLOR , GRAY97 , slateGray , WHITESMOKE } from '../../theme' ;
3+ import { charcoal , DARK_TEAL , SNOW_WHITE } from '../../theme/colors/colors' ;
24
35type DesignCardProps = {
46 outerStyles : React . CSSProperties ;
@@ -45,12 +47,13 @@ export const NoTechnologyText = styled('div')(() => ({
4547} ) ) ;
4648
4749export const StyledInnerClassWrapper = styled ( 'div' ) < StyledInnerClassWrapperProps > ( ( {
48- catalogClassName
50+ catalogClassName,
51+ theme
4952} ) => {
5053 const mapToColor : Record < string , string > = {
51- community : 'rgba(122,132,142,.8)' ,
52- official : '#EBC017' ,
53- verified : '#00B39F'
54+ community : slateGray . main ,
55+ official : theme . palette . background . cta ?. default || '#EBC017' ,
56+ verified : theme . palette . background . brand ?. default || '#00B39F'
5457 } ;
5558 return {
5659 font : 'bold 10px sans-serif' ,
@@ -67,7 +70,7 @@ export const StyledInnerClassWrapper = styled('div')<StyledInnerClassWrapperProp
6770 justifyContent : 'center' ,
6871 alignItems : 'center' ,
6972 backgroundColor : mapToColor [ catalogClassName ] ,
70- color : '#fff'
73+ color : catalogClassName === 'official' ? theme . palette . common . black : theme . palette . common . white
7174 } ;
7275} ) ;
7376
@@ -122,7 +125,7 @@ export const DesignType = styled('span')(({ theme }) => ({
122125 fontSize : '0.875rem' ,
123126 textTransform : 'capitalize' ,
124127 background : theme . palette . background . brand ?. default ,
125- color : theme . palette . text . inverse ,
128+ color : theme . palette . background . constant ?. white ,
126129 borderRadius : '0 1rem 0 2rem'
127130} ) ) ;
128131export const MetricsCount = styled ( 'p' ) ( ( { theme } ) => ( {
@@ -131,13 +134,13 @@ export const MetricsCount = styled('p')(({ theme }) => ({
131134 margin : '0rem' ,
132135 lineHeight : '1.5' ,
133136 textAlign : 'center' ,
134- color : theme . palette . text . secondary ,
137+ color : theme . palette . mode === 'light' ? DARK_TEAL : SNOW_WHITE ,
135138 fontWeight : '600'
136139} ) ) ;
137- export const DesignName = styled ( Typography ) ( ( ) => ( {
140+ export const DesignName = styled ( Typography ) ( ( { theme } ) => ( {
138141 fontWeight : 'bold' ,
139142 textTransform : 'capitalize' ,
140- color : '#000D12' ,
143+ color : theme . palette . text . default ,
141144 fontSize : '1.125rem' ,
142145 marginTop : '2rem' ,
143146 padding : '0rem 1rem' ,
@@ -151,15 +154,13 @@ export const DesignName = styled(Typography)(() => ({
151154 fontFamily : 'inherit'
152155} ) ) ;
153156
154- export const MetricsContainerFront = styled ( 'div' ) < MetricsProps > ( ( { isDetailed } ) => ( {
157+ export const MetricsContainerFront = styled ( 'div' ) < MetricsProps > ( ( { isDetailed, theme } ) => ( {
155158 display : 'flex' ,
156159 justifyContent : 'space-around' ,
157- // borderTop: "0.851px solid #C9DBE3",
158160 fontSize : '0.2rem' ,
159- color : 'rgba(26, 26, 26, .8)' ,
160- // margin: "-0.8rem 0.7rem 0",
161+ color : theme . palette . mode === 'light' ? 'rgba(26, 26, 26, .8)' : theme . palette . text . default ,
161162 padding : '0.9rem 0.1rem' ,
162- background : ' #E7EFF3',
163+ background : theme . palette . mode === 'light' ? ' #E7EFF3' : DARK_TEAL ,
163164 ...( isDetailed && {
164165 position : 'absolute' ,
165166 bottom : '0px'
@@ -194,7 +195,7 @@ export const DesignDetailsDiv = styled('div')(() => ({
194195} ) ) ;
195196
196197export const ImageWrapper = styled ( 'div' ) ( ( { theme } ) => ( {
197- background : theme . palette . mode === 'light' ? 'rgba(231, 239, 243, 0.40)' : '#212121' ,
198+ background : theme . palette . background . surfaces ,
198199 display : 'flex' ,
199200 alignItems : 'center' ,
200201 justifyContent : 'center' ,
@@ -347,22 +348,34 @@ export const CardBack = styled('div')<CatalogProps>(({ isCatalog }) => ({
347348 } )
348349} ) ) ;
349350
350- export const CardFront = styled ( 'div' ) < DesignCardDivProps > ( ( { shouldFlip, isDetailed, theme } ) => ( {
351- ...( shouldFlip && {
352- position : 'absolute' ,
353- boxShadow : `2px 2px 3px 0px ${ theme . palette . background . brand ?. default } ` ,
354- background : `linear-gradient(to left bottom, #EBEFF1, #f4f5f7, #f7f7f9, white, white, white, white, white, white, #f7f7f9, #f4f5f7, #EBEFF1);`
355- } ) ,
356- ...( isDetailed && {
357- boxShadow : `2px 2px 3px 0px ${ theme . palette . background . brand ?. default } ` ,
358- background : `linear-gradient(to left bottom, #EBEFF1, #f4f5f7, #f7f7f9, white, white, white, white, white, white, #f7f7f9, #f4f5f7, #EBEFF1);`
359- } ) ,
360- width : '100%' ,
361- height : '100%' ,
362- WebkitBackfaceVisibility : 'hidden' ,
363- borderRadius : '0.9375rem' ,
364- backfaceVisibility : 'hidden'
365- } ) ) ;
351+ const getBackground = ( isLightMode : boolean ) => {
352+ const lightGradient = `linear-gradient(to left bottom, ${ WHITESMOKE } , ${ GRAY97 } ,white, white, white, white, white, white, white,white, $, ${ WHITESMOKE } , ${ GRAY97 } )` ;
353+ const darkGradient = `linear-gradient(to right top, ${ DARK_PRIMARY_COLOR } , ${ accentGrey [ 30 ] } , ${ accentGrey [ 20 ] } , ${ accentGrey [ 10 ] } , ${ accentGrey [ 10 ] } , ${ accentGrey [ 10 ] } , ${ accentGrey [ 10 ] } , ${ accentGrey [ 10 ] } , ${ accentGrey [ 10 ] } , ${ charcoal [ 20 ] } , ${ charcoal [ 10 ] } , black)` ;
354+
355+ return isLightMode ? lightGradient : darkGradient ;
356+ } ;
357+ export const CardFront = styled ( 'div' ) < DesignCardDivProps > ( ( { shouldFlip, isDetailed, theme } ) => {
358+ const isLightMode = theme . palette . mode === 'light' ;
359+ const background = getBackground ( isLightMode ) ;
360+ const boxShadow = `2px 2px 3px 0px ${ theme . palette . background . brand ?. default } ` ;
361+
362+ return {
363+ ...( shouldFlip && {
364+ position : 'absolute' ,
365+ boxShadow,
366+ background
367+ } ) ,
368+ ...( isDetailed && {
369+ boxShadow,
370+ background
371+ } ) ,
372+ width : '100%' ,
373+ height : '100%' ,
374+ WebkitBackfaceVisibility : 'hidden' ,
375+ borderRadius : '0.9375rem' ,
376+ backfaceVisibility : 'hidden'
377+ } ;
378+ } ) ;
366379
367380export const DateText = styled ( 'div' ) ( ( ) => ( {
368381 fontSize : '0.875rem' ,
@@ -399,29 +412,24 @@ export const DesignAuthorName = styled('div')(() => ({
399412 }
400413} ) ) ;
401414
402- export const CatalogEmptyStateDiv = styled ( 'div' ) ( ( { theme } ) => ( {
403- backgroundColor : theme . palette . common . white ,
404- textAlign : 'center' ,
405- borderRadius : '1rem' ,
406- width : '15rem' ,
407- height : '18rem' ,
408- display : 'flex' ,
409- flexDirection : 'column' ,
410- justifyContent : 'center' ,
411- alignItems : 'center' ,
412- [ theme . breakpoints . down ( 'lg' ) ] : {
413- height : '18.75rem'
414- }
415- } ) ) ;
415+ export const CatalogEmptyStateDiv = styled ( 'div' ) ( ( { theme } ) => {
416+ const isLightMode = theme . palette . mode === 'light' ;
417+ const background = getBackground ( isLightMode ) ;
418+ const boxShadow = `2px 2px 3px 0px ${ theme . palette . background . brand ?. default } ` ;
416419
417- export const EmptyStateDiv = styled ( 'div' ) ( ( { theme } ) => ( {
418- backgroundColor : theme . palette . common . white ,
419- textAlign : 'center' ,
420- borderRadius : '1rem' ,
421- width : '100%' ,
422- padding : '1.5rem' ,
423- display : 'flex' ,
424- flexDirection : 'column' ,
425- justifyContent : 'center' ,
426- alignItems : 'center'
427- } ) ) ;
420+ return {
421+ background : background ,
422+ boxShadow : boxShadow ,
423+ textAlign : 'center' ,
424+ borderRadius : '1rem' ,
425+ width : '15rem' ,
426+ height : '18rem' ,
427+ display : 'flex' ,
428+ flexDirection : 'column' ,
429+ justifyContent : 'center' ,
430+ alignItems : 'center' ,
431+ [ theme . breakpoints . down ( 'lg' ) ] : {
432+ height : '18.75rem'
433+ }
434+ } ;
435+ } ) ;
0 commit comments