@@ -9,6 +9,7 @@ import "../App.css";
99import WorthAlert from "./Worth/WorthAlert" ;
1010import Skeleton from "./Skeletons/Skeleton" ;
1111import HomeSkeleton from "./Skeletons/HomeSkeleton" ;
12+ import PromotedCard from "./PromotedCard" ;
1213
1314export 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 && (
0 commit comments