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;
left: 10px;
margin: auto;
height: 80px;
width: 80px;
height: 40px;
width: 40px;
}

View File

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