Skip to content

Commit

Permalink
Update Projects.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaditya019Jain authored Oct 13, 2023
1 parent 899c7cc commit 3319531
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions frontend/src/pages/Projects.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
import ProjectCard from "../components/ProjectCard"
import axios from "axios";
import { useEffect } from "react";
import { useState } from "react";
import "./ProjectCard.css";

export default function Projects() {
return (<section>

const [details, setDetails] = useState([]);

useEffect(() => {
// Make an HTTP request to fetch the card image from the backend
axios.get('/api/projects/')
.then((response) => {
// Assuming the response contains the image URL
console.log(response.data);
setDetails(response.data);
})
.catch((error) => {
console.error('Error fetching card image:', error);
});
}, []);

return (<section className="project-card">
<h1>Projects</h1>
<ProjectCard />
{details.map((details,index)=>(
<div key={index}>
<ProjectCard link={details.banner_image} title={details.title} />
</div>
))}

</section>);
}

0 comments on commit 3319531

Please sign in to comment.