Skip to content

Commit ef0fa69

Browse files
committed
add Review section
1 parent 30bdd29 commit ef0fa69

File tree

8 files changed

+214
-2
lines changed

8 files changed

+214
-2
lines changed

package-lock.json

Lines changed: 126 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"@emotion/react": "^11.11.4",
1414
"@emotion/styled": "^11.11.5",
1515
"@mui/material": "^5.15.19",
16+
"@smastrom/react-rating": "^1.5.0",
17+
"@tanstack/react-query": "^5.40.1",
18+
"axios": "^1.7.2",
1619
"react": "^18.2.0",
1720
"react-awesome-reveal": "^4.2.11",
1821
"react-dom": "^18.2.0",

public/happy.png

272 KB
Loading

src/Hooks/useAxiosPublic.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import axios from "axios";
2+
3+
4+
const axiosPublic = axios.create({
5+
baseURL:"http://localhost:5000"
6+
})
7+
const useAxiosPublic = () => {
8+
return axiosPublic
9+
};
10+
11+
export default useAxiosPublic;
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import SectionTitle from "../../../../Component/SectionTitle";
2+
import { Autoplay, Pagination, Navigation } from 'swiper/modules';
3+
import { useEffect, useState } from "react";
4+
import { Rating } from "@smastrom/react-rating";
5+
import '@smastrom/react-rating/style.css';
6+
import { Swiper, SwiperSlide } from "swiper/react";
7+
import 'swiper/swiper-bundle.css';
8+
9+
10+
11+
12+
13+
const Review = () => {
14+
const [review, setRiew] = useState([]);
15+
useEffect(()=>{
16+
fetch('http://localhost:5000/reviews')
17+
.then(res => res.json())
18+
.then(data => {
19+
setRiew(data)
20+
console.log(data);
21+
})
22+
},[])
23+
return (
24+
<div className="container">
25+
<div className="mt-24 mb-10">
26+
<SectionTitle subHeading={'Happy Client'} heading={"what's our client say"}></SectionTitle>
27+
<div className="flex gap-5 flex-wrap p-4">
28+
<div className="md:w-2/5 w-full">
29+
<img src='/happy.png' alt="" />
30+
</div>
31+
<div className="md:w-1/2 w-full md:flex-1">
32+
<Swiper
33+
spaceBetween={30}
34+
centeredSlides={true}
35+
autoplay={{
36+
delay: 2500,
37+
disableOnInteraction: false,
38+
}}
39+
pagination={{
40+
clickable: true,
41+
}}
42+
navigation={true}
43+
modules={[Autoplay, Pagination, Navigation]}
44+
className="mySwiper"
45+
>
46+
{review.map((item) => (
47+
<SwiperSlide key={item._id}>
48+
49+
<div className="text-center flex flex-col items-center justify-center mx-24 my-16">
50+
<div className="avatar">
51+
<div className="w-24 rounded-full ring ring-primary ring-offset-base-100 ring-offset-2 mb-2">
52+
<img src={item.image} />
53+
</div>
54+
</div>
55+
<h3 className="text-2xl">{item.name}</h3>
56+
<Rating style={{ maxWidth: 200 }} value={item.rating} readOnly></Rating>
57+
58+
<p className="py-8">{item.details}</p>
59+
60+
</div>
61+
</SwiperSlide>
62+
))}
63+
</Swiper>
64+
</div>
65+
</div>
66+
67+
</div>
68+
</div>
69+
);
70+
};
71+
72+
export default Review;

src/Pages/Home/Home.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import Step from "./Component/How it's work/Step";
33

44
import OurFeatures from "./Component/Our Feature/OurFeatures";
5+
import Review from "./Component/Review/Review";
56
import Slider from "./Component/Slider";
67
import TopEarn from "./Top Earning/TopEarn";
78

@@ -14,6 +15,7 @@ const Home = () => {
1415
<OurFeatures></OurFeatures>
1516
<Step></Step>
1617
<TopEarn></TopEarn>
18+
<Review></Review>
1719
</div>
1820
);
1921
};

src/Pages/Home/Top Earning/TopEarn.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const TopEarn = () => {
1515
fetch('/TopEarnin.json')
1616
.then(res => res.json())
1717
.then(data =>{
18-
console.log(data);
1918
setTop(data)
2019
})
2120
},[])

src/Pages/Home/Top Earning/TopEarnCard.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
const TopEarnCard = ({item}) => {
66
const {name,skills,earnings,projects_completed,rating,image} = item;
7-
console.log(name,skills,earnings,projects_completed,rating,image);
87
return (
98
<div className="mb-4">
109
<div className="card bg-base-100 shadow-xl">

0 commit comments

Comments
 (0)