Skip to content

Commit 28715a5

Browse files
committed
added empty stat/card at first
1 parent 44a22de commit 28715a5

File tree

2 files changed

+67
-37
lines changed

2 files changed

+67
-37
lines changed

client/src/components/Home.jsx

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import "../App.css";
99
import WorthAlert from "./Worth/WorthAlert";
1010
import Skeleton from "./Skeletons/Skeleton";
1111
import HomeSkeleton from "./Skeletons/HomeSkeleton";
12+
import PromotedCard from "./PromotedCard";
1213

1314
export default function Home() {
1415
const [showStats, setShowStats] = useState(false);
@@ -111,44 +112,39 @@ export default function Home() {
111112
<option value="Sort by Questions Solved">Sort by Questions Solved</option>
112113
</select>
113114
</div>
114-
{
115-
loading ? (
116-
<div className="flex flex-col mx-auto max-w-screen-xl px-2 sm:px-6 lg:px-8">
117-
<div className="grid grid-cols-1 gap-4 py-4 ">
118-
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
119-
{
120-
Array.from({ length: 9 }, (_, index) => index + 1).map((item) => {
121-
return <HomeSkeleton key={item} />
122-
})
123-
}
124-
</div>
125-
</div>
115+
116+
<div className="min-h-screen flex flex-col mx-auto max-w-screen-xl px-2 sm:px-6 lg:px-8">
117+
<div className="grid grid-cols-1 gap-4 py-4 ">
118+
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
119+
<PromotedCard />
120+
{
121+
loading ? (
122+
123+
Array.from({ length: 9 }, (_, index) => index + 1).map((item) => {
124+
return <HomeSkeleton key={item} />
125+
})
126+
127+
) : (
128+
filteredData.length === 0 ? (
129+
<p className="grid place-content-center ">No user found</p>
130+
) : (
131+
filteredData.map((data, index) => (
132+
<motion.div
133+
key={data.username}
134+
initial={{ opacity: 0, x: -50 }}
135+
whileInView={{ opacity: 1, x: 0 }}
136+
viewport={{ once: true }}
137+
transition={{ duration: 0.3, type: "spring", stiffness: 110, delay: (index % 4) * 0.3 }}
138+
>
139+
<Stat data={data} index={index} />
140+
</motion.div>
141+
))
142+
)
143+
)
144+
}
126145
</div>
127-
)
128-
: (
129-
<div className="min-h-screen flex flex-col mx-auto max-w-screen-xl px-2 sm:px-6 lg:px-8">
130-
<div className="grid grid-cols-1 gap-4 py-4 ">
131-
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
132-
{
133-
filteredData.length === 0 ? (
134-
<p className="grid place-content-center ">No user found</p>
135-
) : (
136-
filteredData.map((data, index) => (
137-
<motion.div
138-
key={data.username}
139-
initial={{ opacity: 0, x: -50 }}
140-
whileInView={{ opacity: 1, x: 0 }}
141-
viewport={{ once: true }}
142-
transition={{ duration: 0.3, type: "spring", stiffness: 110, delay: (index % 4) * 0.3 }}
143-
>
144-
<Stat data={data} index={index} />
145-
</motion.div>
146-
))
147-
)
148-
}
149-
</div>
150-
</div>
151-
</div>)
146+
</div>
147+
</div>)
152148
}
153149
</div>
154150
{showStats && (
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import Questions from "./Profile/Circle&Questions/Questions";
2+
import Circle from "./Profile/Circle&Questions/Circle";
3+
import { useState, useEffect } from "react";
4+
import Profile from "./Profile/About/Profile";
5+
import SocialLinks from "./Profile/About/SocialLinks";
6+
import { motion } from "framer-motion";
7+
8+
9+
export default function PromotedCard() {
10+
11+
12+
13+
return (
14+
<div className="flex justify-center flex-col items-center rounded-lg h-[280px] bg-[#292829]">
15+
<div>
16+
<div className="flex gap-1 xl:gap-4 items-center justify-between ">
17+
{/* Profile */}
18+
19+
</div>
20+
<div style={{ height: '0.5px', backgroundColor: '#E0E0E0' }} className="h-[0.5px] bg-white" />
21+
22+
<div className=" flex lg:flex-row gap-5 items-center justify-center mt-4">
23+
{/* Circle */}
24+
25+
</div>
26+
27+
28+
29+
</div>
30+
</div>
31+
32+
)
33+
}
34+

0 commit comments

Comments
 (0)