File tree Expand file tree Collapse file tree
src/components/Contributors Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,11 +7,14 @@ function Contribute() {
77 const userURL = "https://api.github.com/users/" ;
88 const url = "https://api.github.com/repos/devvsakib/github-error-solve/contributors"
99 const [ data , setData ] = useState ( [ ] ) ;
10+ const [ loading , setLoading ] = useState ( true ) ;
1011 useEffect ( ( ) => {
12+ setLoading ( false )
1113 const fetchUsers = async ( url ) => {
1214 const response = await fetch ( url ) ;
1315 const users = await response . json ( ) ;
1416 setData ( users )
17+ setLoading ( true )
1518 }
1619 fetchUsers ( url )
1720 } , [ data . length ] )
@@ -29,7 +32,7 @@ function Contribute() {
2932 {
3033 // User filtered by CONTRIBUTIONS number, contribute more to jump in first place
3134
32- data . map ( user =>
35+ loading ? ( data . map ( user =>
3336 < div
3437 id = "container"
3538 className = { `py-4 mb-4 col-span-12 md:col-span-6 xl:col-span-4 md:px-6 border-l-4 rounded-lg bg-dark-secondary flex flex-col mt-8 items-center mx-auto gap-2 px-3 border-[#${ changeColor ( ) } ] hover:border-primary hover:text-primary` } >
@@ -42,6 +45,14 @@ function Contribute() {
4245 </ div >
4346 </ div >
4447 )
48+ ) : (
49+ < div className = 'translate-y-[4rem]' >
50+ < img src = "/assets/run.gif"
51+ className = 'w-1/2 mx-auto'
52+ alt = "Running Gif" />
53+ < h1 className = 'text-center md:text-2xl text-white' > Contributors coming...</ h1 >
54+ </ div >
55+ )
4556 }
4657 </ section >
4758 </ Layout >
You can’t perform that action at this time.
0 commit comments