Skip to content

Commit b3504b2

Browse files
Changing the Card's logic when there is no image to render
1 parent 54bdce3 commit b3504b2

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

components/containers/CardsColumns.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,25 @@ export default function CardsColumns({
3939
{titles.map((title, index) => (
4040
<SwiperSlide key={index} className={styles.swiperSlide}>
4141
<div className={styles.inner__content}>
42-
<Card
43-
title={title}
44-
image={images?images[index]:undefined}
45-
altTag={altTags?altTags[index]:undefined}
46-
content={content[index]}
47-
link={links[index]}
48-
linkText={linkText[index]}
49-
key={index}
50-
/>
42+
{images ? (
43+
<Card
44+
title={title}
45+
image={images[index]}
46+
altTag={altTags[index]}
47+
content={content[index]}
48+
link={links[index]}
49+
linkText={linkText[index]}
50+
key={index}
51+
/>
52+
) : (
53+
<Card
54+
title={title}
55+
content={content[index]}
56+
link={links[index]}
57+
linkText={linkText[index]}
58+
key={index}
59+
/>
60+
)}
5161
</div>
5262
</SwiperSlide>
5363
))}

0 commit comments

Comments
 (0)