-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathportfolio.jsx
40 lines (32 loc) · 1.32 KB
/
portfolio.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { useState } from "react";
import { useQuery } from "react-query";
import BannerLayout from "../components/Common/BannerLayout";
import Footer from "../components/Footer";
import PortfolioCard from "../components/Portfolio/PortfolioCard";
import axios from "axios";
import { Skeleton } from "antd";
import ImageAndParagraphSkeleton from "../components/Common/ImageAndParagraphSkeleton";
const Portfolio = () => {
const { isLoading, error, data } = useQuery('portfolio', () =>
axios.get('api/portfolio')
.then(({ data }) => data)
.catch(error => console.error('Error fetching testimonials:', error)))
return (
<>
<h1 className="text-white ml-10 text-xl font-bold mt-6">Projects</h1>
<div className="grid justify items-center grid-flow-row md:grid-cols-2 grid-rows-auto gap-4 px-8 my-6 ">
{
isLoading ?
[1, 2, 3, 4].map(() => (
<ImageAndParagraphSkeleton className={"w-full object-cover"} />
))
:
data?.map((data, key) => (
<PortfolioCard key={key} data={data} />
))
}
</div >
</>
);
};
export default Portfolio;