updated to use react looping for blog card generation

This commit is contained in:
philip-ellis-sp
2023-05-23 13:58:49 -05:00
parent 4deaa7c5fa
commit 22191cc67d
2 changed files with 12 additions and 45 deletions

View File

@@ -69,6 +69,6 @@
bottom: 10px; bottom: 10px;
left: 10px; left: 10px;
margin: auto; margin: auto;
height: 80px; height: 40px;
width: 80px; width: 40px;
} }

View File

@@ -23,50 +23,17 @@ export default function BlogCards() {
if (ans) { if (ans) {
return ( return (
<div className={styles.center}> <div className={styles.center}>
<div className={styles.gridContainer}> <div className={styles.gridContainer}>
<BlogCard
excerpt={ans[0].excerpt} {ans.map(function(a, index){
name={ans[0].name} return <BlogCard
tags={ans[0].tags} excerpt={a.excerpt}
link={ans[0].link} name={a.name}
title={ans[0].title} tags={a.tags}
image={ans[0].image}></BlogCard> link={a.link}
<BlogCard title={a.title}
excerpt={ans[1].excerpt} image={a.image}></BlogCard>
name={ans[1].name} })}
tags={ans[1].tags}
link={ans[1].link}
title={ans[1].title}
image={ans[1].image}></BlogCard>
<BlogCard
excerpt={ans[0].excerpt}
name={ans[0].name}
tags={ans[0].tags}
link={ans[0].link}
title={ans[0].title}
image={ans[0].image}></BlogCard>
<BlogCard
excerpt={ans[1].excerpt}
name={ans[1].name}
tags={ans[1].tags}
link={ans[1].link}
title={ans[1].title}
image={ans[1].image}></BlogCard>
<BlogCard
excerpt={ans[0].excerpt}
name={ans[0].name}
tags={ans[0].tags}
link={ans[0].link}
title={ans[0].title}
image={ans[0].image}></BlogCard>
<BlogCard
excerpt={ans[1].excerpt}
name={ans[1].name}
tags={ans[1].tags}
link={ans[1].link}
title={ans[1].title}
image={ans[1].image}></BlogCard>
</div> </div>
</div> </div>
); );