Skip to content

Commit 30bdd29

Browse files
committed
Add top earning section
1 parent 0e5df23 commit 30bdd29

File tree

9 files changed

+153
-0
lines changed

9 files changed

+153
-0
lines changed

public/TopEarnin.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[
2+
{
3+
"freelancer_id": 101,
4+
"name": "Alice Johnson",
5+
"skills": ["Web Development", "JavaScript", "React","MongoDB"],
6+
"earnings": 120000,
7+
"projects_completed": 35,
8+
"rating": 4.9,
9+
"image": "/top/person.png"
10+
},
11+
{
12+
"freelancer_id": 102,
13+
"name": "Bob Smith",
14+
"skills": ["Graphic Design", "Illustrator", "Photoshop"],
15+
"earnings": 95000,
16+
"projects_completed": 50,
17+
"rating": 4.8,
18+
"image": "/top/person1.jpg"
19+
},
20+
{
21+
"freelancer_id": 103,
22+
"name": "Carol Martinez",
23+
"skills": ["Content Writing", "SEO", "Blogging","local SEO"],
24+
"earnings": 85000,
25+
"projects_completed": 45,
26+
"rating": 4.7,
27+
"image": "/top/person2.jpg"
28+
},
29+
{
30+
"freelancer_id": 104,
31+
"name": "David Brown",
32+
"skills": ["Data Analysis", "Python", "Machine Learning"],
33+
"earnings": 105000,
34+
"projects_completed": 30,
35+
"rating": 4.9,
36+
"image": "/top/person3.jpg"
37+
},
38+
{
39+
"freelancer_id": 105,
40+
"name": "Eva Green",
41+
"skills": ["Digital Marketing", "Social Media", "Ad Campaigns"],
42+
"earnings": 90000,
43+
"projects_completed": 40,
44+
"rating": 4.8,
45+
"image": "/top/person4.jpg"
46+
}
47+
]
48+

public/top/person.png

9.42 KB
Loading

public/top/person1.jpg

9.51 KB
Loading

public/top/person2.jpg

6.85 KB
Loading

public/top/person3.jpg

6.69 KB
Loading

public/top/person4.jpg

6.1 KB
Loading

src/Pages/Home/Home.jsx

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

44
import OurFeatures from "./Component/Our Feature/OurFeatures";
55
import Slider from "./Component/Slider";
6+
import TopEarn from "./Top Earning/TopEarn";
67

78

89

@@ -12,6 +13,7 @@ const Home = () => {
1213
<Slider></Slider>
1314
<OurFeatures></OurFeatures>
1415
<Step></Step>
16+
<TopEarn></TopEarn>
1517
</div>
1618
);
1719
};
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import { useEffect, useState } from "react";
2+
import SectionTitle from "../../../Component/SectionTitle";
3+
import TopEarnCard from "./TopEarnCard";
4+
5+
6+
import { Swiper, SwiperSlide } from "swiper/react";
7+
8+
// Import Swiper styles
9+
import "swiper/css";
10+
import "swiper/css/free-mode";
11+
import "swiper/css/pagination";
12+
const TopEarn = () => {
13+
const [top,setTop] = useState([])
14+
useEffect(()=> {
15+
fetch('/TopEarnin.json')
16+
.then(res => res.json())
17+
.then(data =>{
18+
console.log(data);
19+
setTop(data)
20+
})
21+
},[])
22+
return (
23+
<div className="container">
24+
<div className="mt-24">
25+
<SectionTitle heading={'top Freelancer'} subHeading={'Make Money'}></SectionTitle>
26+
<div>
27+
<Swiper
28+
slidesPerView={1}
29+
spaceBetween={10}
30+
breakpoints={{
31+
640: {
32+
slidesPerView: 2,
33+
spaceBetween: 20,
34+
},
35+
768: {
36+
slidesPerView: 2,
37+
spaceBetween: 40,
38+
},
39+
1024: {
40+
slidesPerView: 3,
41+
spaceBetween: 50,
42+
},
43+
}}
44+
freeMode={true}
45+
pagination={{
46+
clickable: true,
47+
}}
48+
className="mySwiper mb-12"
49+
>
50+
{
51+
top.map((item,index) => <SwiperSlide key={index}>
52+
<TopEarnCard key={index} item={item}></TopEarnCard>
53+
</SwiperSlide>)
54+
}
55+
</Swiper>
56+
</div>
57+
</div>
58+
</div>
59+
);
60+
};
61+
62+
export default TopEarn;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
3+
4+
5+
const TopEarnCard = ({item}) => {
6+
const {name,skills,earnings,projects_completed,rating,image} = item;
7+
console.log(name,skills,earnings,projects_completed,rating,image);
8+
return (
9+
<div className="mb-4">
10+
<div className="card bg-base-100 shadow-xl">
11+
<figure className="px-10 pt-10 h-[200px]">
12+
<div className="avatar">
13+
<div className="w-24 rounded-full ring ring-primary ring-offset-base-100 ring-offset-2">
14+
<img src={image} />
15+
</div>
16+
</div>
17+
</figure>
18+
<div className="card-body ">
19+
<h2 className="text-2xl font-semibold text-center">{name}</h2>
20+
<div className="flex gap-3 flex-wrap">
21+
{
22+
skills.map((skill,index) => <span key={index} className="p-2 bg-red-200 text-black font-medium rounded-lg">{skill}</span>)
23+
}
24+
</div>
25+
<div className="card-actions flex">
26+
<div className=" flex gap-5 justify-between">
27+
<p className="text-lg font- meduim">Earnigs: ${earnings} </p>
28+
<p className="text-lg font- meduim">Completed Project:{projects_completed} </p>
29+
30+
</div>
31+
<div className="flex-1">
32+
<p>Rataing:{rating}</p>
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
</div>
38+
);
39+
};
40+
41+
export default TopEarnCard;

0 commit comments

Comments
 (0)