File tree Expand file tree Collapse file tree 2 files changed +48
-13
lines changed Expand file tree Collapse file tree 2 files changed +48
-13
lines changed Original file line number Diff line number Diff line change @@ -103,25 +103,50 @@ export function CardCta({
103
103
text,
104
104
color = '#000' ,
105
105
withArrow,
106
+ asPlainContent = false ,
106
107
...rest
107
108
} ) {
108
- return (
109
- < Link
110
- className = { className }
111
- to = { to }
112
- style = { {
113
- color : color ,
114
- paddingTop : '15px' ,
115
- paddingBottom : '50px' ,
116
- } } >
109
+ const contentJSX = (
110
+ < >
117
111
{ text }
118
112
{ withArrow && (
119
113
< span className = { styles . card__title__arrow } >
120
114
< IconArrow />
121
115
</ span >
122
116
) }
117
+ </ >
118
+ ) ;
119
+
120
+ if ( asPlainContent ) {
121
+ return (
122
+ < div
123
+ className = { className }
124
+ style = { {
125
+ color : color ,
126
+ paddingTop : '15px' ,
127
+ paddingBottom : '50px' ,
128
+ } }
129
+ { ...rest }
130
+ >
131
+ { contentJSX }
132
+ </ div >
133
+ ) ;
134
+ }
135
+
136
+ return (
137
+ < Link
138
+ className = { className }
139
+ to = { to }
140
+ style = { {
141
+ color : color ,
142
+ paddingTop : '15px' ,
143
+ paddingBottom : '50px' ,
144
+ } }
145
+ { ...rest }
146
+ >
147
+ { contentJSX }
123
148
</ Link >
124
- )
149
+ ) ;
125
150
}
126
151
127
152
export function Card ( {
Original file line number Diff line number Diff line change @@ -154,11 +154,21 @@ export default function PageHome() {
154
154
styles . home__categories__item ,
155
155
) }
156
156
>
157
- < Card categoryType = { categoryType } asCallToAction >
157
+ < Card categoryType = { categoryType } href = { categoryItemCardLink } asCallToAction >
158
158
{ categoryItemCardIconName && < CardIcon name = { categoryItemCardIconName } color = { categoryItemCardIconColor } /> }
159
- { categoryItemCardTitle && < CardTitle > { categoryItemCardTitle } </ CardTitle > }
159
+ { categoryItemCardTitle && < CardTitle > { categoryItemCardTitle } </ CardTitle > }
160
160
{ categoryItemCardDescription && < CardDescription > { categoryItemCardDescription } </ CardDescription > }
161
- { categoryItemCardLink && < CardCta withArrow to = { categoryItemCardLink } text = { categoryItemCardCtaText } color = { categoryItemCardIconColor } className = "category-card-cta" /> }
161
+ { /* Use asPlainContent=true when parent Card already has asCallToAction */ }
162
+ { categoryItemCardLink &&
163
+ < CardCta
164
+ asPlainContent = { true }
165
+ withArrow = { true }
166
+ to = { categoryItemCardLink }
167
+ text = { categoryItemCardCtaText }
168
+ color = { categoryItemCardIconColor }
169
+ className = "category-card-cta"
170
+ />
171
+ }
162
172
{ categoryItemCardImgSrc && < CardImg src = { categoryItemCardImgSrc } /> }
163
173
</ Card >
164
174
{ /* {categoryItem.links && (
You can’t perform that action at this time.
0 commit comments