@@ -8,17 +8,20 @@ interface QuizTypeCardProps {
88 point : string ;
99 onClick : ( ) => void ;
1010 isDisabled ?: boolean ;
11+ disabledLabel ?: string ;
1112}
1213
13- const QuizTypeCard = ( { title, description, image, point, onClick, isDisabled } : QuizTypeCardProps ) => {
14+ const QuizTypeCard = ( { title, description, image, point, onClick, isDisabled, disabledLabel } : QuizTypeCardProps ) => {
1415 return (
1516 < button className = { cx ( cardStyle , isDisabled && disabledStyle ) } onClick = { onClick } disabled = { isDisabled } >
16- < img className = { imageStyle } src = { image } alt = { title } width = { 100 } height = { 100 } />
17- < Flex direction = "column" gap = "4px" >
17+ < img className = { cx ( imageStyle , isDisabled && disabledContentStyle ) } src = { image } alt = { title } width = { 100 } height = { 100 } />
18+ < Flex className = { isDisabled ? disabledContentStyle : undefined } direction = "column" gap = "4px" >
1819 < h4 className = { titleStyle } > { title } </ h4 >
1920 < p className = { descriptionStyle } > { description } </ p >
2021 </ Flex >
21- < p className = { pointStyle } > { point } </ p >
22+ < p className = { isDisabled && disabledLabel ? disabledLabelStyle : pointStyle } >
23+ { isDisabled && disabledLabel ? disabledLabel : point }
24+ </ p >
2225 </ button >
2326 ) ;
2427} ;
@@ -37,10 +40,14 @@ const cardStyle = css({
3740} ) ;
3841
3942const disabledStyle = css ( {
40- opacity : 0.5 ,
4143 pointerEvents : 'none' ,
4244} ) ;
4345
46+ const disabledContentStyle = css ( {
47+ opacity : 0.4 ,
48+ filter : 'grayscale(1)' ,
49+ } ) ;
50+
4451const imageStyle = css ( {
4552 flexShrink : 0 ,
4653} ) ;
@@ -62,6 +69,18 @@ const descriptionStyle = css({
6269 textAlign : 'left' ,
6370} ) ;
6471
72+ const disabledLabelStyle = css ( {
73+ position : 'absolute' ,
74+ top : '8px' ,
75+ right : '8px' ,
76+ padding : '2px 12px' ,
77+ backgroundColor : 'white.white_50' ,
78+ borderRadius : 'full' ,
79+ textStyle : 'glyph12.regular' ,
80+ fontWeight : 700 ,
81+ color : 'white' ,
82+ } ) ;
83+
6584const pointStyle = css ( {
6685 position : 'absolute' ,
6786 top : '8px' ,
0 commit comments